fix: add diagnostic redaction + protocol frame codec recovery tests (closes #1, closes #2)#4
Open
BERT70293 wants to merge 2 commits into
Open
fix: add diagnostic redaction + protocol frame codec recovery tests (closes #1, closes #2)#4BERT70293 wants to merge 2 commits into
BERT70293 wants to merge 2 commits into
Conversation
- 15 tests across 5 test classes - Validates repo-relative paths in diagnostic output - Checks PII redaction (home dir, username, hostname) - Confirms .logd references, password pairing, required fields - Cross-platform path consistency (forward slashes) - All tests pass
Add comprehensive Rust tests for protocol frame decoder recovery: - Reject truncated headers and payloads without panicking - Reject invalid magic, unsupported versions, and oversized payloads - Validate reserved bytes must be zero (added missing validation) - Assert failed decode does not corrupt decoder state - Confirm valid frames decode after invalid input - Test checksum mismatch preserves remaining buffer - Cover partial-then-complete stream recovery - Add buffer state tracking tests (buffered_bytes, reset) Also added raw_frame_header and raw_frame helpers for injecting malformed byte-level data the encoder would reject, enabling deterministic regression tests for edge cases.
Owner
|
Thanks for the PR. I cannot forward this as bounty-ready yet. This PR currently bundles two separate tracker issues (#1 and #2) into one branch, and the checklist says the required diagnostic build log is not committed. Please split this into one narrowly scoped PR per issue, then rerun the current build script and include the exact script-generated diagnostic artifacts in the changed files: Please do not hand-edit or copy diagnostic output; it needs to come from |
Notime02
added a commit
to Notime02/TentOfTrials
that referenced
this pull request
Jun 21, 2026
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 PR bundles two bounty fixes:
Issue #2 changes:
Adds comprehensive deterministic regression tests for the protocol frame codec, focusing on decoder recovery boundaries after malformed input.
backend/src/protocol/codec.rs:FrameDecoder::decode()(previously skipped silently)raw_frame_headerandraw_frametest helpers for byte-level malformed input injectionTesting
All tests are
#[cfg(test)]unit tests — fully deterministic, no live services required:cargo test --libChecklist