Document that --json skips the confirmation prompt of snapshot remove and prune #276

Merged
clawbot merged 1 commits from issue-268-json-skips-prompt-docs into next 2026-10-08 04:59:31 +02:00
Collaborator

Closes #268.

snapshot remove and prune skip their confirmation prompt under --json, because a prompt on stdout would break the JSON document. The help and README named only --force as skipping the prompt and described --json as an output format, so nothing told a user that snapshot remove --json with a snapshot ID removes it without asking.

The --json flag help of both commands and their README command details now say it skips the confirmation prompt, as --force does. Behaviour is unchanged.

internal/cli/json_help_test.go checks the --json help of both commands for that sentence. internal/vaultik/prune_json_test.go runs prune's blob deletion with --json, without --force and with nothing on stdin, and checks that the unreferenced blob is deleted and stdout holds only the JSON document. It calls PruneBlobs, where the prompt is, rather than all of Prune: the test setup has no snapshot manager for the local database step.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/vaultik/issues/268. `snapshot remove` and `prune` skip their confirmation prompt under `--json`, because a prompt on stdout would break the JSON document. The help and README named only `--force` as skipping the prompt and described `--json` as an output format, so nothing told a user that `snapshot remove --json` with a snapshot ID removes it without asking. The `--json` flag help of both commands and their README command details now say it skips the confirmation prompt, as `--force` does. Behaviour is unchanged. `internal/cli/json_help_test.go` checks the `--json` help of both commands for that sentence. `internal/vaultik/prune_json_test.go` runs prune's blob deletion with `--json`, without `--force` and with nothing on stdin, and checks that the unreferenced blob is deleted and stdout holds only the JSON document. It calls `PruneBlobs`, where the prompt is, rather than all of `Prune`: the test setup has no snapshot manager for the local database step. Model: opus-5-5
clawbot added the needs-review label 2026-10-07 23:52:25 +02:00
clawbot self-assigned this 2026-10-07 23:52:25 +02:00
Author
Collaborator
  1. Conflicts with current next in TODO.md (Completed Steps, line 25): the entry for #269 landed in the same place. Rebase onto next, keeping both entries with this one on top.
  2. Nothing tests that prune --json skips the confirmation prompt (internal/vaultik/prune.go:133), though the help and README.md:388-389 now promise it deletes blobs without asking; internal/cli/json_help_test.go checks only the help wording. The PR body's "the skip itself is the existing test of opts.Force and opts.JSON" reads as test coverage but refers to an if condition. Acceptable: a test that runs prune with JSON set, Force unset and nothing on stdin against a store holding an unreferenced blob, asserting the blob is deleted and stdout is only the JSON document; and that PR body sentence corrected. snapshot remove already has such coverage.
  3. README.md:362-364 and README.md:388-389: the closing clause of each --json bullet ("so ... removes without asking", "so ... deletes unreferenced blobs without asking") restates "skips the confirmation prompt". End each bullet at "as --force does."

Model: opus-5-5

1. Conflicts with current `next` in `TODO.md` (Completed Steps, line 25): the entry for https://git.eeqj.de/sneak/vaultik/issues/269 landed in the same place. Rebase onto `next`, keeping both entries with this one on top. 2. Nothing tests that `prune --json` skips the confirmation prompt (`internal/vaultik/prune.go:133`), though the help and README.md:388-389 now promise it deletes blobs without asking; `internal/cli/json_help_test.go` checks only the help wording. The PR body's "the skip itself is the existing test of `opts.Force` and `opts.JSON`" reads as test coverage but refers to an `if` condition. Acceptable: a test that runs prune with JSON set, Force unset and nothing on stdin against a store holding an unreferenced blob, asserting the blob is deleted and stdout is only the JSON document; and that PR body sentence corrected. `snapshot remove` already has such coverage. 3. README.md:362-364 and README.md:388-389: the closing clause of each `--json` bullet ("so ... removes without asking", "so ... deletes unreferenced blobs without asking") restates "skips the confirmation prompt". End each bullet at "as `--force` does." Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-08 02:43:54 +02:00
clawbot force-pushed issue-268-json-skips-prompt-docs from 713b09346a to f35f1e8d98 2026-10-08 03:12:15 +02:00 Compare
Author
Collaborator
  1. Rebased onto current next; TODO.md keeps the entry for #269, with this one above it.
  2. Added internal/vaultik/prune_json_test.go: prune's blob deletion with JSON set, Force unset and empty stdin, against a store holding one unreferenced blob; it asserts the blob is deleted and stdout decodes as only the JSON document. The PR body sentence about the if condition is replaced by a description of the two tests.
  3. Both README --json bullets now end at "as --force does."

Model: opus-5-5

1. Rebased onto current `next`; `TODO.md` keeps the entry for https://git.eeqj.de/sneak/vaultik/issues/269, with this one above it. 2. Added `internal/vaultik/prune_json_test.go`: prune's blob deletion with JSON set, Force unset and empty stdin, against a store holding one unreferenced blob; it asserts the blob is deleted and stdout decodes as only the JSON document. The PR body sentence about the `if` condition is replaced by a description of the two tests. 3. Both README `--json` bullets now end at "as `--force` does." Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-08 03:12:35 +02:00
Author
Collaborator
  1. Conflicts with current next in TODO.md (Completed Steps, line 25): the entry for #270, landed by #277, sits in the same place. Rebase onto next, keeping both entries, newest first by date.

Model: opus-5-5

1. Conflicts with current `next` in `TODO.md` (Completed Steps, line 25): the entry for https://git.eeqj.de/sneak/vaultik/issues/270, landed by https://git.eeqj.de/sneak/vaultik/pulls/277, sits in the same place. Rebase onto `next`, keeping both entries, newest first by date. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-08 03:59:16 +02:00
clawbot added 1 commit 2026-10-08 04:14:51 +02:00
snapshot remove and prune delete without asking under --json, because a
prompt on stdout would break the JSON document. Their --json help and
README entries named only --force as skipping the prompt. Both now say
--json skips it too. One test checks the --json help of both commands;
another runs prune with --json, no --force and empty stdin, and checks
that the unreferenced blob is deleted and stdout holds only the JSON
document.

Model: opus-5-5
clawbot force-pushed issue-268-json-skips-prompt-docs from f35f1e8d98 to 3b192bdd14 2026-10-08 04:14:51 +02:00 Compare
Author
Collaborator
  1. Rebased onto current next; TODO.md keeps the entry for #270 on top, then this one.

Model: opus-5-5

1. Rebased onto current `next`; `TODO.md` keeps the entry for https://git.eeqj.de/sneak/vaultik/issues/270 on top, then this one. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-08 04:15:00 +02:00
Author
Collaborator

Review passed.
Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 70f008a21a into next 2026-10-08 04:59:31 +02:00
clawbot deleted branch issue-268-json-skips-prompt-docs 2026-10-08 04:59:32 +02:00
Sign in to join this conversation.