mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Store security risk scores as a snapshot (#38567)
## What changed - Replace the single `category` and `score` fields in `SecurityRiskScore` with a deterministic map of category names to scores. - Validate the full Guardian V2 classifier response before storing it as one thread extension value and, for non-ephemeral threads, one rollout item. - Cover serialization and rollout loading with snapshots containing multiple score categories. GitOrigin-RevId: 24525de691f96bd34ccfe04acab2f01aca309837
This commit is contained in:
@@ -16,6 +16,7 @@ use codex_rollout::CompactedItem;
|
||||
use codex_rollout::RolloutItem;
|
||||
use codex_rollout::RolloutLine;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use super::*;
|
||||
use crate::protocol::v2::ThreadItem;
|
||||
@@ -202,8 +203,7 @@ fn ignores_legacy_abort_without_turn_id_and_context_only_records() {
|
||||
window_id: None,
|
||||
}));
|
||||
let security_risk = project(RolloutItem::SecurityRiskScore(SecurityRiskScore {
|
||||
category: "action_risk".to_string(),
|
||||
score: 0.92,
|
||||
scores: BTreeMap::from([("action_risk".to_string(), 0.92)]),
|
||||
}));
|
||||
|
||||
assert!(aborted.is_empty());
|
||||
|
||||
Reference in New Issue
Block a user