Skip to content

fix(docs): a documentation link names a page that exists, and a gate refuses the next one that does not (#1643) - #1645

Merged
cjimti merged 1 commit into
mainfrom
issue-1643-docs-links
Sep 6, 2026
Merged

fix(docs): a documentation link names a page that exists, and a gate refuses the next one that does not (#1643)#1645
cjimti merged 1 commit into
mainfrom
issue-1643-docs-links

Conversation

@cjimti

@cjimti cjimti commented Sep 6, 2026

Copy link
Copy Markdown
Member

docs/scripts/running.md linked ../architecture/call-catalog.md. There is no docs/architecture/ directory and no page named call-catalog.md anywhere; 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 where docs/portal/admin-sessions.md:56 already sends a reader for the same noun, and it holds the ### The one caller you do not name subsection, which links back to docs/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 info level rather than warning, and mkdocs.yml sets no validation: block, so --strict passes one. docs/reference/tools-api.md:334 linked [`fetch`](#fetch) on a page that has no fetch heading: a reader following it landed at the top of the same page with no error anywhere. fetch is documented at docs/server/tools.md:664, which the link now names.

Both classes now fail before a push

TestDocsMarkdownLinksResolve (test/structure/verify_test.go) walks docs/**/*.md and 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.sh delegates to it as hard gate 2, the same way its orphaned-page gate delegates to TestDocsPagesInNavOrExcluded — 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 verify never builds the documentation, so the path half is now enforced by go test ./... in both make verify and 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:

  • A fenced code block closes only on the marker that opened it. Closing ``` on ~~~ desynchronizes the walk on the indented fences inside pymdownx.tabbed blocks and hides every heading after them — 6 false failures across docs/server/ and docs/reference/.
  • A heading slug drops backticks and emphasis but keeps underscores. ### manage_table anchors at manage_table, and stripping _ as an emphasis marker breaks every tool-name link in docs/server/tools.md.
  • A repeated heading takes _1, _2. Seven pages under docs/ repeat one, ## Configuration twice being the common case, so #configuration_1 is a link that resolves.

Verification

  • mkdocs build --strict exits 0 with zero warnings, which is the exact command the deploy workflow runs.
  • TestDocsMarkdownLinksResolve passes 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.
  • On the duplicate-slug case it accepts #configuration_1 and rejects #configuration_9.
  • make doc-check reports all five hard gates OK. make verify is green.

docs/llms.txt and docs/llms-full.txt are unchanged: neither carries either link, and no documented behavior changed.

Closes #1643

…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

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.59%. Comparing base (fcd4dc8) to head (1c47b14).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cjimti
cjimti merged commit 3930ec1 into main Sep 6, 2026
10 checks passed
@cjimti
cjimti deleted the issue-1643-docs-links branch September 6, 2026 20:31
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.

The documentation site has not published since 2026-09-05: a link to a page that was never written fails the strict build

1 participant