fix(builder): keep all JSON mode output structured #2688

Merged
HumanBean merged 3 commits from HumanBean/Longshot:fix/builder-json-output into main 2026-11-27 21:14:12 +00:00
Owner

Summary

A launcher reading --output json can receive plain text from some builder commands, child tools, and the game. Those lines require separate parsing and can be mistaken for broken events.

Use JSON Lines on stdout for output in this mode. Builder messages and tool diagnostics use the reporter. The play command wraps ordinary game output with its source stream and forwards renderer startup progress and readiness as their existing events. Human-readable command output continues to use the text mode.

Worker diagnostics now use the same tracing adapter as CLI messages while retaining their build's output writer, saved build log and observer. Compile failures include severity, unit and retry fields. Tool and game messages carry stream provenance, and the launcher can disconnect while the builder continues writing its local log. The first JSON build record is still the build plan.

Testing

Tested: Six builder CLI tests and six archive tests passed on Linux. The game-output unit test passed and covers forwarding startup events, keeping stderr provenance, and encoding ordinary output as a log event. The CLI tests cover JSON usage errors, help, developer diagnostics, and a build plan followed by a setup error.

The logging audit also passed the reporter tests, both build-log tests (including a disconnected launcher), the three shader outcome tests, the game startup relay test and the six CLI tests.

Still to test:

  • Exercise a complete live game launch and reload with a launcher consuming the stream, including cancellation and renderer failure, on Linux and Windows by hand.

Measurements

This changes the output format and routing. A live run still needs to verify the effect of relaying game output under load.

Risks

The builder drains both game streams in JSON mode. Launcher consumers may see more structured log events during play. The companion launcher change keeps ordinary gameplay diagnostics out of the startup transcript.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Approved in review, every comment answered.
  • CI passes on the head.
## Summary A launcher reading `--output json` can receive plain text from some builder commands, child tools, and the game. Those lines require separate parsing and can be mistaken for broken events. Use JSON Lines on stdout for output in this mode. Builder messages and tool diagnostics use the reporter. The play command wraps ordinary game output with its source stream and forwards renderer startup progress and readiness as their existing events. Human-readable command output continues to use the text mode. Worker diagnostics now use the same tracing adapter as CLI messages while retaining their build's output writer, saved build log and observer. Compile failures include severity, unit and retry fields. Tool and game messages carry stream provenance, and the launcher can disconnect while the builder continues writing its local log. The first JSON build record is still the build plan. ## Testing **Tested:** Six builder CLI tests and six archive tests passed on Linux. The game-output unit test passed and covers forwarding startup events, keeping stderr provenance, and encoding ordinary output as a log event. The CLI tests cover JSON usage errors, help, developer diagnostics, and a build plan followed by a setup error. The logging audit also passed the reporter tests, both build-log tests (including a disconnected launcher), the three shader outcome tests, the game startup relay test and the six CLI tests. **Still to test:** - Exercise a complete live game launch and reload with a launcher consuming the stream, including cancellation and renderer failure, on Linux and Windows by hand. ## Measurements This changes the output format and routing. A live run still needs to verify the effect of relaying game output under load. ## Risks The builder drains both game streams in JSON mode. Launcher consumers may see more structured log events during play. The companion launcher change keeps ordinary gameplay diagnostics out of the startup transcript. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [ ] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head.
fix(builder): keep all JSON mode output structured
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 8s
CI / What the change needs (pull_request) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Failing after 15s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m48s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
05be1f8765
Assisted-by: OpenAI Codex
feat(builder): emit structured CLI and tool diagnostics with tracing
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 15s
CI / What the change needs (pull_request) Successful in 18s
CI / Third-party parts and guide screenshots (pull_request) Failing after 21s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m52s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
135cea0672
fix(builder): preserve structured worker diagnostics in build logs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 12s
CI / What the change needs (pull_request) Successful in 20s
CI / Third-party parts and guide screenshots (pull_request) Failing after 27s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
c73d6cd366
HumanBean force-pushed fix/builder-json-output from c73d6cd366
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 12s
CI / What the change needs (pull_request) Successful in 20s
CI / Third-party parts and guide screenshots (pull_request) Failing after 27s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 029207d844
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Third-party parts and guide screenshots (pull_request) Failing after 15s
CI / What the change needs (pull_request) Successful in 17s
PR description / Title and description (pull_request_target) Successful in 23s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-27 21:07:07 +00:00
Compare
HumanBean force-pushed fix/builder-json-output from 029207d844
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Third-party parts and guide screenshots (pull_request) Failing after 15s
CI / What the change needs (pull_request) Successful in 17s
PR description / Title and description (pull_request_target) Successful in 23s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to ff7c3855c6
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Successful in 22s
CI / Third-party parts and guide screenshots (pull_request) Failing after 26s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m45s
PR description / Title and description (pull_request_target) Failing after 6s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m30s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m25s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m55s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m30s
CI / Website build and checks (pull_request) Successful in 3m12s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 13m0s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 30m15s
2026-11-27 21:09:09 +00:00
Compare
HumanBean changed title from WIP: fix(builder): keep all JSON mode output structured to fix(builder): keep all JSON mode output structured 2026-11-27 21:14:01 +00:00
HumanBean deleted branch fix/builder-json-output 2026-11-27 21:14:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2688
No description provided.