mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 20:34:02 +01:00
simulate.ts 384 -> 226 and inventoryIo.ts 287 -> 178, with the moved names re-exported so no importer or test changed. search.ts and badgeValue.ts are reverted. findBestSet calls enumerateAll and hillClimb which call back into expand; valueBadge and format are mutually recursive with the recommendation half. Splitting either makes the two files import each other. The split also exposed a TypeScript hazard worth knowing: with the local Selection type no longer imported, tsc silently resolved it to the DOM global and complained about anchorNode and focusNode rather than saying the name was missing. 288 tests passing before and after, coverage still 100%. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
19 lines
1.3 KiB
JSON
19 lines
1.3 KiB
JSON
{
|
|
"title": "Split kcd2 simulate.ts and inventoryIo.ts, reverting two mutually-dependent seams",
|
|
"objective": "Bring src/core/simulate.ts (384) and src/lib/inventoryIo.ts (287) under the 250-line cap, and establish that a seam whose halves call back into each other must be abandoned rather than forced.",
|
|
"acceptance_criteria": [
|
|
"simulate.ts, simulateTurns.ts, inventoryIo.ts and inventoryHash.ts are each at most 250 lines.",
|
|
"The suite still reports exactly 288 passing tests in 15 files.",
|
|
"Coverage stays at 100% for statements, branches, functions and lines, with the new modules measured.",
|
|
"npm run lint passes with no new suppression and no eslint-disable.",
|
|
"Every name previously exported from simulate.ts and inventoryIo.ts is still exported from the same path, so no importer or test is edited.",
|
|
"search.ts and badgeValue.ts are fully restored, leaving no partial split and no orphan module."
|
|
],
|
|
"out_of_scope": [
|
|
"search.ts and badgeValue.ts, whose halves are mutually recursive.",
|
|
"The kcd2 test files and App.tsx, which are separate commits.",
|
|
"Editing any test."
|
|
],
|
|
"verifier": "npm test -- --run (expects exactly 288 passed in 15 files), npm run coverage (100% on all four metrics), npm run lint, and check_file_length.sh."
|
|
}
|