Silence prune and snapshot removal status under --cron and --quiet #369

Merged
clawbot merged 1 commits from issue-294-quiet-prune-status into next 2026-10-14 01:10:43 +02:00
Collaborator

Fixes #294.

What was wrong: the status lines of prune, snapshot purge, snapshot remove and remote nuke (PruneBlobs, CleanupLocalSnapshots, confirmAndExecutePurge, RemoveSnapshot, RemoveAllSnapshots) were written straight to stdout instead of through internal/ui, so neither --cron nor --quiet silenced them. The README's daily cron line, snapshot create --cron --prune --keep-newer-than 4w, printed on every successful run.

What changed: every status line in those paths now goes through internal/ui (Info; Detail for list items; Notice for the follow-up hints and the dry-run line), so --cron and --quiet drop them. Warnings and errors still print, and --json documents are untouched. Each line keeps its wording, apart from a trailing period, the Note: prefix (the Notice marker replaces it) and the dry-run line, which now reads "Dry run: no changes made."

The confirmation prompts and their "Cancelled" answer still go straight to stdout, as the database delete prompt does, together with what they ask to delete: the snapshot list before the snapshot purge prompt, and the blob count and total size before the prune prompt. So --quiet never hides what the operator is confirming. With --force there is no prompt and those lines are status lines. The README's output style section says this.

  • The two purge test fixtures (setupPurgeTest, setupConsistencyTest) built a Vaultik with no UI writer. They now set one, as production always does.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/294. **What was wrong:** the status lines of `prune`, `snapshot purge`, `snapshot remove` and `remote nuke` (`PruneBlobs`, `CleanupLocalSnapshots`, `confirmAndExecutePurge`, `RemoveSnapshot`, `RemoveAllSnapshots`) were written straight to stdout instead of through `internal/ui`, so neither `--cron` nor `--quiet` silenced them. The README's daily cron line, `snapshot create --cron --prune --keep-newer-than 4w`, printed on every successful run. **What changed:** every status line in those paths now goes through `internal/ui` (Info; Detail for list items; Notice for the follow-up hints and the dry-run line), so `--cron` and `--quiet` drop them. Warnings and errors still print, and `--json` documents are untouched. Each line keeps its wording, apart from a trailing period, the `Note:` prefix (the Notice marker replaces it) and the dry-run line, which now reads "Dry run: no changes made." The confirmation prompts and their "Cancelled" answer still go straight to stdout, as the `database delete` prompt does, together with what they ask to delete: the snapshot list before the `snapshot purge` prompt, and the blob count and total size before the `prune` prompt. So `--quiet` never hides what the operator is confirming. With `--force` there is no prompt and those lines are status lines. The README's output style section says this. - The two purge test fixtures (`setupPurgeTest`, `setupConsistencyTest`) built a `Vaultik` with no UI writer. They now set one, as production always does. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 22:40:57 +02:00
clawbot self-assigned this 2026-10-13 22:40:57 +02:00
Author
Collaborator
  1. internal/vaultik/snapshot.go, confirmAndExecutePurge: with --quiet and no --force, snapshot purge now asks "Delete N snapshot(s)? [y/N]" without saying which snapshots, because the list printed before the prompt goes through the UI and --quiet drops it. On next that list is shown under --quiet, and the database delete prompt this change cites as its model prints the file it will delete together with its question. Acceptable: when a prompt follows, the list is written with the prompt, straight to stdout as database delete does, so --quiet cannot hide what the operator is confirming; with --force it stays a status line. The line before the prune prompt (blob count and total size) is the same case.
  2. internal/vaultik/snapshot.go, removeSnapshotDryRun and handleRemoveAllDryRun: "[Dry run - no changes made]" is now a UI Notice, but it is not a sentence ending in a period, which the README's output style section requires of UI messages. Acceptable: a plain sentence such as "Dry run: no changes made."

Model: opus-5-5

1. `internal/vaultik/snapshot.go`, `confirmAndExecutePurge`: with `--quiet` and no `--force`, `snapshot purge` now asks "Delete N snapshot(s)? [y/N]" without saying which snapshots, because the list printed before the prompt goes through the UI and `--quiet` drops it. On `next` that list is shown under `--quiet`, and the `database delete` prompt this change cites as its model prints the file it will delete together with its question. Acceptable: when a prompt follows, the list is written with the prompt, straight to stdout as `database delete` does, so `--quiet` cannot hide what the operator is confirming; with `--force` it stays a status line. The line before the `prune` prompt (blob count and total size) is the same case. 2. `internal/vaultik/snapshot.go`, `removeSnapshotDryRun` and `handleRemoveAllDryRun`: "[Dry run - no changes made]" is now a UI Notice, but it is not a sentence ending in a period, which the README's output style section requires of UI messages. Acceptable: a plain sentence such as "Dry run: no changes made." Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-13 22:52:21 +02:00
clawbot force-pushed issue-294-quiet-prune-status from cd573def55 to 7981ebc33a 2026-10-13 22:59:50 +02:00 Compare
clawbot force-pushed issue-294-quiet-prune-status from 7981ebc33a to 6476fa831a 2026-10-14 00:00:57 +02:00 Compare
clawbot added 1 commit 2026-10-14 00:58:32 +02:00
PruneBlobs, CleanupLocalSnapshots, RemoveSnapshot, RemoveAllSnapshots
and snapshot purge wrote their status lines straight to stdout, so
`snapshot create --cron --prune` printed on every successful run and
--quiet did not silence `prune`, `snapshot purge`, `snapshot remove` or
`remote nuke`. Those lines now go through internal/ui, which drops them
under --cron and --quiet; warnings, errors and --json documents still
print.

The confirmation prompts still write straight to stdout, as the
`database delete` prompt does, together with what they ask to delete:
the snapshot list before the purge prompt, and the blob count and size
before the prune prompt. With --force those lines are status lines.

The two purge test fixtures gained the UI writer production always sets.

Model: opus-5-5
clawbot force-pushed issue-294-quiet-prune-status from 6476fa831a to b496da5223 2026-10-14 00:58:32 +02:00 Compare
Author
Collaborator

Rework:

  1. The snapshot list before the snapshot purge prompt, and the blob count and size before the prune prompt, are now written straight to stdout with the prompt; with --force they stay status lines. The README's output style sentence now says each prompt shows what it asks to delete.
  2. The dry-run line now reads "Dry run: no changes made."

Rebased onto current next.

Model: opus-5-5

Rework: 1. The snapshot list before the `snapshot purge` prompt, and the blob count and size before the `prune` prompt, are now written straight to stdout with the prompt; with `--force` they stay status lines. The README's output style sentence now says each prompt shows what it asks to delete. 2. The dry-run line now reads "Dry run: no changes made." Rebased onto current `next`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-14 00:58:46 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 30285c7a8c into next 2026-10-14 01:10:43 +02:00
clawbot deleted branch issue-294-quiet-prune-status 2026-10-14 01:10:43 +02:00
Sign in to join this conversation.