Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
Two games, one engine, no sharing — and a test that says so in both directions #92
Check · Review · Land · Live done — Landed and live in production.
`src/range/independence.test.ts` moves to `src/independence.test.ts` and gains the half that was missing: **a game's sources may not import another game's**, checked in both directions over every source outside the engine. The failure names the offender — `src/client/world.ts imports "../range/targets.ts"; a game may not import another game` — and the range reaching the other way fails the same wa…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/range/independence.test.tsmoves tosrc/independence.test.tsand gains the half that was missing: a game's sources may not import another game's, checked in both directions over every source outside the engine. The failure names the offender —src/client/world.ts imports "../range/targets.ts"; a game may not import another game— and the range reaching the other way fails the same way it did before. Who owns which directory comes from the registry (dirname(entry)of eachGAMESentry), so a third game is covered by the entry that adds it, andsrc/rl/is written down as the shooter's with a sentence of reasoning: it readssrc/client/because that game is the environment it trains in, and for exactly that reason it may not readsrc/range/.src/server.tsandsrc/pages/belong to no game and are held to neither rule — the app is allowed to know about every game on it.One file, not two, and one mechanism: the symmetric rule and the range's stricter one (engine door,
src/pages/shell.ts, its own siblings, nothing else) are one question — who may import whom, once you are outside the engine — so they live in one place, and both read the sources withoutsideSources/sources/specifiersOfimported fromsrc/engine/boundary.test.tsrather than a third copy of the regex. The range's rule is the stricter of the two and stays stricter on purpose: the shooter cannot be held to it (it sharessrc/result.tswith the server, legitimately), and the range is the proof that the engine suffices, so it pays the higher price.Two existing assertions had to move with the file rather than pass unchanged: the range's "has the sources this test is about" sentinel is now
targets.test.tsinstead of the test file that left the directory, andboundary.test.ts's synthetic door examples namesrc/independence.test.tsat its new depth. No real offence existed in the tree, so the rule was proved by adding one tosrc/client/hud.ts, watching it fail by name, and reverting it.bun testis green (503 tests),/and/rangeanswer 200, and the README gains thesrc/independence.test.tsentry plus thesrc/rl/sentence;src/engine/GUIDE.mdis untouched, since the claim is about this repository's layout rather than about building a game on the package.🤖 Generated with Claude Code
Closes #68