Separate exec permission paths from core models (#33200)

## Why

Core filesystem permission models operate on native absolute paths, while exec
sandbox contexts must serialize paths as portable URIs.

## What changed

- Make the core filesystem permission and profile types concrete over
  `AbsolutePathBuf` instead of generic over their path representation.
- Add exec-specific permission types that convert native permission paths to
  `PathUri` values at the sandbox protocol boundary.
- Replace the legacy read/write-roots tuple with a named
  `LegacyReadWriteRoots` struct.

## Testing

- Add coverage that exec sandbox permission paths serialize as URIs and round
  trip through the filesystem protocol.

GitOrigin-RevId: a0ef5f8aba9bbfdf00a00fcc4f199314836bc85d
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-07-15 01:31:40 +00:00
1 parent 70a0b1eef8
commit 72b41c55fb
7 files changed
+292 -281

No files matched your search

@@ -290,7 +290,7 @@ fn write_permissions_for_paths_keep_dirs_outside_workspace_root() {
permissions
.and_then(|profile| profile.file_system)
.and_then(|fs| fs.legacy_read_write_roots())
.and_then(|(_read, write)| write),
.and_then(|roots| roots.write),
Some(vec![expected_outside])
);
}
@@ -1649,7 +1649,10 @@ async fn partial_request_permissions_grants_do_not_preapprove_new_permissions()
let approval_file_system = approval_permissions
.file_system
.expect("expected filesystem permissions");
let (approval_reads, approval_writes) = approval_file_system
let codex_protocol::models::LegacyReadWriteRoots {
read: approval_reads,
write: approval_writes,
} = approval_file_system
.legacy_read_write_roots()
.expect("expected legacy-compatible permissions");
assert!(approval_reads.as_ref().is_none_or(Vec::is_empty));
@@ -1657,7 +1660,10 @@ async fn partial_request_permissions_grants_do_not_preapprove_new_permissions()
let mut approval_writes = approval_writes.unwrap_or_default();
approval_writes.sort_by_key(|path| path.display().to_string());
let (_, expected_writes) = merged_permissions
let codex_protocol::models::LegacyReadWriteRoots {
write: expected_writes,
..
} = merged_permissions
.file_system
.expect("expected merged filesystem permissions")
.legacy_read_write_roots()