// Validation error types

/// Choreography validation errors
#[derive(Debug, Clone, thiserror::Error)]
pub enum ValidationError {
    #[error("Role {0} not declared in choreography")]
    UndefinedRole(String),

    #[error("Recursive variable {0} not bound")]
    UnboundVariable(String),

    #[error("Choice role {0} must be sender in all branches")]
    InvalidChoice(String),

    #[error("Deadlock detected in protocol")]
    Deadlock,

    #[error("Role {0} is not used in protocol")]
    UnusedRole(String),

    #[error("Extension error: {0}")]
    ExtensionError(String),

    #[error("Duplicate proof bundle declaration: {0}")]
    DuplicateProofBundle(String),

    #[error("Required proof bundle is not declared: {0}")]
    MissingProofBundle(String),

    #[error(
        "ProtocolMachine-core operation requires capability not covered by required bundles: {0}"
    )]
    MissingCapability(String),
}
