fix(inspect): bound batches across writer races#5
Merged
siriusctrl merged 2 commits intoJul 22, 2026
Conversation
Preflight the next checkpoint before a non-empty forward batch crosses its record or byte budget. This keeps large committed groups atomic without decoding or formatting them until a caller has room, while still validating malformed checkpoint starts. Treat refresh reads as a coherent transaction over one file observation. Retry confirmed truncate/replace races, discard partial suffix decoder state, and publish offsets and prefix samples only after the observed file remains stable. Cover oversized forward groups, malformed preflight data, buffered-reader position restoration, and deterministic concurrent tail replacement. Document the checkpoint-budget and refresh snapshot semantics.
Upgrade the published crates.io fmtview dependency to 0.6.2. Upstream PR #15 fixed sticky-layout convergence where the one-draw preserved position overrode the exact active-follow tail after a JSON breadcrumb changed the first frame height, immediately producing follow:detached. Keep fiasco behind the public fmtview facade; fmtview-core remains registry-transitive only, with no path or Git dependency.
siriusctrl
marked this pull request as ready for review
July 22, 2026 13:37
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
Root causes
The forward reader checked its budget only after decoding a checkpoint. A small checkpoint followed by a large group therefore decoded and returned both, crossing the requested bound and doing large eager work.
The refresh path also mutated its suffix decoder while reading a length captured before a concurrent writer truncate/replace. A short read could terminate follow mode and leave partial scan state behind.
Finally, fmtview 0.6.1 sticky-layout convergence let the one-draw preserved position override the exact active-follow tail when a JSON breadcrumb changed first-frame height. Upstream fmtview #15 fixed that issue and released it as 0.6.2.
Dependency boundary
Cargo.tomldepends only on the published crates.iofmtview = "0.6.2"facade. There is no path dependency, Git dependency, or directfmtview-coredependency; the locked core crate is registry-transitive only.Validation
cargo fmt --checkcargo check --all-targetscargo clippy --all-targets -- -D warningscargo test --all-targets— 300 passed, 0 failed, 1 ignoredgit diff --checkFresh post-0.6.2 PTY checks pass for:
follow:onGreattachesfpause/resume preserves the viewport and later catches upRunDirStoreinvokesprepare_append, replaces an uncommitted tail, and exposes the replacement exactly once without discarded records or duplicate refstnavigation round-tripsrshows the exact{"cmd":"cargo test --all-targets"}source argumentqexits zero and restores alternate screen, mouse capture, cursor visibility, and byte-for-byte PTY termios stateFresh Kitty/Xvfb/ffmpeg evidence also covers those visible states. The 25.07-second real-emulator recording has twelve key screenshots, ten sampled nonblank frames, a contact sheet, and a video timeline sheet. All recorder, emulator, display, and tmux processes were cleaned up.
Local ignored evidence bundle:
/root/.codex/worktrees/fiasco-inspect-fresh-review/target/fiasco-inspect-follow-review-v2/