//! Diagnostic types for the architectural checker. /// Severity level of an architectural diagnostic. #[derive(Debug, Clone, PartialEq)] pub enum Severity { Error, Warning, } /// A single architectural diagnostic (error or warning). #[derive(Debug, Clone)] pub struct ArchDiagnostic { pub severity: Severity, /// Rule identifier, e.g. "VBD-001". pub rule: String, pub message: String, /// Function name or other location hint. pub location: Option, } /// Type alias — an ArchError is an ArchDiagnostic with Severity::Error. pub type ArchError = ArchDiagnostic; /// Type alias — an ArchWarning is an ArchDiagnostic with Severity::Warning. pub type ArchWarning = ArchDiagnostic; impl ArchDiagnostic { pub fn error(rule: impl Into, message: impl Into, location: Option) -> Self { Self { severity: Severity::Error, rule: rule.into(), message: message.into(), location, } } pub fn warning(rule: impl Into, message: impl Into, location: Option) -> Self { Self { severity: Severity::Warning, rule: rule.into(), message: message.into(), location, } } }