Skip to content

API Reference parrot.tools.execution_plan.checkpoint

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.execution_plan.checkpoint

View source

Plan-specific checkpoint policy around the existing flow scheduler.

Class LeaseDelegatingStore

Delegate store calls while handing the continuation lease to a resumed flow.

Parameter Type Default Description
inner CheckpointStore
root_flow_id str
holder str
leased_flow_ids set[str]

Method LeaseDelegatingStore.acquire_lease

Hand off covered leases and acquire all other flow leases normally.

acquire_lease(flow_id: str, holder: str, ttl: int = 60) -> bool

Parameter Type Default Description
flow_id str
holder str
ttl int 60

Returns: bool

Method LeaseDelegatingStore.renew_lease

Renew a covered lease with the continuation's real holder.

renew_lease(flow_id: str, holder: str, ttl: int = 60) -> bool

Parameter Type Default Description
flow_id str
holder str
ttl int 60

Returns: bool

Method LeaseDelegatingStore.release_lease

Keep covered leases owned by the continuation until its exit.

release_lease(flow_id: str, holder: str) -> None

Parameter Type Default Description
flow_id str
holder str

Method LeaseDelegatingStore.put

Reject delayed older writes while permitting equal-id final rewrites.

put(checkpoint: FlowCheckpoint) -> None

Parameter Type Default Description
checkpoint FlowCheckpoint

Method LeaseDelegatingStore.latest

Delegate latest-checkpoint lookup.

latest(flow_id: str) -> FlowCheckpoint | None

Parameter Type Default Description
flow_id str

Returns: FlowCheckpoint | None

Method LeaseDelegatingStore.get

Delegate checkpoint lookup by id.

get(flow_id: str, checkpoint_id: int) -> FlowCheckpoint | None

Parameter Type Default Description
flow_id str
checkpoint_id int

Returns: FlowCheckpoint | None

Method LeaseDelegatingStore.history

Delegate checkpoint history lookup.

history(flow_id: str, limit: int = 10) -> list[FlowCheckpoint]

Parameter Type Default Description
flow_id str
limit int 10

Returns: list[FlowCheckpoint]

Method LeaseDelegatingStore.list_flows

Delegate flow listing.

list_flows(status: str | None = None) -> list[dict[str, Any]]

Parameter Type Default Description
status str | None None

Returns: list[dict[str, Any]]

Method LeaseDelegatingStore.delete_flow

Delegate flow deletion.

delete_flow(flow_id: str) -> None

Parameter Type Default Description
flow_id str

Method LeaseDelegatingStore.close

Leave the borrowed inner store open.

close() -> None

Class PlanContinuation

Hold one root lease across validation, authoring, and flow execution.

Parameter Type Default Description
run PlanRun
store Optional[CheckpointStore]
durable_store Optional[CheckpointStore] None
ttl int 60

Method PlanContinuation.raise_if_lease_lost

Raise a structured error when the heartbeat has lost the root lease.

raise_if_lease_lost() -> None

Method PlanContinuation.flow_store

Return a store that hands the root lease to resumed flow checkpointers.

flow_store(*extra_flow_ids: str) -> CheckpointStore

Parameter Type Default Description
*extra_flow_ids str ()

Returns: CheckpointStore

Class PlanFlow

Apply plan-specific checkpoint policy around the existing scheduler.

Parameter Type Default Description
name str
**kwargs Any {}

Function build_plan_flow

Compile a plan and bind its run identity and checkpoint policy.

build_plan_flow(plan: ExecutionPlan, *, run: PlanRunMetadata, tool_manager: Any, working_memory: Any, agent_registry: AgentRegistry, permission_context: Any, step_mapping: Mapping[str, str], store: Optional[CheckpointStore], durable_store: Optional[CheckpointStore], delegates: Sequence[Any] = (), delegate_trace_sink: Optional[Any] = None, allow_delegate_side_effects: bool = False) -> PlanFlow

Parameter Type Default Description
plan ExecutionPlan
run PlanRunMetadata
tool_manager Any
working_memory Any
agent_registry AgentRegistry
permission_context Any
step_mapping Mapping[str, str]
store Optional[CheckpointStore]
durable_store Optional[CheckpointStore]
delegates Sequence[Any] ()
delegate_trace_sink Optional[Any] None
allow_delegate_side_effects bool False

Returns: PlanFlow

Function degraded_lock

Return the process-wide serialization lock for an uncheckpointed run.

degraded_lock(run_id: str) -> asyncio.Lock

Parameter Type Default Description
run_id str

Returns: asyncio.Lock

Function plan_run_projector

Project only the validated plan-run envelope into checkpoint shared data.

plan_run_projector(ctx: FlowContext) -> Dict[str, Any]

Parameter Type Default Description
ctx FlowContext

Returns: Dict[str, Any]

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally