Skip to content

Every builtin module's page on the site links the page the crate's reference documents that module on, from the one module-to-page mapping the rustdoc check holds the published tree to, and only in a build that composed the reference

Each builtin module has a page on the site, under /registry/modules/, and each module the crate

declared statusdeclared status: guaranteed Declared deterministic and blocking, implemented, and naming the behavioural test that is to prove it. Whether a recorded run supports it is the evidence verdict, shown beside it.

recorded evidencerecorded evidence: not run Declared guaranteed, and not supported by a recorded run: the test is named, and no passing run of the current inputs is recorded. how evidence is recorded

The mapping is quality::rustdoc::module_routes, the crate's exported modules each with the page derived from the crate's own inventory, which majordomus quality rustdoc requires of the tree as a missing-page finding. majordomus generate carries it into the site's registry dataset as rustdoc on each module, and a module rustdoc gives no page (pub(crate) or private) carries none. The template joins it with the surfaces the build composed, from data/build.json, which scripts/site-build writes from docs/generated/web.json; it derives no route, and a build without the reference links nothing. scripts/ci/link-check resolves every such link against the composed site.

What it means

Each builtin module has a page on the site, under /registry/modules/, and each module the crate exports has a page in the crate's reference, under /rustdoc/. The first links the second: the module page's provenance names the module's crate path as "crate reference" and links the page rustdoc documents it on. A module rustdoc gives no page — one declared pub(crate) or private — links nothing, and a build that did not compose the reference links nothing either, so a link on a module page is never a link to a page that is not there.

How it works

The mapping from a module to its rustdoc page is decided once, where the reference is checked. quality::rustdoc::module_routes reads the crate's own syntax-tree inventory (quality::source::Inventory), keeps the modules the crate exports, and derives each one's page by rustdoc's route rule — the same derivation majordomus quality rustdoc holds the published tree to, where a module without its page is a missing-page finding. majordomus generate carries that answer into the site's registry dataset (site/data/registry/registry.json) as rustdoc on each builtin module: the surface the page is published under, the module's crate path and the page within the surface. It is read from the crate's source, so the dataset is the same on every machine whether or not the tree has been built.

The template, site/templates/registry-module.html, joins that with the surfaces the build composed: scripts/site-build records each one, with its mount, in data/build.json, from the selection mj_web_composed reads out of docs/generated/web.json. The link is the composed surface's mount and the page, through get_url, so a build for another base path keeps working. The template derives no route, and names no surface of its own.

How to see it

scripts/rust-check --doc
majordomus quality rustdoc --format json | jq '.modules[] | select(.path | test("builtin::quality$"))'
jq '.registry.modules[] | select(.id == "quality") | .rustdoc' site/data/registry/registry.json
scripts/site-build && grep -o 'crate reference.*quality/index.html' site/public/registry/modules/quality/index.html
bash test/run.sh 492_rustdoc_module_links
cargo test --manifest-path apps/majordomus-cli/Cargo.toml site::tests quality::rustdoc

What it does not cover

The Cockpit's module pages are another surface with their own renderer; this claim is about the published site. Whether the linked page is complete is rustdoc-complete, and whether it is this commit's is rustdoc-verified-live. A module page links the module's own page, not the pages of the items in it: rustdoc's page lists them.

Why it exists

The crate's reference was published with no way in from the pages that describe the same code. The tempting fix is a line in the template that turns src/capability/builtin/<x>.rs into majordomus_cli/capability/builtin/<x>/index.html, and that line is a second statement of the route rule the rustdoc check already owns. It is also wrong for every module the crate does not export: rustdoc writes no page for a pub(crate) module, so that rule would link a 404 from every module page whose module the crate keeps to itself. test/cases/492_rustdoc_module_links.sh reads every module page of a real build against the check's own answer, and builds again without the reference to see every link go.

Detail rendered from docs/claims/rustdoc-referenced.md.

From the statement to the proof

  1. 1 · the public statement

    Every builtin module's page on the site links the page the crate's reference documents that module on, from the one module-to-page mapping the rustdoc check holds the published tree to, and only in a build that composed the reference

    No feature or README responsibility names it; this page is where it is stated.

  2. 2 · the canonical claim

    rustdoc-referenceddeclared status: guaranteed in docs/CLAIMS.yaml

    Defined in read it on this site · docs/RUSTDOC.md

  3. 3 · the implementation

    apps/majordomus-cli/src/site.rs

  4. 4 · the test and the scenarios

    Test: test/cases/492_rustdoc_module_links.sh

  5. 5 · the recorded runs

    recorded evidence: not run how evidence is recorded

Verify it yourself

The test runs in a disposable temporary repository and asserts the behaviour, not a string in the source.

from a clone of the repository
bash test/run.sh 492_rustdoc_module_links

Related claims same implementation

Searches the titles and descriptions of every page this site publishes.