fix(search): keep follow scans open for appends#6
Closed
siriusctrl wants to merge 2 commits into
Closed
Conversation
Extend an in-flight search budget when follow refresh adds formatted lines and mark the match index inexact so records committed after search start are still considered. Add a boundary-focused forward-search regression.
Distinguish fixed-size reverse-read buffers from total scan work when the EOF record is incomplete, and document the append-oriented rewrite detection boundary. Record the active-search append fix in the unreleased notes.
Owner
Author
|
Superseded by #12, which implements append-aware search using disjoint scan spans and includes independent-review fixes for lazy-prefix ordering, backward multi-append priority, and short-read safety. |
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.
Independent review result
This is a fresh review of the complete
origin/main..agent/record-timeline-followimplementation and the relevant pre-PR viewer/load code. I did not rely on the implementation thread's summary.PR #5 moved the target while this review was in progress and already merged equivalent fixes for explicit follow controls, transactional newer cursors, pending-tail verification, synchronized frame commits, and the other reviewer's bounded prefix-probe overlap design. I did not stack a second overlap model on top of that work.
This draft contains the two remaining review changes:
Findings and selectable checkpoints
The separately pushed branch
agent/review-record-timeline-follow-a47bdc77preserves the requested clean checkpoints on exact base5faa172:20c28e0cf2fdfeb0bcce9is already present after PR #57fc5fca5ed4cb6's narrower non-consuming prefix probe45e1678606168bis already present after PR #5a89f298The C alternative avoids a synchronous prefix probe and reconciles only when normal reverse loading reaches the true prefix. Its cost is substantially more consumer state: overlap removal must shift viewport, search, structure, and tool anchors. The merged prefix-probe API adds one source-neutral non-consuming operation but keeps the consumer append-only and the public
ViewFileChangenarrower. I consider the merged prefix-probe design the better final choice and keep C only as a separately selectable comparison.Correctness coverage
Focused timeline integration: 38/38 passed, covering:
f, and shifted horizontal wheel input;No
crossterm, raw-mode, terminal lifecycle, poll cadence, or frame-commit type entersfmtview-core; those remain in the root package.Frame and visual evidence
For the same sized PTY interaction (initial frame, two scroll draws, quit):
20c28e0): 0 synchronized-update opens, 0 closes, 9,795 transcript bytes;cf2fdfeor current target): 3 opens, 3 closes, 9,859 transcript bytes.The writer regression additionally asserts
CSI ?2026h < frame content > CSI ?2026l. Ordinary, diff, and follow PTY smokes exited 0; the current transcripts contained one balanced pair per actual draw (3/3 ordinary, 1/1 diff, 5/5 follow).A fresh Kitty/Xvfb/ffmpeg follow run produced 190 frames, 13 action-adjacent keyframes, and 10 scripted actions. Settled frames were visually inspected and showed attached append, detached append without a tail jump, PageDown reattach, explicit pause with no append jump, and resume with the fourth record visible. Layout, role/tool gutters, title, and footer remained legible.
The software-GL capture alternated complete front-buffer images with non-preserved partial back-buffer images even while the application emitted no bytes; disabling vsync and direct window capture reproduced it. Therefore the video supports semantic/layout verification but is not used to claim pixel-level tearing absence. The balanced PTY protocol bytes and writer regression are the deterministic frame-commit evidence.
Verification
cargo fmt --all -- --checkcargo check --workspace --all-targets --lockedcargo test --workspace --all-targets --locked(root 8, CLI 38, core 230, headless 3, timeline 38; 317 passed total)cargo clippy --workspace --all-targets --all-features --locked -- -D warningsRUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --lockedcargo build --workspace --release --lockedcargo build --release --locked --target x86_64-unknown-linux-muslfmtview-core144 files;fmtview46 filescargo publish -p fmtview-core --dry-run --locked: passed, 144 files, 808.8 KiB / 151.1 KiB compressedcargo publish -p fmtview --dry-run --locked: expected pre-release sequencing failure becausefmtview-core 0.5.4has not actually been uploaded; this matchesdocs/releasing.mdfmtview 0.5.4;npm pack --dry-run --jsoncontained exactly README, JS shim, manifest, and bundled binary--followexited 1 with the documented TTY errorbenches/load-performance.sh --samples 3 --case timeline: medians 0.639 ms tail-open, 1.493 ms older, 2.229 ms newer, 2.911 ms followNo merge is requested; this remains a draft for the implementation thread to choose.