Skip to content

fix(cli): an interactive restore that ticks nothing restores nothing - #813

Merged
blafourcade merged 3 commits into
nextfrom
fix/restore-none-selected
Sep 10, 2026
Merged

fix(cli): an interactive restore that ticks nothing restores nothing#813
blafourcade merged 3 commits into
nextfrom
fix/restore-none-selected

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

🎯 What & why

An interactive aidd sync that finds drifted files asks which to restore. Ticking nothing came back as files: [], which the restore reads as "no selection made", the same as a non-interactive run, and every drifted file was restored. Deselect-all meant restore-all. Found by the mutation pass of #798 (#804), where no test asserted either reading.

🛠️ How it works

  • RestoreAllUseCase.promptForFiles returns the checkbox answer as given; an empty answer ends the run with nothing restored and an empty result.
  • A run where nothing drifted shows no checkbox and returns undefined, so the restore still runs and still repairs the plugin files the picker never offers. That path is unchanged and covered by the existing materialization tests.
  • One it: an interactive run with a modified tracked file and an empty selection leaves the file as edited and reports zero restored.

🧪 How to verify

  • cd cli && pnpm vitest run tests/contexts/framework/application/restore-all-use-case.unit.test.ts
  • Red first: expected '{ "respectGitignore": false, …' to be 'EDITED OUTSIDE THE CLI'.
  • Locally green on the branch merged with next: typecheck, lint, arch (126), knip, unit+integration, e2e (297), build, smoke (FAIL 0), type honesty.

⚠️ Heads-up

None.

🔗 Linked issue

Closes #805

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb

blafourcade and others added 3 commits September 10, 2026 09:12
`RestoreAllUseCase` forwarded an empty checkbox answer as `files: []`, which the restore
reads as "no selection made", the same as a non-interactive run, and every drifted file was
restored. An empty selection now ends the run with nothing restored; a run where nothing
drifted, so no checkbox was shown, still restores the plugin files the picker never offers.

Red first: the new test failed with `expected '{ "respectGitignore": false, …' to be
'EDITED OUTSIDE THE CLI'`.

Closes #805

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
Two tests from #804 pinned the behaviour #805 fixes: an empty selection forwarded as
`files: []`. They now assert that the run never delegates when nothing was ticked, and that
a run with no drifted entry delegates with no selection at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
@blafourcade
blafourcade requested a review from a team as a code owner September 10, 2026 07:18
@blafourcade
blafourcade merged commit 42f572c into next Sep 10, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant