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
// T26 — restriction-category lint on production code only.
// `#[cfg(test)]` modules inside production sources DO see this when
// invoked via `cargo build`, but `cargo test` evaluates `not(test)`
// as false (test cfg is on) and silences the warning everywhere —
// which is what we want: tests panic deliberately via unwrap, prod
// code should `.expect("invariant: ...")` or propagate.
//! cpm-planner: a textbook Critical Path Method (CPM) planner, exposed as a
//! standalone MCP server.
//!
//! The CPM kernel does the forward pass (earliest start/finish), backward pass
//! (latest start/finish), slack computation, critical-path identification,
//! parallel batch grouping, and bottleneck (ROI) analysis.
//!
//! On top of that kernel, [`BasicCpmPlanner`] implements the lock-aware
//! [`Planner`](ports::Planner) trait: callers submit a [`PlanGraph`](plan::PlanGraph),
//! then acquire / heartbeat / release locks on disjoint cohorts of deliverables
//! so that multiple workers can run in parallel without stepping on each other.
//! [`PlanServer`] surfaces those operations as MCP tools (`plan.submit`,
//! `plan.acquire_cohort`, …) over stdio, so any MCP-speaking client — Claude
//! Code, Cursor, a custom orchestrator, or an mcp-flowgate workflow `connection`
//! — can drive it.
//!
//! # Layout
//!
//! - [`plan`] — the wire/domain model (deliverables, cohorts, locks, errors).
//! - [`ports`] — the [`Planner`](ports::Planner) trait.
//! - [`algorithm`] / [`task`] — the pure CPM kernel and its internal model
//! (the `Task` types carry ES/EF/LS/LF/slack/batching state the wire model
//! doesn't need to expose).
//! - [`planner`] — [`BasicCpmPlanner`], the lock-aware implementation.
//! - [`server`] — the MCP tool façade.
//! - [`audit`] — the lock-lifecycle audit surface.
//!
//! This crate has no dependency on mcp-flowgate; it is consumed purely over the
//! MCP protocol.
pub use CpmAlgorithm;
pub use ;
pub use ;
pub use ;
pub use ;