Repository navigation
feat(usage)!: cost and first rounds per writer and reviewer cell, for the routing charts - #721
Conversation
Quest-Claim: 0f2f37390dd71883
… the routing charts quest usage --json now carries every measure the cost-against-quality charts plot: each implementer's writing cost over the merged PRs it was found on, a local reviewer rollup with tallies and reviewing cost per PR, and first-round findings, which quest review's tally now records. A sub-agent that names no PR's branch takes its parent's PR, and its parent's role there, so a review's sub-agents count as reviewing. The model check carries the chart procedure and the published benchmark table; the charts quest is done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ged PRs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… split true ties Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… split spend Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Maintainer decision (2026-11-14, design checkpoint at 5bba01f): ✅ continue: show (Written by Claude Opus 5.5) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…spend is not writing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
ℹ️ No critical issues — one edge case in the parent fallback, inline.
Reviewed changes
I reviewed the full diff at 04392af: the first-round tally, the parent-based attribution, the share allocator, and the new reviewers rollup. vitest run test/usage.test.ts test/review.test.ts passes locally (98 tests).
- First-round findings —
tallied()freezesTally.firston a seat's first round. TheRounds:line writes it asfirst round N (...)andparseCountsvalidates it. Records and saved state from before the change still parse, withfirst: null. - Parent attribution —
attribute()now places sessions through a memoizedplace(). A session that names no PR's branch takes its parent's PR, and a sub-agent on the same PR as its parent takes the parent's role. Aseenset stops parent chains that loop. share()allocator — spend goes to a writer or reviewer seat in this order: the seat a record names, then model and effort, then role to break ties. Spend that still fits several seats is split evenly and reported assplit. Spend on a model no seat names goes to the costliest seat.- New rollup fields — each
accuracyrow gainsspent(merged PRs only) andfirstRounds. A newreviewersrollup groups by PR size, harness, model, effort, and shadow. The text rollups show cost per PR and any split spend. - Docs and quests — this PR updates the README,
--help, and the chart procedure and benchmark table inquest/m1/model-check.md. It adds the hand-backs follow-up quest and removes the finishedcharts.mdquest.
claude-opus-5-5 | 𝕏
There was a problem hiding this comment.
ℹ️ The new merge commit adds no issues. The earlier inline finding on the parent-PR fallback is still open; it is now at
src/cli/usage.ts:530.
Reviewed changes
This pass covers merge commit efc894f, which brings in main's risk tiers (#716) on top of 04392af. vitest run test/usage.test.ts test/review.test.ts passes (105 tests).
- The
classifyingrole comes first — inplace(), a session the record names as the risk classifier isclassifyingbefore the reviewer, parent-role, and time checks run. A classifier's sub-agents inherit that role through the parent rule. - Classifier spend stays out of writer cost —
accuracyRowsnow passesshare()onlyimplementinganditeratingsessions.reviewerRowsstill takes onlyreviewingsessions, so the classifier's spend counts in neither rollup. - The
tiersrollup sits besidereviewers— theUsageshape, the README, and the--helptext combine both PRs' wording without duplicates or lost clauses. - Fixture change —
OWNEDis now the classifier session. Theunknown-effort case it used to cover in the end-to-end test now has its own unit test indescribe("share").
claude-opus-5-5 | 𝕏
Combine #720's writer A/B arm rows with per-cell cost, reviewer rollup and spent.split. A sub-agent known to be in another repository no longer inherits its parent's PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
ℹ️ No functional issues. The parent-fallback fix is correct. One misplaced doc comment from the merge is noted inline.
Reviewed changes
This pass covers merge commit 0e8da02. It brings in main through a5b1225, including the writer A/B arms from #720, and fixes the earlier parent-fallback finding. vitest run test/usage.test.ts test/review.test.ts passes (107 tests), and tsc --noEmit is clean.
- Fixed the parent-PR fallback across repositories. In
place(), a session now inherits its parent's PR only whenowned(session)is null or includes that PR's repository. The new test keeps a sub-agent inother/repounattributed. The README and--helpwording match. - Merged the arms rollup into the shared outcome helper. Main's
outcomes()closure gave way to this PR'soutcome(row, each, latest)withtallied().accuracyRowsandarmRowsboth use it, soArmRownow carriesfirstRounds, and the arm text line shows first rounds. - Combined the README and
--helptext. They now describe the writer A/B rollup next to the new writer-cost and local-reviewer rollups, with no clause duplicated or lost.
claude-opus-5-5 | 𝕏
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This pass covers a44a1e5, the only commit since the prior Pullfrog review.
- Moved
tallied()'s doc comment back above it. The comment now sits atsrc/cli/usage.ts:743directly overtallied, andnoOutcomesno longer carries a stale branch-tally doc. This resolves the earlier misplaced-comment finding.
claude-sonnet-5-5 | 𝕏

