{ "intent": "Clear the reverse_survivors test files under the cap, and defer its two core source files after both seams failed.", "scope": [ "src/core/sim.test.ts (698 -> 175) + simEnemies, simUnits, simFrenzy test modules", "src/core/director.test.ts (315 -> 178) + directorPowers.test.ts", "Reverted: src/core/sim.ts (361), src/core/types.ts (295)", "Non-goal: no assertion changed, no test deleted" ], "changes": [ "Four new test modules, each carrying the original preamble; the unused imports and orphaned local helpers were then pruned iteratively from tsc's own TS6133/TS6192/TS6196 output rather than guessed.", "sim.ts was reverted: its exported step() calls survivorStep, which any seam moves out, so the suite failed with 'ReferenceError: survivorStep is not defined' in 63 tests. tsc reported only unused-import warnings on that same code.", "types.ts was reverted: the difficulty tables sit below type declarations that reference them, so moving them left StatusKind, EnemyKind and BossKind unresolvable in the new module." ], "verification": [ { "command": "npm test -- --run", "result": "fail twice, then pass", "evidence": "160 passed in 13 files, matching the baseline of 160. The two failures were the source splits, not the test splits: 63 and then 64 tests failed with a ReferenceError, which is again a runtime-only symptom that tsc did not catch." }, { "command": "npx tsc --noEmit && npx eslint . --max-warnings 0", "result": "pass", "evidence": "Both clean after pruning roughly a dozen imports and two orphaned test helpers." }, { "command": "bash ~/utils/scripts/check_file_length.sh --all | grep reverse", "result": "pass", "evidence": "Only sim.ts and types.ts remain, both source files, both deliberately deferred." } ], "risks": [ "This is the third project where a TypeScript seam compiled clean and failed at runtime. The pattern is consistent enough to state plainly: in TS, tsc is not a check that a split worked - only the test run is.", "sim.ts and types.ts stay over the cap. Splitting sim.ts means passing the step functions in or hoisting them into a third module; types.ts needs its type declarations separated from the tables that use them." ], "rollback": [ "git revert the commit; the two originals return at 698 and 315 lines and the four new modules disappear.", "After rollback, re-run npm test and expect 160 passed." ] }