Skip to content

docs: check that every part of the language has a documented home - #543

Merged
godofecht merged 1 commit into
mainfrom
docs/coverage-checker
Aug 18, 2026
Merged

godofecht merged 1 commit into
mainfrom
docs/coverage-checker

Conversation

@godofecht

@godofecht godofecht commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Fourth of the wiki series. Branches from main; independent of #540, #541 and #542.

This is the part that answers "people should be able to find information about every aspect of the language" with a number instead of an opinion.

The inventory is read from the compiler

Never hand-maintained, so it cannot fall behind the implementation:

Category Source Count
keyword parser.py, Lexer.keyword_map 44
attribute attributes.py, KNOWN_ATTRIBUTES 20
cli the flow driver's dispatch case 66
stdlib lib/stdlib/**/*.flow 109
backend src/flow/*_{generator,codegen,compiler}.py 9

docs/coverage.json maps each feature to the page that documents it. Three ways a mapping can fail, all of them errors:

  • the feature has no entry
  • the entry names a page that does not exist
  • the entry names a page that never mentions the feature

That last one is the point. A mapping that points somewhere plausible but silent is worse than an admitted gap, because it reads as covered. A mapping for something the compiler has since dropped is reported as stale in the other direction.

What bootstrapping it found

16 features that no page mentions anywhere:

backend:wasm_compiler
cli:check
cli:firg                cli:install-tools
cli:ui-layout           cli:ui-layout-window
cli:vulkan-2048         cli:vulkan-breakout     cli:vulkan-demo
cli:vulkan-demo-advanced cli:vulkan-demo-basic  cli:vulkan-layout
cli:vulkan-layout-dsl   cli:vulkan-pong         cli:vulkan-snake
cli:vulkan-tetris

Twelve are compatibility aliases for flow demo ... and two are spelling aliases (firg, install-tools); all now exempt with that reason written down. wasm_compiler is the direct wasm32 backend, which #539 documents.

One was a real gap. flow check has existed since #415 and was documented nowhere. It lints .flow sources against [conventions].avoid in flow.toml. This adds it to DEVELOPMENT.md with what it reads, what it skips (build/, .freebuff/), and the fact that it exits non-zero on a match so it can be used as a gate.

Result

Coverage:
  attribute    20/20   covered   exempt   0   problems   0   uncovered   0
  backend       8/9    covered   exempt   1   problems   0   uncovered   0
  cli          52/66   covered   exempt  14   problems   0   uncovered   0
  keyword      44/44   covered   exempt   0   problems   0   uncovered   0
  stdlib      109/109  covered   exempt   0   problems   0   uncovered   0

every feature has a documented home

Two extraction details

Subcommands come from the dispatch table, not the help text, so a command that exists but was never added to show_help still counts. My first attempt read every case in the driver and picked up architecture arms (x86_64, aarch64) and profile arms (safety, flight) as if they were commands. A test now pins that they stay out.

mentions is deliberately literal, per category. @gpu matches the attribute while the bare word "gpu" does not; ./flow run matches the command while "a long run of failures" does not. Parametrised tests cover both directions, because a search loose enough to match anything would make the whole check meaningless.

Scope

Reporting only, no CI gate. The gate arrives with the others later in the series.

Validation

  • Unit suite 1428 passed, 2 skipped (17 new)
  • check_doc_coverage.py exits 0
  • check_doc_links.py clean
  • ruff check src clean

The feature list is read out of the compiler rather than hand-maintained,
so it cannot fall behind the implementation: keywords from Lexer.keyword_map,
attributes from KNOWN_ATTRIBUTES, subcommands from the flow driver's dispatch
table, modules from lib/stdlib, backends from the *_generator / *_codegen /
*_compiler modules. That is 248 features today.

docs/coverage.json maps each one to the page that documents it. A mapping
only counts when the page exists and actually mentions the feature, so an
entry cannot be a promise nobody kept, and a mapping for something the
compiler has since dropped is reported as stale.

Bootstrapping it found 16 features no page mentions at all. Twelve are
compatibility aliases for `flow demo ...` and two are spelling aliases, all
now exempt with reasons. One is the direct wasm32 backend, which PR #539
documents. The last was real: `flow check` has existed since #415 and was
documented nowhere, so this adds it to DEVELOPMENT.md with what it reads
from flow.toml, what it skips, and what it exits.

Coverage now: attribute 20/20, backend 8/9, cli 52/66, keyword 44/44,
stdlib 109/109, with 15 exemptions each carrying a written reason and
nothing uncovered.

Two extraction details worth knowing. Subcommands come from the dispatch
`case` arms rather than show_help, so a command that exists but was never
added to the help text still counts; the first attempt read every `case` in
the driver and picked up architecture and profile arms, which the tests now
pin against. And `mentions` is deliberately literal per category: `@gpu`
matches the attribute while the bare word "gpu" does not, so a passing
mention cannot masquerade as documentation.

Reporting only, no CI gate yet.

Unit 1428 passed, ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@godofecht
godofecht merged commit 09b9593 into main Aug 18, 2026
19 checks passed
@godofecht
godofecht deleted the docs/coverage-checker branch August 18, 2026 09:48
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