Skip to content

docs: make the coverage dashboard recompute itself - #30

Merged
Sean-Koval merged 1 commit into
mainfrom
agent/worker-meredith-coverage-port
Aug 31, 2026
Merged

docs: make the coverage dashboard recompute itself#30
Sean-Koval merged 1 commit into
mainfrom
agent/worker-meredith-coverage-port

Conversation

@Sean-Koval

Copy link
Copy Markdown
Contributor

The coverage page told you to trust it because "every number comes with the command that produced it" — but nothing ran those commands. It was already stale: it claimed 59 pages / 8 draft when the real tally was 57 / 5, and it stated check:api-drift was "currently failing" when that gate exits 0. It was overtaken about an hour after it was written.

This makes the page regenerate itself and adds check:coverage to the docs gates.

  • Three <!-- coverage:begin:NAME --> regions are derived from source — frontmatter status across the Starlight collection, pub mod in lib.rs, and python/openquant/*.py. Prose outside the regions is untouched. --check fails on drift, --write regenerates.
  • An undocumented public module is a hard failure unless coverage_allowlist.toml carries a reason and an unexpired date. An exemption for a module that is documented also fails — a stale exemption is how an allowlist stops meaning anything.
  • The measured-on date deliberately does not fail the build. A gate that goes red because a week passed is a gate people switch off.

util is treated as a namespace rather than a gap, since util::fast_ewma and util::volatility have their own pages.

Verified independently of the author. Clean run of every gate exits 0 (build 97 pages, links 109 files, api-drift, content-schema, coverage, 39 Rust examples). Negative-tested: an undocumented pub mod → exit 1 naming it; a perturbed tally number → exit 1 coverage.md is stale in: status-tally; a date-only edit → exit 0 by design. All restored, clean run 0.

Origin: salvage of an abandoned February effort. Two other candidate features from it were rejected as superseded — the chapter IA (its mapping was a strict subset of by-afml-chapter.md and mapped ch6 to the wrong modules) and a hand-maintained apiCatalog.ts (apiInventory.ts is generated and gated).

coverage.md opens by promising that every number on it ships with the
command that produced it, and then closes by admitting the numbers were
hand-transcribed from commands someone ran once. That gap had already
opened: the page claimed 59 docs pages (8 draft) when the tree had 57
(6 draft), and 12 enriched / 27 stub module pages when the real split
was 10 full-template / 29 base — moduleDocs.ts was rewritten after the
page was last touched. It also said check:api-drift was failing; it
passes.

So this adds the command. scripts/docs/check_coverage.py derives all
three tables from the tree and compares them with marked regions of the
page, failing on drift; --write regenerates them. Prose outside the
markers is untouched, so the page stays hand-written where it should be.

Undocumented public modules are now a hard failure rather than a line in
a table. docs-site/coverage_allowlist.toml is the only place a gap may
live, and an entry costs a reason and an expiry date, so a gap cannot be
parked there indefinitely. data_processing and bars are the two current
entries. An exemption for a module that turns out to be documented also
fails, because a stale exemption is how an allowlist stops meaning
anything.

Wired into check:docs and the docs-checks CI job next to the other docs
gates. Python only — the job already runs check:api-drift on the
runner's bare python3 before its setup-python step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfGwkvxHYD4UbTQEU4Mx2S
@Sean-Koval
Sean-Koval merged commit d3e6dfa into main Aug 31, 2026
4 checks passed
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