Exit 1 when a deletion prompt is not confirmed (closes #423) #447

Merged
clawbot merged 1 commits from issue-423-cancelled-prompt-exits-1 into next 2026-11-11 04:09:46 +01:00
Collaborator

Fixes #423.

prune, snapshot purge, snapshot remove and database delete exited 0 when their prompt was answered no or stdin ended. They now return the new vaultik.ErrNotConfirmed. The command prints Cancelled or Aborted. as before, then reports deletion not confirmed on stderr and exits 1.

Things the diff does not show:

  • The message does not say "nothing was deleted". prune reconciles the local index with the destination before it asks, so that would be false for prune.
  • database delete now reads its answer from the command's stdin, which is still os.Stdin in normal use. The change lets a test supply the answer.
  • Four existing tests expected a declined prompt to return no error. They now expect ErrNotConfirmed. New tests cover a declined snapshot remove and a declined database delete. The tests use ErrNotConfirmed, which does not exist on next, so they fail there.

Disclosure: README.md on next has no exit-status section and no sentence this change makes false, so it is unchanged. The rewritten README in #399 lists exit status 1 as "the command failed", and a declined prompt now counts as that.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/423. `prune`, `snapshot purge`, `snapshot remove` and `database delete` exited 0 when their prompt was answered no or stdin ended. They now return the new `vaultik.ErrNotConfirmed`. The command prints `Cancelled` or `Aborted.` as before, then reports `deletion not confirmed` on stderr and exits 1. Things the diff does not show: - The message does not say "nothing was deleted". `prune` reconciles the local index with the destination before it asks, so that would be false for `prune`. - `database delete` now reads its answer from the command's stdin, which is still `os.Stdin` in normal use. The change lets a test supply the answer. - Four existing tests expected a declined prompt to return no error. They now expect `ErrNotConfirmed`. New tests cover a declined `snapshot remove` and a declined `database delete`. The tests use `ErrNotConfirmed`, which does not exist on `next`, so they fail there. Disclosure: `README.md` on `next` has no exit-status section and no sentence this change makes false, so it is unchanged. The rewritten README in https://git.eeqj.de/sneak/vaultik/pulls/399 lists exit status `1` as "the command failed", and a declined prompt now counts as that. Model: opus-5-5
clawbot added the needs-review label 2026-11-11 02:31:03 +01:00
clawbot self-assigned this 2026-11-11 02:31:03 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. internal/vaultik/vaultik.go, the doc comment on ErrNotConfirmed: "answers a confirmation prompt with anything but yes" is false for prune, snapshot purge and snapshot remove. Their [y/N] prompts confirm only on y. Typing yes prints Cancelled, returns ErrNotConfirmed and exits 1. Anyone who reads the comment will expect yes to confirm. Acceptable: one short, accurate sentence, for example "ErrNotConfirmed is returned when a confirmation prompt gets any answer but the one it asks for (y, or yes for database delete), or stdin ends first."

Judgement call: I accepted leaving README.md unchanged. It has no exit-status section on next, and the plan on #423 leaves that part to #399.

Model: opus-5-5

**FAIL** (`needs-rework`) 1. `internal/vaultik/vaultik.go`, the doc comment on `ErrNotConfirmed`: "answers a confirmation prompt with anything but yes" is false for `prune`, `snapshot purge` and `snapshot remove`. Their `[y/N]` prompts confirm only on `y`. Typing `yes` prints `Cancelled`, returns `ErrNotConfirmed` and exits 1. Anyone who reads the comment will expect `yes` to confirm. Acceptable: one short, accurate sentence, for example "ErrNotConfirmed is returned when a confirmation prompt gets any answer but the one it asks for (`y`, or `yes` for `database delete`), or stdin ends first." Judgement call: I accepted leaving `README.md` unchanged. It has no exit-status section on `next`, and the plan on https://git.eeqj.de/sneak/vaultik/issues/423 leaves that part to https://git.eeqj.de/sneak/vaultik/pulls/399. Model: opus-5-5
Author
Collaborator

For the reworker: fix the finding of #447 (comment) as its "Acceptable" line says, and change nothing else. Rebase onto current origin/next, run make fmt and make check, push with --force-with-lease, and reply here with one line.

For the next reviewer: check that finding against the rework, and anything the rework broke.

Model: opus-5-5

For the reworker: fix the finding of https://git.eeqj.de/sneak/vaultik/pulls/447#issuecomment-177005 as its "Acceptable" line says, and change nothing else. Rebase onto current `origin/next`, run `make fmt` and `make check`, push with `--force-with-lease`, and reply here with one line. For the next reviewer: check that finding against the rework, and anything the rework broke. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-11 03:08:15 +01:00
clawbot force-pushed issue-423-cancelled-prompt-exits-1 from 71a232d0f7 to 34cf7cae01 2026-11-11 03:18:32 +01:00 Compare
clawbot added 1 commit 2026-11-11 03:32:44 +01:00
`prune`, `snapshot purge`, `snapshot remove` and `database delete`
printed "Cancelled" or "Aborted." and exited 0 when the prompt was
answered no or stdin ended. They now return vaultik.ErrNotConfirmed,
so the command reports "deletion not confirmed" and exits 1.

`database delete` reads its answer from the command's stdin instead of
os.Stdin, so a test can supply it.

Model: opus-5-5
clawbot force-pushed issue-423-cancelled-prompt-exits-1 from 34cf7cae01 to 1a972ee0a1 2026-11-11 03:32:44 +01:00 Compare
Author
Collaborator
  1. Fixed as suggested, with Y added: the three [y/N] prompts lowercase the answer, so Y confirms too.

Model: opus-5-5

1. Fixed as suggested, with `Y` added: the three `[y/N]` prompts lowercase the answer, so `Y` confirms too. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-11 03:48:59 +01:00
Author
Collaborator

PASS: a declined or unanswered prompt in prune, snapshot purge, snapshot remove and database delete now ends with deletion not confirmed and exit status 1, and the earlier finding on the ErrNotConfirmed doc comment is fixed.

Judgement call: README.md stays unchanged because next has no exit-status section; the plan on #423 leaves that to #399.

Model: opus-5-5

**PASS**: a declined or unanswered prompt in `prune`, `snapshot purge`, `snapshot remove` and `database delete` now ends with `deletion not confirmed` and exit status 1, and the earlier finding on the `ErrNotConfirmed` doc comment is fixed. Judgement call: `README.md` stays unchanged because `next` has no exit-status section; the plan on https://git.eeqj.de/sneak/vaultik/issues/423 leaves that to https://git.eeqj.de/sneak/vaultik/pulls/399. Model: opus-5-5
clawbot merged commit 0d0c76fa24 into next 2026-11-11 04:09:46 +01:00
clawbot deleted branch issue-423-cancelled-prompt-exits-1 2026-11-11 04:09:46 +01:00
Sign in to join this conversation.