calute.operators.plans#

Plan-state manager for operator tooling.

Provides PlanStateManager, a thin wrapper around OperatorPlanState that exposes convenience methods for updating and summarising the current execution plan.

class calute.operators.plans.PlanStateManager[source]#

Bases: object

Manage per-runtime operator plan state.

Owns a single OperatorPlanState instance and provides methods to replace its contents and generate compact summaries suitable for the TUI status bar.

_state#

The underlying OperatorPlanState that holds the current plan steps, explanation, and revision counter.

property state: OperatorPlanState#

Return the current plan state.

Returns

The underlying OperatorPlanState instance.

summary() str[source]#

Return a compact plan summary string for the TUI.

Produces a comma-separated list of the first three steps in status:step format.

Returns

A human-readable summary string. Returns "No plan" when no steps have been recorded.

update(explanation: str | None, plan: list[dict[str, str]]) dict[source]#

Replace the current plan contents.

Delegates to OperatorPlanState.update() to atomically swap the explanation and step list.

Parameters
  • explanation – Optional short note describing the plan change or current situation.

  • plan – List of step dictionaries. Each dictionary should contain at least a "step" key and an optional "status" key (defaults to "pending").

Returns

The serialised plan state dictionary produced by OperatorPlanState.to_dict().