Rule handbook metadata

Rule
DET.HTML.EMPTY_INLINE · lane deterministic
Page status
current
page_version
dbe79823bbc33762ff1359462db1ad4daa978530a36e767f1a280470a5945241
generated_at
2026-05-25T11:30:00.000Z
registry_fingerprint
2ce40848effce579d3e4879f6ca85535183a14db201870a6c007da424624550c

How this rule is fixed

Pilot deterministic fixer: handbook_after · harness mode standalone · verify expect_rule_clean.

  • Harness: apply-harness-fixture-remediation.py copies the After example HTML from this handbook page onto the defect fixture, then invoke-det-ruleset-remediation-verify.sh re-audits and expects zero findings for this rule.
  • Production sites: run-website-ux-remediation-loop.sh runs handbook_html_patch (HTML patches in lib/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-html-empty-inline. Scroll down for Before / After examples and Evidence and remediation steps.

Purpose

Handbook and product pages built with forge-autodoc and Kitchen Sink transforms (components/transforms.py enhance_tables, render_table in components/components.py) often wrap table focus cells or Markdown emphasis in <strong> or <em>. When a generator bug, partial Markdown parse, or placeholder row leaves the wrapper with no trimmed text, the tag still appears in the DOM but announces nothing to screen readers and adds noise to accessibility semantics scans.

This deterministic rule evaluates main#main (or the first main landmark) only. It counts <strong> and <em> elements whose textContent, with whitespace collapsed, is empty. Empty <strong> findings are minor; empty <em> are trivial. Content outside main (header chrome, sidebars) is out of scope.

Plan: Crawl handbook chapters, token grids, and comparison tables inside doc-main. Do: Fix transforms so emphasis tags wrap real labels or omit the tag when there is no focus text. Check: metrics.emptyInlineReport reports zero counts. Adjust: Pair with DET.DATA.TABLE_HEADERS when table structure also lacks scoped headers.

Passing signals

  • Every <strong> / <em> inside main contains at least one non-whitespace character (visible text or .sr-only helper text inside the same element).
  • render_table cells use plain text or populated emphasis—for example <td><strong>Recommended</strong></td> instead of an empty wrapper.
  • Autodoc / Markdown pipelines that mark a “focus” row emit a word such as “Primary”, “Focus”, or the row label inside <strong>, not an empty shell left for CSS to style.
  • Prose in forge-support paragraphs uses <strong>visible</strong> for inline emphasis; decorative bolding uses CSS classes on spans, not empty semantic tags.
  • metrics.emptyInlineReport: { emptyStrongCount: 0, emptyEmCount: 0 } after crawl.
  • No finding evidence keys empty_strong_count= or empty_em_count= on audited URLs.

Failing signals

  • empty_strong_count=N — one or more <strong></strong> (or whitespace-only <strong> </strong>) inside main (minor).
  • empty_em_count=N — empty <em></em> tags in main (trivial).
  • Autodoc table focus column with <td><strong></strong></td> where the Markdown cell was blank but the transform still opened an emphasis wrapper.
  • Handbook comparison tables in .forge-table-wrap beside forge-support lede copy that references “marked rows” while the marker cell is an empty <strong>.
  • Generator regression after editing enhance_tables or autodoc post-processors: emphasis tags emitted as placeholders for future content.
  • Page may still pass DET.CTA.LABEL_NONEMPTY (buttons named) while failing here—empty inline semantics are independent of CTA naming.

Before example

Before (failing example)

Methodology comparison

Rows marked indicate the recommended delivery focus for agent-assisted teams.

Methodology Focus Iteration
Scrum 2-week sprint
Forge Spark-driven
Kanban Continuous flow Ongoing

Failing KS markup: handbook doc-main with a comparison table whose focus column uses empty <strong> wrappers (typical autodoc table focus-row defect).

After example

After (passing example)

Methodology comparison

Rows marked Recommended indicate the delivery focus for agent-assisted teams.

Methodology Focus Iteration
Scrum Recommended 2-week sprint
Forge Primary path Spark-driven
Kanban Continuous flow Ongoing

Passing KS markup: same table with populated emphasis labels (or plain text when no emphasis is needed).

Evidence and remediation

Evidence: Playwright probe collectEmptyInlineReport (or crawl metric metrics.emptyInlineReport) inside main#main. Finding messages cite empty_strong_count=N, empty_em_count=N, and optional url= suffix. Module: design-rules/deterministic/generated/det-html-empty-inline.check.js.

Remediate (in order):

  1. Locate empty tags: In DevTools, search main for strong / em with zero text; common sites are .forge-table-wrap focus columns and autodoc-generated comparison matrices.
  2. Fix generators: Update autodoc or enhance_tables transforms so emphasis wrappers are omitted when cell text is blank, or inject the focus label (for example “Recommended”, “Primary”) from Markdown metadata.
  3. Fix hand-authored HTML: Replace <strong></strong> with visible copy or remove the tag; use forge-support + CSS weight classes when semantics are decorative only.
  4. Optional regions: Align with DET.PY.OPTIONAL_REGIONS—do not emit placeholder emphasis for slots that render empty.
  5. Re-verify: Run analyze-website-ux.mjs on affected handbook routes; confirm emptyInlineReport counts are zero. For ruleset harness: generator/build_rule_defect_fixtures.py and auditor-tests/invoke-det-ruleset-harness.sh --only-rule DET.HTML.EMPTY_INLINE.