store: rebuild ReadConversation around thread completion - #363
Open
anish749 wants to merge 2 commits into
Open
Conversation
anish749
force-pushed
the
worktree-read-thread-completion
branch
from
May 28, 2026 21:43
c20589c to
48607b5
Compare
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
ReadConversationhad asymmetric filter logic:--sincepost-filtered by ts at the caller, while--datehad no post-filter andinterleaveThreadsdumped every unmatched thread file at the end. Result:--date Xfor a day with no date file leaked unrelated thread data, and matched-thread replies on different days were treated inconsistently between modes.Solution
Rebuild around one model. Both
--dateand--sinceare time windows. Pipeline is filter → thread-complete → dedupe → sort → interleave.read.GlobFiles(filename is a directory-layout contract — type-safe). Thread files are listed whole and filtered at parse time using typedtime.Timecomparisons; pre-filtering by content patterns would couple to MsgLine.Ts's JSON serialization, which is fragile.internal/store/window.go— store layer owns it, callinginternal/readfor the rg primitives.--last=25default forpigeon readlives incommands.RunRead(the UX layer). Store has no opinions; with no filter, it returns the full conversation. Hub callers (which passSinceexplicitly) are unaffected.Tests
Date_NoFile_NoThreadActivity,Date_ParentInWindow_PullsLaterReplies,Date_ReplyInWindow_PullsOlderParent,Date_ThreadAtomSortedByParentTs,DedupsParentBetweenDateAndThreadFiles,NoFilter_ReturnsEverything.ThreadReply_OldParentInDateFilenow asserts the old parent rides along — direct consequence of the new thread-completion model.Supersedes #358.