Skip to content

fix(usage): add refused_transcripts to the empty-stats expected dict - #9322

Closed
jeeshofone wants to merge 1 commit into
kirodotdev:mainfrom
jeeshofone:fix/9317-empty-stats-key
Closed

fix(usage): add refused_transcripts to the empty-stats expected dict#9322
jeeshofone wants to merge 1 commit into
kirodotdev:mainfrom
jeeshofone:fix/9317-empty-stats-key

Conversation

@jeeshofone

Copy link
Copy Markdown
Contributor

Problem / Motivation

#9317: test_usage.py::TestParseSessions::test_empty_session_stats fails 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_sessions include refused_transcripts in 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.py full suite: 95 passed locally on main + this fix (was 2 failed).
  • Reproduced the failure on unpatched main (678fc3266) first; verified both parametrizations ([True]/[False]) flip to green with the fix.
  • black gate, flake8, isort on the touched file: clean.

Manual verification

Confirmed via git log -S refused_transcripts that #9254 introduced the key into every payload path, and via the pytest -vv dict 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 -S for the extra key before suspecting the platform or the shard.

Checklist

  • Tests added/updated and passing locally
  • Lint gates clean on touched files
  • No unrelated changes

Contribution License Agreement

By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.

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.
@jeeshofone
jeeshofone requested a review from a team as a code owner September 7, 2026 23:09
@jeeshofone
jeeshofone requested a review from pepmach September 7, 2026 23:09
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed b43df1d3ca3634c2da083f5708815dbe7c5336a8 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b43df1d

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of b43df1d3ca3634c2da083f5708815dbe7c5336a8 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Correct minimal fix: expected dict aligns with the single payload path (usage.py:1947), which the empty case genuinely shares — no design concerns.

[DESIGN-REVIEWED] b43df1d

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed b43df1d3ca3634c2da083f5708815dbe7c5336a8 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b43df1d

@jeeshofone

Copy link
Copy Markdown
Contributor Author

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.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 7, 2026
@jeeshofone

Copy link
Copy Markdown
Contributor Author

Closing in favor of #9319 (3 minutes earlier, functionally identical, maintainer-endorsed on #9317). One of the two should merge quickly — main's shard 4 stays red until then.

@jeeshofone jeeshofone closed this Sep 7, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend Tests shard 4: test_empty_session_stats fails on every head built after 22:03Z (both 3.12 and Windows)

1 participant