Skip to content

API Reference parrot.tools.execution_plan.runs

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

parrot.tools.execution_plan.runs

View source

Checkpoint-derived run resolution for ExecutionPlanToolkit (FEAT-585 M3).

The checkpoint is the SOLE persisted execution state (spec §2, §8 D3): there is no receipt store, tombstone or second persisted run object. Everything an agent-facing tool needs — status, artifacts, resume eligibility, repair lineage — is derived fresh from the latest checkpoint(s) by this module.

Registration (register_plan_checkpoint_types) must run before ANY checkpoint encode or decode touches an ArtifactRef — otherwise FlowStateSerializer degrades it to a lossy repr (finding R1) and project_run fails closed with checkpoint_invalid rather than silently trusting a repr() string.

Class PlanRunResolver

Resolve every agent-facing run operation from the same authority (the checkpoint).

Parameter Type Default Description
store Optional[CheckpointStore]
durable_store Optional[CheckpointStore]
scope Optional[TaskScope]
cache Dict[str, PlanRun]

Method PlanRunResolver.resolve

Resolve latest authorized lineage; classify misses by configured tier capability.

resolve(run_id: str) -> PlanRun

Parameter Type Default Description
run_id str

Returns: PlanRun

Method PlanRunResolver.envelope

Build the response envelope from a resolved run.

envelope(run: PlanRun) -> PlanRecoveryEnvelope

Parameter Type Default Description
run PlanRun

Returns: PlanRecoveryEnvelope

Function classify_miss

§8 D3: durable tier configured → unknown_run; ephemeral-only → missing_or_expired; none → checkpoint_unavailable.

classify_miss(store: Optional[CheckpointStore], durable_store: Optional[CheckpointStore]) -> str

Parameter Type Default Description
store Optional[CheckpointStore]
durable_store Optional[CheckpointStore]

Returns: str

Function plan_fingerprint

sha256 over canonical JSON of the effective plan.

plan_fingerprint(plan: ExecutionPlan) -> str

Parameter Type Default Description
plan ExecutionPlan

Returns: str

Function process_identity

host:pid — identity of memory-mode artifacts (§2).

process_identity() -> str

Returns: str

Function project_run

Derive typed refs, progress and status; reject lossy or inconsistent state.

project_run(checkpoint: FlowCheckpoint, *, metadata: PlanRunMetadata) -> PlanRun

Parameter Type Default Description
checkpoint FlowCheckpoint
metadata PlanRunMetadata

Returns: PlanRun

Function read_run_metadata

Parse the plan_run envelope; anything malformed is checkpoint_invalid.

read_run_metadata(checkpoint: FlowCheckpoint) -> PlanRunMetadata

Parameter Type Default Description
checkpoint FlowCheckpoint

Returns: PlanRunMetadata

Function register_plan_checkpoint_types

Idempotently register ArtifactRef before any checkpoint encode or decode (R1).

register_plan_checkpoint_types() -> None

Function select_latest

Greatest checkpoint_id across configured tiers; equal ids with different state are corruption.

select_latest(store: Optional[CheckpointStore], durable_store: Optional[CheckpointStore], flow_id: str) -> Optional[FlowCheckpoint]

Parameter Type Default Description
store Optional[CheckpointStore]
durable_store Optional[CheckpointStore]
flow_id str

Returns: Optional[FlowCheckpoint]

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