Repository navigation
Safely match and apply blank-only V4A edits - #113
Conversation
Author
|
This PR was generated with Warp. Comment |
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.


Description
Match complete V4A search windows, including their final blank lines, and compare replacement line sequences for no-op detection. Blank-only deletions also reject fuzzy matches onto nonblank content.
Context remains outside replacement spans, so neighboring edits cannot overlap through expanded anchors and fuzzy-matched indentation stays unchanged. The wire schema is unchanged.
Companion server change: https://github.com/warpdotdev/warp-server-for-benchmarks/pull/6504. Safe blank application requires this matcher correction; do not roll out the server's blank-preserving encoding to unfixed clients.
Linked Issue
https://linear.app/sandbox/issue/REMOTE-1
ready-to-specorready-to-implement— sandbox implementation work; label not verified.Testing
CARGO_BUILD_JOBS=2 cargo nextest run --manifest-path /workspace/warp/Cargo.toml -p ai -E 'test(diff_validation::)' --no-fail-fast— 34 passed.CARGO_BUILD_JOBS=2 cargo clippy --manifest-path /workspace/warp/Cargo.toml -p ai --all-targets --tests -- -D warnings— passed.git diff --check— passed.Regression tests failed before the correction. An isolated harness also feeds actual server ProduceActions output into the real matcher for 21 cases. It asserts exact ranges and complete byte-level applied contents, including EOF safety, neighboring edits, blank context, and fuzzy-context preservation. The assertion-backed fixture/harness bundle is attached as
blank-line-application-proof.tar.gzin the run artifacts../script/run— not needed for pure matcher behavior; verified through the actual matcher and application semantics.Agent Mode
CHANGELOG-BUG-FIX: Fixed agent patches that add or remove blank lines being ignored or matched to the wrong lines.