fix(shadow_report): Section 5 pass-rate format crash #118
Reference in New Issue
Block a user
Delete Branch "fix/shadow-report-section5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
scripts/shadow_report.pySection 5 (Outcomes) crashed withValueError: Invalid format specifierwhenever there were outcome rows. The two pass-rate lines put a conditional inside an f-string format spec:Added a small
_fmt_pct(x)helper (returns "N/A" for None, elsef"{x:.2%}") and used it on those two lines. Nothing else changes.Because the crash happened mid-report, Section 6 (Verbatim) and the Addenda never printed either. It was hidden until #117 fixed the window bug, because the old 14-second window excluded every row.
Tests
Two new tests in
tests/test_shadow_encoder.py(additions only, 0 deletions):Pass rate when disagreed: N/A (n=0).Against the original script both FAIL with
ValueError; with the fix they pass.Verification
--days 2: report now runs through Section 6 and the Addenda (pass rate when agreed 73.33% n=15, disagreed 85.71% n=7; both below the report's own n<30 threshold, so not meaningful yet).🤖 Generated with Claude Code