Count thread grant usage on the leaderboard #204
- AtlantisPleb opened this issue 2d ago
-
A 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.
- closed this as completed 2d ago
Outcome
Coder and thread spend reaches the leaderboard.
Leaderboard.account_totals/0gains a third union arm overInference.Grant.usagefor thread-backed grants, alongside TurnReceipt and Voice.Session.Identified in
docs/2026-08-24-coder-account-integration-audit.mdas the first account-integration gap.