fix(nwsync): write emit and assemble summaries to stderr #82

Merged
archvillainette merged 1 commits from fix/81-nwsync-summary-to-stderr into main 2026-07-31 18:42:21 +00:00
Owner

Fixes #81.

crucible nwsync emit and assemble printed their summary line to stdout. Any caller that captures a script's stdout as a value gets the summary glued onto it — pack-haks.sh does release_dir="$(...)", so all 11 emit summaries landed in $release_dir and publish-release.sh died with "release dir not found".

Both lines move to stderr, where lib.sh's own nwsync: emitted $key log already goes. Neither line is a machine-readable contract: sow-topdata's contract tests grep an EMIT_LOG their own fake-crucible stub writes, not real stdout, so nothing parses these.

runEmit/runAssemble no longer take the stdout writer — a leak in those two functions is now impossible to write by accident. Run still passes stdout to printRunUsage for explicit -h/help, which is correct.

Adds TestRunKeepsSummariesOffStdout: runs both verbs end to end against a local tree and asserts stdout stays empty while the summary reaches stderr. It asserts emptiness, not wording, so the summary text stays free to change.

Full go test ./... green.

Follow-up, outside this repo: sow-assets-manifest needs a flake.lock bump, then a re-run of the v0.2.1-rc1 tag.

🤖 Generated with Claude Code

Fixes #81. `crucible nwsync emit` and `assemble` printed their summary line to **stdout**. Any caller that captures a script's stdout as a value gets the summary glued onto it — `pack-haks.sh` does `release_dir="$(...)"`, so all 11 emit summaries landed in `$release_dir` and `publish-release.sh` died with "release dir not found". Both lines move to stderr, where `lib.sh`'s own `nwsync: emitted $key` log already goes. Neither line is a machine-readable contract: sow-topdata's contract tests grep an `EMIT_LOG` their own fake-crucible stub writes, not real stdout, so nothing parses these. `runEmit`/`runAssemble` no longer take the stdout writer — a leak in those two functions is now impossible to write by accident. `Run` still passes stdout to `printRunUsage` for explicit `-h`/`help`, which is correct. Adds `TestRunKeepsSummariesOffStdout`: runs both verbs end to end against a local tree and asserts stdout stays empty while the summary reaches stderr. It asserts emptiness, not wording, so the summary text stays free to change. Full `go test ./...` green. Follow-up, outside this repo: sow-assets-manifest needs a `flake.lock` bump, then a re-run of the v0.2.1-rc1 tag. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
archvillainette added 1 commit 2026-07-31 18:38:00 +00:00
fix(nwsync): write emit and assemble summaries to stderr
ci / ci (pull_request) Successful in 3m31s
1062fd007c
crucible nwsync emit and assemble printed their summary line to stdout.
Callers that capture a script's stdout as a value got the summary glued
onto it: pack-haks.sh does release_dir="$(...)", so all 11 emit summaries
landed in $release_dir and publish-release.sh failed with "release dir
not found".

Neither line is a machine-readable contract, so move both to stderr,
where lib.sh's own "nwsync: emitted $key" log already goes. runEmit and
runAssemble no longer need the stdout writer.

Fixes #81.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
xtul approved these changes 2026-07-31 18:38:29 +00:00
archvillainette merged commit 2f860ca9e4 into main 2026-07-31 18:42:21 +00:00
archvillainette deleted branch fix/81-nwsync-summary-to-stderr 2026-07-31 18:42:21 +00:00
Sign in to join this conversation.