fix(viewer): harden conversation record inspection#8
Merged
Conversation
Blockers addressed: - require explicit media typing and validate standard versus URL-safe alphabets - suppress duplicate tool-result envelopes while preserving canonical fallbacks - snapshot lazy raw records so source rewrites cannot change an open record - force a full redraw when switching structured and raw content spaces Invariants preserved: - redirected output and tool arguments remain token-preserving - media payloads stay streaming and decoded-size-only in the display spool - raw record reads remain bounded to 32 KiB plus at most 3 UTF-8 boundary bytes - terminal lifecycle stays outside fmtview-core
siriusctrl
marked this pull request as ready for review
July 22, 2026 09: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 is an independent review/fix layer on top of the conversation JSON implementation in #7.
Root cause and impact
The original display paths mixed a few independent assumptions: payload characters could imply encoding, a role-tool envelope could compete with its typed child, lazy raw mode reread mutable source bytes, and terminal scroll deltas crossed content-space boundaries. Together those could produce false media summaries, incorrect tool navigation, non-repeatable raw records, or stale terminal rows after
rtoggles.The fix keeps redirected output and tool arguments token-preserving, keeps media scanning streaming, and leaves all terminal lifecycle/rendering ownership outside
fmtview-core.Validation
cargo test --workspace --all-targets --no-fail-fastcargo clippy --workspace --all-targets -- -D warningsRUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-depscargo publish -p fmtview-core --dry-run --lockedr -> j x48 -> rrecording; raw moved from 20% to 53% and the structured screen restored cleanlyLocal durable evidence is under
target/fmtview-emulator-recordings/raw-scroll-review-d80e725-3/: Kitty video/contact sheet and text snapshots, pluspty.log,pty-check.json,pty-raw-screen.txt, andpty-structured-screen.txt.Documented streaming limitations
datafor streaming recognitionRaw search also intentionally does not match across the artificial 32 KiB chunk seam.