Follow-up from #2346 (child C of #2335).
Purpose
Three daemon test files sit over the 1,000-line tripwire that scripts/__tests__/test-file-size-ratchet.test.ts ratchets against the merge-base:
| File |
Lines |
src/daemon/handlers/__tests__/snapshot-handler.test.ts |
1656 |
src/daemon/replay/internal/__tests__/session-replay-repair-transaction.test.ts |
1202 |
src/daemon/interaction/internal/__tests__/find.test.ts |
1199 |
AGENTS.md ("Module and test topology") calls a file past 1,000 lines architecture debt, and the ratchet's own message names the remedy: split it along the source module it mirrors.
#2346 split src/daemon/types.ts into a request module and a session-state module. Every file that used both halves gained one import line, and these three had no headroom. Each shed one line that carried nothing to stay at its base length — two redundant toHaveLength assertions that an adjacent toEqual on an explicit array literal already makes, and one three-line wrapped expect rewritten as a named local. No assertion was weakened, and the ratchet passes, but the underlying size problem is untouched and the next mechanical change to these files hits the same wall with less room.
Required behavior
- Split each file along the source module it mirrors, so no part is over the tripwire.
- Pure moves carry their tests unchanged; a moved
test keeps its name and body so the split is reviewable as a move.
- Shared fixtures and helpers move to a sibling fixture module rather than being duplicated.
Completion conditions
- No test file under
src/daemon/ exceeds 1,000 lines.
pnpm test:unit passes with the same test count (no test dropped or merged).
scripts/__tests__/test-file-size-ratchet.test.ts passes without a gate edit.
Non-goals
Changing what any of these tests assert, and raising or editing the tripwire.
Follow-up from #2346 (child C of #2335).
Purpose
Three daemon test files sit over the 1,000-line tripwire that
scripts/__tests__/test-file-size-ratchet.test.tsratchets against the merge-base:src/daemon/handlers/__tests__/snapshot-handler.test.tssrc/daemon/replay/internal/__tests__/session-replay-repair-transaction.test.tssrc/daemon/interaction/internal/__tests__/find.test.tsAGENTS.md ("Module and test topology") calls a file past 1,000 lines architecture debt, and the ratchet's own message names the remedy: split it along the source module it mirrors.
#2346 split
src/daemon/types.tsinto a request module and a session-state module. Every file that used both halves gained one import line, and these three had no headroom. Each shed one line that carried nothing to stay at its base length — two redundanttoHaveLengthassertions that an adjacenttoEqualon an explicit array literal already makes, and one three-line wrappedexpectrewritten as a named local. No assertion was weakened, and the ratchet passes, but the underlying size problem is untouched and the next mechanical change to these files hits the same wall with less room.Required behavior
testkeeps its name and body so the split is reviewable as a move.Completion conditions
src/daemon/exceeds 1,000 lines.pnpm test:unitpasses with the same test count (no test dropped or merged).scripts/__tests__/test-file-size-ratchet.test.tspasses without a gate edit.Non-goals
Changing what any of these tests assert, and raising or editing the tripwire.