fix(search): track appended scan ranges#12
Merged
Conversation
Represent active searches as disjoint half-open spans so live appends and lazy older inserts extend only unvisited ranges. Preserve true-prefix ordering while allowing committed appends to stay searchable during follow. Add forward/backward wrap, reset-tail, completed-miss, index recount, and lazy-history regressions. Clarify committed-boundary discovery separately from the bounded initial tail load.
Grow the wrapped forward-search fixture beyond one lazy older-load batch so the regression proves a newer reverse-loaded match cannot outrank the true source prefix.
Defer independently inserted older history until a forward search reaches the true source prefix, and prioritize newer append ranges during backward scans even after an earlier append was partially consumed. Fill bounded search windows across short ViewFile reads so reverse scans cannot consume different coordinates than they inspected. Add regressions for huge tail records, multi-append ordering, reset boundaries, short reads, and search-index rebuilds.
fix(search): preserve dynamic scan ordering
siriusctrl
marked this pull request as ready for review
July 22, 2026 11:10
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.
Summary
This supersedes the search implementation in #6 while retaining its documentation intent.
Why
Extending a wrapped search by only increasing its remaining-line budget can spend the new budget revisiting old lines and still miss appended records. Explicit unvisited spans make append and prepend deltas exact in both search directions.
Verification
No terminal-backend video was added because the behavior is covered through backend-neutral viewer and timeline tests.