chore: add approval metric (#8970)

This commit is contained in:
jif-oai
2026-01-09 13:10:31 +00:00
committed by GitHub
parent 225614d7fb
commit e2e3f4490e
5 changed files with 38 additions and 8 deletions

View File

@@ -1878,6 +1878,20 @@ pub enum ReviewDecision {
Abort,
}
impl ReviewDecision {
/// Returns an opaque version of the decision without PII. We can't use an ignored flag
/// on `serde` because the serialization is required by some surfaces.
pub fn to_opaque_string(&self) -> &'static str {
match self {
ReviewDecision::Approved => "approved",
ReviewDecision::ApprovedExecpolicyAmendment { .. } => "approved_with_amendment",
ReviewDecision::ApprovedForSession => "approved_for_session",
ReviewDecision::Denied => "denied",
ReviewDecision::Abort => "abort",
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, TS)]
#[serde(tag = "type", rename_all = "snake_case")]
#[ts(tag = "type")]