testsAndMisc/docs/superpowers/evidence/reverse-survivors-test-split-2026-08-16.json
Krzysztof kuhy Rudnicki 093e2f6f68 Split the reverse_survivors test files; defer its two core sources
sim.test.ts 698 -> 175 and director.test.ts 315 -> 178, into four new
modules. 160 tests passing before and after.

sim.ts and types.ts are reverted. sim.ts's exported step() calls
survivorStep, which any seam moves out - 63 tests failed with a
ReferenceError while tsc reported only unused imports. types.ts has its
difficulty tables below the type declarations that use them.

Third project now where a TypeScript seam compiles clean and fails at
runtime. In TS, tsc does not tell you a split worked; the test run does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-16 20:26:59 +02:00

40 lines
2.5 KiB
JSON

{
"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."
]
}