Repository navigation
test(cli): cover install and restore before generalizing them - #550
Merged
Merged
Conversation
Coverage gate for epic E8's three refactors. Measured the eight files they
touch; two findings changed the plan.
RestoreRegularFilesUseCase had no dedicated test file anywhere. Its 42.7%
statement coverage was incidental, leaking in from higher-level restore and
e2e tests, and the unexecuted part was the bodies of collectDrift and
applyRestorations, which are exactly the skeleton the restore story
extracts. Now 100% statements, 100% branches, via 10 tests covering both
drift kinds, all decision modes including the InputRequiredError path, the
restored/kept partition, and fileFilter honoured vs null.
UpdateAiToolsUseCase and UpdateIdeToolsUseCase were already at 100% branches
and statements, so the update story needs no new coverage. Confirmed and
left alone rather than padded.
The four install content use-cases were all missing the same two branches:
the entryFile gate and buildInstallPath returning null. Covered in each,
since the generalization collapses them into one implementation and any
per-file quirk has to be pinned first.
Two asymmetries are now pinned rather than smoothed over. copilot's handlers
return null for .gitkeep where claude's never do. InstallAgentsUseCase takes
an extra ALL_TOOL_SUFFIXES parameter the other three lack.
Pinned as suspicious, not fixed: a drifted file with no entry in the dist
map is silently dropped, neither restored nor kept nor reported.
One branch stays uncovered in all four install files:
\`.split("/").at(-1) ?? relativeFileName\`. split never returns an empty
array, so the fallback is unreachable. Documented rather than faked with a
test that cannot fail.
No production code changed. 2136/2136 pass (2118 plus 18), tsc clean.
The new restore tests were verified to bite: inverting the skip check in
applyRestorations fails 6 of 10, and inverting the force/interactive gate in
resolve-restore-decision fails 3 of 10.
--no-verify: biome OOMs here; each changed file was checked individually and
reports no fixes.
Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Jul 29, 2026
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
Coverage gate for epic E8's three refactors. Measured the eight files they
touch; two findings changed the plan.
RestoreRegularFilesUseCase had no dedicated test file anywhere. Its 42.7%
statement coverage was incidental, leaking in from higher-level restore and
e2e tests, and the unexecuted part was the bodies of collectDrift and
applyRestorations, which are exactly the skeleton the restore story
extracts. Now 100% statements, 100% branches, via 10 tests covering both
drift kinds, all decision modes including the InputRequiredError path, the
restored/kept partition, and fileFilter honoured vs null.
UpdateAiToolsUseCase and UpdateIdeToolsUseCase were already at 100% branches
and statements, so the update story needs no new coverage. Confirmed and
left alone rather than padded.
The four install content use-cases were all missing the same two branches:
the entryFile gate and buildInstallPath returning null. Covered in each,
since the generalization collapses them into one implementation and any
per-file quirk has to be pinned first.
Two asymmetries are now pinned rather than smoothed over. copilot's handlers
return null for .gitkeep where claude's never do. InstallAgentsUseCase takes
an extra ALL_TOOL_SUFFIXES parameter the other three lack.
Pinned as suspicious, not fixed: a drifted file with no entry in the dist
map is silently dropped, neither restored nor kept nor reported.
One branch stays uncovered in all four install files:
\`.split("/").at(-1) ?? relativeFileName\`. split never returns an empty
array, so the fallback is unreachable. Documented rather than faked with a
test that cannot fail.
No production code changed. 2136/2136 pass (2118 plus 18), tsc clean.
The new restore tests were verified to bite: inverting the skip check in
applyRestorations fails 6 of 10, and inverting the force/interactive gate in
resolve-restore-decision fails 3 of 10.
--no-verify: biome OOMs here; each changed file was checked individually and
reports no fixes.
Co-authored-by: Claude Opus 5 <[email protected]>
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
Coverage gate for epic E8's three refactors. Measured the eight files they
touch; two findings changed the plan.
RestoreRegularFilesUseCase had no dedicated test file anywhere. Its 42.7%
statement coverage was incidental, leaking in from higher-level restore and
e2e tests, and the unexecuted part was the bodies of collectDrift and
applyRestorations, which are exactly the skeleton the restore story
extracts. Now 100% statements, 100% branches, via 10 tests covering both
drift kinds, all decision modes including the InputRequiredError path, the
restored/kept partition, and fileFilter honoured vs null.
UpdateAiToolsUseCase and UpdateIdeToolsUseCase were already at 100% branches
and statements, so the update story needs no new coverage. Confirmed and
left alone rather than padded.
The four install content use-cases were all missing the same two branches:
the entryFile gate and buildInstallPath returning null. Covered in each,
since the generalization collapses them into one implementation and any
per-file quirk has to be pinned first.
Two asymmetries are now pinned rather than smoothed over. copilot's handlers
return null for .gitkeep where claude's never do. InstallAgentsUseCase takes
an extra ALL_TOOL_SUFFIXES parameter the other three lack.
Pinned as suspicious, not fixed: a drifted file with no entry in the dist
map is silently dropped, neither restored nor kept nor reported.
One branch stays uncovered in all four install files:
\`.split("/").at(-1) ?? relativeFileName\`. split never returns an empty
array, so the fallback is unreachable. Documented rather than faked with a
test that cannot fail.
No production code changed. 2136/2136 pass (2118 plus 18), tsc clean.
The new restore tests were verified to bite: inverting the skip check in
applyRestorations fails 6 of 10, and inverting the force/interactive gate in
resolve-restore-decision fails 3 of 10.
--no-verify: biome OOMs here; each changed file was checked individually and
reports no fixes.
Co-authored-by: Claude Opus 5 <[email protected]>
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
🎯 What & why
SPIKE-E8-01 is the coverage gate for epic E8's three refactors. Measured the eight files they touch, and two findings changed the plan.
RestoreRegularFilesUseCasehad no dedicated test file anywhere. Its 42.7% statement coverage was incidental, leaking in from higher-level restore and e2e tests. The unexecuted part was the bodies ofcollectDriftandapplyRestorations— exactly the "collect drift → resolve decision → partition" skeleton US-E8-04 extracts. Its siblingRestoreMergeFilesUseCasewas already at 100%, so the pair was asymmetric.UpdateAiToolsUseCaseandUpdateIdeToolsUseCasewere already at 100% branches and statements, so US-E8-03 needs no new coverage. Confirmed and left alone rather than padded to look busy.🛠️ Coverage before → after
shared/restore-regular-files-use-case.tsinstall/install-agents-use-case.tsinstall/install-rules-use-case.tsinstall/install-commands-use-case.tsinstall/install-skills-use-case.tsshared/restore-merge-files-use-case.tsglobal/update-{ai,ide}-tools-use-case.tsThe four install use-cases were all missing the same two branches — the
entryFilegate andbuildInstallPathreturningnull. Covered in each, since US-E8-02 collapses them into one implementation and any per-file quirk must be pinned first.🧪 How to verify
No production code changed — tests only. 2136/2136 pass (2118 plus 18),
tsc --noEmitclean.The new restore tests were verified to bite, because a characterization test that passes against broken code is worthless:
applyRestorationsfails 6 of 10;resolve-restore-decisionfails 3 of 10.📋 Pinned, not fixed
copilot's handlers returnnullfor.gitkeepwhereclaude's never do, andInstallAgentsUseCasetakes an extraALL_TOOL_SUFFIXESparameter the other three lack. The generalisation must preserve both..split("/").at(-1) ?? relativeFileName.splitnever returns an empty array, so the fallback is unreachable. Documented rather than faked with a test that cannot fail.Committed with
--no-verify: biome OOMs on this machine; each changed file was checked individually and reports no fixes.