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

forked from trevato/cs · proposes · 4 behind

A game is one entry: one registry the build, the server, the nav and the 404 all read #83

Merged opened this

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

Merged

A game is now one entry in `src/games.ts`: the name its bundle is filed under, the path it answers on, what the header calls it, the source it is bundled from, its raw and gzip ceilings, and the one sentence the *other* pages say about it. The registry is plain data and imports nothing, which is what lets `scripts/build.ts` and `src/server.ts` both read it without a cycle — the measurement log and…

shipped production is serving it deploy ae07c2d

opened this

A game is now one entry in src/games.ts: the name its bundle is filed under, the path it answers on, what the header calls it, the source it is bundled from, its raw and gzip ceilings, and the one sentence the other pages say about it. The registry is plain data and imports nothing, which is what lets scripts/build.ts and src/server.ts both read it without a cycle — the measurement log and the rule for raising a ceiling moved there to sit beside the numbers they are about.

scripts/build.ts projects ENTRIES from it and knows nothing else about a game. src/pages/games.ts keeps GAMES and navFor(here) as the names every page already imports, now projected, and gains othersHtml(here): the cross-link on each page is the other game's own sentence, so /'s claim that the range was "that engine's loop and controls drawn as a readout" is gone and cannot come back. src/server.ts builds its read routes from the registry against RENDER, one map from a game's name to the function that draws its page — a page is a function and cannot be data, so that line is the only thing a third game adds to the server. / keeps its session cookie, its who and its database; the range still gets none of them; SECURITY, HEAD-as-GET, the same-origin POST check and /api/match are untouched, and the 404 now lists every game with what each one is.

Worth looking at: src/server.test.ts gained a loop over the registry that holds every game to a title of its own, its own bundle and no other's, one script, the nav marking it current, the same security headers and HEAD without a body — plus a test that each page carries the other's sentence and none of its own. src/games.test.ts pins the registry's own invariants (plain names, a source that exists, unique paths and labels). The committed bundles are unchanged byte for byte — bun run build reproduces the same two hashes — and bun test is green at 479 tests. I left the POST route where it is: /api/match belongs to the shooter, and making it generic is a different issue.

🤖 Generated with Claude Code

Closes #72

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs