[codex] Migrate apply_patch to executor filesystem (#17027)

- Migrate apply-patch verification and application internals to use the
async `ExecutorFileSystem` abstraction from `exec-server`.
- Convert apply-patch `cwd` handling to `AbsolutePathBuf` through the
verifier/parser/handler boundary.

Doesn't change how the tool itself works.
This commit is contained in:
pakrym-oai
2026-04-07 14:20:22 -07:00
committed by GitHub
parent d45513ce5a
commit e9702411ab
22 changed files with 817 additions and 334 deletions

View File

@@ -126,6 +126,38 @@ impl From<AbsolutePathBuf> for PathBuf {
}
}
/// Helpers for constructing absolute paths in tests.
pub mod test_support {
use super::AbsolutePathBuf;
use std::path::Path;
use std::path::PathBuf;
/// Extension methods for converting paths into [`AbsolutePathBuf`] values in tests.
pub trait PathExt {
/// Converts an already absolute path into an [`AbsolutePathBuf`].
fn abs(&self) -> AbsolutePathBuf;
}
impl PathExt for Path {
#[expect(clippy::expect_used)]
fn abs(&self) -> AbsolutePathBuf {
AbsolutePathBuf::try_from(self).expect("path should already be absolute")
}
}
/// Extension methods for converting path buffers into [`AbsolutePathBuf`] values in tests.
pub trait PathBufExt {
/// Converts an already absolute path buffer into an [`AbsolutePathBuf`].
fn abs(&self) -> AbsolutePathBuf;
}
impl PathBufExt for PathBuf {
fn abs(&self) -> AbsolutePathBuf {
self.as_path().abs()
}
}
}
impl TryFrom<&Path> for AbsolutePathBuf {
type Error = std::io::Error;