fix(worktrees): retain evidence evicted before the first Git catalog - #829
Merged
Conversation
… catalog Refs #822 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013SULm3ApxebET2a8eLxKHd
Records evicted from the live window while Git IPC was still pending were folded through foldRaw, which skips every non-worktree-state record without a catalog. They were dropped silently, so a fast-starting session lost attribution for everything before its newest 500 relevant records. Hold those records in a second bounded list and fold them on the first rebuild that has a catalog; count, do not hide, what the bound drops. Fixes #822 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013SULm3ApxebET2a8eLxKHd
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.
Problem
LiveWorktreeReconciler.observefolds records evicted from the 500-record live window into the baseline throughfoldRaw, andfoldRawskips every non-worktree-staterecord while the cwd has no Git catalog. A session that buffers more than 500 relevant records before the first catalog reply loses attribution for all but the newest 500. Surfaced by the independent review of #808 and filed as #822; pre-existing on main.Change
deferredRaw, bounded by the samerecentRawLimit.rebuild()that has a catalog folds the deferred list into the baseline in arrival order.summarize()reportsdeferredEvidenceCountanddroppedBeforeCatalogso the debug panel can say when attribution is still incomplete.Tests
Verification
npm run typecheck, the work-context unit suite,npm run check:worktree-live-fixtures.Fixes #822
🤖 Generated with Claude Code
https://claude.ai/code/session_013SULm3ApxebET2a8eLxKHd