feat: save and replay decoded sessions#32
Merged
Conversation
iPeluwa
marked this pull request as ready for review
July 17, 2026 18:59
Owner
|
Can we confirm there is a new mode when we use |
Owner
|
let me merge this first and verify by myself. |
sunng87
added a commit
that referenced
this pull request
Jul 22, 2026
The SAVED SESSIONS section and OPTIONS entries for --save/--replay landed in #32, but the EXAMPLES section only covered pcap/mitm/TUI-filter usage. Add three examples mirroring the README so the manpage stands alone: tapgres --save session.jsonl tapgres --replay session.jsonl --tui tapgres --replay session.jsonl -Y 'message.type == "Query"'
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
RowDescription/DataRowdetails.--save FILEto continuously record the complete output stream before display filtering or TUI history eviction, while stdout or the TUI continues normally.--replay FILEas a file source that replaces pcap/mitm and feeds saved records through the existing stdout, display-filter, and rich TUI rendering pipeline./and:with:save/:wand:open/:ocommands.Design decisions
The saved format is structured JSONL rather than a plain transcript. Every record carries
schema_version: 1and an RFC 3339 timestamp. Message records retain the filter fields and optional rich-rendering payload, so replayed traffic behaves like live decoded traffic instead of becoming display-only text.--savewrites each completed JSONL line directly to disk before display filtering and independently of the bounded TUI history. Unknown schema versions, malformed records, invalid timestamps, and attempts to overwrite the replay input are refused with explicit errors.CLI replay is instant and streams large files without retaining the full session. TUI open validates the complete file atomically and retains the newest 50,000 records. Opening from a live TUI switches the view to replay mode, closes any active recorder, and discards subsequent live display records so the two timelines cannot mix.
User impact
tapgres --save session.jsonl tapgres --replay session.jsonl tapgres --replay session.jsonl --tui --tui-rich tapgres --replay session.jsonl -Y 'message.type == "Query"'In the TUI,
/or:opens the command bar:Validation
cargo fmt --all --checkcargo test --all-targets(64 tests passed: 54 library, 5 protocol replay, 5 session CLI)cargo clippy --all-targets -- -D warningscargo build --release:opensmoke testgit diff --checkCloses #16.