The trace does not price a run: join burnrate instead of rebuilding token accounting #198
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
external-review
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence-archived#198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The problem
.planning/trace.jsonldoes not price a run, and it is the only thing/cad-reportand/cad-suggestread.Measured on this repo, 2026-08-16: the trace recorded 795,845 tokens for the
whole
v3.5.2milestone across 6 dispatches. burnrate, reading the same day'stranscripts, recorded 16,261,487 billed-equivalent for the project on that
one day. Roughly 20x, and the gap is structural rather than a bug:
contributes zero to it and 59% of actual spend (154,625,939 against the
subagents' 105,743,431 over the last 7 days).
events: no
cache_read, nocache_creation, nothing. Cache-read is 62.5% ofthe real bill and the record cannot see any of it.
that actually multiply out to the cost.
So
/cad-suggestprices a configuration off a number that is wrong by an orderof magnitude and blind to the dominant term.
What burnrate already has
/data/code/burnrateparses every transcript ONCE into a per-message cache(gzipped, under
$XDG_CACHE_HOME/burnrate) and re-parses only changed sessions.Per day x project x command x model x effort x main|agent it carries:
input,cache_writesplit 5m/1h,cache_read,output, message countbilled_equivalent = input + 1.25*cw5m + 2*cw1h + 0.10*crcontext footprint = input + cache_write + cache_read(the live window)peak_ctx, compactions, interrupts, agent counts<command-name>and by"skill":"..."tool call, socadence:cad-executeis already a first-class rowThat is every quantity Cadence's own record is missing, keyed the way Cadence
would key it, and it exists.
The proposal
/cad-reportand/cad-suggestread burnrate's cache for spend, andtrace.jsonlkeeps what it is actually good at: WHAT happened (routingdecisions, gate fires, adjudications, brackets, outcomes). Two records, two
jobs, no reimplementation.
absent, exactly like the recall backend degrades.
which worker ran, burnrate says what the window around it cost.
The obvious objection
This adds a dependency on a tool outside the plugin, and Cadence ships zero-dep
by design. Two answers worth weighing rather than assuming: the join could read
the cache file format rather than shell out (no dependency, just a reader), or
it stays opt-in behind a config key and the absent case is the default. If
neither is acceptable the honest outcome is to stop claiming the trace prices a
run and delete the token figures from
/cad-suggestrather than keep reportinga number that is 20x low.
Open question, not part of the proposal
5-minute cache writes are 21% of the weekly bill (48,704,671 raw tokens against
23,900,093 at the 1-hour TTL). I do not know whether the TTL is selectable from
Claude Code or fixed by the harness. Worth confirming before anyone treats it as
a lever.
Decided in Phase 2 (MSR-02) on
cadence/v3.5.3, not yet merged to main. Answered NO to the join: Cadence does not import burnrate's accounting and stores no multiplier. Instead the spend receipt names what its figure excludes, and the gap prints as its TERMS - dispatches, turns, per-dispatch window as a stated proxy, and the unmeasured count - with burnrate left as a comparator the user runs. Commits6c4e8ac,8e2ee9f,059493f;SPEND_EXCLUDESis the single frozen export both readers take, watched failing at4b1d659. Closing as decided; the code lands with v3.5.3.