{ "intent": "Bring poker-stakes' four over-250-line files under the shared cap without weakening its 100% coverage gate.", "scope": [ "poker-stakes/src/ui/useGame.test.tsx (494) -> reducer/session/debt test files + shared fixtures", "poker-stakes/src/engine/handEval.test.ts (269) -> rank5/compare test files + shared fixtures", "poker-stakes/src/ui/useGame.ts (268) -> useGame.ts + gameState.ts", "poker-stakes/src/engine/handFlow.ts (252) -> handFlow.ts + handFlowBetting.ts", "Non-goal: any behaviour change; non-goal: violations outside poker-stakes/" ], "changes": [ "Split useGame.test.tsx by describe-block into useGame.reducer/session/debt.test.tsx (75/219/156 lines).", "Split handEval.test.ts at the evaluate7 boundary into handEval.rank5.test.ts (174) and handEval.compare.test.ts (67).", "Extracted shared test helpers to src/test/useGameFixtures.tsx and src/test/handEvalFixtures.ts. Placed under src/test/ deliberately: vite.config.ts already excludes that directory from coverage, so no NEW exclusion entry was needed. An earlier attempt put the fixtures beside the source, where v8 counted their unused branches as production code and dropped coverage to 98.57%.", "Extracted GameState/HandPhase/gameReducer/hasOutstandingDebt into gameState.ts; useGame.ts re-exports them so no importer changed.", "Extracted the betting-state helpers into handFlowBetting.ts; handFlow.ts re-exports potFromBetting for its existing consumers." ], "verification": [ { "command": "cd poker-stakes && npm run check", "result": "pass", "evidence": "exit 0; 220 tests passed (unchanged count); Statements 100% (572/572), Branches 100% (299/299), Functions 100% (109/109), Lines 100% (542/542)." }, { "command": "cd poker-stakes && npm run build", "result": "pass", "evidence": "built in 84ms; dist/assets/index-zO7BhOW2.js 208.17 kB. Confirms the module graph still resolves after the extractions." }, { "command": "bash ~/utils/scripts/check_file_length.sh --all", "result": "pass", "evidence": "poker-stakes violations: 0. Repo total 196 -> 192." } ], "risks": [ "invariants.test.ts failed once on a 5s timeout during this work. Investigated rather than retried blindly: it passes standalone in 2.56s and passed on re-run of the full suite, so it is a pre-existing contention flake under parallel coverage load, not a regression from the split. Left unfixed as out of scope, but it will recur in CI.", "The test splits move tests between files; a future reader must not assume a describe-block's tests are all in one file." ], "rollback": [ "git revert this commit; the four original files return intact.", "Validate with: cd poker-stakes && npm run check" ] }