Skip to content

docs: one nav manifest, validated, and every page reachable - #541

Closed
godofecht wants to merge 3 commits into
mainfrom
docs/nav-manifest
Closed

godofecht wants to merge 3 commits into
mainfrom
docs/nav-manifest

Conversation

@godofecht

@godofecht godofecht commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

The problem

The sidebar was a 280-line dict literal inside build_wiki.py:607-886, and the same information was hand-maintained in four other places: page_category for the search filter, write_llms_txt as a third index, the tutorial track order, and mkdocs.yml. They had drifted.

docs/nav.json is now the single source, and two things are checked on every build, both failures rather than warnings:

  • every nav entry resolves to a real page
  • every page under docs/ is either in the nav or listed in unlisted with a written reason

build_wiki.py exits non-zero on either, and the wiki job runs it, so this is gated without a new CI job.

What the checks found

A dead sidebar link, shipping to readers. The Project section carried project/PROJECT_STRUCTURE.md. That file only exists under archive/.

55 pages in no sidebar at all. For a reference manual that means the information exists and cannot be found. The Language tab had 16 entries while docs/language/ has 36 pages. Absent from it:

ordering            shaders              dynamics-dsl        lifetime-domains
safety-profiles     wasm-crossings       mlir-opt-flags      export-abi
modules-namespacing multi-implementation explainable-compilation
graphics-3d         c-fnptr-call         concurrency-vs-go   replace-go
debugging           flow-run             README (the directory index)

The restructure

Appending 18 rows to one long list would have satisfied the checker and not the reader. The Language tab is now five sections:

Section Entries
Reference 12
Language features 8
Domain surfaces 4
Targets & interop 5
Comparisons 2

Domain surfaces is the one worth calling out. dynamics-dsl and shaders are the headline feature set, the flow/evolves as material the vision leads with, and neither page was reachable from the sidebar.

Library splits into Standard library (7) and Domain libraries (10). Tooling gains a Certification & compliance section for the five certification/ pages, none of which were in the sidebar. Language 16 → 31, Library 8 → 17, Tooling 4 → 12.

Eight pages are explicitly unlisted with reasons: three archived, plus internal runbooks and process notes that are not reader documentation.

The other drift sources

page_category now derives from the tab a page sits under. It was a separate prefix match, so a page could sit under Language in the sidebar and be reported as a guide in search.

llms.txt is generated from the manifest. It was a hand-written 25-link index that neither link checker validated, because it is not markdown, so its paths could rot silently. It now covers everything.

mkdocs.yml is the remaining consumer and is deliberately left for a follow-up, to avoid conflicting with #539 which is also editing it. I wrote and then removed a mkdocs_nav() helper rather than ship an unused function.

Why JSON and not YAML

The plan said YAML. The wiki job turns out to run bare python3 with no setup-python step and no pip install:

- uses: actions/checkout@v7
- name: Build static wiki
  run: python3 scripts/build_wiki.py

PyYAML is not in requirements.txt or the lock file, so anything build_wiki.py imports has to be standard library. JSON is also already the output format.

Validation

  • Unit suite: 1460 passed, 2 skipped (16 new, covering both the shipped manifest and each failure the validator exists to catch)
  • scripts/wiki_nav.py reports the manifest consistent with docs/
  • check_wiki_links.py and check_doc_links.py clean
  • ruff check src clean
  • Wiki rebuilds; the two generated proof sections still populate (6 Euclid books, 9 corpus groups)

godofecht and others added 2 commits August 18, 2026 09:24
First step of the wiki work: build the instrument before changing any
content, so every later claim about coverage is measured.

