Make turn diff tracking operation backed (#21180)

## Summary
- replace filesystem-based turn diff tracking with an operation-backed
accumulator
- preserve enough verified apply_patch state to render move-overwrite
cases correctly
- keep the turn/diff/updated contract intact while removing remote-only
turn-diff test skips

This takes the assumption that no 3P services rely on the output format
of `apply_patch`

## Why
For the CCA file system isolation push

---------

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
jif-oai
2026-05-07 11:33:47 +02:00
committed by GitHub
Unverified
parent b2268999fe
commit f7e8ff8e50
15 changed files with 1050 additions and 898 deletions
+4 -5
View File
@@ -76,11 +76,10 @@ pub(crate) async fn apply_patch(
pub(crate) fn convert_apply_patch_to_protocol(
action: &ApplyPatchAction,
) -> HashMap<PathBuf, FileChange> {
let changes = action.changes();
let mut result = HashMap::with_capacity(changes.len());
for (path, change) in changes {
let mut result = HashMap::with_capacity(action.changes().len());
for (path, change) in action.changes() {
let protocol_change = match change {
ApplyPatchFileChange::Add { content } => FileChange::Add {
ApplyPatchFileChange::Add { content, .. } => FileChange::Add {
content: content.clone(),
},
ApplyPatchFileChange::Delete { content } => FileChange::Delete {
@@ -95,7 +94,7 @@ pub(crate) fn convert_apply_patch_to_protocol(
move_path: move_path.clone(),
},
};
result.insert(path.clone(), protocol_change);
result.insert(path.to_path_buf(), protocol_change);
}
result
}