Move Guardian permission context into the shared section registry (#43538)

## What changed

Represent denied read paths and globs with `PermissionContext` and render them through a sync-only section in `codex-guardian-context`. Keep policy resolution in the host and preserve the existing permission warning in Guardian review prompts.

## Testing

Extend registry tests to verify permission sections appear only for synchronous reviews. Extend the session reuse test to check that resolved denied paths and globs appear in both the initial review request and the next review's delta.

GitOrigin-RevId: a966a14b367f1eedb5a577f7ed74a869559ae646
This commit is contained in:
felixxia-oai authored and copyberry committed 2026-09-07 18:10:05 +00:00
1 parent 93ac341410
commit 81f23bc186
11 files changed
+139 -26

No files matched your search

@@ -99,6 +99,7 @@ fn registered_transcript_preserves_shared_roles_and_node_repl_tool_attribution()
root_conversation: &[],
trusted_user_answers: &[],
planned_action: None,
permissions: None,
})
.expect("transcript collection should succeed");
@@ -172,6 +173,7 @@ fn excluded_tool_calls_still_attribute_included_results() {
root_conversation: &[],
trusted_user_answers: &[],
planned_action: None,
permissions: None,
})
.expect("transcript collection should succeed");
@@ -264,6 +266,7 @@ fn outputs_with_call_ids_or_explicit_names_are_retained() {
root_conversation: &[],
trusted_user_answers: &[],
planned_action: None,
permissions: None,
})
.expect("transcript collection should succeed");
let mut expected = vec![
@@ -310,6 +313,7 @@ fn reused_registry_applies_current_history_sources_and_entry_limits() {
root_conversation: &[],
trusted_user_answers: &[],
planned_action: None,
permissions: None,
})
.expect("transcript collection should succeed");
assert_eq!(
@@ -343,6 +347,7 @@ fn reused_registry_applies_current_history_sources_and_entry_limits() {
root_conversation: &[],
trusted_user_answers: &[],
planned_action: None,
permissions: None,
})
.expect("transcript collection should succeed");
let mut expected = vec![ConversationTranscriptEntry {