Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
The engine has one door: src/engine/index.ts is the surface, and nothing outside reaches past it #28
Check · Review · Land · Live done — Landed and live in production.
`src/engine/index.ts` is now the engine's only door: it re-exports the public names of all eight modules — values and types, one docstring per module — and holds no logic and no constants of its own. Every import of the engine from `src/client/`, `src/rl/`, their tests and `scripts/train.ts` goes through it (29 deep imports became 22 door imports; where swapping the specifier left a file importing…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/engine/index.tsis now the engine's only door: it re-exports the public names of all eight modules — values and types, one docstring per module — and holds no logic and no constants of its own. Every import of the engine fromsrc/client/,src/rl/, their tests andscripts/train.tsgoes through it (29 deep imports became 22 door imports; where swapping the specifier left a file importing the same path two or three times, those lines were merged into one). Inside the engine, modules still import each other directly.src/engine/boundary.test.tsgrew the rules that hold it: no file undersrc/orscripts/may name a path inside the engine other thanindex.ts; every non-test module undersrc/engine/is behind the door and the door re-exports nothing else; no engine module goes through its own door; and the sorted list of the 76 names the door offers is written out in the test, so adding, removing or renaming one fails and is read in review. Each rule has a unit test for the predicate itself beside the sweep over the sources, and one test checks the re-exported values are identical to the modules' own.No two modules exported the same name, so nothing is aliased. Nothing grew and nothing moved: the bundle went from 68220 to 68224 bytes (
app.90bb5b2a7e.js→app.3fa56501a8.js, rebuilt and committed),src/client/replay.test.ts's digests are untouched, andbun testis 226 pass / 0 fail.tsc --noEmit --strictreports the same three pre-existing errors asmainand no resolution or missing-export errors. The README's shape section gains a bullet naming the door, listing the surface and stating the rule.What I left alone: nothing in the engine does work at import time today and I added nothing that does, but the test that would prove it stays #26's. Worth a look in the preview:
/still renders and serves the new bundle (200, ~20 ms locally).🤖 Generated with Claude Code
Closes #25