Extract Guardian review policy into a dedicated crate (#44227)

## What changed

Move assessment parsing and schema, model selection, review outcomes, retry handling, and rejection circuit breakers into `codex-guardian-reviewer`. Update core to use the extracted APIs while retaining session execution and decision enforcement in the host.

## Testing

Move existing assessment, circuit breaker, and retry tests into the new crate, including coverage for transient errors, cancellation, and deadlines.

GitOrigin-RevId: 96ec9989a0066acb012bf3bec0b9f7d8bf11a4ef
This commit is contained in:
jif authored and copyberry committed 2026-09-09 17:31:37 +00:00
1 parent a2e83a783e
commit e8e7103cb9
19 files changed
+730 -570

No files matched your search

+2 -2
View File
@@ -362,8 +362,8 @@ pub(crate) fn guardian_truncate_text(content: &str, token_cap: usize) -> (String
)
}
use super::assessment::guardian_output_contract_prompt;
pub use super::assessment::parse_guardian_assessment;
use codex_guardian_reviewer::guardian_output_contract_prompt;
pub use codex_guardian_reviewer::parse_guardian_assessment;
pub(crate) const BUNDLED_GUARDIAN_POLICY: &str = include_str!("../../assets/guardian/policy.md");
pub(crate) const BUNDLED_GUARDIAN_POLICY_TEMPLATE: &str =