fix(usage): add refused_transcripts to the empty-stats expected dict - #9322
fix(usage): add refused_transcripts to the empty-stats expected dict#9322jeeshofone wants to merge 1 commit into
Conversation
Cross-PR semantic conflict (kirodotdev#9317): kirodotdev#9254 made _parse_sessions include refused_transcripts in every payload; kirodotdev#9305 added test_empty_session_stats with an expected dict written before kirodotdev#9254 landed. Each PR was green in isolation; every head built on both fails shard 4 with one extra left-side key (refused_transcripts: 0), on POSIX and Windows alike. The empty-directory zero-statistics payload genuinely carries the key, and asserting it present-and-zero pins the kirodotdev#9254 contract. Fixes kirodotdev#9317.
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Correct minimal fix: expected dict aligns with the single payload path ( [DESIGN-REVIEWED] b43df1d |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
|
Duplicate resolution: #9319 (opened 3 minutes before this, functionally identical, maintainer-endorsed on #9317) should win — same key, and its comment additionally cites the #6733 complete-vs-unknown rationale. No objection to closing this one in its favor; leaving it open only until #9319 merges in case that stalls. |
Problem / Motivation
#9317:
test_usage.py::TestParseSessions::test_empty_session_statsfails on every head built after 2026-09-07 22:03:57Z, across all authors' PRs. Cross-PR semantic conflict: #9254 (merged 20:49Z) made_parse_sessionsincluderefused_transcriptsin every payload; #9305 (merged 22:03:57Z — the exact boundary) added this test with an expected dict written before #9254 landed. Each PR was green in isolation; together, every head fails with one extra left-side key —refused_transcripts: 0.Why it matters
Base-red on shard 4 for the whole repository: every PR built on current main carries this failure regardless of its content, which both blocks unrelated merges and trains people to ignore a red shard.
What changed
Motivation → approach → change: the empty-directory zero-statistics payload genuinely carries
refused_transcripts: 0(the #9254 contract), so the test's expected dict gains that key with a comment explaining the semantic-conflict history. One-line-plus-comment test fix; no source change — the source behavior of both merged PRs is correct and mutually consistent.Tests
test/test_usage.pyfull suite: 95 passed locally on main + this fix (was 2 failed).678fc3266) first; verified both parametrizations ([True]/[False]) flip to green with the fix.Manual verification
Confirmed via
git log -S refused_transcriptsthat #9254 introduced the key into every payload path, and via the pytest-vvdict diff that the only mismatch is the single missing key — no value differences.Screenshots / video
N/A — test-only change.
Related Issues
Fixes #9317. Context: #9254, #9305.
Pattern harvest
Two PRs touching the same payload contract can be individually green and jointly red; when a whole-dict equality assertion starts failing repo-wide at an exact merge timestamp, diff the dict keys against
git log -Sfor the extra key before suspecting the platform or the shard.Checklist
Contribution License Agreement
By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.