use crate::deployment_truth::{PromotionReadinessStatusV1, SafetySeverityV1};
use thiserror::Error as ThisError;
#[derive(Debug, ThisError)]
pub enum PromotionReadinessError {
#[error("promotion readiness schema mismatch: expected {expected}, found {found}")]
SchemaVersionMismatch { expected: u32, found: u32 },
#[error("promotion readiness is missing required field: {field}")]
MissingRequiredField { field: &'static str },
#[error("promotion readiness status {status:?} does not match blocker count {blocker_count}")]
StatusBlockerMismatch {
status: PromotionReadinessStatusV1,
blocker_count: usize,
},
#[error("promotion readiness contains duplicate role: {role}")]
DuplicateRole { role: String },
#[error("promotion readiness role {role} has inconsistent restage state")]
RestageStateMismatch { role: String },
#[error("promotion readiness finding in {field} has severity {severity:?}")]
FindingSeverityMismatch {
field: &'static str,
severity: SafetySeverityV1,
},
#[error("promotion readiness field {field} must be a lowercase sha256 hex digest")]
InvalidSha256Digest { field: &'static str },
#[error("promotion readiness field {field} is inconsistent")]
LinkageMismatch { field: &'static str },
}