Move trusted skill evidence into the Guardian context registry (#43599)

## What changed

Move trusted skill rendering into `codex-guardian-context` as `TrustedSkills` and collect it through an async-only context section. Pass the collected section to the sampler, preserving the separate developer message and bounded JSON rendering. Omit skill paths from `Debug` output, exposing only their count.

## Testing

Move rendering tests alongside the shared type, covering multiple paths and escaped UTF-8 within the size budget. Extend registry tests to cover async-only inclusion, omission for empty input, section ordering, and path redaction in debug output.

GitOrigin-RevId: c0778067f19d31e693ca954aee1a7d7be8f9739a
This commit is contained in:
felixxia-oai
2026-09-07 21:38:25 +00:00
committed by copyberry
parent 2554239561
commit f5331dc237
14 changed files with 222 additions and 129 deletions
+4 -1
View File
@@ -248,7 +248,9 @@ pub(crate) async fn build_guardian_prompt_items_with_parent_turn(
push_text(text);
}
}
ContextSection::PreviousReviews(_) | ContextSection::TrustedTool(_) => {
ContextSection::PreviousReviews(_)
| ContextSection::TrustedTool(_)
| ContextSection::TrustedSkills(_) => {
unreachable!("trusted review and tool sections are async-only")
}
ContextSection::ConversationTranscript { .. } => {}
@@ -485,6 +487,7 @@ pub(super) fn collect_guardian_context(
permissions,
previous_reviews: None,
trusted_tool: None,
trusted_skill_paths: &[],
})
}