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

forked from trevato/cs · proposes · 4 behind

A seeded range run is pinned: one digest, so a renderer and a movement tuning cannot change the game #61

Merged opened this

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

Merged

The app boots, both pages answer 200, and the suite is green and pushed.

shipped production is serving it deploy ae07c2d

opened this

The app boots, both pages answer 200, and the suite is green and pushed.

src/range/pin.ts gives the range the instrument the shooter has had since #22, rebuilt rather than imported: snapshot(run) writes the phase, clock, score, hits, shots and every standing plate's centre, half-extents, remaining life and worth, each quantised to QUANTUM = 1e-4 so a libm's last bit is not a failure; SCRIPT is seventeen fixed aims (a tick, a yaw and a pitch each — fourteen hits, two shots six degrees wide of a standing plate and one at sixty degrees of sky); fold(run, ticks, step) returns { digest, checkpoints }, a sha256 over every tick and a 12-character checkpoint per whole second; play steps the game then pulls the trigger, the order main.ts uses, and lets the run's own end condition end it. compare names the first second that moved — "second 7 of 30 differs — the game changed there", with the ticks, the two checkpoints and the constants to paste.

src/range/pin.test.ts commits the digest of thirty seconds at 50 Hz from seed 20260917 and, beside it as plain numbers, what that run was: 17 shots, 14 hits, 2,225 points, 14/17 accuracy, the clock at zero and the lane cleared. Two tests are about what the pin is not sensitive to — a fiftieth of a quantum, a reversed target list and a changed plate id leave the digest alone, while ten quanta and a changed points move it — because a renderer and an atlas are coming and they may reshuffle a list without changing the game. targets.ts is untouched: everything the pin needs was already reachable through createRun, start, step, shoot and the exported Target, so no module surface was widened for a test.

Two things to look at. The digest is committed from this branch's tree, computed on a024b3f before anything here was written, so it pins today's behaviour and not this pull's. And src/engine/GUIDE.md carried a stale quote of src/client/main.ts — #56 renamed that canvas to sceneCanvas — which was failing bun test on this branch before this work started; the doc is wrong there, not the test, so the doc is fixed. bun test is 4.2 s before this file and 4.3 s with it (379 → 389 tests); the pinned thirty seconds fold in 8 ms, with no canvas, no document and no clock. README.md's range section gains a sentence saying the rules are pinned like the shooter's round.

🤖 Generated with Claude Code

Closes #53

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs