docs checks: validate destinations used by Markdown reference links #2200
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2200
Loading…
Reference in a new issue
No description provided.
Delete branch "ubiq/docs-reference-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: TEST-DOCS-REFERENCE-LINKS (claim)
The docs link check let a page pass when
[Guide][guide]pointed to a missing file via a separate definition. The checker now resolves common full, collapsed and shortcut reference links and images, passing their destinations through the existing file and anchor checks. It accounts for unused definitions, repeated labels and GFM footnotes.A synthetic page with four missing destinations reproduced the false pass on
a73a57e13. With the patch it reports all four. On macOS with Python 3.12.14, all 18 link tests and the complete docs-only suite (62 tests across 14 files) passed. CI registration, line-ending, compile, diff and changed-file game-data checks also passed.GPUs tested: n/a. All tests used synthetic inputs.
AI-assisted: yes. Created with gpt-6.2-astra in Codex.
Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. python -I tests/test_docs_links.py: 18 tests OK, so the tracked documents have no broken reference links today.
The check is new rather than a fix, so I compared it with main's version directly: for a page with "See [the guide][g]." and "[g]: nowhere.md", main's broken_links() returns nothing, and this PR's returns ("page.md", "nowhere.md", "missing file"). compileall clean.
AI-assisted: yes (Claude Code)
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
tests/test_docs_links.py: 18 passed (main: 17 passed).(AI-assisted test run; output checked by hand.)
#2200 | head
2a2cc220c146753a55fa7717564e4d9af913b9bc|python3 -I tests/test_docs_links.py -v| red: 18 passed with full file. Methods only: 1 test, 1 assertion failure | green: 18 passed with full file. Same methods: 1 passed | Full file green/green. Isolated check red → greenThe reference-link checker lives in the test file. As a separate control I copied only the new test method verbatim onto main, preserving its link checker. Its assertion failed there and passed on the merged tree. The focused invocation was
python3 -I tests/test_docs_links.py RepositoryLinksTest.test_checks_referenced_definitions_but_not_unused_ones -v.Pinned main
4938673668d807bf365b61284bf22b1ff8d02cc4, merged into the PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Independent verification on Windows 11 (
10.0.26200, x64) of2a2cc220c1merged onto currentorigin/main(59e65849b0,0merge conflicts), tested under bothPython 3.12.10andPython 3.14.5:origin/mainlinks()):'See [Guide][g].\n\n[g]: missing.md\n'returns[], missing broken reference-link targets.2a2cc220c1merged ontoorigin/main):python -I -B tests/test_docs_links.py RepositoryLinksTest.test_checks_referenced_definitions_but_not_unused_ones:Ran 1 test,OK(0.007 s), and CRLF\r\nmulti-line reference definitions resolve cleanly (['missing.md']).python -I -B tests/test_docs_links.py(18tests on bothPython 3.12.10andPython 3.14.5):17/18pass — confirming0broken reference-style links across all tracked Markdown files (includingd3d12/); the single failure matchesorigin/main's pre-existing inlineREADME.md#project-status/README.md#running-the-loader-on-linuxanchor mismatch (16/17onorigin/main).git diff --check,python -I -m compileall -q tests/test_docs_links.py,python -I scripts/check_no_game_data.py tests/test_docs_links.py,python -I tests/test_ci_registration.py(18/18), andpython -I tests/test_text_write_line_endings.py(3/3) all exited0.AI-assisted.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 2a2cc220c : red 1 new failure / green 17 OK (+1 pre-existing main failure)
python3.12 -I tests/test_docs_links.py(18 tests):found.extend(reference_links(text))neutralised on main.test_checks_referenced_definitions_but_not_unused_ones(the new test) fails.git merge --no-ff): 17/18 OK, skipped 0. The PR finds no new broken link in the repo.test_every_relative_link_resolves— 3 missing README.md anchors:#project-status(fromd3d12/README.mdanddocs/i18n/ar/quickstart.md) and#running-the-loader-on-linux(from the Arabic quickstart).test_docs_adjacent_fenced_blocks,_encoding,_repo_paths,_pr_template,_list_items): OK on main and merge.test_docs_cli_flagsfails on both (README.md:94passes-Gametoscripts/play-d3d12.ps1), unrelated.[^x]footnotes are excluded and covered by the test. No game data.Verdict: READY
AI-assisted: Claude Code
Merging, thank you @EdenBendheim! OreoFR's agent verified this head merged with current main: the test fails on main and passes with the PR (https://github.com/ProjectLeonida/mandy/pull/2200#issuecomment-7249872937), and it still merges cleanly.
AI-assisted (Claude Code, Claude Opus 5.5), on behalf of DadaCap.