Function: renderPlan()
function renderPlan(plan: RawPlanView, options: RenderPlanOptions): string;Defined in: src/batteries/orchestration/render.ts:113
Render a plan as prose — the review surface an operator reads at the approval gate, or the re-consumption surface a model reads for a plan it did not author.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | RawPlanView | the RawPlanView to render. |
options | RenderPlanOptions | audience, view, and (for as_executed) the RunProjection to resolve against. |
Returns
string
the prose projection, as a single string.
Remarks
A PURE function of its arguments — no store access, no I/O, no clock. That is what keeps it testable and deterministic: the same plan plus the same options yields byte-identical output, and a snapshot test is a complete regression contract. It reads no PlanStore, resolves no live values, and registers nothing.
The as_planned view renders staged arguments as their provenance (a NodeRef names the node and selection it reads, never a fabricated value); the as_executed view resolves them against run.outputs. The operator view renders every side effect with its tool and arguments, every authority claim, every condition with its exact predicate, and ends with a deduplicated total-authority summary grouped by capability; the model view renders exact identifiers.
DETERMINISTIC and TOTAL — see the module doc. Not reversible.