1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
//! 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-export core types
pub use brainwires_core;
// Re-export the tool runtime for ToolExecutor / ToolRegistry trait surface.
pub use brainwires_tool_runtime;
// ── LLM-driven workhorses moved to brainwires-inference in Phase 11f ─────────
// chat_agent, summarization, planner_agent, judge_agent, validator_agent,
// validation_agent, validation_loop, cycle_orchestrator, plan_executor,
// system_prompts, task_agent — see crates/brainwires-inference/
// ── Personas (pluggable system-prompt assembly) ──────────────────────────────
// agent_hooks moved to brainwires-inference in Phase 11f (TaskAgent-coupled).
// runtime + context moved to brainwires-inference in Phase 11f (the
// AgentRuntime drives the inference workhorses; AgentContext owns the
// AgentLifecycleHooks trait object).
// ── Schema + lifecycle ───────────────────────────────────────────────────────
// pool moved to brainwires-inference in Phase 11f (TaskAgent pool, not generic).
// ── Core components ──────────────────────────────────────────────────────────
// `confidence` moved to `brainwires-core` in Phase 11a; the agent-side
// shim was dropped in Phase 11g. Use `brainwires_core::confidence::*`
// directly.
// ── Coordination patterns ────────────────────────────────────────────────────
// ── Access control ─────────────────────────────────────────────────────────
// ── Agent management (lifecycle trait + MCP tool registry) ─────────────────
//
// Moved out of brainwires-network in Phase 2 — both modules import only
// brainwires_core/serde/anyhow/async_trait, so they belong here with the
// rest of the agent-runtime surface.
/// Agent lifecycle management — `AgentManager` trait + `SpawnConfig`.
/// Pre-built MCP tools for agent operations — `AgentToolRegistry`.
pub use ;
pub use AgentToolRegistry;
// ── Git coordination ───────────────────────────────────────────────────────
// plan_executor moved to brainwires-inference in Phase 11f.
// task_orchestrator moved to brainwires-inference in Phase 11f
// (TaskAgent-coupled, not a generic orchestrator).
// ── Workflow graph builder ───────────────────────────────────────────────────
// ── OpenTelemetry export ─────────────────────────────────────────────────────
// Eval — extracted to its own brainwires-eval crate in Phase 11e.
// MDAP — extracted to its own brainwires-mdap crate in Phase 11b.
// SEAL — extracted to its own brainwires-seal crate in Phase 11d.
// Skills — extracted to its own brainwires-skills crate in Phase 11c.
// ── Analysis ────────────────────────────────────────────────────────────────
// validation_agent + validation_loop moved to brainwires-inference in Phase 11f.
// ── Re-exports ───────────────────────────────────────────────────────────────
// agent_hooks re-exports moved to brainwires-inference in Phase 11f
// (the trait references TaskAgentResult, which is TaskAgent-specific).
// AgentRuntime + run_agent_loop re-exports moved to brainwires-inference in
// Phase 11f.
// Core components
pub use ;
// confidence types moved to brainwires-core in Phase 11a; re-export shim
// dropped in Phase 11g. Import from `brainwires_core::confidence::*` directly.
pub use ;
pub use OperationTracker;
pub use ;
pub use ;
pub use ;
pub use TaskQueue;
pub use WorktreeManager;
// Access control
pub use ;
// Git coordination
pub use ;
// Task orchestration re-exports moved to brainwires-inference in Phase 11f
// (TaskAgent-coupled).
// Workflow graph builder
pub use ;
// Coordination patterns
pub use ContractNetManager;
pub use MarketAllocator;
pub use OptimisticController;
pub use SagaExecutor;
pub use ;
pub use WaitQueue;
// Schema + lifecycle (AgentContext re-export moved to brainwires-inference in 11f)
pub use ;
pub use ;
// pool re-exports moved to brainwires-inference in Phase 11f.
// SEAL re-exports — extracted to brainwires-seal in Phase 11d.
// LLM-driven workhorses (chat_agent, planner_agent, judge_agent, validator_agent,
// validation_agent, validation_loop, cycle_orchestrator, plan_executor,
// summarization, system_prompts, task_agent) — extracted to brainwires-inference
// in Phase 11f. Import from `brainwires_inference::*` directly or via
// `brainwires::inference::*` (facade).
/// Prelude module for convenient imports — coordination + patterns + schema.
///
/// LLM-driven workhorses (`ChatAgent`, `TaskAgent`, planner/judge/validator,
/// validation_loop, cycle_orchestrator, plan_executor, system_prompts,
/// summarization) live in `brainwires-inference` since Phase 11f. Import
/// from there directly or use the umbrella `brainwires::inference` module.