There are 775 ```flow blocks across the tracked markdown. None of them was
checked by anything. `scripts/check_doc_examples.py` compiles all of them
in about half a second, in process, and writes a ledger to
docs/generated/example-status.json. The baseline is 569 verified (73%) and
206 unverified.

Most documented examples are fragments by design, so the checker tries a
short ladder of wrappers and records which rung each block needed. A block
that only passes under the loosest wrapper stays visible in the ledger
rather than disappearing into a green count.

The ladder needs a guard. Flow reads `state angle` as two bare variable
expressions and `angle evolves as velocity` as a variable followed by a
cast of `evolves` to type `velocity`. Both parse once wrapped in a main,
and neither means anything like what the surrounding prose says. Without a
check for no-op statements the tool reported 581 verified; 12 of those were
prose. All 12 are in VISION.md, describing syntax the language does not
have yet, which is what the ignore= tag is for.

Extraction moves into scripts/docs_blocks.py. build_wiki.py and
verify_browser_interp.py each carried a copy of the same regex and the same
"function main" filter, kept in sync by a comment, and had already
diverged: only one derived a section heading. The regex also mispaired
fences, since with DOTALL and a non-greedy body it can start at a closing
fence and run to the next opening one, capturing prose as code. The
replacement walks lines and applies the CommonMark fence rule. Tutorial
extraction is byte-identical before and after: 257 lessons, same ids,
sections and bodies.

Per-block metadata goes in the info string, which markdown offers and
nothing was using: expect-error, ignore="reason", host=, preamble=, from=,
flow-body. Unknown words are rejected, so a typo fails loudly instead of
quietly verifying a block the author meant to exempt.

Reporting only. No CI gate yet.

Unit 1426 passed, ruff clean, doc-links and wiki-links clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A stress test of the first version found it was overstating. It reported
569 of 775 verified; compiling those through transpile and clang showed
that a fifth of them do not build. On the first 120 alone, 52 failed.

The cause was the fast tier. It ran the type checker with strict=False,
and in lenient mode names are not resolved, so undefined identifiers
survived to clang and the checker never looked. Three fixes, each one
because leaving it out produced green on documentation that does not work:

- Strict type checking, then C generation, then clang. Batching clang at
  150 translation units per process keeps the whole run near six seconds,
  so there is no reason to stop early.
- Route source through the field and dynamics expanders the way
  module_resolver does. Without them `dsys plant { ... }` and
  `field T: f64[32] on Line` were reported as syntax errors, which is the
  opposite mistake: correct documentation called broken.
- Reject blocks that compile to an empty translation unit. `theorem`
  declarations and unused generics are erased before codegen, so clang was
  being asked to approve an empty file. 42 blocks were passing this way,
  including the theorem example on the page whose subject is that theorems
  are checked, and a block under the heading "What gets rejected" whose
  body is entirely commented out.

Two harness rungs are removed after measuring that both rescue zero blocks.
`flow-body` cannot work: _validate_flow rejects a flow with no state and
limits members to f32/f64, while the docs write `state angle : Angle`.
`decl-wrap` was worse than useless; a translation unit needs no entry point
to compile, so all it ever did was hand an empty `main` to otherwise empty
blocks and defeat the vacuity check.

The no-op guard now recurses, so a bare identifier inside an `if` is caught
the same as one at the top level.

`host=`, `preamble=` and `from=` are removed from the accepted info string
until something honours them. They parsed and did nothing, which is worse
than absent: an author writes preamble= and gets a green that means nothing.

Ledger rows are keyed by content hash rather than line number. Inserting a
paragraph at the top of VISION.md moves all 30 of its blocks; across recent
history 178 of 813 commits would have renumbered rows, up to 223 at once.
That is a standing merge conflict that trains reviewers to resolve it
blindly. A content key changes exactly when the block does.

Honest baseline: 399 of 774 verified (52%). Unverified stops at parse 258,
types 62, vacuous 42, clang 13.

Unit 1444 passed, ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@godofecht
godofecht changed the base branch from docs/verify-example-blocks to main August 18, 2026 08:57
The sidebar was a 280-line dict literal inside build_wiki.py, and the same
information was hand-maintained in four other places: page_category for the
search filter, write_llms_txt as a third index, the tutorial track order,
and mkdocs.yml. They had drifted.

docs/nav.json is now the single source. build_wiki.py reads it, and two
things are checked on every build, both failures rather than warnings:

- every nav entry resolves to a real page
- every page under docs/ is either in the nav or listed in "unlisted" with
  a written reason

The first check immediately found project/PROJECT_STRUCTURE.md in the
Project section, pointing at a file that only exists under archive/. It has
been shipping as a dead sidebar link.

The second found 55 pages that were in no sidebar at all, which for a
reference manual means the information exists and cannot be found. The
Language tab held 16 entries while docs/language/ had 36 pages. Missing
from it: ordering, shaders, dynamics-dsl, lifetime-domains, safety-profiles,
wasm-crossings, mlir-opt-flags, export-abi, modules-namespacing,
multi-implementation, explainable-compilation, graphics-3d, c-fnptr-call,
concurrency-vs-go, replace-go, debugging, flow-run, and the directory index.

Rather than appending 18 rows to one long list, the Language tab is now five
sections: Reference, Language features, Domain surfaces, Targets and interop,
Comparisons. Domain surfaces is the one worth naming, since dynamics-dsl and
shaders are the headline feature set and neither was reachable. Library
splits into Standard library and Domain libraries; Tooling gains a
Certification and compliance section for the five certification pages, none
of which were in the sidebar.

Eight pages are explicitly unlisted with reasons: three archived, plus
internal runbooks and process notes that are not reader documentation.

page_category now derives from the tab a page sits under, so a page cannot
be filed under Language in the sidebar and reported as a guide in search.
llms.txt is generated from the manifest as well; it was a hand-written
25-link index that neither link checker validated, because it is not
markdown.

JSON rather than YAML: the wiki CI job runs bare python3 with no
setup-python and no pip install, so build_wiki.py has to stay stdlib-only.

Language tab 16 entries to 31, Library 8 to 17, Tooling 4 to 12.
Unit 1460 passed, ruff clean, wiki and doc links clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@godofecht

Copy link
Copy Markdown
Contributor Author

Superseded by a clean rebase onto main now that #540 has landed. Continues as the branch docs/nav-manifest2.

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.

1 participant