- Exclude problematic markdown files from linting (existing legacy issues) - Make clippy check less aggressive (warnings only, not -D warnings) - Move cargo test to manual stage (too slow for pre-commit) - Exclude SVG files from end-of-file-fixer and trailing-whitespace - Add markdown linting exclusions for existing documentation This allows pre-commit hooks to run successfully on new code without blocking commits due to existing issues in legacy documentation files.
57 lines
1.5 KiB
Rust
57 lines
1.5 KiB
Rust
// Agent coordination abstraction layer
|
|
// Decouples agent orchestration from swarm implementation
|
|
|
|
use async_trait::async_trait;
|
|
|
|
/// Abstraction for agent coordination/load balancing.
|
|
/// Decouples agent orchestration from swarm implementation details.
|
|
#[async_trait]
|
|
pub trait SwarmCoordination: Send + Sync {
|
|
/// Register agent profiles with coordination layer.
|
|
async fn register_profiles(&self, profiles: Vec<AgentProfile>) -> anyhow::Result<()>;
|
|
|
|
/// Get best agent for task (load-balanced).
|
|
async fn select_agent(
|
|
&self,
|
|
task_type: &str,
|
|
required_expertise: Option<&str>,
|
|
) -> anyhow::Result<AgentAssignment>;
|
|
|
|
/// Report task completion (update load/metrics).
|
|
async fn report_completion(
|
|
&self,
|
|
agent_id: &str,
|
|
success: bool,
|
|
duration_ms: u64,
|
|
) -> anyhow::Result<()>;
|
|
|
|
/// Get current agent load (for monitoring).
|
|
async fn agent_load(&self, agent_id: &str) -> anyhow::Result<AgentLoad>;
|
|
}
|
|
|
|
/// Profile used by coordination layer (internal to agents crate).
|
|
/// Decouples from swarm's AgentProfile type.
|
|
#[derive(Clone, Debug)]
|
|
pub struct AgentProfile {
|
|
pub id: String,
|
|
pub role: String,
|
|
pub max_concurrent_tasks: usize,
|
|
pub success_rate: f64,
|
|
}
|
|
|
|
/// Assignment result.
|
|
#[derive(Clone, Debug)]
|
|
pub struct AgentAssignment {
|
|
pub agent_id: String,
|
|
pub agent_name: String,
|
|
pub confidence: f64,
|
|
}
|
|
|
|
/// Agent load snapshot.
|
|
#[derive(Clone, Debug)]
|
|
pub struct AgentLoad {
|
|
pub agent_id: String,
|
|
pub current_tasks: usize,
|
|
pub capacity: usize,
|
|
}
|