Move Guardian review evidence into the reviewer extension (#57702)

## What changed

Move review evidence storage, authorization snapshots, sender exchange selection,
and bounded Node REPL evidence into `codex-guardian-reviewer`. Update core to
call or re-export these APIs while retaining host-specific context rendering and
capture-mode selection.

Move the existing Node REPL evidence and text truncation tests alongside their
implementations in the reviewer crate.

GitOrigin-RevId: d851cd353cf9f31eb47ce13f43f6f935dc2f5d93
This commit is contained in:
jif
2026-10-28 11:25:13 +00:00
committed by copyberry
parent 13b0217567
commit e6de6a2423
19 changed files with 642 additions and 581 deletions
+2 -24
View File
@@ -187,30 +187,8 @@ pub enum ConfigRefreshOutcome {
pub use codex_guardian_context::GuardianRootMessage;
/// Authorization state that changes on genuine user input or history resets.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct GuardianAuthorizationVersion {
/// User-message/reset revision, preserved across compaction and internal context.
pub user_message_revision: u64,
/// False when required retained answers or root instructions are unavailable.
pub retained_context_complete: bool,
}
/// Root authorization state, selected messages and request-local originals from one snapshot.
#[derive(Debug, PartialEq)]
pub struct GuardianRootSnapshot {
/// Authoritative root from which this evidence was captured.
pub root_thread_id: ThreadId,
/// Distinguishes a history reset from additional authorization in the same history.
pub(crate) history_reset_version: u64,
pub authorization_version: GuardianAuthorizationVersion,
/// Confirmed assistant context is relevant to review but cannot authorize an action.
pub review_context_revision: u64,
pub messages: Vec<GuardianRootMessage>,
/// Request-local originals retained before the bounded compatibility projection.
pub(crate) request_candidates: Option<codex_guardian_context::RootConversationInput>,
pub trusted_skill_paths: Vec<String>,
}
pub use codex_guardian_reviewer::GuardianAuthorizationVersion;
pub use codex_guardian_reviewer::GuardianRootSnapshot;
pub struct CodexThread {
pub(crate) session: Arc<Session>,