Orchestration¶
Planning, subagents, and code verification.
Plan¶
Plan dataclass ¶
Plan execution - immutable state machine.
State machine: draft -> approved -> executing -> completed/cancelled. cancel() is available from any state.
approve ¶
draft -> approved.
Raises: ValueError: if the plan is not in draft status.
start_execution ¶
approved -> executing.
Raises: ValueError: if the plan is not in approved status.
mark_completed ¶
executing -> completed.
Raises: ValueError: if the plan is not in executing status.
update_step ¶
Update a step by id and return a new plan.
Raises: ValueError: if the step id is not found.
PlanStep¶
PlanStep dataclass ¶
Immutable plan step with state-transition helpers.
PlanStore Protocol¶
PlanStore ¶
Bases: Protocol
Store planoin - ISP: <=4 methods.
Multi-tenant: user_id + topic_id in each other.
InMemoryPlanStore¶
InMemoryPlanStore ¶
In-memory PlanStore with multi-tenant namespace isolation.
Namespace is set via set_namespace(user_id, topic_id). save() binds the plan to the current namespace. list_plans() filters by namespace.