mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +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:
1 parent
08c48e3700
commit
aa905bb962
10 files changed
+41
-32
No files matched your search
@@ -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