use thiserror::Error;
#[derive(Debug, Error)]
pub enum CrvError {
#[error("Dimension mismatch: expected {expected}, got {actual}")]
DimensionMismatch { expected: usize, actual: usize },
#[error("Invalid stage: {0} (must be 1-6)")]
InvalidStage(u8),
#[error("Empty input: {0}")]
EmptyInput(String),
#[error("Session not found: {0}")]
SessionNotFound(String),
#[error("Encoding error: {0}")]
EncodingError(String),
#[error("Attention error: {0}")]
AttentionError(#[from] ruvector_attention::AttentionError),
#[error("Serialization error: {0}")]
SerializationError(#[from] serde_json::Error),
}
pub type CrvResult<T> = Result<T, CrvError>;