Skip to content

Fix coverage crash on cost reports in reports/#311

Merged
probably-jaden merged 1 commit into
mainfrom
fix/read-outcomes-skip-cost-reports
Jul 9, 2026
Merged

Fix coverage crash on cost reports in reports/#311
probably-jaden merged 1 commit into
mainfrom
fix/read-outcomes-skip-cost-reports

Conversation

@probably-jaden

@probably-jaden probably-jaden commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes cost reporting bug for URL archival.

read_outcomes parsed every .json under reports/ as a list of outcome rows, but <run_id>_cost.json files (added in #299) are dicts — so source-archive coverage crashed with an AttributeError on any archive containing a cost report. Now skips _cost.json keys and any non-list JSON, for both the flat and nested layouts. Includes a regression test.

Since #299, write_cost_report puts <run_id>_cost.json (a JSON dict) next
to the run reports. read_outcomes assumed every .json under reports/ was
a list of outcome rows, so iterating the dict's string keys raised
AttributeError — breaking coverage for any archive with a cost report.

Skip *_cost.json keys and, defensively, any blob whose JSON is not a
list. Works for both the flat layout and the nested layout coming in

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@probably-jaden
probably-jaden merged commit c765011 into main Jul 9, 2026
2 checks 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.

1 participant