use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ValidateError {
#[error("V001: Baseline directory not found: {path}")]
BaselineNotFound { path: PathBuf },
#[error("V002: Invalid baseline manifest: {reason}")]
InvalidManifest { reason: String },
#[error("V003: Baseline version mismatch: expected {expected}, found {found}")]
VersionMismatch { expected: String, found: String },
#[error("V004: Syscall count mismatch: baseline={baseline}, current={current}")]
SyscallCountMismatch { baseline: usize, current: usize },
#[error(
"V005: Syscall sequence mismatch at index {index}: expected {expected}, found {found}"
)]
SequenceMismatch { index: usize, expected: String, found: String },
#[error("V006: Timing regression: {syscall} ({baseline_ms:.2}ms -> {actual_ms:.2}ms, {delta_percent:+.1}%)")]
TimingRegression { syscall: String, baseline_ms: f64, actual_ms: f64, delta_percent: f64 },
#[error("V007: Canary output mismatch: expected {expected:?}, found {found:?}")]
CanaryMismatch { expected: String, found: String },
#[error("V008: APR model not found: {path}")]
AprModelNotFound { path: PathBuf },
#[error("V009: Tensor statistics violation: {tensor} - {reason}")]
TensorStatsViolation { tensor: String, reason: String },
#[error("V010: Configuration error: {reason}")]
ConfigError { reason: String },
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("JSON error: {0}")]
JsonError(#[from] serde_json::Error),
#[error("Trace capture failed: {0}")]
TraceCaptureError(String),
}
pub type Result<T> = std::result::Result<T, ValidateError>;