Skip to main content

Module resume

Module resume 

Source
Expand description

Resume planner — classify each freshly-pre-mapped phase against the saved checkpoint document and emit a ResumePlan the executor consults before dispatch.

Per SRD-44 §“Resume protocol”, the planner walks the pre-map phase list (already in DFS-of-the-scenario-tree order) and for each phase asks:

  1. Is there a structural match (same yaml_path and coords) in the saved doc? If not → ReRun (this is a new phase that wasn’t in the last invocation).
  2. If matched and the saved status is Completed:
    • phase declared checkpoint: idempotent (or long form with idempotent: true) → Skip when hashes match, IdentityMismatch (and re-run) when they don’t.
    • phase declared checkpoint: none (or absent) → ReRun regardless of saved status (operator opted out).
  3. If matched and the saved status is Running:
    • the phase has cursor state recorded → CursorResume with that opaque snapshot (Tier 2).
    • no cursor state → ReRun (Tier 1 inflight crash).
  4. If matched and the saved status is Failed → ReRun (the errors cascade decides whether to surface the failure again — see SRD-44 §“Error handling is invocation-agnostic”). The planner doesn’t pre-decide.
  5. If matched and the saved status is Pending → ReRun (the previous invocation never started this phase).

Structs§

ResumePlan
The resume plan for one pre-mapped scenario tree. Maps each phase’s identity-key to its ResumeAction. A “fresh” plan (no saved checkpoint) maps every phase to ReRun.

Enums§

ResumeAction
What the executor should do with one pre-mapped phase. The planner emits one of these per phase keyed by identity-key (see super::writer for the key shape).