Command output breaks the README's stdout and stderr rules in three places #224

Closed
opened 2026-10-06 01:49:45 +02:00 by clawbot · 1 comment
Collaborator

The README's "stdout and stderr" section and #149 settle the rules: stdout carries only the output asked for, errors always reach stderr, and --quiet silences the human reports. Three places break them. All three were measured on next at 0700901.

  1. The startup banner lands in machine-read stdout. Entry prints the banner to stdout before cobra runs (internal/cli/entry.go:28). The banner is suppressed only for --quiet, -q, --cron and --json (entry.go:91-118). So the first line of vaultik completion bash is vaultik dev by ... starting up at ..., and every completion command in README.md:236-253 produces a broken script. The same line also precedes the value printed by vaultik config get KEY, which the README (:661) says scripts consume.
  2. A failing --json command prints nothing on either stream. Under --json the failure reporters return early (internal/cli/remote.go:94-97, internal/cli/prune.go:50-53, internal/cli/app.go:321-324), and those commands write no document on failure (internal/vaultik/info.go:237-240). Measured with an unreadable destination: remote info --json and prune --json exit 1 with empty stdout and empty stderr. snapshot remove --json takes the same path (traced). The README says errors go to stderr and are never suppressed.
  3. snapshot verify --quiet prints its whole report. The verify report is written straight to stdout (internal/cli/snapshot.go:722-881, internal/vaultik/verify.go) and ignores --quiet, which the README (:179) describes as "Suppress non-error output". Under the issue 149 rule, --quiet silences human reports. The exit status still carries the verdict.

Definition of done

  1. completion and config get write nothing to stdout except their own output.
  2. Under --json, a failing remote info, prune or snapshot remove reports its error on stderr, and stdout stays free of anything that is not JSON.
  3. snapshot verify --quiet prints no report on success. A failure is still reported on stderr, and the exit status is unchanged.
  4. Tests: the first line of completion bash output, config get output, each --json failure's stderr, and verify -q stdout.
  5. make check passes.

Model: fable-5-1 (audit); opus-5-5 (issue)

The README's "stdout and stderr" section and https://git.eeqj.de/sneak/vaultik/issues/149 settle the rules: stdout carries only the output asked for, errors always reach stderr, and `--quiet` silences the human reports. Three places break them. All three were measured on `next` at `0700901`. 1. **The startup banner lands in machine-read stdout.** `Entry` prints the banner to stdout before cobra runs (`internal/cli/entry.go:28`). The banner is suppressed only for `--quiet`, `-q`, `--cron` and `--json` (`entry.go:91-118`). So the first line of `vaultik completion bash` is `vaultik dev by ... starting up at ...`, and every completion command in `README.md:236-253` produces a broken script. The same line also precedes the value printed by `vaultik config get KEY`, which the README (`:661`) says scripts consume. 2. **A failing `--json` command prints nothing on either stream.** Under `--json` the failure reporters return early (`internal/cli/remote.go:94-97`, `internal/cli/prune.go:50-53`, `internal/cli/app.go:321-324`), and those commands write no document on failure (`internal/vaultik/info.go:237-240`). Measured with an unreadable destination: `remote info --json` and `prune --json` exit 1 with empty stdout and empty stderr. `snapshot remove --json` takes the same path (traced). The README says errors go to stderr and are never suppressed. 3. **`snapshot verify --quiet` prints its whole report.** The verify report is written straight to stdout (`internal/cli/snapshot.go:722-881`, `internal/vaultik/verify.go`) and ignores `--quiet`, which the README (`:179`) describes as "Suppress non-error output". Under the issue 149 rule, `--quiet` silences human reports. The exit status still carries the verdict. ## Definition of done 1. `completion` and `config get` write nothing to stdout except their own output. 2. Under `--json`, a failing `remote info`, `prune` or `snapshot remove` reports its error on stderr, and stdout stays free of anything that is not JSON. 3. `snapshot verify --quiet` prints no report on success. A failure is still reported on stderr, and the exit status is unchanged. 4. Tests: the first line of `completion bash` output, `config get` output, each `--json` failure's stderr, and `verify -q` stdout. 5. `make check` passes. Model: fable-5-1 (audit); opus-5-5 (issue)
clawbot self-assigned this 2026-10-06 01:49:45 +02:00
Author
Collaborator

Implemented in #252.

Decision taken for item 1, open to the owner to overrule: the startup banner now goes to stderr for every command. The other way was to keep it on stdout and add completion and config get to the argument scan that already suppresses it for --json. That needs a list of commands, and it still leaves the hidden __complete command, which the generated completion scripts run on every tab press, printing the banner into the completions. With the banner on stderr, stdout carries only the output asked for, which is what the README's stdout and stderr section says. --quiet, --cron and --json still suppress it.

Found on the way and filed separately: #251 (snapshot remove --json prints a warning on stdout ahead of the document when the destination is unreachable).

Model: opus-5-5

Implemented in https://git.eeqj.de/sneak/vaultik/pulls/252. Decision taken for item 1, open to the owner to overrule: the startup banner now goes to stderr for every command. The other way was to keep it on stdout and add `completion` and `config get` to the argument scan that already suppresses it for `--json`. That needs a list of commands, and it still leaves the hidden `__complete` command, which the generated completion scripts run on every tab press, printing the banner into the completions. With the banner on stderr, stdout carries only the output asked for, which is what the README's stdout and stderr section says. `--quiet`, `--cron` and `--json` still suppress it. Found on the way and filed separately: https://git.eeqj.de/sneak/vaultik/issues/251 (`snapshot remove --json` prints a warning on stdout ahead of the document when the destination is unreachable). Model: opus-5-5
Sign in to join this conversation.