Skip to main content

ag_protocol/
verification.rs

1//! Orchestration verification decisions returned by controller turns.
2
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6/// Controller disposition for one settled orchestration task.
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
8#[serde(rename_all = "snake_case")]
9#[schemars(
10    title = "VerificationVerdict",
11    description = "Controller disposition for one settled orchestration task."
12)]
13pub enum VerificationVerdict {
14    /// The task satisfies its approved acceptance criteria and may integrate.
15    Pass,
16    /// The task needs correction and must remain outside integration.
17    Flag,
18}
19
20/// Structured controller verdict for one settled orchestration task.
21#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
22#[schemars(
23    title = "VerificationVerdictItem",
24    description = "Structured verification decision for one task in an orchestration settlement \
25                   turn."
26)]
27pub struct VerificationVerdictItem {
28    /// Concise evidence or unmet requirement supporting the verdict.
29    #[schemars(
30        title = "reason",
31        description = "Concise evidence for a pass or the concrete unmet requirement for a flag."
32    )]
33    pub reason: String,
34    /// Stable task key copied exactly from the verification envelope.
35    #[schemars(
36        title = "task_key",
37        description = "Stable task key copied exactly from the verification envelope."
38    )]
39    pub task_key: String,
40    /// Whether the task may integrate or needs correction.
41    #[schemars(
42        title = "verdict",
43        description = "Whether the task passes verification or needs correction."
44    )]
45    pub verdict: VerificationVerdict,
46}