Count thread grant usage on the leaderboard #204

Closed AtlantisPleb opened this 2d ago 1 comment

Outcome

Coder and thread spend reaches the leaderboard. Leaderboard.account_totals/0 gains a third union arm over Inference.Grant.usage for thread-backed grants, alongside TurnReceipt and Voice.Session.

Identified in docs/2026-08-24-coder-account-integration-audit.md as the first account-integration gap.

  1. AtlantisPleb opened this issue 2d ago
  2. A AtlantisPleb Author 2d ago

    Closing as completed. Merged to main and pushed as 4a578fc (WAL receipt seq 297). OpenAgents.Leaderboard.account_totals/0 gains a third union arm over thread-fenced inference_grants.usage (inner join grant -> thread -> visitor, DATA-002 respected); conversation-fenced grants stay excluded because the turn-receipt arm already claims the chat lane (the exactly-one-fence CHECK makes the sets disjoint). record_usage/2 now invalidates the cached board for thread-fenced grants. LEADERBOARD-001 in INVARIANTS.md updated in the same change. Tests: 14 leaderboard tests pass (3 new: mixed-account summation, no conversation-grant double count, zero-usage silence) plus the targeted fence/inference set, 64 passed 0 failures.

  3. closed this as completed 2d ago
Sign in with GitHub to comment on this issue.