codeburn/app/renderer
reviewer a3a4c97ec5 sessions: harden PR attribution and add models + category breakdown
Addresses the review findings on the per-turn PR attribution and adds the
model and task-category surfaces.

Correctness:
- Cache migration: the 5 -> 6 session-cache bump now adopts the prior v5
  file's expired-source PR entries instead of abandoning them, and the claude
  scan preserves and surfaces PR-bearing orphans, so a session whose transcript
  was deleted still appears as a legacy even-split instead of vanishing. The
  daily cache is untouched.
- Date-range carry: the parser captures the PR set active at the start of the
  in-range turn slice and seeds the state machine with it, so a PR referenced
  before the window still owns its later, in-range, ref-less turns instead of
  the session falling back to a whole-session approx split.
- Calls are split across a multi-PR turn by largest-remainder, keeping per-PR
  counts whole (a 1-call, 2-PR turn no longer renders as 2 calls).
- The CLI and app footers reconcile to the rounded row values actually shown.
- Distinct sessions are keyed by project + sessionId, not sessionId alone.
- The app tolerates an older by-reference payload (no attributedCost): it keeps
  the old non-summable footer and never renders NaN.

Features:
- Each PR contribution records the models of its calls and the turn's task
  category (split by the same share on a multi-PR turn); legacy even-split rows
  carry the model union but no category breakdown.
- Payload rows gain models (short names, cost-desc) and categories (label + cost,
  cost-desc, omitted when empty); the payload gains otherPrCount/otherPrCost for
  the PRs beyond the sent top 20.
- CLI --by-pr gains a Models column. The desktop table is now full-width with a
  Models column and click-to-expand rows showing a per-category cost breakdown
  with proportional bars, keyboard accessible, with an "Other (N more PRs)" row
  when capped.

Tests: state-machine seed/models/categories/largest-remainder/dedup, the prRefs
round-trip through the real incremental-append path (continuation + straddle),
v5 adoption of an expired PR session, payload round-trip, and the desktop
expansion/models/old-payload cases.
2026-07-21 01:08:52 +02:00
..
assets brand: restore binary 0101 flame across all surfaces 2026-07-17 14:14:40 -07:00
components payload: spend by pull request and by branch; desktop Pull requests tab (#788) 2026-07-20 14:36:53 -07:00
hooks app: Download button direct-downloads the update asset (#777) 2026-07-20 10:02:43 -07:00
lib sessions: harden PR attribution and add models + category breakdown 2026-07-21 01:08:52 +02:00
sections sessions: harden PR attribution and add models + category breakdown 2026-07-21 01:08:52 +02:00
styles sessions: harden PR attribution and add models + category breakdown 2026-07-21 01:08:52 +02:00
test feat(app): refresh cadence, instant switching, cache coherence, telemetry v1 2026-07-16 11:47:05 -07:00
App.test.tsx payload: spend by pull request and by branch; desktop Pull requests tab (#788) 2026-07-20 14:36:53 -07:00
App.tsx payload: spend by pull request and by branch; desktop Pull requests tab (#788) 2026-07-20 14:36:53 -07:00
index.html harden(app): Electron security + spawn efficiency batch 2026-07-16 01:57:44 -07:00
main.tsx fix(app): zero background work when hidden; currency applies instantly 2026-07-16 18:41:28 -07:00
vite-env.d.ts feat(app): scaffold Electron+Vite package and codeburn CLI spawn 2026-07-10 15:16:55 -07:00