fix(logger): route pino records to stderr so check --json stdout parses - #89
robotlearning123 wants to merge 3 commits into
Conversation
Keeps --json stdout stream pure parseable JSON. Closes #79.
|
Independent verification pass (fresh worktrees from fetched origin refs) — review-pipeline status: Verified by execution:
Pending gate: the independent cross-model code review could not run — the review lane returned Resume (one command once the review lane is healthy): |
|
Verification (cycle 20260928_030031, issue #79): premise reproduced on main — One-command resume when the reviewer lane recovers: |
|
Reviewer lane recovered — grok review result: VERDICT FIX-FIRST. action.yml:64 (major, reproduced): |
R2 repair verification — independent, by executionVerified at
RED (pre-fix line temporarily restored, uncommitted) — finding reproduced: merged GREEN (committed fix, stderr goes to the action log): Split confirmed on the built CLI: stderr = 8235 bytes of pino records; stdout = pure JSON. Downstream handling: Issue oracle: Scope: PR diff is |
Fixes #79
What
check --jsonemitted pino log records on stdout ahead of the JSON payload, so every programmatic consumer got unparseable output. The logger was constructed with no destination stream, so pino defaulted to fd 1 (stdout).Change (2 commits, minimal diff):
src/utils/logger.ts: passpino.destination(2)as the second argument topino(...), routing all pino records to stderr. Level / base / transport behavior unchanged.test/check-json.test.ts: new regression test that spawnscheck test/fixtures/minimal-repo --json, asserts stdout parses as JSON and the payload hasareas.Why
The CLI's only machine-readable interface was corrupt: stdout carried interleaved pino records (
{"level":20,...}) before the payload, andJSON.parseon the captured stream failed withSyntaxError: Unexpected non-whitespace character after JSON at position 1312 (line 2 column 1).Test evidence (run on this branch)
RED (test at 6e20459, before the logger fix):
GREEN / acceptance oracle at HEAD:
Full gates:
Diff scope (
git diff --stat e704b49..HEAD):src/utils/logger.ts(+11/−8),test/check-json.test.ts(+27).