Skip to content

test(routing): catch gate-coverage doc drift against a fresh render - #1945

Merged
pinin4fjords merged 1 commit into
mainfrom
fix/1921-gate-coverage-doc-drift
Sep 6, 2026
Merged

test(routing): catch gate-coverage doc drift against a fresh render#1945
pinin4fjords merged 1 commit into
mainfrom
fix/1921-gate-coverage-doc-drift

Conversation

@pinin4fjords

@pinin4fjords pinin4fjords commented Sep 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds test_gate_coverage_doc_in_sync to tests/test_routing_gate_coverage.py, which regenerates docs/dev/routing_gate_coverage.md via _render_markdown and compares it (line-number-normalized) against the committed doc.
  • Previously only tests/data/routing_gate_coverage_baseline.json was checked for drift; the published markdown a contributor actually reads had no corresponding check, so it could silently fall behind merged gate/triage changes.
  • Runs behind the module's existing CPython-3.11 rgc guard, in the same CI job (routing-gates) that already enforces test_gate_coverage_baseline_in_sync.
  • No src/ changes. docs/dev/routing_gate_coverage.md is already byte-identical to a fresh render on this base, so the new test passes immediately with no doc regeneration needed.

Fixes #1921

Test plan

  • pytest -q -n 0 tests/test_routing_gate_coverage.py -k doc_in_sync — 1 passed (collected count verified, not 0)
  • pytest -q -n 0 tests/test_routing_gate_coverage.py — 29 passed
  • ruff check + ruff format --check clean on the changed file
  • Runtime validator: not applicable (test-infrastructure invariant, no layout geometry)
  • Visual review of render preview
  • Render-preview verdict: expected no visual changes (no src/ touched)

…1921)

The gate-coverage ratchet only compared the baseline JSON, which pins the
un-exercised-arm gap *set*. A stale docs/dev/routing_gate_coverage.md - a
moved gate, a reworded triage note, an arm the corpus covers but the doc marks
un-exercised - could drift undetected.

Add test_gate_coverage_doc_in_sync: render the matrix fresh from the corpus and
compare it to the committed file, normalizing source-line numbers out of both
sides (the Line column and the ->L arc-destination markers, negative for
exit-arc gates) so an unrelated line shift does not red the test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Render preview: no visual changes detected. All renders match main.

@pinin4fjords
pinin4fjords marked this pull request as ready for review September 6, 2026 21:42
@pinin4fjords
pinin4fjords merged commit 9e69418 into main Sep 6, 2026
15 checks passed
@pinin4fjords
pinin4fjords deleted the fix/1921-gate-coverage-doc-drift branch September 6, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing checks the published gate-coverage matrix, so it drifts while the ratchet stays green

1 participant