Rule handbook metadata
- Rule
DET.INVENTORY.CROSSWALK· lanedeterministic- Page status
- current
- page_version
1ff85299f06dc68add4d86309b7e7f7baa939d1767e55cee5288b001d5d0c73b- generated_at
- 2026-05-25T14:32:00.000Z
- registry_fingerprint
2ce40848effce579d3e4879f6ca85535183a14db201870a6c007da424624550c
How this rule is fixed
Pilot deterministic fixer: repo_overlay · harness mode repo_overlay · verify expect_rule_clean.
- Harness: fixture includes a repo overlay tree;
remediate_repo_overlay()writes catalog/repo files, then applies After HTML when present. - Production:
repo_overlayNode adapter patches the website repository (contracts, registry JSON, CSS, Python stubs).
Detection module: docs/design/ux-audit/deterministic-design-rules.md#det-inventory-crosswalk. Scroll down for Before / After examples and Evidence and remediation steps.
Purpose
Kitchen Sink builds a showcase tree (showcase/*.html, showcase/assets/*.js) that demonstrates every governed visual surface. Those files emit hash="XYZ" and data-ks-hash="XYZ" markers on catalog roots. DET.INVENTORY.CROSSWALK is a repo-wide deterministic check (metrics phase) that crosswalks all showcase-emitted hashes against docs/design/catalog/visual-registry.generated.json and flags stray tokens whose values are not exactly three ASCII letters.
Primary evidence lives in docs/design/catalog/visual-inventory.generated.json → catalogCrosswalk, refreshed by node tools/design-catalog/inventory-ks-visuals.mjs --repo . --out docs/design/catalog/visual-inventory.generated.json. The check module design-rules/deterministic/generated/det-inventory-crosswalk.check.js reads that block (or rescans showcase/ when the block is absent) and surfaces findings capped at MAX_INVENTORY_CROSSWALK_FINDINGS (12) per audit pass.
Plan: Register a surface in visual-registry.yaml before adding its hash to showcase output. Do: Run python3 generator/build-showcase.py after component changes; regenerate inventory JSON so catalogCrosswalk.showcase_hashes_not_in_registry stays empty. Check: node tools/design-catalog/check-visual-catalog.mjs --repo . --refresh-inventory and analyze-website-ux.mjs metrics for inventoryCrosswalkReport. Adjust: Register missing hashes, remove experimental markers, or fix invalid token shapes before chasing per-page DET.HASH.REGISTRY_ROW failures on consumer sites.
Unlike per-page rules, this rule evaluates the entire showcase inventory, not a single crawled URL. Passing DET.HASH.MARKERS on one page does not guarantee the repo crosswalk is clean if another showcase file still emits an unregistered hash.
Passing signals
visual-inventory.generated.jsonincludes acatalogCrosswalkblock withouterror, listingshowcase_dir(typicallyshowcase) and an emptyshowcase_hashes_not_in_registryarray.- Every hash collected from showcase HTML/JS by
collectEmittedHashes()exists invisual-registry.generated.jsonwith a valid three-letter token (for example Hbk, Ksr, Ksf, Vln, Ldg on preview pages). collectShowcaseStrayTokens()returns emptyhashanddataKsHasharrays — no values likeABCD,12, or placeholder slugs onhash=/data-ks-hash=attributes.- Showcase JS under
showcase/assets/uses the same three-letter convention inhash:"XYZ"and"data-ks-hash":"XYZ"literals when present. buildInventoryCrosswalkReport(repoRoot)returns{ skipped: false, issues: [] }.- After
python3 generator/build-showcase.py, preview shells such asshowcase/preview-handbook.htmlandshowcase/preview-landing.htmlemit only registry-known layout and chrome hashes. - Consumer submodule sites inherit a showcase tree whose crosswalk was verified at KS source — drift appears when local edits add markers without updating the registry.
Failing signals
unregistered-emitted(warn): Showcase HTML emitshash="Zzz"/data-ks-hash="Zzz"but Zzz has no row invisual-registry.generated.json— common after a prototype component ships beforeallocate-visual-hash.mjs/ registry YAML update.stray-token(minor): Invalid marker shape in showcase — for examplehash="ABCD"(four letters),hash="12", ordata-ks-hash="todo"— detected bycollectShowcaseStrayTokens().crosswalk-missing(minor):visual-inventory.generated.jsonexists but lackscatalogCrosswalk; regenerate inventory before interpreting crosswalk results.crosswalk-error(minor):catalogCrosswalk.erroris set — inventory generation failed; fix upstream catalog tooling first.inventory-parse-error/no-inventory: Missing or unreadable inventory JSON — runinventory-ks-visuals.mjsfrom repo root.- Findings truncate at 12 issues with a trailing "additional inventory crosswalk issues omitted" message when many showcase files drift at once.
- Passing
DET.HASH.REGISTRY_ROWon a single built page does not clear this rule if another showcase file still emits an orphan hash.
Before example
Before (failing example)
Showcase
Inventory crosswalk failure
Zzz is not in visual-registry.generated.json; hash="ABCD" is not three ASCII letters.
Body
Inner card has no hash markers — only governed roots are crosswalked.
Failing showcase fragment: layout preview emits an unregistered hash Zzz and a sidebar carries a stray four-letter token. Inventory crosswalk reports both unregistered-emitted and stray-token kinds.
After example
After (passing example)
Handbook
Governed delivery
Hbk and Ksr are registered; showcase crosswalk is clean.
Body
Site footer region uses registered hash Ksf when emitted below main.
Passing showcase fragment (aligned with showcase/preview-handbook.html): every emitted hash is registered; markers use exactly three ASCII letters with matching pairs.
Evidence and remediation
| Finding kind | Severity | Remediation |
|---|---|---|
unregistered-emitted |
warn | Add the surface to docs/design/catalog/visual-registry.yaml, regenerate visual-registry.generated.json, or remove the stray showcase marker if the surface is not governed. |
stray-token |
minor | Replace invalid values with a registered three-letter hash in both hash="XYZ" and data-ks-hash="XYZ", or remove the marker from showcase HTML/JS. |
crosswalk-missing / crosswalk-error |
minor | Run node tools/design-catalog/inventory-ks-visuals.mjs --repo . --out docs/design/catalog/visual-inventory.generated.json, then node tools/design-catalog/check-visual-catalog.mjs --repo . --refresh-inventory. |
| Truncated list (>12 issues) | minor | Use the full catalog check output; fix registry and showcase in batch before re-auditing. |
Workflow (PDCA):
- Plan — When adding a visual root to
components/or showcase previews, allocate or reuse a registry hash first (allocate-visual-hash.mjs/ editvisual-registry.yaml). - Do — Emit markers via
ks_hash_attrs(),layout_shell_attrs(), orchrome_region_attrs()in Python generators; rebuild showcase withpython3 generator/build-showcase.py. - Check — Refresh inventory JSON and run the UX auditor on the KS repo (metrics phase reads
inventoryCrosswalkReport). Confirmshowcase_hashes_not_in_registryis empty and no stray tokens appear inshowcase/. - Adjust — Register orphan hashes, delete experimental markers, or normalize invalid token shapes; regenerate inventory before consumer submodule bumps.
Harness verification: python3 generator/build_rule_defect_fixtures.py (overlay with unregistered Zzz), then auditor-tests/invoke-det-ruleset-harness.sh --only-rule DET.INVENTORY.CROSSWALK.