Skip to main content

Crate cpm_planner

Crate cpm_planner 

Source
Expand description

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 trait: callers submit a 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 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).
  • plannerBasicCpmPlanner, 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.

Re-exports§

pub use algorithm::CpmAlgorithm;
pub use estimator::EffortEstimator;
pub use estimator::EstimationConfig;
pub use planner::BasicCpmPlanner;
pub use planner::ClockFn;
pub use planner::DEFAULT_EFFORT_HOURS;
pub use planner::DEFAULT_TTL;
pub use server::plan_tool_definitions;
pub use server::PlanServer;
pub use server::PLAN_TOOL_NAMES;
pub use server::TOOL_ACQUIRE_COHORT;
pub use server::TOOL_FORCE_RELEASE;
pub use server::TOOL_HEARTBEAT;
pub use server::TOOL_MARK_STATUS;
pub use server::TOOL_STATUS;
pub use server::TOOL_SUBMIT;
pub use task::Bottleneck;
pub use task::CriticalPathResult;
pub use task::Task;
pub use task::TaskBatch;
pub use task::TaskKind;
pub use task::TaskStatus;

Modules§

algorithm
CPM Algorithm Implementation
audit
Minimal audit surface for the planner’s lock-lifecycle events.
estimator
Effort Estimation for CPM Tasks
plan
SPEC §33 PA1 — Planner data model.
planner
BasicCpmPlanner — open-source Planner implementation.
ports
The lock-aware Planner trait — the seam between an MCP/host caller and a scheduling implementation. crate::planner::BasicCpmPlanner is the textbook Critical Path Method implementation shipped by this crate.
server
MCP tool surface for the open-source CPM planner.
task
CPM Task data structures