Rule handbook metadata
- Rule
DET.DIAGRAM.ASSET_REGISTRY· lanedeterministic- Page status
- stale
- page_version
760457a5e7fdd76fad2a2fdc15e29a3d65de58e38a97a0e6f3b0d66d497fd4dc- generated_at
- 2026-05-19T21:30:00.000Z
- registry_fingerprint
6773fda516344e110b5a7b1435e655e1264e773825ca8bbe62194189891c42ba
How this rule is fixed
Pilot deterministic fixer: handbook_after · harness mode standalone · verify expect_rule_clean.
- Harness:
apply-harness-fixture-remediation.pycopies the After example HTML from this handbook page onto the defect fixture, theninvoke-det-ruleset-remediation-verify.shre-audits and expects zero findings for this rule. - Production sites:
run-website-ux-remediation-loop.shrunshandbook_html_patch(HTML patches inlib/ux-deterministic-fixers/fixers/patches/) before invoking the Cursor agent when the quality gate still fails.
Detection module: docs/design/ux-audit/deterministic-design-rules.md#det-diagram-asset-registry. Scroll down for Before / After examples and Evidence and remediation steps.
Purpose
Kitchen Sink ships reusable diagram tiles through render_ks_diagram_block, ks_diagram_tile_html, js/ks-diagram-catalog.js, and generator/pages/_diagram_gallery.py. Consumer sites inherit those keys and assets/svg/template-*.svg paths. Without registry governance, teams ship one-off SVGs or invented data-diagram-key values that bypass catalog contracts, legend maps, and hash coverage.
This deterministic rule aligns three layers:
- Repo baseline — active
diagram-familyparent (for example Ksv) exists; every catalog key injs/ks-diagram-catalog.jsmaps to a gallery template; every gallery SVG path appears on an activediagram-familyordiagram-asset-groupsource_pathsrow (for example Zxd diagram templates). - DOM crawl — rendered
[data-diagram-key]values exist in the catalog;<img src="…assets/svg/…">paths under.forge-diagram,.ks-diagram-tile, or page-wide SVG mounts are registered.
Plan: Inventory diagram keys and SVG paths on the page and in repo sources. Do: Register new assets under docs/design/catalog/visual-registry.yaml, add gallery + catalog entries, regenerate visual-registry.generated.json. Check: metrics phase diagramAssetRegistryReport / diagramAssetRegistryRepoReport. Adjust: Remove stale keys or stop shipping unregistered paths to consumers.
Passing signals
- Visual registry includes an active
diagram-familyrow (Ksv — Kitchen Sink SVG diagram & schematic assets) with childdiagram-asset-grouppartitions (for example Zxd — diagram template SVGs). - Every
data-diagram-keyon consumer HTML matches a key exported fromwindow.__FORGE_KS_DIAGRAM_CATALOG/js/ks-diagram-catalog.js(for examplelinear,gate,swimlane). - Shipped diagram
<img src="assets/svg/template-*.svg">paths resolve to rows listed on active diagram-family or diagram-asset-groupsource_paths. - Repo parity: keys in
js/ks-diagram-catalog.jseach have a matching"key"entry ingenerator/pages/_diagram_gallery.py; gallery"svg"filenames map to registeredassets/svg/…paths. - Expandable tiles use
forge-diagram-trigger ks-diagram-triggeronly with valid catalog keys so modal detail (openDiagramWithDetail) resolves against registered metadata. - No orphan consumer assets: bespoke SVGs under
assets/svg/that appear on public pages are either registered or removed before deploy.
Failing signals
- Missing diagram family:
visual-registry.generated.jsonhas no activetype: diagram-familyrow — diagram assets cannot roll up under catalog governance. - Unknown diagram key:
data-diagram-key="gate-chain-delivery"(or any string absent fromks-diagram-catalog.js) on a shipped tile. - Unregistered SVG:
<img src="assets/svg/custom-delivery-flow.svg">(or anyassets/svg/path not on a diagram-family / diagram-asset-groupsource_pathsrow). - Catalog key without gallery mapping: key present in
js/ks-diagram-catalog.jsbut missing from_diagram_gallery.py_FAMILIESitems. - Gallery SVG not registered: template added to
_diagram_gallery.pyandassets/svg/but Zxd (or appropriate group)source_pathsnot updated before regeneration. - Stale expand modal key:
onclick='openDiagramWithDetail(this, "bogus")'where"bogus"is not a catalog key. - External or data URLs counted as bypass: ad-hoc
https://…/diagram.svgor inline-only diagrams on product pages without registry coverage when the team treats them as shipped KS visuals.
Before example
Before (failing example)
How it works
Delivery gate chain
Work moves through intent, human review, agent execution, and release checkpoints.
Custom flow for this landing page only.
Failing KS markup: consumer page ships an invented catalog key and an unregistered one-off SVG inside standard diagram tile chrome.
After example
After (passing example)
How it works
Delivery gate chain
Work moves through intent, human review, agent execution, and release checkpoints.
Registered template under Ksv / Zxd — catalog key gate matches gallery and visual registry.
Passing KS markup: registered catalog key (gate from ks-diagram-catalog.js) and registered template SVG (assets/svg/template-gate-chain.svg on Zxd source_paths), emitted via ks_diagram_tile_html.
Evidence and remediation
Evidence: Auditor metrics diagramAssetRegistryRepoReport (repo scan) and diagramAssetRegistryReport (DOM collection). Findings include kinds missing-diagram-family, catalog-key-unmapped, gallery-svg-not-registered, unknown-diagram-key, and unregistered-diagram-svg with evidence tokens key=…, svg=assets/svg/…, and url=…. Default severity is warn on score dimension visualCatalogGovernance. Capture the tile outer HTML, data-diagram-key, img[src], and the matching registry row ids (Ksv, Zxd).
Remediate (in order):
- Add or confirm parent family — ensure an active
diagram-familyrow (Ksv) exists indocs/design/catalog/visual-registry.yaml. - Register the SVG — add
assets/svg/template-….svg(or the bespoke path, if truly reusable) to the appropriatediagram-asset-groupsource_paths(for templates, Zxd). - Wire catalog + gallery — add the key to
generator/pages/_diagram_gallery.py_FAMILIESitems and mirror legend metadata injs/ks-diagram-catalog.js. - Regenerate catalog JSON — run
node tools/design-catalog/inventory-ks-visuals.mjsandnode tools/design-catalog/check-visual-catalog.mjs --repo . --strict-inventoryfor the full coverage report. - Fix consumer markup — replace invented keys with valid catalog keys; point
srcat registered paths; userender_ks_diagram_block(key="gate")in generators instead of hand-rolled paths. - Follow-on checks — after registry alignment, run
DET.DIAGRAM.LABELS,DET.DIAGRAM.ALT, andDET.HASH.MARKERS; semantic accuracy remains underAI.DIAGRAM.SEMANTIC_ACCURACY.