Public: anyone can read this; the crew can change it.
forked from trevato/cs
One list of what a player can do: the touch pads and the bindings table are held together by a test #270
Check · Review · Land · Live done — Landed and live in production.
`src/pages/actions.test.ts` is a new guard that holds each game's two lists of actions together: every action a page offers a thumb has to be one that game's bindings table binds, and every action a table binds has to be reachable from that page or written down in `ELSEWHERE` with the reason it needs no button. Both sides are read from their own sources — the rendered document scraped for `data-ac…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/pages/actions.test.tsis a new guard that holds each game's two lists of actions together: every action a page offers a thumb has to be one that game's bindings table binds, and every action a table binds has to be reachable from that page or written down inELSEWHEREwith the reason it needs no button. Both sides are read from their own sources — the rendered document scraped fordata-action, andObject.valuesofCS_KEYS/CS_MOUSE,RANGE_KEYS/RANGE_MOUSEand the example'sBINDINGS— so there is no third copy of the list, and a failure names the action and the side that is missing it (app: "molotov" is bound to a key and no button reaches it — the bindings are ahead of the page). I checked both directions bite by temporarily adding a key with no button and by renaming a pad's action; a line inELSEWHEREthat has stopped being true fails the same way, and a coverage check againstsrc/games.tsmeans the fourth game must be a fourth entry.The file sits beside the pages rather than beside a game because pages belong to no game —
src/independence.test.tsholds that line, and no game gained an import. The example's table is in its entry, which boots itself when imported, so it is imported into a page that is still loading exactly assrc/example/boot.test.tsdoes; that helper's docstring now says so.Worth looking at is
ELSEWHEREin the new file, because that list is the argument. Most of it is "reached another way" — the analogue thumb stick covers the movement keys and the walk (wishSpeedscales with the push, and a gentle one is under the footstep speed), the shell's ⛶ button covers full screen, the HUD's score covers Tab's hold-to-peek board, and buying a weapon equips it, so a phone plays what it bought. Three entries are gaps rather than choices and I wrote them down as gaps instead of quietly dressing them up: cs's scope, its three weapon slots and its pause have no touch path today, and the range'sreloadis in the table and the readout with nothing consuming it. I did not add buttons for them — that is a judgement about the pad's six slots and the page's labels, which this issue puts outside the guard.bun testis green on today's tree (1175 pass), which is the point: the two lists already agreed, and now they have to keep agreeing. One thing I deliberately left alone:PAGE_ACTIONSinsrc/client/stage.test-helper.tsandRANGE_ACTIONSinsrc/range/stage.test-helper.tsare stub-page fixtures that have fallen behind the real pages (no grenade, flash or smoke; no walk, start or drill), andsrc/server.test.tsonly checks the served page contains them, so nothing failed. Bringing them up to date changes what the boot tests exercise and belongs in its own pull.🤖 Generated with Claude Code
Closes #205