Repository navigation
feat: diff parser hardening — Phase 1 (#195) - #218
Merged
Merged
Conversation
- Hunk line count validation: warn on mismatch (truncated diffs) - Broader binary detection: GIT binary patch, Binary file singular - Graceful truncated diff handling: return partial parse instead of drop - 3 new tests: truncated diff, git binary patch, binary file variant - 15 total diff parser tests passing
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
Implements Phase 1 of #195 — diff parser hardening for real-world edge cases.
Changes
Binary Detection
GIT binary patchprefix now detected (was onlyBinary files)Binary filesingular form now detectedTruncated Diff Handling
Tests (3 new)
truncated_diff_returns_partial_parse— simulates truncated git outputgit_binary_patch_detected— GIT binary patch formatbinary_file_marker_variants— singular "Binary file" formTotal: 15 diff parser tests passing.
Test Plan