codeburn/src
reviewer 384fb5ef0b sessions: address adversarial review of subagent PR attribution
Rework child attribution to resolve each subagent to the PR its launching
turn was working on, using the parent's UNFILTERED turn data, and enforce
that every dollar is counted exactly once.

- Mutual exclusion: a child that referenced its own PR attributes
  standalone and is never folded; a child with no links is folded only.
  Fixes a double-charge where a self-linking child was both folded and
  self-attributed.
- Recursion: a fold aggregates a child plus its non-self-linking
  descendants (depth-first, cycle-guarded), so grandchildren spawned by
  subagents reach the PR report.
- Global linkage: the subagent index keys by parentSessionId alone
  (UUIDs are globally unique), so a child whose worktree resolves to a
  different project still links.
- Date-range correctness: spawn-to-PR sets are built at assembly from the
  full turn list, so a spawn in a pre-range turn attributes to the right
  PR; a PR-linked parent whose own turns fall out of range is kept as a
  0-cost fold anchor so its in-range child is not lost.
- Timestamp fallback compares epoch ms (mixed UTC offsets order right) and
  is end-bounded: a child active after the parent's last turn is unlinked
  (contributes nothing), matching orphan semantics.
- Cache adoption tries the newest prior versioned file (v6 then v5) so the
  preceding build's expired-PR history survives the v7 bump; an invariant
  note requires the list to cover every version that can exist on disk.
- Spawn-result pairing matches the tool_result block that carries the
  agentId, not the first block, when a record batches several results.
- resolveSubagentAttribution is computed once and shared by aggregateByPr
  and prLinkedTotals.

