Skip to content

API Reference parrot.flows.dev_loop.sdd_coder.checkpoint

github-actions[bot] edited this page Nov 10, 2026 · 4 revisions

parrot.flows.dev_loop.sdd_coder.checkpoint

View source

Durable neutral handoff after authoritative execution settlement.

Spec sdd/specs/sdd-execution-optimization.spec.md (FEAT-584), module M4 (R5 "Checkpoint antes del code reviewer"). A scripts.sdd.review_checkpoint CLI is a SEPARATE process from the MCP engine, so it never has access to the engine's own in-memory tables (SddCoderEngine._executions, _validation_handles, ...) -- every fact this module relies on is re-derived from durable, on-disk state:

  • The execution's settlement is the ExecutionSnapshot end_execution (engine.py, TASK-3565) publishes OUTSIDE the worktree via ExecutionEvidenceStore.put_artifact, under <root>/executions/<execution_id>/artifacts/<sha256>.json. There is no index of which artifact IS the settlement -- this module scans that directory and keeps only artifacts that parse as a closed ExecutionSnapshot scoped to this (feature, worktree, execution_id), picking the highest generation when more than one exists. A settlement write that failed (end_execution's own persistence_degraded path) simply leaves nothing to find here -- checkpoint_busy follows naturally, never a fabricated "degraded but let's proceed".
  • "Settled validations" (spec R8) are read the same way: every BackgroundRegistration of kind == 'validation' registered under <root>/executions/<execution_id>/background/*.json (TASK-3563/3564/3565) is re-checked via the PUBLIC BackgroundRegistry.status() API -- never a cached outcome. A registry record that fails to parse is treated as unresolved (busy), never silently skipped: an unknown state is never zero activity (spec R8).

prepare_review_checkpoint never mutates execution state or the engine's close scripts -- it only reads the durable settlement/validations, hashes the spec/index/conventions and git refs it can observe directly, and publishes an immutable ReviewCheckpoint record under <root>/executions/<execution_id>/review/<checkpoint_id>.json (spec R3 layout). validate_review_checkpoint re-derives the SAME facts from scratch and rejects any drift -- it never approves the underlying code.

Alias BackgroundBudgetExceededError

Re-exported from parrot.flows.dev_loop.sdd_coder.background.BackgroundBudgetExceededError.

Alias BackgroundNotFoundError

Re-exported from parrot.flows.dev_loop.sdd_coder.background.BackgroundNotFoundError.

Alias BackgroundRegistration

Re-exported from parrot.flows.dev_loop.sdd_coder.optimization_models.BackgroundRegistration.

Alias BackgroundRegistry

Re-exported from parrot.flows.dev_loop.sdd_coder.background.BackgroundRegistry.

Class CheckpointBusyError

Execution not durably closed, or admitted work/validations not settled.

Spec R5: "Un estado desconocido no equivale a cero actividad" -- covers both a genuinely in-flight execution AND one this module simply cannot yet observe as closed/settled.

Class CheckpointError

Base class for every domain error this module/review_checkpoint.py raises.

Class CheckpointIncompleteError

Required evidence, hashes or scope binding are missing or mismatched.

Never a partial/best-effort checkpoint: spec R5 "sin aprobación sintética".

Class CheckpointStaleError

HEAD, branch, spec/index/convention hashes or evidence drifted since preparation.

Spec R5: "Si cambian, devolver checkpoint_stale y regenerar; ninguna aprobación anterior cubre el nuevo diff."

Alias EvidenceRef

Re-exported from parrot.flows.dev_loop.sdd_coder.optimization_models.EvidenceRef.

Alias ExecutionEvidenceStore

Re-exported from parrot.flows.dev_loop.sdd_coder.evidence.ExecutionEvidenceStore.

Alias ExecutionSnapshot

Re-exported from parrot.flows.dev_loop.sdd_coder.models.ExecutionSnapshot.

Attribute GIT_TIMEOUT_S

Type: float

Alias ReviewCheckpoint

Re-exported from parrot.flows.dev_loop.sdd_coder.optimization_models.ReviewCheckpoint.

Alias TaskScheduler

Re-exported from parrot.flows.dev_loop.task_scheduler.TaskScheduler.

Alias git_env

Re-exported from parrot.flows.dev_loop.procs.git_env.

Function load_review_checkpoint

Load a previously published checkpoint by its emitted ID -- never an arbitrary path.

load_review_checkpoint(execution_id: str, checkpoint_id: str, *, store: ExecutionEvidenceStore) -> ReviewCheckpoint

Parameter Type Default Description
execution_id str
checkpoint_id str
store ExecutionEvidenceStore

Returns: ReviewCheckpoint

Raises:

  • CheckpointIncompleteError — no such checkpoint was ever published, or its durable content is corrupted.

Attribute logger

Function prepare_review_checkpoint

Validate settlement and persist immutable identity, constraints and evidence.

prepare_review_checkpoint(*, feature: str, worktree: Path, execution_id: str, store: ExecutionEvidenceStore) -> ReviewCheckpoint

Parameter Type Default Description
feature str
worktree Path
execution_id str
store ExecutionEvidenceStore

Returns: ReviewCheckpoint

Raises:

  • ValueError — execution_id is not a canonical UUID.
  • CheckpointBusyError — the execution is not durably closed, still lists outstanding attempts/reservations/jobs, or an admitted validation has not settled.
  • CheckpointIncompleteError — the per-spec index/spec/conventions are unreadable, or the durable settlement is scoped to a different feature/worktree than requested.

Alias resolve_durable_root

Re-exported from parrot.flows.dev_loop.sdd_coder.telemetry.resolve_durable_root.

Alias resolve_index_path

Re-exported from parrot.flows.dev_loop.task_scheduler.resolve_index_path.

Alias run_bounded

Re-exported from parrot.flows.dev_loop.procs.run_bounded.

Function validate_review_checkpoint

Reject stale branch, SHA, criteria, conventions or unverifiable evidence.

Re-derives HEAD/branch/spec/index/convention hashes from scratch and re-verifies every durable evidence ref this checkpoint carries -- never trusts the checkpoint's own claims. Never approves the underlying code: a clean return means "still an accurate handoff", nothing more.

validate_review_checkpoint(checkpoint: ReviewCheckpoint, *, worktree: Path) -> None

Parameter Type Default Description
checkpoint ReviewCheckpoint
worktree Path

Raises:

  • CheckpointStaleError — branch, HEAD, spec/index/convention hashes, or any evidence ref has drifted since checkpoint was prepared.

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