fix(docs): a documentation link names a page that exists, and a gate refuses the next one that does not (#1643) - #1645
Merged
Merged
Conversation
…refuses the next one that does not (#1643) `docs/scripts/running.md` linked `../architecture/call-catalog.md`, a page that was referenced and never written. `mkdocs build --strict` fails on an unresolved link, so the documentation site stopped publishing and served pre-1.130.3 content until someone read the workflow log. The link now points at the "Call Catalog Configuration" section of `docs/server/configuration.md`, which is where `docs/portal/admin-sessions.md` already sends a reader for the same noun and which links back to this page in turn. A second reference was broken in a way no CI gate could see. MkDocs reports an unresolved anchor at info level rather than warning, and `mkdocs.yml` sets no `validation:` block, so `--strict` passes one: `docs/reference/tools-api.md` pointed at `#fetch` on a page with no such heading, landing readers at the top of it in silence. `fetch` is documented in `docs/server/tools.md`, which the link now names. `TestDocsMarkdownLinksResolve` holds both halves. Every inline link under `docs/` must name a file that exists and, when it carries a fragment, a heading that file has. `scripts/doc-check.sh` delegates to it as a hard gate exactly as its orphaned-page gate delegates to `TestDocsPagesInNavOrExcluded`, and being a Go test is what makes it reach: `make verify` never builds the documentation, so the path half is now enforced locally and in the CI unit lane rather than only by the deploy workflow. The gate models what python-markdown actually does, because each of these produced a false failure first: a fenced block closes only on the marker that opened it, or the walk desynchronizes on the indented fences inside tabbed blocks and hides every heading after them; a heading slug loses backticks and emphasis but keeps underscores, so `manage_table` keeps its anchor; and a repeated heading takes `_1`, `_2`, which seven pages under `docs/` rely on. Closes #1643
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1645 +/- ##
=======================================
Coverage 91.59% 91.59%
=======================================
Files 777 777
Lines 77877 77877
=======================================
+ Hits 71332 71335 +3
+ Misses 4275 4273 -2
+ Partials 2270 2269 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
docs/scripts/running.mdlinked../architecture/call-catalog.md. There is nodocs/architecture/directory and no page namedcall-catalog.mdanywhere; the link arrived in 87b272f alongside the prose it belongs to, pointing at a page that was planned and never written.mkdocs build --strict(.github/workflows/docs.yml:39) fails on an unresolved link, so the Deploy Documentation workflow had failed on every push since 2026-09-05 04:46 UTC and the site was serving pre-1.130.3 content.The link now names the "Call Catalog Configuration" section of
docs/server/configuration.md:677. That is wheredocs/portal/admin-sessions.md:56already sends a reader for the same noun, and it holds the### The one caller you do not namesubsection, which links back todocs/scripts/running.md— so the two pages describe the script-run exclusion to each other rather than at a page that does not exist.A second link was broken where no gate could see it
MkDocs reports an unresolved anchor at
infolevel rather thanwarning, andmkdocs.ymlsets novalidation:block, so--strictpasses one.docs/reference/tools-api.md:334linked[`fetch`](#fetch)on a page that has nofetchheading: a reader following it landed at the top of the same page with no error anywhere.fetchis documented atdocs/server/tools.md:664, which the link now names.Both classes now fail before a push
TestDocsMarkdownLinksResolve(test/structure/verify_test.go) walksdocs/**/*.mdand resolves every inline link: the path must name a file that exists and stay inside the repository, and a fragment on a Markdown target must be an anchor that file's headings actually produce.scripts/doc-check.shdelegates to it as hard gate 2, the same way its orphaned-page gate delegates toTestDocsPagesInNavOrExcluded— the rule is the one MkDocs applies, and a bash reimplementation would drift from it. Living in Go is what gives the gate its reach:make verifynever builds the documentation, so the path half is now enforced bygo test ./...in bothmake verifyand the CI unit lane instead of only by the deploy workflow after a merge, and the anchor half is enforced for the first time anywhere.The gate reproduces python-markdown's behavior rather than approximating it, because each of these differences produces a false failure on this repository's docs:
```on~~~desynchronizes the walk on the indented fences insidepymdownx.tabbedblocks and hides every heading after them — 6 false failures acrossdocs/server/anddocs/reference/.### manage_tableanchors atmanage_table, and stripping_as an emphasis marker breaks every tool-name link indocs/server/tools.md._1,_2. Seven pages underdocs/repeat one,## Configurationtwice being the common case, so#configuration_1is a link that resolves.Verification
mkdocs build --strictexits 0 with zero warnings, which is the exact command the deploy workflow runs.TestDocsMarkdownLinksResolvepasses on this tree, and fails naming file, line and target when either link is reverted: a missing path and a missing anchor are reported as distinct failures with distinct remedies.#configuration_1and rejects#configuration_9.make doc-checkreports all five hard gates OK.make verifyis green.docs/llms.txtanddocs/llms-full.txtare unchanged: neither carries either link, and no documented behavior changed.Closes #1643