Expand description
Brainwires Agents - Agent orchestration, coordination, and lifecycle management
This crate provides the multi-agent infrastructure for autonomous task execution:
§Core Components
- CommunicationHub - Inter-agent messaging bus with 50+ message types
- FileLockManager - File access coordination with deadlock detection
- ResourceLockManager - Scoped resource locking with heartbeat-based liveness
- OperationTracker - Operation tracking with heartbeat-based liveness checking
- ValidationLoop - Quality checks before agent completion (Bug #5 prevention)
- TaskManager - Hierarchical task decomposition and dependency tracking
- TaskQueue - Priority-based task scheduling with dependency awareness
§Coordination Patterns
- ContractNet - Bidding protocol for agent negotiation
- Saga - Compensating transactions for distributed operations
- OptimisticConcurrency - Optimistic locking with version-based conflict detection
- WaitQueue - Queue-based coordination primitives
- MarketAllocation - Market-based task allocation
- ThreeStateModel - State snapshots for rollback support
§Analysis & Validation
- ResourceChecker - Conflict detection and resolution
- ValidationAgent - Rule-based validation
- Confidence - Response confidence scoring
- WorktreeManager - Git worktree management for agent isolation
§Feature Flags
tools- Enable validation tool integration (check_duplicates, verify_build, check_syntax)
Re-exports§
pub use agent_manager::AgentInfo;pub use agent_manager::AgentManager;pub use agent_manager::AgentResult;pub use agent_manager::SpawnConfig;pub use agent_tools::AgentToolRegistry;pub use communication::AgentMessage;pub use communication::CommunicationHub;pub use communication::ConflictInfo;pub use communication::ConflictType;pub use communication::GitOperationType;pub use file_locks::FileLockManager;pub use file_locks::LockType;pub use operation_tracker::OperationTracker;pub use resource_checker::ConflictCheck;pub use resource_checker::ResourceChecker;pub use resource_locks::ResourceLockGuard;pub use resource_locks::ResourceLockManager;pub use resource_locks::ResourceScope;pub use resource_locks::ResourceType as ResourceLockType;pub use task_manager::TaskManager;pub use task_manager::format_duration_secs;pub use task_queue::TaskQueue;pub use worktree::WorktreeManager;pub use access_control::AccessControlManager;pub use access_control::ContentionStrategy;pub use access_control::LockBundle;pub use access_control::LockPersistence;pub use git_coordination::GitCoordinator;pub use git_coordination::GitLockRequirements;pub use git_coordination::GitOperationLocks;pub use git_coordination::GitOperationRunner;pub use git_coordination::get_lock_requirements;pub use git_coordination::git_tools;pub use workflow::WorkflowBuilder;pub use workflow::WorkflowContext;pub use workflow::WorkflowResult;pub use contract_net::ContractNetManager;pub use market_allocation::MarketAllocator;pub use optimistic::OptimisticController;pub use saga::SagaExecutor;pub use state_model::StateModelProposedOperation;pub use state_model::StateSnapshot;pub use state_model::ThreeStateModel;pub use wait_queue::WaitQueue;pub use execution_graph::ExecutionGraph;pub use execution_graph::RunTelemetry;pub use execution_graph::StepNode;pub use execution_graph::ToolCallRecord;pub use brainwires_core;pub use brainwires_tool_runtime;
Modules§
- access_
control - Unified access control manager for inter-agent coordination
- agent_
manager - Agent lifecycle management —
AgentManagertrait +SpawnConfig. AgentManager trait and supporting types for agent lifecycle abstraction - agent_
tools - Pre-built MCP tools for agent operations —
AgentToolRegistry. Agent Management Tools for MCP - communication
- Inter-agent communication hub and message types
- contract_
net - Contract-Net Protocol for Task Allocation
- execution_
graph - Execution DAG and telemetry for TaskAgent runs
- file_
locks - File locking system for multi-agent coordination
- git_
coordination - Git operation coordination for multi-agent systems
- market_
allocation - Market-Based Resource Allocation with Priority Bidding
- operation_
tracker - Operation tracker with heartbeat-based liveness checking
- optimistic
- Optimistic Concurrency with Conflict Resolution
- otel
- OpenTelemetry export for agent execution traces
- personas
- Pluggable persona construction for any chat agent (e.g.
ChatAgentinbrainwires-inference). - prelude
- Prelude module for convenient imports — coordination + patterns + schema.
- resource_
checker - Cross-resource conflict detection
- resource_
locks - Resource locking system for build/test/git coordination
- roles
- Agent role definitions for constrained, least-privilege execution.
- saga
- Saga-Style Compensating Transactions
- state_
model - Three-State Model for comprehensive state tracking
- task_
manager - Task Manager - Manages a tree-structured task list
- task_
queue - Priority-based task queue for agent scheduling
- wait_
queue - Wait queue implementation for resource coordination
- workflow
- Workflow Graph Builder — Declarative DAG-based workflow pipelines
- worktree
- Git Worktree Management for Agent Isolation
Enums§
- PreHook
Decision - Decision returned by a
ToolPreHookbefore a tool call.
Traits§
- Tool
PreHook - Pluggable pre-execution hook for semantic tool validation.