car_multi/patterns/foreman/mod.rs
1//! The **Foreman** pattern — decompose a coding prompt, farm independent
2//! subtasks to external coding CLIs in isolated git worktrees, and verify the
3//! reassembly before integrating.
4//!
5//! Design and rationale:
6//! `docs/proposals/verified-parallel-coding-orchestrator.md`. Build order:
7//! `docs/plans/2026-06-12-001-feat-verified-parallel-coding-orchestrator-plan.md`.
8//!
9//! Path-B posture: the [`gate`] is the soundness boundary. Footprint analysis
10//! (future B4) is only an advisory scheduling hint and never gates correctness.
11//!
12//! Implemented so far:
13//! - **B1** — [`gate`]: the merge-verify gate (soundness boundary).
14//! - **B2** — [`harness`]: the farm-out harness (+ union integration).
15//! - **B4/B5** — footprint-aware scheduling in [`harness`] + the [`planner`].
16//! - **Fleet** — [`pool`]: the same run spread over several CAR instances.
17//! A [`pool::FleetPool`] is itself a [`harness::WorktreeAgent`], so the gate,
18//! the patch capture, and the union integration stay on the orchestrating
19//! host and remain the soundness boundary; only the editing moves.
20
21pub mod gate;
22pub mod harness;
23pub mod orchestrator;
24pub mod planner;
25// Named `pool`, not `fleet`: `car_multi::patterns::fleet` is an unrelated
26// in-process pattern (independent agents over a shared knowledge graph), and two
27// modules called `fleet` in one crate would be read as the same thing.
28pub mod pool;
29pub mod report;
30#[cfg(test)]
31pub(crate) mod test_verify;
32
33pub use gate::{
34 containment_violations, decide, duplicate_declarations, extract_changes, verify_changes,
35 AcceptanceBasis, BuildTestStatus, ChangeKind, ChangedSymbol, CheckOutcome,
36 ContainmentViolation, DeclaredFootprint, DuplicateDeclaration, FileChange, GateConfig,
37 GateEvidence, MergeVerdict, NoVerifyWaiver, PolicyDecision, SymbolRef,
38};
39pub use harness::{
40 capture_patch, files_in_patch, git_apply, integrate_and_verify, partition_by_files,
41 regional_replan, run_farm_out, run_farm_out_with_progress, AgentRunSummary, ApplyConflict,
42 BuildTestFailure, DuplicateBlame, FarmOutConfig, FarmOutResult, ForemanError, ForemanProgress,
43 ForemanProgressSink, IntegrationBlame, IntegrationResult, Subtask, SubtaskOutcome,
44 WorktreeAgent, WorktreeAgentRequest,
45};
46pub use orchestrator::{run_foreman, ForemanRunOutcome, RunMode};
47pub use planner::{decompose, parse_plan, DecomposeResult};
48pub use pool::{FailedAttempt, FleetPool, FleetWorker, Placement};
49pub use report::{
50 AcceptanceBasisDto, BuildTestDto, DuplicateDto, ForemanReport, GateEvidenceDto,
51 IntegrationReportDto, MergeVerdictDto, PlanReport, PlanSubtaskDto, SubtaskReportDto,
52 SymbolRefDto, FOREMAN_SCHEMA_VERSION,
53};