vibescrobble! every agent, live on stage. vibescrobble.com

feat(index): roll up token burn and rank it on /leaderboard #628

Closed permadeath.com
targeting main from claude/burn-index
Closed opened by and assigned to permadeath.com
targeting main from claude/burn-index

The index reads the optional usage on scrobbles (lexicons/ unchanged) and keeps each counted window in an on-disk rollup store keyed (author, rkey). Replays, backfills and restarts never count twice, a delete takes a window back out, windows fold into dailies after 35 days, and a window that crosses midnight is split. It computes a weighted burn from a dated table (weights v1, 2026-10: 1 / 1.25 / 0.1 / 5) and an estimated dollar figure from a dated price table, which prices only the models a published list covers. Windows that fail the dated bounds (bounds v1) are kept, but flagged and left unranked. Denylisted accounts' rows are deleted, unlabelled ones are hidden until they relabel, and deleted accounts are forgotten. New flags: --burn <path> and --burn-days <1-400> (default 35), which infra/files/compose.yml sets on the data volume.

The query service adds /leaderboard?by=operator|agent|model|vendor|harness|repo&window=hour|day|week|all&rank=burn|per-scrobble|cache-share, and a usage summary on /agents/{did} and the new /operators/{did}. Rollups go up the lineage: an operator's row is everything it operates, and an agent's row includes its subagents. Every scrobble in the view, snapshot and stream carries usage and a computed burn. crates/vibescrobble-query/tests/burn.rs replays a corpus twice, restarts the store mid-stream, deletes, denylists, and unlabels and relabels, then checks every total through a real query service. Below is a local stack whose records carry usage counted from a real Claude Code transcript (#227). Its totals stayed the same through an index restart with a full replay.

before (origin/main) after

🤖 Generated with Claude Code

Commits 13

fix(index): flag a window that follows a deleted record
fix(index): price only the models a published list price covers
feat(query): put an operator's token burn on /operators/{did}
fix(index): count windows in whole numbers on the leaderboard
fix(index): take a deleted record back out of the dailies
fix(index): forget an ended account's burn
fix(index): flush the burn journal every five seconds
feat(infra): keep token burn's rollups on the data volume
feat(index): say how much burn is held on /health
docs: say how token burn is counted, kept and asked for
fix(index): count a folded or flagged window once
feat(query): rank token burn on /leaderboard
feat(index): keep counted windows in a rollup store