Write only the document to stdout from snapshot remove --json (closes #251)
check / check (push) Successful in 18m5s

When the destination store cannot be reached, `snapshot remove` still
removes the snapshot from the local index and warns. The warning went
through the UI, which writes to stdout, so under `--json` it landed
ahead of the document and `| jq` failed on a command that exited 0.
Under `--json` the UI warning is now skipped; the logger's warning
already goes to stderr.

The new test runs the command through `Entry` against a missing
destination directory and decodes stdout as exactly one JSON document.

Judgement call: under `--json` the stderr warning is the log record,
which names the error but not the `vaultik prune` follow-up.

Model: opus-5-5
This commit is contained in:
2026-10-06 23:24:14 +00:00
parent 85d4ef118d
commit b72b6ded58
3 changed files with 50 additions and 10 deletions
+8
View File
@@ -22,6 +22,14 @@ the tag exists and is exercised; what is left is merging `next` to
# Completed Steps
- 2026-10-06: Made `snapshot remove --json` write only its document to
stdout when the destination store cannot be reached
([issue #251](https://git.eeqj.de/sneak/vaultik/issues/251)). Its
warning that the snapshot's metadata was left on the destination store
went to stdout ahead of the document, breaking `| jq` on a command that
exited 0. Under `--json` the warning now reaches stderr only, through
the logger.
- 2026-10-06: Made command output follow the README's stdout and stderr
rules ([issue #224](https://git.eeqj.de/sneak/vaultik/issues/224)). The
startup banner went to stdout, so a `completion` script or a