Finishes the routing charts quest.
quest usage --jsonnow carries every measure the cost-against-quality charts plot. The model check (quest/m1/model-check.md) holds the procedure and the published benchmark table.What the charts quest delivers
The quest's non-goal rules out chart code in
quest, so I read the deliverable as three things:The data. Each axis is a field of
quest usage --json, computed once in the CLI, so the model check and the readout don't each re-derive it with ad hoc joins. These were missing:accuracyrow gainsspent: its writing sessions' spend on its merged PRs, withspent.pullscounting the PRs where spend was found. Cost per merged PR divides by those, so PRs whose sessions no host reported don't dilute it. A PR's spend on a model goes to itsImplementer:line of that model, of the same effort where both name one. Spend on a model no line names, such as a sub-agent on a smaller model, goes to the line that took the most.reviewersrollup groups by PR size, harness, model, effort, and shadow mark. It carries PRs reviewed, tallies (each branch counted once, asaccuracydoes), first rounds, and reviewing cost per PR.quest review's tally now keeps the first round's findings, and the record writes them as- Rounds: 3; first round 2 (medium 2); findings 4 …. Records from before this change still parse, withfirst: null, and saved review state from before keeps working. Rollups count first rounds only over PRs whose every counted tally records one (firstRounds.pulls).parent, whichquest usageignored. A sub-agent in a detached checkout went unattributed, and a Claude/code-reviewsub-agent counted as writing. Now a session that names no PR's branch takes its parent's PR, and takes its parent's role when both are on the same PR. On real data this moved $18 off "unattributed", and reviewing spend now reconciles.The procedure, in the model check's Plan:
unknown-effort cells stay separate points;The epic's readout points to it.
The benchmark table in the model check's Plan: the mypriors rows moved out of the prose, plus Anthropic's cost guide and Artificial Analysis, re-read today. Anthropic's guide now lists Opus 5.5 high (95.3%, $0.29 per task) and xhigh (96.7%, $0.74).
The charts themselves are a per-run artifact, so the first ones are below rather than in the tree.
First charts (2026-11-06 to 2026-11-13, this host only)
Command:
quest usage --since 2026-11-06 --json, with token-max built into this worktree. No other host has token-max installed, so--sshread nothing.Every cell is too thin to act on:
Mermaid quadrant charts normalize both axes to 0-1, so each title gives the scale.
Writers: every cell with a merged PR
Local reviewers
Online reviewers, over the 193 merged PRs:
The benchmark charts plot the table in
quest/m1/model-check.md, one chart per suite. On SWE-bench Pro, Opus low and Sonnet high sit level at about $0.10 per task, and Opus medium, high, and xhigh trace the frontier above them. On Terminal-Bench 4.0, Sonnet high sits alone at the top, and Haiku xhigh is the cheap end. No PR cell is priced well enough yet to compare frontiers.Validation
just checkandjust testpass (1260 tests) after merging main at4ab5dae(feat(review): give every PR a risk tier from its diff #716's risk tiers, feat(land)!: pin bumps follow the latest release #717).quest usage --since 2026-11-06 --json). Checked the result a second way, straight frompulls[]:accuracy[].spent.reviewers[].spent.unknowneffort and spend whose effort doesn't match a line both land on the line of the same model;Public API
Breaking, as the
!says: thequest usage --jsonshape gainsaccuracy[].spent(withsplit),pulls[].sessions[].parent,accuracy[].firstRounds, a top-levelreviewers, andpulls[].review[].tally.first.accuracy[].tallyno longer carriesfirst. The## Reviewrecord'sRounds:line gainsfirst round N (...), which older records lack. No migration is needed: nothing is in production, and older records and saved state still read.Choices made without asking
spent.pulls), not all merged PRs. Most PRs have no sessions on the hosts read, and counting them would make every cell look cheap.accuracyalready counts it. Spend on models no line names, such as a sub-agent on a smaller model, goes to the PR's main writer. Spend that fits several lines of one model and effort goes to the first line when an implementing session spent it and to later lines when an iterating one did (review round 1).~. Rows onmaxand rows without a cost per task are left out.spent.splitin the JSON.classifyingrole stays out of it, as reviewing does.Decisions
User, 2026-11-14, /quest-run:
quest usage --sshruns token-max on the remote host, so it must be on that host's PATH.splitinquest usage's text output (rejected: record each Implementer line's session ID in## Models; leave PRs with two seats of one model and effort off the cost axis; merge as is). Done in round 4: the writer and local-reviewer text rollups append~$X of it split with other seats.Caused by
parent, so a sub-agent in a detached checkout went unattributed and a review's sub-agents counted as writingFollow-ups
userContentEdits) so a merged PR that was once handed back counts. No open decisions; the Plan recommends body history over a## Modelsrecord, since it covers PRs merged before it lands.quest usage --sshcan price their sessions. For/quest-planthere./quest-planthere.Models
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.Head: a44a1e5
Base: origin/main at a5b1225
Risk: high,
Changes to PR review-record parsing and quest usage output could break metrics consumed by skills, Kixel Code, and scripts; reverting restores the code but leaves already-written PR records behind.Classified: high by Codex, gpt-6.1-sol, low effort, session
01a1d7c6-608c-75f0-ac9d-d5c68ae1f3feReviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1d78b-33f8-7160-8da3-e61bac5531a2, round 7Score: 10/10,
The incremental change only moves a documentation comment to the function it describes; no issues were found, and builds and tests were not run as instructed.Rounds: 7; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, medium effort, shadow
Session:
01a1d78b-33f0-7753-983c-c0753cf657e5Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0