Repository navigation
fix(cli): a repair that repaired nothing says so - #762
Merged
Merged
Conversation
`aidd restore --force` printed "Nothing to restore — all files are unmodified." and exited 0 while the modified file it was asked to repair was still modified on disk. The flag was read into `interactive` and then dropped, so the use-case received `force: false`, refused to overwrite, and the resulting error was swallowed into a warning under a success line. `aidd ai restore` and `aidd ide restore` plumb the flag correctly; only the top-level command lost it. - `RestoreAllUseCase.execute` takes `force` and asks for an overwrite when either the interactive checkbox or `--force` supplied the consent. - `restore` exits 1 when the run produced errors, instead of reporting the healthy state it did not reach. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
blafourcade
added a commit
that referenced
this pull request
Sep 4, 2026
Four cases in `smoke-tools.sh` damaged a file and proved nothing about it. They did not know which file they damaged. Four places picked one with `find … | head -1`, and `find` answers in directory order — not sorted, not the same on two filesystems — so each run corrupted whichever file came back first. And the three restore cases never checked the repair: each appended drift, ran `restore --force`, and asserted exit 0. A `restore --force` that exits 0 having restored nothing is precisely the failure #762 fixed inside the command, so the case meant to cover it would have passed throughout. The `ide` case was worse: its drift was a bare newline, which `grep` cannot see, so no check on that file was possible at all. `first_file` (`LC_ALL=C sort | head -1`) replaces every unsorted pick. One named marker, `SMOKE_DRIFT`, is what the three cases append, and `repaired` fails when the mark is still there after the restore, or when nothing was drifted to repair. The harness is not run by CI, so the three guards read its text, the way `smoke-harness-isolation.unit.test.ts` already guards the home sandbox. Each was written first and failed for the reason it names; `bash -n` and `shellcheck -S error` are both clean. Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp Co-authored-by: reference-week <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
aidd restore --forcereported success while repairing nothing.Three false statements in one run: it asked for the flag it was given, it denied the drift it had just detected, and it reported success for a repair it never performed. Same project, same second, the sibling command repaired it:
aidd ai restore --force→Restored 1 file.Why
commands/restore.tsread--forceintointeractiveand then dropped it;RestoreAllUseCase.executehad noforceparameter at all.restore-all-use-case.tspassedforce: interactive, so with--forcethe use-case receivedforce: falseandResolveRestoreDecisionUseCasethrew on the first modified file.result.errors, printed as a warning, and the success line was emitted anyway.aidd ai restoreandaidd ide restoreboth plumbforce: cmdOptions.forcecorrectly. Only the top-level command lost it.The smoke harness never caught it because its
restore --forcecase asserts onlyexit 0, which the broken command satisfied.After
Guards
--forcereaches the restore it delegates toforce: interactive(the original)force: forceprocess.exit(1)Each mutation killed its own guard and no other.
Gates: 3419 tests / 307 files,
tsc,biome ci, knip, jscpd, bundle within budget, 368 repository script tests, 0 broken links, cli layering clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp