use uuid::Uuid;
#[derive(Debug, thiserror::Error)]
pub enum AuditError {
#[error("top_k_result_ids ({ids}) and retrieval_scores ({scores}) length mismatch")]
LengthMismatch { ids: usize, scores: usize },
#[error(
"query_lineage exceeds maximum size ({actual} bytes > {max} bytes); \
store hashes/IDs only, not raw payloads"
)]
LineageTooLarge { actual: usize, max: usize },
#[error("no tenant binding on the current session — bind a tenant first")]
NoTenantBinding,
#[error("signature verification failed for query_id {0}")]
SignatureMismatch(Uuid),
#[error(
"audit master key not configured or invalid — set JAMMI_AUDIT_MASTER_KEY \
to 32 bytes of hex (64 hex chars): {0}"
)]
MasterKey(String),
#[error("serde: {0}")]
Serde(#[from] serde_json::Error),
#[error("storage: {0}")]
Storage(String),
#[error("trigger broker: {0}")]
Broker(String),
}