Skip to main content

Module plan

Module plan 

Source
Expand description

AI Plan snapshot.

Plan stores one immutable planning revision for an Intent. It records the chosen strategy, the stable step structure, and the frozen planning context used to derive that strategy.

§How to use this object

  • Create a base Plan after analyzing an Intent.
  • Create a new Plan revision when replanning is needed.
  • Use multi-parent revisions to represent merged planning branches.
  • Freeze planning-time context through context_frames.
  • Keep analysis-time context on the owning Intent; do not reuse this field for prompt-analysis inputs.

§How it works with other objects

  • Intent is the canonical owner via Plan.intent.
  • Task.origin_step_id points back to the logical step that spawned delegated work.
  • PlanStepEvent records runtime step status, produced context, outputs, and spawned tasks.
  • ContextFrame stores incremental context facts referenced by the plan or step events.

§How Libra should call it

Libra should write a new Plan whenever the strategy itself changes. Libra should not mutate a stored plan to reflect execution progress; instead it should append PlanStepEvent objects and keep the active plan head in scheduler state.

Structs§

Plan
Immutable planning revision for one Intent.
PlanStep
Immutable step definition inside a Plan.