fix(report): raise RuntimeError on non-object run.json (fixes #1109) - #1116
Conversation
|
Too many files changed for review (416 files, 100 file limit). Bypass the limit by tagging |
9224915 to
50bb2e1
Compare
SebTardif
left a comment
There was a problem hiding this comment.
Summary
The change correctly maps a parseable non-object run.json ([], string, null, bool, number) onto RuntimeError, which _load_resume_state already catches and turns into parser.error. That closes the --resume TypeError hole in issue #1109, and the other caller (ReportState.hydrate_from_run_dir) does not catch TypeError so it does not regress. Dominant risk: this reverts the exact RuntimeError -> TypeError edit from #576 that was made to satisfy pre-commit TRY004, so ruff will fail again unless there is a noqa or the catch site is widened instead.
Issue counts by severity
- bugs: 1
- suggestions: 1
- nits: 1
58c8e72 to
55227f2
Compare
e61c358 to
d8ba61a
Compare
d8ba61a to
e3fd04c
Compare
SebTardif
left a comment
There was a problem hiding this comment.
Previous requested changes are addressed on e3fd04c.
read_run_recordstill raises TypeError for a non-object root (TRY004 / #576).- The writer.py comment and extra blank line are gone.
_load_resume_statecatches TypeError so --resume exits through argparse.test_resume_non_object_run_json_exitscovers a list-root run.json.
This clears the earlier Changes requested review.
Summary
Fixes #1109.
read_run_record()(strix/report/writer.py) to raiseRuntimeErrorwhenrun.jsoncontains a valid but non-dict JSON root (such as a list or string).test_read_run_record_non_object_raisesintests/test_report_writer.pyto expectRuntimeErrorinstead ofTypeError, preventing uncaught exceptions during--resumeruns.