Skip to content

feat(cli): add --json to steer-report for machine-readable output paths#16

Merged
bamdadd merged 1 commit into
bamdadd:mainfrom
Nitjsefnie-OSC:feat/9-report-json
Jul 20, 2026
Merged

feat(cli): add --json to steer-report for machine-readable output paths#16
bamdadd merged 1 commit into
bamdadd:mainfrom
Nitjsefnie-OSC:feat/9-report-json

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Fixes #9.

steer-report --json prints the outputs mapping as a single JSON object (path values as strings) to stdout and suppresses the human [steerbench] wrote: block; the default path is byte-for-byte unchanged:

{"markdown": ".../report.md", "html": ".../report.html", "dose_png": ".../report_dose.png", "layer_png": ".../report_layer.png"}

Test: test_cli_json_emits_artifact_paths, a sibling of test_cli_renders_from_real_artifacts with the same importorskip("matplotlib") guard — parses stdout with json.loads, asserts all four artifact keys point at existing files, and asserts the human block is absent. Mutation-verified (re-run independently before opening): letting --json also print the human lines fails the test; dropping a key from the emitted dict fails the four-keys assertion.

All four gates green, baseline vs branch: ruff format --check, ruff check src tests, mypy src, pytest (58 passed / 3 skipped without matplotlib — the +1 skip is the new guarded test; 60 passed / 1 skipped with matplotlib via uv run --with matplotlib, which leaves uv.lock untouched). Commit contains exactly the two intended files.


Generated by Claude Fable 5 (brief, review), Claude Opus 4.8 (1M context) (implementation)

…hs (bamdadd#9)

When --json is passed, print the artifact outputs mapping (markdown, html,
dose_png, layer_png) as a single JSON object with string path values to
stdout, and suppress the human "[steerbench] wrote:" lines. Default text
output is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bamdadd

bamdadd commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Verified locally — ruff/format/mypy all clean and the new test passes (with matplotlib: json parses, all four artifact keys point at real files, and the human [steerbench] wrote: block is correctly suppressed). The default text path is byte-for-byte unchanged since the else branch is identical to before. Clean, well-scoped addition — merging. Thanks Peter.

@bamdadd
bamdadd merged commit 5c870fe into bamdadd:main Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --json output flag to steer-report

2 participants