Rule handbook metadata
- Rule
AI.DIAGRAM.SEMANTIC_ACCURACY· laneai- Page status
- stale
- page_version
b2c3cd488a5b9e9c2bc8a294a6cc9bda1433047eeefebb9ce28fc0fd07fd705f- generated_at
- 2026-05-19T18:15:00.000Z
- registry_fingerprint
6773fda516344e110b5a7b1435e655e1264e773825ca8bbe62194189891c42ba
How this rule is fixed
This is an AI-enabled rule. Pass/fail requires model judgment; there is no deterministic fixer in the pilot registry.
- Harness:
invoke-ai-ruleset-harness.shrunsdesign-rules/ai/run-design-ai-rule.shon the Before fixture and expects findings with matchingprincipleId. - Remediation: Cursor agent plans from
forge-ux-remediation.plan.mdafter sitewide audit — not handbook After copy.
Detection module: docs/design/ux-audit/ai-enabled-design-principles.md#ai-diagram-semantic-accuracy. Scroll down for Before / After examples and Evidence and remediation steps.
Purpose
Kitchen Sink ships diagrams as static SVG tiles (render_ks_diagram_block, ks_diagram_tile_html), ASCII figures (forge-diagram-ascii), and optional expand modals (ks-diagram-trigger, data-diagram-key). Deterministic gates (DET.DIAGRAM.LABELS, DET.DIAGRAM.ALT, DET.DIAGRAM.ASSET_REGISTRY) prove labels exist, alt policy is coherent, and assets are registered; they do not judge whether arrows, gates, and node roles match the story the page tells.
This AI rule asks: do shapes and flow match the described mechanism? A loop template under a "linear gate chain" caption, an agent→human arrow when copy says "human approves before agent work," or diamond gates drawn as plain rectangles all fail—even when contrast and hash markers pass.
Plan: For each informative diagram, read caption, surrounding prose, and catalog legend_map / contract semantics together with the SVG topology (or modal legend). Do: Swap template keys, relabel nodes, or redraw edges so direction, cardinality, and gate symbology align. Check: A reader can trace the claimed sequence on the figure without mental correction. Adjust: When the same mismatch repeats (for example caption always says "sequential" while template-loop-cycle ships), propose a DET.* candidate or tighten diagram contract semantics fields.
Passing signals
- Caption ↔ topology: Prose says "sequential review gates" and the figure is a left-to-right gate chain (
template-gate-chain) or linear flow—not a cycle, fork, or reversed arrow unless the text explicitly allows it. - Arrow direction matches agency: "Human approves, then agent executes" shows approval before the agent box; release follows evidence, not a shortcut from intent to ship.
- Shape vocabulary is consistent: Diamonds (or catalog gate glyphs) mean checkpoints; rectangles mean work stages; dashed vs solid edges match optional vs required paths in the contract legend.
- Labels tie to legend keys: SVG
data-node/ text labels use the same terms as the figcaption andDET.DIAGRAM.LABELScontract keys (no orphan "Step B" when the story names "Review gate"). - Alt and caption agree:
altand surrounding copy describe the same path the eye can follow (informative diagrams are not decorative while claiming a mechanism). - Expand modal legend matches tile: When
forge-diagram-trigger+data-diagram-keyopenks-diagram-catalog.jsdetail, modal narrative does not contradict the static tile. - Template choice is intentional:
render_ks_diagram_block(key=…)orassets/svg/template-*.svgselection matches the mechanism class (linear, gated, decision branch, network)—not "whatever thumbnail looked good."
Failing signals
- Caption promises a one-way gate chain but the tile shows a loop, bidirectional edge, or agent path that skips the human review node.
- Arrow reversal: edges run opposite to numbered steps in body copy or section heading.
- Wrong template family: linear-flow copy paired with loop-cycle, org-chart, or network mesh topology.
- Gate symbology drift: diamonds labeled "optional" in text drawn as required hard gates (or absent gates where copy says "hard stop").
- Decorative misclassification:
role="presentation"/ emptyaltwhile the surrounding section argues a product mechanism (DET.DIAGRAM.ALTmay pass classification while semantics still fail). - Legend modal contradicts tile: expanded catalog text describes a different sequence than the inline SVG.
- Unlabeled decision points: fork or join with no label while prose refers to "if review fails, return to intent"—topology hides the branch.
Before example
Before (failing example)
How it works
Human review before agent execution
Work moves in one direction: shape intent, pass a human review gate, then let the agent execute inside bounded scope, then release with evidence.
Failing KS markup: section copy and figcaption describe a sequential human-then-agent gate chain, but the shipped tile uses a loop-back template and an alt that describes a cycle—topology does not match the mechanism.
After example
After (passing example)
How it works
Human review before agent execution
Work moves in one direction: shape intent, pass a human review gate, then let the agent execute inside bounded scope, then release with evidence.
Linear gate chain: Intent → Human review → Agent execution → Release (matches left-to-right arrows and diamond gates in the SVG).
Passing KS markup: same story with a gate-chain template, left-to-right arrows, and labels that match caption and body copy (ks_diagram_tile_html + expandable catalog key).
Evidence and remediation
Capture: screenshot of the diagram tile and (if expandable) modal legend; copy the figcaption or support line and one paragraph of mechanism prose; export SVG or note data-diagram-key / src path; link the catalog diagram contract legend_map and semantics when present.
Remediate (in order):
- Restate the mechanism in one sentence (actors, order, gates, branches). List required nodes and edge directions.
- Pick the matching template family (
template-linear-flow,template-gate-chain,template-decision-flow, etc.) or update custom SVG labels/data-nodeattributes to match. - Align
alt, caption or support copy, and body text to the same sequence; fixDET.DIAGRAM.ALTclassification if the diagram is informative. - Run
DET.DIAGRAM.LABELSand registry checks; ensureDET.DIAGRAM.ASSET_REGISTRYandDET.HASH.MARKERSstill pass after edits. - Re-run AI review on the page batch; if the same topology mismatch repeats across sites, propose a deterministic
DET.DIAGRAM.*semantic proxy or tighten catalogsemantics/forbidden_patterns.