Skip to main content

Module planner

Module planner 

Source
Expand description

B5 — the decomposition planner.

Turns a natural-language goal into footprint-annotated Subtasks and a parallel schedule. Follows car-builder’s injected-generate pattern: the caller supplies a generate closure (tests pass a fake; the daemon passes inference), and the planner runs prompt → generate → parse → verify → repair. The verify step is the B4 footprint analyzer: if the model double-assigned a symbol (two subtasks declaring the same write), that surfaces as a conflict and is fed back for repair.

Planning never bypasses the merge-verify gate — a produced plan is only a proposal; correctness is still established per-subtask and at the union by the gate during run_farm_out. The planner’s decomposability check is purely advisory: when no real parallelism is found it recommends a single session instead.

Structs§

DecomposeResult
Outcome of decomposing a goal.

Functions§

decompose
Decompose goal into footprint-annotated subtasks. generate(prompt) returns the model’s raw response. Repairs up to max_attempts times when the response won’t parse or the declared footprints conflict.
parse_plan
Parse a model response into footprint-annotated subtasks. Tolerant of markdown fences / preamble: tries a direct parse, then the first {...} block.