Skip to main content

aivcs_core/role_orchestration/
error.rs

1//! Error types for role orchestration.
2
3/// Errors produced by the role orchestration layer.
4#[derive(Debug, thiserror::Error)]
5pub enum RoleError {
6    #[error("role {role} does not accept handoffs from {from}")]
7    UnauthorizedHandoff { role: String, from: String },
8
9    #[error("handoff token integrity check failed: {reason}")]
10    InvalidHandoffToken { reason: String },
11
12    #[error("task decomposition produced no subtasks for role {role}")]
13    EmptyDecomposition { role: String },
14
15    #[error("role conflict: {description}")]
16    ConflictDetected { description: String },
17
18    #[error("parallel role execution error: {detail}")]
19    ParallelExecutionFailed { detail: String },
20
21    #[error("domain error: {0}")]
22    Domain(#[from] crate::domain::error::AivcsError),
23}
24
25/// Result type for role orchestration operations.
26pub type RoleResult<T> = std::result::Result<T, RoleError>;