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
2026-09-09 17:31:37 +00:00
committed by copyberry
parent a2e83a783e
commit e8e7103cb9
19 changed files with 730 additions and 570 deletions
+16
View File
@@ -2988,6 +2988,7 @@ dependencies = [
"codex-file-system",
"codex-git-utils",
"codex-guardian-context",
"codex-guardian-reviewer",
"codex-history",
"codex-home",
"codex-hooks",
@@ -3550,6 +3551,21 @@ dependencies = [
"serde_json",
]
[[package]]
name = "codex-guardian-reviewer"
version = "0.0.0"
dependencies = [
"anyhow",
"codex-analytics",
"codex-protocol",
"pretty_assertions",
"rand 0.9.3",
"serde",
"serde_json",
"tokio",
"tokio-util",
]
[[package]]
name = "codex-guardian-v2"
version = "0.0.0"