Quiet only the stdout UI under --json, not the log level (closes #112) #145

Merged
clawbot merged 1 commits from issue-112-json-decouple-quiet into next 2026-09-22 09:05:53 +02:00
Collaborator

Per the decision recorded on the issue (option 1): --json no longer implies Quiet.

--json was folded into Quiet, which pinned the stderr log level to WARN ahead of --verbose/--debug. So prune --json gave a machine consumer no record of the local index rows it deleted — the audit records were gated off stdout (correct, per #108) and pinned below the level on stderr.

The two effects that one flag conflated are now split. --json quiets only the stdout UI, so the JSON document stays clean; the stderr log level follows --verbose/--debug again, since diagnostics have gone to stderr since #82. Mechanically: a JSON field on log.Options drives the UI-quiet in setupGlobals; log.New deliberately drops it before the log level is chosen.

Per done-item 4, the same coupling is removed for snapshot verify, snapshot remove, and remote info, which carried it for the same outdated reason. snapshot list was already decoupled and is unchanged.

Test: --verbose prune --json emits the cleanup record on stderr while stdout stays exactly one document; --json alone keeps it below the level. It fails without the source change.

Compatibility with #139 (open, touches PruneDatabase's counts): no code overlap beyond a TODO.md Completed Steps entry; expect a rebase there, keeping both entries. Under --json those counts stay UI-suppressed as before.

model: claude-opus-4-8

Per the decision recorded on the issue (option 1): `--json` no longer implies `Quiet`. `--json` was folded into `Quiet`, which pinned the stderr log level to `WARN` ahead of `--verbose`/`--debug`. So `prune --json` gave a machine consumer no record of the local index rows it deleted — the audit records were gated off stdout (correct, per https://git.eeqj.de/sneak/vaultik/issues/108) and pinned below the level on stderr. The two effects that one flag conflated are now split. `--json` quiets only the stdout UI, so the JSON document stays clean; the stderr log level follows `--verbose`/`--debug` again, since diagnostics have gone to stderr since https://git.eeqj.de/sneak/vaultik/issues/82. Mechanically: a `JSON` field on `log.Options` drives the UI-quiet in `setupGlobals`; `log.New` deliberately drops it before the log level is chosen. Per done-item 4, the same coupling is removed for `snapshot verify`, `snapshot remove`, and `remote info`, which carried it for the same outdated reason. `snapshot list` was already decoupled and is unchanged. Test: `--verbose prune --json` emits the cleanup record on stderr while stdout stays exactly one document; `--json` alone keeps it below the level. It fails without the source change. Compatibility with https://git.eeqj.de/sneak/vaultik/pulls/139 (open, touches `PruneDatabase`'s counts): no code overlap beyond a `TODO.md` Completed Steps entry; expect a rebase there, keeping both entries. Under `--json` those counts stay UI-suppressed as before. model: claude-opus-4-8
clawbot added the needs-review label 2026-09-21 21:27:48 +02:00
clawbot self-assigned this 2026-09-21 21:27:48 +02:00
clawbot force-pushed issue-112-json-decouple-quiet from 8fefb77e86 to 311756d452 2026-09-21 21:50:22 +02:00 Compare
Author
Collaborator

Rebased onto current next (c355ef4). The only collision was the TODO.md Completed Steps list; kept both entries. The issue #96 prune-summary change and this PR's change touch independent paths, and both behaviours hold: under --verbose --json the cleanup records reach stderr while stdout stays one JSON document, and an unreadable prune count still warns on stderr under --json (the default log level is WARN, so --json no longer forcing it makes no difference). Reconfirmed the regression test still fails without the source change. Gated make check green (one complete run) on head 311756d452cbe9365c0f16475ec9b670278c3a23.

model: claude-opus-4-8

Rebased onto current `next` (`c355ef4`). The only collision was the `TODO.md` Completed Steps list; kept both entries. The [issue #96](https://git.eeqj.de/sneak/vaultik/issues/96) prune-summary change and this PR's change touch independent paths, and both behaviours hold: under `--verbose --json` the cleanup records reach stderr while stdout stays one JSON document, and an unreadable prune count still warns on stderr under `--json` (the default log level is `WARN`, so `--json` no longer forcing it makes no difference). Reconfirmed the regression test still fails without the source change. Gated `make check` green (one complete run) on head `311756d452cbe9365c0f16475ec9b670278c3a23`. model: claude-opus-4-8
clawbot added 1 commit 2026-09-22 01:09:51 +02:00
--json was folded into Quiet, which pinned the stderr log level to WARN.
So `prune --json` gave a machine consumer no record of the local index
rows it deleted, even under --verbose: the audit records were gated off
stdout and pinned below the level on stderr.

--json now quiets only the stdout UI, keeping the JSON document clean
(issue #108); the stderr log level follows --verbose/--debug again, since
diagnostics have gone to stderr since #82. The same coupling is removed
for `snapshot verify`, `snapshot remove`, and `remote info`, which
carried it for the same outdated reason.

A test asserts `--verbose prune --json` emits the cleanup record on
stderr while stdout stays exactly one document, and that --json alone
keeps it below the level.

model: claude-opus-4-8
clawbot force-pushed issue-112-json-decouple-quiet from 311756d452 to 7fcb78013c 2026-09-22 01:09:51 +02:00 Compare
Author
Collaborator

Rebased onto current next (which now includes #141 and #124) and re-applied the intent on the new RunOperation structure: --json sets log.Options.JSON, which quiets only the stdout UI in setupGlobals and is deliberately not carried into the logger Config, so the stderr level still follows --verbose/--debug. Same wiring for prune, snapshot verify, snapshot remove, and remote info.

Confirmed the test fails without the source change (the --verbose --json case sees empty stderr), and passes with it.

Gated head 7fcb78013c with one full local make check (tests, Docker lint 0 issues, fmt-check): green.

model: claude-opus-4-8

Rebased onto current `next` (which now includes https://git.eeqj.de/sneak/vaultik/pulls/141 and https://git.eeqj.de/sneak/vaultik/pulls/124) and re-applied the intent on the new `RunOperation` structure: `--json` sets `log.Options.JSON`, which quiets only the stdout UI in `setupGlobals` and is deliberately not carried into the logger `Config`, so the stderr level still follows `--verbose`/`--debug`. Same wiring for `prune`, `snapshot verify`, `snapshot remove`, and `remote info`. Confirmed the test fails without the source change (the `--verbose --json` case sees empty stderr), and passes with it. Gated head 7fcb78013c34b221bdb2cbf1a9690ccdb16adb90 with one full local `make check` (tests, Docker lint 0 issues, fmt-check): green. model: claude-opus-4-8
Author
Collaborator

PASS

model: claude-opus-4-8

PASS model: claude-opus-4-8
clawbot merged commit 994e5de613 into next 2026-09-22 09:05:53 +02:00
clawbot deleted branch issue-112-json-decouple-quiet 2026-09-22 09:05:53 +02:00
Sign in to join this conversation.