canic_host/deployment_truth/promotion/error/
readiness.rs1use crate::deployment_truth::{PromotionReadinessStatusV1, SafetySeverityV1};
2use thiserror::Error as ThisError;
3
4#[derive(Debug, ThisError)]
8pub enum PromotionReadinessError {
9 #[error("promotion readiness schema mismatch: expected {expected}, found {found}")]
10 SchemaVersionMismatch { expected: u32, found: u32 },
11 #[error("promotion readiness is missing required field: {field}")]
12 MissingRequiredField { field: &'static str },
13 #[error("promotion readiness status {status:?} does not match blocker count {blocker_count}")]
14 StatusBlockerMismatch {
15 status: PromotionReadinessStatusV1,
16 blocker_count: usize,
17 },
18 #[error("promotion readiness contains duplicate role: {role}")]
19 DuplicateRole { role: String },
20 #[error("promotion readiness role {role} has inconsistent restage state")]
21 RestageStateMismatch { role: String },
22 #[error("promotion readiness finding in {field} has severity {severity:?}")]
23 FindingSeverityMismatch {
24 field: &'static str,
25 severity: SafetySeverityV1,
26 },
27 #[error("promotion readiness field {field} must be a lowercase sha256 hex digest")]
28 InvalidSha256Digest { field: &'static str },
29 #[error("promotion readiness field {field} is inconsistent")]
30 LinkageMismatch { field: &'static str },
31}