test(routing): catch gate-coverage doc drift against a fresh render - #1945
Merged
Conversation
…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>
Contributor
|
Render preview: no visual changes detected. All renders match |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_gate_coverage_doc_in_synctotests/test_routing_gate_coverage.py, which regeneratesdocs/dev/routing_gate_coverage.mdvia_render_markdownand compares it (line-number-normalized) against the committed doc.tests/data/routing_gate_coverage_baseline.jsonwas checked for drift; the published markdown a contributor actually reads had no corresponding check, so it could silently fall behind merged gate/triage changes.rgcguard, in the same CI job (routing-gates) that already enforcestest_gate_coverage_baseline_in_sync.src/changes.docs/dev/routing_gate_coverage.mdis 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 passedruff check+ruff format --checkclean on the changed filesrc/touched)