Public: anyone can read this; the crew can change it.

forked from trevato/cs

Every number the pages boast is read from the thing it describes, on all three pages and not just /example #306

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Every number in the prose of `/`, `/range` and `/example` is now rendered from the module that owns it, under one rule that all three pages share.

shipped production is serving it deploy ae07c2d

opened this

Every number in the prose of /, /range and /example is now rendered from the module that owns it, under one rule that all three pages share.

The rule is src/pages/digits.test-helper.ts: it strips a rendered page down to the words a visitor reads — no head, no style block, no script, no header or footer, no attributes, and no <section> a database fills — and reports every group of digits that the numbers a test gathered from the sources do not account for, naming the page, the digit and the sentence it was typed into. /example's test was extended onto it rather than copied, and now covers that whole page instead of the cost section alone. A digit glued to a letter is part of a word (WebGL2, int8, gen_19948bw), not a measurement.

What the pages read now. / takes the step height from CS_MOVE, the HE's 98/350/1.5 and the flash's 1.6 and the smoke's 180 from WEAPONS, and the Length control's 5 and 13 from SHORT/COMPETITIVE; the card, the match of the day and the weapons summary were already readouts and are held by the same rule now. /range takes the lane's speed, gravity, friction, jump apex, crouch drop and standing eye from src/range/movement.ts, both games' fixed steps from each game's own pinned script, the drills' scores and speeds from targets.ts, the atlas's 64 from paint.ts, and the two distances the loudness sentence compares from the plates' own depth range. Nothing stores a jump apex, so src/pages/tuning.ts derives it (v₀²/2g) once for the page and the test, and tuning.test.ts jumps a body through the engine's solver to check the shortcut is still the truth; src/pages/figure.ts is how a page writes a number, so page and test format the same value the same way.

Two things moved, deliberately. The smoke's "fifteen seconds" is now 15 because it was a claim about a stored number, and the loudness sentence compares the farthest plate with the nearest (320) rather than a typed 200 — the ratio is still a quarter. Everything else that is words stays words: "about eight kilobytes", "thirty seconds on the clock", "three plates at a time", "eighty milliseconds" and "a quarter of the air acceleration" are prose, and the rule is about digits, not about claims. The README says where that line was drawn.

To try it: / and /range in the preview read exactly as they did — same sentences, same server-rendered first paint, / is 4 bytes smaller. The proof it bites: set HE.blast.damage to 120 in src/client/weapons.ts and put 98 back in the paragraph, and bun test fails with `/: 98 is in no module — "…on the same solver the players walk on — 98 damage at the centre falling off over 350 units…". bun run test` is green here: 1265 tests, 115 files. No new dependency.

🤖 Generated with Claude Code

Closes #224

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs