Remove legacy Guardian approval review paths (#43462)

## What changed

- Remove the `fast_decision` and `full_review` extension hooks and `ApprovalAssessment`, leaving `ApprovalReviewContributor::decide` as the approval decision interface.
- Remove the duplicate Guardian V2 fast-approval implementation and `StrictReviewReason` state.
- Require an explicit `GuardianReviewReason` for synchronous reviews.

## Testing

Migrate Guardian reviewer tests to the production `decide_approval` path and cached-score tests to the registry's decision interface.

GitOrigin-RevId: 1f9092c0ff5bb1eed0c63fa557fb3807e2e71564
This commit is contained in:
jif authored and copyberry committed 2026-09-07 13:02:46 +00:00
1 parent 8260619cb6
commit db0568dbbb
14 files changed
+342 -968

No files matched your search

@@ -4,9 +4,6 @@ use std::fmt;
use std::sync::Arc;
use codex_protocol::ThreadId;
use codex_protocol::approvals::GuardianAssessmentOutcome;
use codex_protocol::approvals::GuardianRiskLevel;
use codex_protocol::approvals::GuardianUserAuthorization;
use serde_json::Value;
use crate::ConversationHistorySnapshot;
@@ -15,19 +12,6 @@ use crate::ExtensionData;
/// Thread-local state installed only after Guardian V2's async classifier initializes.
pub struct GuardianV2Enabled;
/// Classification returned by an approval reviewer.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ApprovalAssessment {
/// Final allow-or-deny decision for the requested action.
pub outcome: GuardianAssessmentOutcome,
/// Risk level assigned to the action by the reviewer.
pub risk_level: GuardianRiskLevel,
/// Whether the conversation authorizes the requested action.
pub user_authorization: GuardianUserAuthorization,
/// Human-readable explanation of the assessment.
pub rationale: String,
}
/// Operational failure returned by an approval reviewer.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ApprovalReviewError {