subagentSessions now counts folded subtrees (children plus descendants).
Verified on real data: attributed + unattributed reconciles to cost, and
parent-only cost plus folded-children cost equals the folded total to the
cent (no double-count).
2026-07-21 05:46:36 +02:00
..
act feat(act): defer-* plan kinds for native deferral config (part 2 of #614) (#631) 2026-07-16 19:01:54 -07:00
data release: 0.9.19 (#774) 2026-07-20 09:35:32 -07:00
guard feat(claude): account for /advisor escalations under the advisor model (#659) 2026-07-16 07:42:49 -07:00
mcp fix(report): surface estimated costs distinctly (#688) 2026-07-16 10:46:21 -07:00
providers feat(capture): parse-time capture of branch, LOC deltas, interruptions, titles, PR links 2026-07-20 05:56:38 -07:00
sharing Merge origin/main into feat/desktop-app 2026-07-16 07:52:28 -07:00
sync fix(sync): address PR review — https enforcement, keychain test isolation, golden ID pins 2026-07-13 16:45:39 +00:00
antigravity-statusline.ts refactor(cli): share persistent-codeburn resolver; tighten Antigravity hook ownership 2026-05-31 20:07:57 -07:00
audit-report.ts feat: add codeburn audit token-source view (#578) 2026-07-01 13:02:29 +02:00
bash-utils.ts fix(bash): attribute wrapped commands to the real tool, not the wrapper (#658) 2026-07-10 06:36:07 -07:00
budget.ts feat(budget): spend budgets with overview display and scriptable --check (#562) 2026-07-16 11:10:16 -07:00
cache-refresh-lock.ts cache: strict cross-process gate for the warm session-cache refresh transaction (#743) 2026-07-20 09:06:35 -07:00
classifier.ts fix(classifier): attribute skills to skillBreakdown regardless of turn category 2026-07-18 22:54:49 +03:00
cli-date.ts feat(cli): add lifetime period for CLI and dashboard (#753) 2026-07-20 05:24:33 -07:00
cli.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
codex-cache.ts feat(capture): parse-time capture of branch, LOC deltas, interruptions, titles, PR links 2026-07-20 05:56:38 -07:00
codex-credits.ts feat(codex): compute Codex credit usage (#408, #495) (#510) 2026-06-18 17:03:46 +02:00
compare-stats.ts fix(cli): compare cache-hit rate excludes cache writes 2026-07-16 01:14:41 -07:00
compare.tsx feat: implement act apply-model and report baseline tripwire (#607) (#616) 2026-07-16 11:10:08 -07:00
config.ts feat(budget): spend budgets with overview display and scriptable --check (#562) 2026-07-16 11:10:16 -07:00
content-utils.ts fix(parser): tolerate string message content; isolate per-file parse failures (#441) (#450) 2026-06-06 04:01:12 +02:00
context-budget.ts Extract shared token estimation helper, migrate all CHARS_PER_TOKEN sites (#644) (#677) 2026-07-16 11:58:22 -07:00
context-tree-codex.ts Extract shared token estimation helper, migrate all CHARS_PER_TOKEN sites (#644) (#677) 2026-07-16 11:58:22 -07:00
context-tree.ts Extract shared token estimation helper, migrate all CHARS_PER_TOKEN sites (#644) (#677) 2026-07-16 11:58:22 -07:00
context-tui.tsx feat(context): per-session context token tree across CLI, TUI, and dashboard (#592) 2026-07-02 05:00:03 +02:00
currency.ts currency: honor CODEBURN_CACHE_DIR for the exchange-rate cache (#766) 2026-07-20 08:28:29 -07:00
cursor-cache.ts feat(doctor): per-provider detection diagnostics (#685) 2026-07-16 10:38:08 -07:00
daily-cache.ts prerelease: quota NaN guard, 10-year daily retention, test date bomb (#764) 2026-07-20 07:37:56 -07:00
dashboard.tsx models: resolve Fireworks-hosted models to friendly display names (#787) 2026-07-20 14:22:12 -07:00
day-aggregator.ts daily-cache: fix tz-change double-count and multi-provider turn-stat inflation (#762) 2026-07-20 08:57:41 -07:00
doctor.ts doctor: surface Claude Code transcript retention (#757) 2026-07-20 05:25:12 -07:00
export.ts feat(export): subagentType and model on per-record exports; --by-agent follow-ups (#712) 2026-07-16 16:35:33 -07:00
fetch-utils.ts fix(network): add timeouts to critical-path fetches (#445) (#448) 2026-06-06 03:25:36 +02:00
format.ts fix(report): CLI totals read the durable daily cache, matching the menubar exactly 2026-07-20 06:33:56 -07:00
fs-utils.ts feat(copilot): track GitHub Copilot JetBrains IDE usage 2026-07-03 16:11:27 +05:30
granular-history.ts feat(dashboard): add granular session and model timelines (#673) 2026-07-16 03:04:54 -07:00
ink-win.ts Fix dashboard hang and ExperimentalWarning on Windows 2026-05-02 11:54:58 -07:00
main.ts sessions: fold subagent runs into PR attribution 2026-07-21 05:46:36 +02:00
menubar-installer.ts Fix menubar install release lookup 2026-07-08 21:36:20 +02:00
menubar-json.ts sessions: fold subagent runs into PR attribution 2026-07-21 05:46:36 +02:00
model-breakdown.ts models: resolve Fireworks-hosted models to friendly display names (#787) 2026-07-20 14:22:12 -07:00
model-efficiency.ts fix(devin): report friendly GPT model names with effort tier (#585) 2026-07-01 16:01:49 +02:00
models-report.ts feat(export): subagentType and model on per-record exports; --by-agent follow-ups (#712) 2026-07-16 16:35:33 -07:00
models.ts models: resolve Fireworks-hosted models to friendly display names (#787) 2026-07-20 14:22:12 -07:00
optimize.ts feat(insights): workflow intelligence (corrections, time-to-first-edit, file churn, coverage) + dash wire-up (#756) 2026-07-20 05:47:46 -07:00
overview.ts fix(report): CLI totals read the durable daily cache, matching the menubar exactly 2026-07-20 06:33:56 -07:00
parser.ts sessions: address adversarial review of subagent PR attribution 2026-07-21 05:46:36 +02:00
persistent-codeburn.ts refactor(cli): share persistent-codeburn resolver; tighten Antigravity hook ownership 2026-05-31 20:07:57 -07:00
plan-usage.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
plans.ts feat(providers): add Grok Build provider (#521) 2026-06-19 17:21:41 +02:00
quota.ts prerelease: quota NaN guard, 10-year daily retention, test date bomb (#764) 2026-07-20 07:37:56 -07:00
session-cache.ts sessions: address adversarial review of subagent PR attribution 2026-07-21 05:46:36 +02:00
sessions-report.ts sessions: address adversarial review of subagent PR attribution 2026-07-21 05:46:36 +02:00
spend-flow.ts fix(cli): surface mDNS scan errors, robust spend-flow rollup + date label, harden tests 2026-07-10 16:20:41 -07:00
sqlite.ts Merge main into feat/multi-provider-plans, remove dead tautology 2026-05-16 10:42:03 -07:00
text-table.ts feat(devices): joined Totals by machine report (#536) 2026-06-20 19:23:03 +02:00
token-estimate.ts Extract shared token estimation helper, migrate all CHARS_PER_TOKEN sites (#644) (#677) 2026-07-16 11:58:22 -07:00
types.ts sessions: address adversarial review of subagent PR attribution 2026-07-21 05:46:36 +02:00
usage-aggregator.ts sessions: fold subagent runs into PR attribution 2026-07-21 05:46:36 +02:00
web-dashboard.ts feat(context): per-session context token tree across CLI, TUI, and dashboard (#592) 2026-07-02 05:00:03 +02:00
workflow-insights.ts insights: close the post-merge review findings on workflow intelligence (#763) 2026-07-20 07:26:08 -07:00
yield.ts fix(yield): case-insensitive canonical repo grouping via realpathSync.native 2026-07-19 03:12:03 +03:00