Rule handbook metadata
- Rule
DET.DIAGRAM.ALT· lanedeterministic- Page status
- stale
- page_version
2a41d2762a8955a191adcfb2803cbf7d10eb49e43c8b575f7545749b36ddb51d- generated_at
- 2026-05-19T21:45: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-alt. Scroll down for Before / After examples and Evidence and remediation steps.
Purpose
Kitchen Sink ships mechanism diagrams as static tiles (ks_diagram_tile_html, forge-diagram, ks-diagram-tile, ks-diagram-canvas), ASCII figures (forge-diagram-ascii), and catalog-linked mounts (data-diagram-key, expandable forge-diagram-trigger). Screen readers need a consistent contract: decorative assets stay out of the accessibility tree; informative diagrams expose a name through alt, aria-label, aria-labelledby, aria-describedby, or nearby figcaption / forge-support copy (minimum 3 characters).
This deterministic rule scans visible diagram roots (.forge-diagram, .ks-diagram-tile, [data-diagram-key], figure.forge-diagram, figure.forge-diagram-ascii, and qualifying svg[role="img"] inside diagram mounts). It excludes data-chart mounts ([data-ks-chart], .ks-chart-mount, chart containers) and ambient layers (.forge-ambient-bg, .ks-living-scene, nav, toolbars). Violation kinds: diagram-alt-missing-summary, diagram-alt-informative-hidden, diagram-alt-decorative-named, diagram-alt-conflicting-role.
Plan: List diagram tiles on the page; note whether each block teaches a mechanism (informative) or only adds texture (decorative). Do: Use ks_diagram_tile_html(..., decorative=True) for wallpaper tiles; use role="figure" or role="img" plus meaningful alt / caption for catalog-linked diagrams. Check: Re-run auditor metrics (diagramAltReport) or inspect each .ks-diagram-tile in DevTools for aria-hidden, role, and name sources. Act: Fix generator flags, page templates, or hand-authored HTML so classification matches assistive-tech exposure; for semantic accuracy of arrows and labels, see AI.DIAGRAM.SEMANTIC_ACCURACY.
Passing signals
- Informative catalog tile:
div.forge-diagram.ks-diagram-tilewithdata-diagram-key,role="figure", innerimgwithaltat least 3 characters, and noaria-hidden="true"on the root or primaryimg/svg. - Informative SVG mount:
svg[role="img"]inside.ks-diagram-canvaswitharia-label(oraria-labelledbyto visible caption text) when the tile is not decorative. - Figure + caption:
figure.forge-diagramorfigure.forge-diagram-asciiwithfigcaption.forge-supportwhose text is at least 3 characters, satisfying the name requirement without duplicating a misleadingalt. - Decorative tile:
role="presentation"on the root,alt=""onimg, andaria-hidden="true"on the decorative asset—noaria-label, non-emptyalt, orrole="img"on the same subtree. - ASCII diagram:
figure.forge-diagram.forge-diagram-asciiwithdata-diagram-keyand caption infigcaption.forge-diagram-ascii-captionwhen the ASCII teaches structure; decorative ASCII uses presentation role and hidden subtree perascii_diagram_figure_htmldecorative mode. - Expand trigger consistency:
forge-diagram-trigger/ks-diagram-triggerdoes not hide an informative name while the adjacent section argues a product mechanism. - Chart exclusion:
.ks-chart-mountand[data-ks-chart]regions are scored underDET.CHART.ALT_SUMMARY, not this rule.
Failing signals
diagram-alt-missing-summary: Visibledata-diagram-keytile orrole="figure"/role="img"diagram with noalt,aria-label, labelledby/describedby target, orfigcaptiontext of at least 3 characters.diagram-alt-informative-hidden: Meaningfulalt/aria-labelor caption text present while root or target hasaria-hidden="true"orrole="presentation"(assistive tech cannot reach the claimed name).diagram-alt-decorative-named:alt=""onimgbut a non-empty accessible name elsewhere (for examplearia-labelon parent) withoutaria-hidden/ presentation role—empty alt and named exposure conflict.diagram-alt-conflicting-role:aria-hidden="true"combined withrole="img"on the same diagram or primarysvg/imgtarget.- Misclassified hero texture: Section background diagram inside
ks-sectionmarked informative while copy treats it as ambient-only (or the reverse). - Chart misfiled as diagram: Do not fix chart mounts here; wire summaries under
DET.CHART.ALT_SUMMARYinstead.
Before example
Before (failing example)
How governed delivery flows
Intent to release
Failing KS markup (div wrappers only): informative tile hidden from AT (diagram-alt-informative-hidden), aria-hidden with role="img" (diagram-alt-conflicting-role), catalog tile without a name (diagram-alt-missing-summary), and empty alt with parent aria-label (diagram-alt-decorative-named).
After example
After (passing example)
How governed delivery flows
Intent to release
Linear gate chain: Intent → Human review → Agent execution → Release
Passing KS markup: informative catalog tile with role="figure", non-empty alt, and visible forge-support caption; decorative companion uses presentation + empty alt + aria-hidden only.
Passing ASCII diagram block (informative) using div wrappers and forge-diagram-ascii classes:
<div class="forge-diagram forge-diagram-ascii breathe-static mb-4" data-diagram-key="ascii-gate-sketch" role="figure" hash="Asc" data-ks-hash="Asc">
<div class="forge-diagram-ascii-canvas">
<pre class="forge-code forge-diagram-ascii-pre">[ Intent ] --> [ Review ] --> [ Agent ] --> [ Release ]</pre>
</div>
<p class="forge-diagram-ascii-caption forge-support small mt-2 mb-0">
ASCII sketch of the same linear gate chain for text-only readers.
</p>
</div>
Evidence and remediation
Evidence: Auditor metrics diagramAltReport with violations[] entries carrying kind (diagram-alt-missing-summary, diagram-alt-informative-hidden, diagram-alt-decorative-named, diagram-alt-conflicting-role), selectorHint (for example div.ks-diagram-tile[key=template-gate-chain][@Gtc]), and className. Findings surface as major accessibility issues with remediation text keyed by kind. Capture outer HTML for the diagram root, primary img / svg, and adjacent forge-support / caption nodes.
Remediate (in order):
diagram-alt-missing-summary: Add meaningfulalt,aria-label,aria-labelledby, orfigcaption/forge-supportcopy (≥ 3 characters) on informative tiles; or mark purely decorative tiles withdecorative=Trueinks_diagram_tile_html.diagram-alt-informative-hidden: Removearia-hidden="true"androle="presentation"from informative roots; keep the caption andaltaligned with body copy.diagram-alt-decorative-named: Remove strayaria-label/ non-emptyaltfrom decorative assets, or reclassify as informative and drop empty-alt + hidden flags.diagram-alt-conflicting-role: Never pairaria-hidden="true"withrole="img"; userole="presentation"and hidden subtree for decorative SVG/img only.- Re-run deterministic diagram checks; if names exist but topology or legend keys disagree with prose, address
AI.DIAGRAM.SEMANTIC_ACCURACYandDET.DIAGRAM.LABELSseparately.