Check the documentation against the kit it describes

REFERENCE.md was 751 lines long and said the kit had 27 models, 15,425
triangles and eleven material slots. It had 35, 31,404 and thirteen, and the
document named none of the last six models at all. A reference nobody can trust
the numbers in is worse than no reference, because a reader has no way to tell
which parts are still true.

This is the third time the same failure has happened here. It is why
`catalog-table.ts` exists — the reference once said "four items" when the kit
had twenty-three — but regenerating the TABLE never touched the prose around
it, and the prose kept its own copies of every number.

So the counts are now checked the way the geometry is: against the models
themselves, by a script that fails. `check-docs.ts` reads the built kit and
requires each of the three documents to state the right model count and
triangle total, to list every model that exists, to name none that does not,
and to get the slot count right where it is written as a word.

Mutation-tested, as everything else here is — a wrong total, a dropped model
row and a stale slot word each fail it. And that test cost me the very fix it
was testing: `git checkout REFERENCE.md` to undo a mutation threw away the
uncommitted repairs along with it. Mutation-test after committing, not before.

Two things it caught immediately:

  - The root README never stated a triangle total at all, so the number a
    reader most wants for judging whether a kit is affordable was in two of
    the three documents and absent from the front door.
  - My own first version of the slot check. It looked for any word before
    "slots", matched the ordinary phrase "material slots" several paragraphs
    earlier, found that "material" is not a number, and silently checked
    nothing — reporting nothing rather than failing. A check that passes by
    not running is worse than no check, because it reads as evidence.

`bun run check:docs`, and it is in the README's verify list with the others.
This commit is contained in:
CRTkafa 2026-08-26 18:37:18 +00:00
parent 424d07c48f
commit 0ebb3aa5ec
4 changed files with 154 additions and 25 deletions

View file

@ -14,6 +14,10 @@ on an opaque package. This repository holds one such registry.
![The whole kit](media/kit.png)
35 models and one shared library, **31,404 triangles** for the whole kit — less
than a single medium-detail character. Every one is procedural source you own
and edit, not an asset you load.
## Run the viewer
Requires [Bun](https://bun.sh) and a browser with WebGPU (the `@scifi-kit` model
@ -57,6 +61,7 @@ textures at all.
bun run typecheck
bun run verify # geometry, protocol, metadata, actions
bun run verify:glb # export every model, read it back, compare
bun run check:docs # the three READMEs against the kit they describe
bun run render # renders/_sheet.png — actually look at the models
```
@ -159,6 +164,7 @@ scripts/
support.ts voxel connectivity — nothing may float
audit.ts runs the support check across every configuration
render.ts offline software rasteriser → PNG contact sheet
check-docs.ts documented counts against the models themselves
reference-shots.ts one photographic reference per model, for comparison
probe-tree.ts measures the oak against its reference photographs
catalog-table.ts regenerates the model table in the registry README