Repository navigation
ci: doc-refs audit, baseline-gated check for stale references in hand-written docs - #7623
Merged
Merged
Conversation
…nd-written docs tests/doc_refs_audit.py checks every hand-written markdown file for a backticked repo path, relative link or this repo's GitHub URL whose target is gone, a `script.py --flag` the script no longer spells, a bare `name.py` with no file, a missing skill, and a gitgalaxy/**/README.md that never names a public module beside it. Content-keyed baseline (177 findings on main), --ci fails only on new ones. Runs as an always() step in the Small audits job (stdlib, ~2 s, no extra runner) and in audit_check.py. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A wrapped sentence puts keyword-rosetta's name and its docs/GATING.md on different lines. Rebaselined: 160 on main; 47 left and none new on #7617. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 3, 2026
Contributor
…d gate test_source_reads.py bans errors="ignore"; the audit stays stdlib-only, so it can't use gitgalaxy.core.source_text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ics_task_* rows land in #7617) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 4, 2026
Merged
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
Part of #7624 (step 1).
This adds
tests/doc_refs_audit.py, a baseline-gated audit that fails a PR when hand-written markdown names something the repo no longer has. This is step 1 of the docs-drift plan that followed the #7617 sweep.That sweep fixed 113 files, and about 80% of what it found could be checked mechanically. The only wiki page that hadn't drifted was the CLI reference, and that's because
test_cli_contract.pypins it. This audit pins the rest of the docs the same way.pathtests/tools/x.py,gitgalaxy/core/) that isn't tracked, isn't gitignored and isn't published to thegeneratedbranch, where its folder exists herelinkgithub.com/squid-protocol/gitgalaxy/blob/main/...URL, whose target is missingflagpython <script>.py --flagorpython -m gitgalaxy.x --flag, where neither the script nor any.pybeside it spells the flag. A longer flag that starts with the same text doesn't count.namename.pywith no file of that nameskillxskill" for a skill that's neither in.claude/skills/nor in thedocs/ecosystem.mdtablemodulegitgalaxy/**/README.mdthat never names a public.pymodule beside itOut of scope:
namecheck.<lang>,*and{x}.Baseline keys are
check | doc | target, with no line number, so editing elsewhere in a doc doesn't change the key.--cifails only on new findings and lists baselined keys that no longer occur. Wrong findings go inALLOWEDwith a reason, and there are 5 of them.Baseline: 160 findings on main. Run against #7617's tree, 98 of them are fixed and none are new, so either PR can merge first. After #7617 merges,
python tests/doc_refs_audit.py --write-baselineshrinks the baseline to 47.Wiring and CI cost (
ci-workflows.md§5)if: always()step in the existing Small audits job, so it adds no runner request. It runs on the runner'spython3, stdlib only, with no install and no history, in about 2 s. It runs on every PR, including docs-only ones, which the plan skips for the other small audits. That's intentional: both a doc edit and a code rename can break a reference.test_audit_skip_plan.pynow allows that one step through, and asserts it hasalways()and no install.audit_check.pyruns it as[doc-refs].gate_controls.pylists it, with a negative control intest_doc_refs_audit.py.change_classifier.PATTERN_HOLDERSincludesdoc_refs_audit. Its globs name every doc, so counting it as a reader would turn every doc into test-read-doc and widen every plan.docs_read_by_tests.txtis unchanged.docs/agents/baseline-audits.md.File-cap exception: this is a new gate plus its registration in the four places every gate is registered (workflow, gate registry,
audit_check.py, skip-plan test). The new files are the script, its test and the generated baseline.Follow-ups (filed separately)
Step 2: workers fix the doc-refs findings they cause in the same PR, with markdown outside the 5-file cap. That needs the promoter-bot precheck. Step 3: computed counts instead of copied ones. Step 4: a nightly drift job that files issues. Step 5: a periodic judgment sweep.
Test plan
tests/test_doc_refs_audit.py: 14 tests, including plainpytestfrom an unrelated directory.test_audit_skip_plan,test_gate_controls,test_ci_replay_6278,test_engine_reach_workflows,test_change_classifier,test_cli_contractandtest_dead_key_audit: 194 passed.ruff_audit.py --ciis clean,ruff format --checkis clean, andchange_classifier.py --checkis fresh.doc_refs_audit.py --cipasses on this branch, and shows 0 new findings against docs: repo-wide refresh of READMEs, wiki, skills and agent docs #7617's tree.mypy_auditcrashes on this box's numpy stubs, which is an environment problem unrelated to this PR. CI's mypy job covers it.🤖 Generated with Claude Code