Split The code is public; the app answers only to the crew.

The ids `main.ts` reaches for are a contract nothing checks #127

Merged opened this

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

Merged

Pushed.

Notes

shipped merged

opened this

Pushed.

Added src/client/main.test.ts: it reads main.ts's own source text for every $("…")/$<Type>("…") id lookup (including the prefixed crosshair-panel shape, expanded for menu/pause) and every .querySelector/.querySelectorAll/.closest call with a literal selector, then checks each against gamePage()'s rendered HTML — except a small, explicit allow-list of what main.ts writes into the page itself (buy-close, buy-money, buy-clock, radio-close for ids; button.bind, .bind-status, .reset-bindings, .grid, button, .buy-line, .buy-why, .radio-call for selectors — the remaining page-reaching selectors are the bare tags details/summary). Two guard tests assert the extracted counts stay well above zero so a regex that stops matching can't silently turn the checks into no-ops.

Proved both directions of the contract by hand (renamed id="wrapper" in game.ts, then renamed the $("name") lookup in main.ts), watched the relevant test go red each time, then reverted — no left-over diff. bun run check (tsc + full suite) is green: 508 pass, 0 fail.

Left out: the harness itself doesn't run any DOM — it's a static string check per #99's brief, so #114's decision about a real DOM harness is untouched; if that harness lands, it should subsume this file rather than sit beside it, per atlas's note.

Closes #99

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs