--cron and --quiet do not silence the status lines of prune #294

Open
opened 2026-10-13 00:29:21 +02:00 by clawbot · 0 comments
Collaborator

Found by the defect hunt in #288 (part 4).

What is wrong: PruneBlobs (internal/vaultik/prune.go) and CleanupLocalSnapshots (internal/vaultik/snapshot.go) write their status lines with stdoutf and printlnStdout, not through internal/ui. The README says --cron is silent on total success and that --quiet silences status lines, and the README's daily cron line (snapshot create --cron --prune --keep-newer-than 4w) therefore produces output on every run.

How it was shown: snapshot create --cron --prune etc and snapshot create --cron --prune --keep-newer-than 4w etc both exited 0 and printed "No unreferenced blobs to remove." on stdout, or "Found N unreferenced blob(s) ... Deleted N blob(s) ..." when there were blobs to delete. vaultik -q prune --force printed "No stale local snapshots found." and "No unreferenced blobs to remove."

Definition of done

  • A successful snapshot create --cron --prune ... prints nothing on stdout or stderr, and -q prune --force prints no status lines; errors and warnings still print.
  • The same holds for -q snapshot purge --keep-latest --force, -q snapshot remove --force ID (and --dry-run) and -q remote nuke --force, which today print their full reports (RemoveSnapshot, RemoveAllSnapshots and confirmAndExecutePurge in internal/vaultik/snapshot.go). Output asked for with --json is not status output and still prints.
  • Every status line in these paths goes through internal/ui, as the rest of the command output does.
  • Tests cover --cron and --quiet for both paths.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 4). **What is wrong:** `PruneBlobs` (`internal/vaultik/prune.go`) and `CleanupLocalSnapshots` (`internal/vaultik/snapshot.go`) write their status lines with `stdoutf` and `printlnStdout`, not through `internal/ui`. The README says `--cron` is silent on total success and that `--quiet` silences status lines, and the README's daily cron line (`snapshot create --cron --prune --keep-newer-than 4w`) therefore produces output on every run. **How it was shown:** `snapshot create --cron --prune etc` and `snapshot create --cron --prune --keep-newer-than 4w etc` both exited 0 and printed "No unreferenced blobs to remove." on stdout, or "Found N unreferenced blob(s) ... Deleted N blob(s) ..." when there were blobs to delete. `vaultik -q prune --force` printed "No stale local snapshots found." and "No unreferenced blobs to remove." **Definition of done** - A successful `snapshot create --cron --prune ...` prints nothing on stdout or stderr, and `-q prune --force` prints no status lines; errors and warnings still print. - The same holds for `-q snapshot purge --keep-latest --force`, `-q snapshot remove --force ID` (and `--dry-run`) and `-q remote nuke --force`, which today print their full reports (`RemoveSnapshot`, `RemoveAllSnapshots` and `confirmAndExecutePurge` in `internal/vaultik/snapshot.go`). Output asked for with `--json` is not status output and still prints. - Every status line in these paths goes through `internal/ui`, as the rest of the command output does. - Tests cover `--cron` and `--quiet` for both paths. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:29:21 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#294