feat: auto-merge a run's session into one file at exit - #78
Open
lroolle wants to merge 1 commit into
Open
Conversation
A resumed session used to leave one trace-*.jsonl per run; every capture run now merges its OWN sessions into session-<sid8>.jsonl at exit and prunes the sources it fully absorbed. Scoped by the sids seen on the wire (planMerge's new MergeScope), so a concurrent run's trace is never touched, and gated on there being something to consolidate — a fresh single-file session's trace stays byte-identical. The scoped plan needs a stricter prune rule than the whole-dir sweep: a source is prunable only when every pair lands in a session THIS plan writes, or a file also holding an unmerged session's pairs would vanish into no output. --no-auto-merge opts out; --fresh already does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
A resumed session fragments across one trace-*.jsonl per run; the viewer stitches them at read time, but the disk never converges unless someone remembers cctrace merge --yes. Now every capture run consolidates its OWN sessions on the way out.
What it does
Correctness
Verification
🤖 Generated with Claude Code