Plan-and-execute separates a task-level plan from the executor that advances it. The plan records dependencies and acceptance evidence; the executor selects ready work, records attempts, and persists progress. Shared execution state—not a model-written checklist—is what lets work branch, pause, resume, and recover. section 6.4
Use the pattern when interruption or partial completion makes an unqualified restart unsafe, or when dependencies must be constructed or revised at runtime. A short, read-only, safely repeatable task may be simpler as a chain or loop; a known sequence may need only ordinary application code. section 6.4 section 6.4.6 section 10.7.1
A durable execution design needs to:
- Persist the goal, plan version, dependencies, object references, step status, attempts, and acceptance evidence outside the model context. section 6.4 section 6.4.6
- Admit ready steps and mark them complete only when task-specific evidence confirms the external effect. A returned function, queued job, or green command alone may not establish acceptance. section 11.2.3 section 6.4.6
- After failure, freeze accepted work, verify uncertain effects, and limit replanning to the affected pending scope. Local repair must not erase accepted effects or rewrite the goal. section 6.4 section 6.4.6
- Measure recovery success, accepted-effect replay, unknown-state age, replan scope, blocked work, latency, and completion. section 6.4
Cross-repository schema change
A schema definition, generated client, and consuming service form a versioned dependency graph. The plan records which revisions and published artifacts already exist, so a restart does not blindly repeat work. Each repository step can use a checked inspection-edit-verification chain; tool dispatch limits available capabilities, while preconditions and postconditions surround publication. section 6.6
Figure 6.6 A cross-repository schema change composes Action patterns at different seams: the plan holds dependencies, chains verify local artifacts, dispatch narrows each capability surface, and guardrails surround publication effects.
The diagram maps the dependency graph and the checks around individual repository steps and publication effects. section 6.6
Plan nodes need not be agents: they can be deterministic tools, prompt chains, human approvals, or collaborating agents. Add these structures at the failure seams the task actually exposes, rather than treating every action pattern as a mandatory layer. section 6.6 section 6.1.4
