Unify Guardian context section collection (#42076)

## What changed

- Add typed context sections for root-conversation evidence, trusted user answers, and conversation transcripts to `codex-guardian-context`.
- Use the shared section registry when building core Guardian prompts and asynchronous Guardian V2 scoring context.
- Preserve source-role labeling while delivering authorization evidence as user-role context, and fail closed when context collection fails.

## Testing

- Cover shared section ordering and role preservation for synchronous and asynchronous targets.
- Verify trusted user answers appear exactly once as user-role input in Guardian V2 approval flows.

GitOrigin-RevId: 1d5d793ffbf166077411a66e85e039596907fb7e
This commit is contained in:
felixxia-oai authored and copyberry committed 2026-09-01 15:22:21 +00:00
1 parent d141438342
commit 2350823caa
15 files changed
+357 -108

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ impl SectionContributor for ConversationTranscriptSection {
}
fn contribute(&self, input: &SectionInput<'_>) -> Result<Option<ContextSection>, SectionError> {
Ok(Some(ContextSection {
Ok(Some(ContextSection::ConversationTranscript {
items: collect_transcript(input.history, input.transcript),
}))
}