Harden transcript_apply path validation and patch replay - #2
Open
taylorai-coding-agents[bot] wants to merge 1 commit into
Open
taylorai-coding-agents[bot] wants to merge 1 commit into
taylorai-coding-agents[bot] wants to merge 1 commit into
Conversation
Author
🤖 PR Review by codex (gpt-5.3-codex)Verdict: 🔧 Changes Requested Core fixes are mostly in place, but generated patch normalization currently corrupts file content via global replacements. Issues🔴 Global patch path normalization rewrites diff body content
🟡 Patch test checks syntax only, not semantic fidelity
|
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.
Addresses the correctness and security blockers called out in the merged PR review by tightening filesystem validation and making recovered patches compatible with standard
git apply.What changed
VirtualWorkspace.disk_path()so reads, writes, deletes, and creates resolve existing components, reject symlink escapes outside the target root, and fail early on non-directory parents or directory targets.TranscriptApplyError.apply_patchparsing to accept*** End of Fileinside update hunks instead of treating it as an unsupported directive.\ No newline at end of fileand preserving line-ending semantics during context matching.a/andb/prefixes instead of double-prefixed paths, then added agit apply --checkregression test.Why
The previous implementation could write through symlinks outside the requested root, emit unusable patch paths, and reject valid
apply_patchpayloads. These changes make transcript recovery safer and bring patch replay behavior in line with expected patch syntax.Reviewer notes
*** End of Filepayloads, no-trailing-newline hunks, andgit apply --checkvalidation for generated patches.