feat(capture): parse-time capture of branch, LOC deltas, interruptions, titles, PR links#758
Merged
Merged
Conversation
…s, titles, PR links
iamtoruk
added a commit
that referenced
this pull request
Jul 20, 2026
The rich session capture (#758) stores every PR URL a transcript references, but nothing displayed it. codeburn sessions --by-pr now groups spend by pull request: cost, savings, sessions, calls, and the date span per PR, sorted by cost, with a GitHub-shortened label and json output. Attribution is by reference, so a session that mentions several PRs counts fully toward each row; the footer reports the distinct-session total so overlapping rows are never mistaken for a grand total. prLinks now ride from the cached file onto SessionSummary in both the Claude pipeline and the generic provider path. Co-authored-by: reviewer <review@local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capture half of the rich-session-data plan: parse-time capture of fields the real Claude/Codex stores already carry but CodeBurn discarded. Capture only — no report, payload, or UI consumes these yet; feature PRs (cost-per-branch/per-PR, LOC risk map, ground-truth correction signals) will read them from cache with no further re-parses.
New optional cached fields (omitted at zero/false; cache grew +0.47% on a real 36MB cache)
locAdded/locRemoved: counted from ClaudetoolUseResult.structuredPatchhunks and Codexpatch_apply_end.changes[*].unified_diff. Numbers only, never patch text.interrupted,userModified,toolErrors(Claude, from explicitis_errormarkers, deliberately not stderr which carries warnings),editFailed(Codexsuccess === false).gitBranch(Claude), stored only when it differs from the previous turn (carry-forward on read). Added as a seventh field to the perf(parser): single-pass field extraction in the large-line JSONL scanner #752 single-pass scanner, so large lines pay no extra scan.title(lastai-titlewins),prLinks,isSidechain. Investigated sidechain linking:parentUuidreferences an intra-file entry uuid, not a session id (0 matches across the sampled corpus), so only the boolean marker is captured and the limitation is documented.Parse versions
One conscious bump each:
claude->...-rich-capture-v1,codexbump +CODEX_CACHE_VERSION5 -> 6 in lockstep (the codex results layer would otherwise serve old field-less calls). Cold re-parse cost is ~half what it was pre-#752.daily-cache.ts/day-aggregator.tsuntouched.Verification
interrupted/userModified/editFailedhad no true samples on this corpus and are covered by unit tests.Known transient: until this ships, an older CLI sharing the cache re-parses it back to the old version and the dev CLI re-upgrades it (standard bump thrash, resolves on release).