feat(cli): add --json to steer-report for machine-readable output paths#16
Merged
Merged
Conversation
…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>
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9.
steer-report --jsonprints theoutputsmapping 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 oftest_cli_renders_from_real_artifactswith the sameimportorskip("matplotlib")guard — parses stdout withjson.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--jsonalso 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 viauv run --with matplotlib, which leavesuv.lockuntouched). Commit contains exactly the two intended files.Generated by Claude Fable 5 (brief, review), Claude Opus 4.8 (1M context) (implementation)