Skip to content

oxo-flow resume#

Resume an interrupted workflow from a checkpoint file.

Usage#

oxo-flow resume [OPTIONS] <CHECKPOINT>

Description#

The resume command loads a checkpoint generated by a previous oxo-flow run and continues execution from where it left off. Rules that already completed successfully are skipped; only incomplete or previously-failed rules are re-executed.

The checkpoint file (.oxo-flow/checkpoint.json) is automatically created by oxo-flow run and stores the completion status and benchmarks of each rule, plus a config snapshot and per-rule fingerprints for change detection.

The checkpoint also records the working directory the original run executed in, so resume re-runs from the same place even when invoked from another directory — completed rules' outputs resolve identically and stay skipped. The recorded workflow path and workdir are stored as absolute paths; a legacy checkpoint without a recorded workdir falls back to the workflow file's directory.

Resuming goes through the same config-change impact analysis as run: if the workflow config or a rule definition changed since the checkpoint was written, only the affected rules and their downstream re-execute. See Config changes and precise invalidation. Input changes are detected the same way — glob, directory, and plain-file inputs are compared against the recorded manifests, and changed inputs re-execute the affected rules (see Input changes and manifest invalidation).

resume passes no CLI config overrides, so the effective config is the workflow's defaults. When the original run carried overrides (its recorded config snapshot differs), the resumed run prints a Config drift warning naming every key that changed and its old → new values — plan-time gated instances (pair/sample when, {meta.*} baking) re-judge on the defaults and may drift from the recorded instance set. Re-pass the original overrides with oxo-flow run (which auto-resumes) to reproduce the recorded instance set exactly.

A resumed local run honors OXO_FLOW_MAX_GPUS for the capacity-level GPU pool; resume has no --max-gpus flag, so the env is the only per-invocation control (and --max-gpus 0 exists only on run). A cluster profile ignores it with a warning. See Local GPU capacity.

Checkpoint re-entry and runtime-discovered output_pattern domains recorded in the checkpoint are replayed on every resume — including a resume routed to a cluster profile — before execution planning. The deferred rule instances re-join the plan (their completed records are reused under the same output-manifest verification). This is intentional: a cluster resume now rebuilds the recorded plan instead of silently skipping replay and under-executing it. A recorded re-entry that conflicts with the current workflow can therefore fail the plan with a re-entry diagnostic (E015 pair conflict / E016 name collision) where a cluster resume previously ignored it; remove the conflicting rule or start a fresh run if the divergence is intentional.

Output verification (strict by default)#

Every successful rule records a declared-output manifest in the checkpoint: each expanded output path with its size and, for regular files up to OXO_FLOW_MANIFEST_HASH_MAX_BYTES (default 64 MiB), a sha256 content hash. The manifest is written by both execution paths (local executor and cluster settle hook) and does not require --provenance.

resume verifies that manifest before reusing a completed rule. A rule is skipped only when the existing freshness gate passes and every currently expanded declared output has a manifest entry, exists, matches its recorded size, and — when the entry carries one — matches its recomputed content hash (hashed in full, regardless of the recording cap). Otherwise the rule re-executes with a warning naming the rule, path, and reason. This closes the silent-acceptance hole where a completed-but-truncated artifact (a BAM cut short by a killed job, a half-written VCF) was reused because its mtime looked newer than its inputs:

WARN strict output verification failed — re-executing the rule instead of
     trusting size+mtime evidence ... rule=align path=aln/S1.bam
     reason="output 'aln/S1.bam' is 500 bytes but the manifest recorded 1024"

The check runs in two places, and both are required: a pre-plan pass verifies every checkpoint-completed rule in the run's FINAL execution set — it runs after the checkpoint re-entry and output_pattern replay, so instances rebuilt from the checkpoint are verified too — and, on failure, invalidates the rule together with its completed downstream in the checkpoint and forces the closure to re-execute (a dependent whose own output is intact but was built from the damaged artifact must not be skipped). That invalidation also feeds the tombstone cascade-up, so temporary/transform-cleaned producers of a forced rule regenerate instead of being skipped with deleted inputs. The executor's freshness gate re-verifies any rule that still reaches it (crash-leftover outputs with no completion record, targeted subsets). On a cluster resume the pre-plan pass seeds the submission plan, whose downstream cascade resubmits affected completed rules.

The failed rule and its downstream re-run together; the run does not exit 0 with dependents derived from the damaged artifact. The safe default has three deliberate consequences:

  • A legacy checkpoint (written before output manifests existed) has no manifest for its completed rules, so those rules re-run on the next resume — once. Their fresh completions record manifests.
  • An output above the hash cap records size only and is therefore unverified: strict resume re-runs it. --provenance does not relax this — its checksums map is a separate audit trail and the manifest entry still has no sha256, so an over-cap output remains unverified until the cap is raised (or --trust-mtime accepts mtime evidence). Same-size corruption of an output above the cap is only detectable once the cap is raised.
  • A declared output that is a directory (or another non-regular file) has no content hash and is treated as unverified, so such rules re-run under the strict default.

Pass --trust-mtime to opt out and keep the historical size+mtime verdict (existence and mtime only) — including for cluster re-attach adoption, where it prevents resubmitting an already-successful scheduler job over an unverifiable (over-cap/directory) output. This is the escape hatch for large-output or directory-output workflows where re-hashing/re-running is unacceptable. Plain oxo-flow run keeps the historical size+mtime gate; run --verify-outputs opts a plain run (for example a retry wrapper) into the same strict behavior, and resume applies it by default.

Coverage boundary. The resume command (resume-checkpoint on the web surface), the web retry path, and run --verify-outputs apply strict verification. The web retry spawns run --resume-failed --verify-outputs (the flag is set for every retry shape — --resume-failed, --rerun, and --from-rule), so a retry of a run whose outputs were damaged after completion re-executes the affected rule and its completed downstream instead of silently reusing them. OXO_FLOW_MANIFEST_HASH_MAX_BYTES is forwarded into the local web server spawn environment allowlist, so locally web-spawned runs, retries, and their resumes hash with the operator's cap exactly like a direct CLI run. Web cluster runs execute the staged copy on the remote host with the remote CLI's own environment, so a cap must be set there too. Plain web create remains a run and keeps the historical size+mtime gate by design, and dry-run/status previews do not verify. Same-size corruption of an output above the hash cap remains unverified (size-only), so strict verification re-runs it; raise the cap for content identity, or --trust-mtime accepts the size+mtime verdict.

Orphaned sample_pattern completions#

resume re-plans from the workflow recorded in the checkpoint, which re-derives a sample_pattern discovery domain from disk. The checkpoint persists the domain its completion records were built from, so a sample file deleted since the original run drops its instance from the resumed plan while the checkpoint keeps claiming it completed. The delegated run loop prints a warning naming every such orphaned instance and its recorded output path (nothing is deleted automatically) — the same report status and dry-run show:

Warning: 1 instance completed with sample_pattern 'data/{sample}.txt' whose sample file is no longer discovered — the checkpoint still claims it as complete, but it is not in the current plan; recorded outputs are left on disk (never deleted automatically):
  ⚠ count_auto-discovered_b — sample 'b' is gone from the discovery domain (recorded output: res/b.count)

Restoring the sample file re-admits the instance; when its content changed, the ordinary input-manifest invalidation re-executes the rule. The persisted domain is a union across runs, so the warning survives resumes until the completion claim is resolved. See Orphaned completions for the JSON field and the full semantics.

Checkpoint format version#

Every checkpoint records a checkpoint_format_version marker. If the version recorded is newer than the running engine's — i.e. the checkpoint was written by a future oxo-flow build whose completed-rule set this engine cannot prove it understands — resume (and run's auto-resume path) refuses to start and says so, rather than silently trusting state it cannot verify. The standalone resume command refuses at its own load, before printing its banner or any --json counts, so no output is narrated from untrusted state; --resume-failed and every other Execute path refuse the same way. A read-only preview (dry-run) instead warns and plans as if every rule had never completed, so the preview stays usable, and status still shows the recorded listing but prints the same trust warning. A checkpoint with no marker (written before the marker existed) is treated as compatible. See the cross-version contract in docs/superpowers/audits/reentry-2026-11.md (§5.2/§5.3).

Cluster runs: re-attach or abandon#

A run --profile <NAME> cluster run records, in the checkpoint, the profile name/backend/queue it submitted through and the scheduler job id of every accepted job. Each id is removed as its job settles, so the checkpoint's cluster_jobs map holds exactly the jobs an interrupted driver never observed reaching a terminal state.

resume reconciles those recorded jobs with the scheduler before it clears the persisted in-flight set or re-plans execution:

  • No profile recorded and none supplied — fail closed. Nothing is cleared, persisted, or executed; the error names every recorded job and the two escape hatches.
  • Profile available — the explicit --profile, else the profile the checkpoint recorded if its file still exists under the workflow's profiles/ directory. Resume re-attaches through the backend recorded at submit time:
    • queued/running → waits, polling, until the job is terminal; it is never resubmitted;
    • terminal success with every declared output present → the rule is marked completed (a recorded_as: "adopted from <backend> job <id>" benchmark is written only when no measured benchmark exists). When the checkpoint carries a recorded output manifest for that rule, the outputs must also verify against it (size and content hash); a failing manifest leaves the rule for a normal re-run. A rule whose outputs are declared only through output_pattern has no fixed files to verify at adoption time; its scheduler-confirmed success is adopted without a per-instance file check;
    • terminal success whose declared outputs are missing → a warning, and the rule re-runs;
    • terminal failure or cancellation → recorded, and the normal resume re-runs the rule;
    • scheduler unreachable, or a job neither in the live queue nor in the accounting store → fail closed with the job named.
  • --abandon-jobs — cancel the recorded live jobs through the backend that owns them (scancel/qdel/bkill/…), clear their records, and re-run the rules. With a usable profile the rerun keeps the cluster route; without one it continues locally (announced on stderr). A cancel the scheduler rejects fails closed: a job that may still be running is never reported as abandoned. An accepted scancel/qdel/… is the scheduler's acknowledgement that the signal was delivered, not proof the process has already stopped — a brief termination window remains. If the scheduler reports the id no longer exists (a purged record), cancel cannot confirm anything: verify with oxo-flow cluster status, then remove that rule's cluster_jobs entry from the checkpoint manually (or complete the rule) before resuming.

Reconciliation always uses the backend recorded on each job, never the backend a (possibly edited) profile resolves to today. A checkpoint whose unsettled jobs span more than one scheduler (a crash on one backend followed by a run on another) is reconciled group by group, each through the scheduler that owns it — a job id is never handed to a different backend. When a group's backend differs from the checkpoint's recorded run, an error's recovery command cannot know that scheduler's location/zone; add its --queue value manually (GCP location / Tencent availability zone). A resume with no recorded cluster jobs still routes through the recorded profile (when its file still exists), so the remaining rules keep running on the scheduler instead of silently falling back to the local executor.

Checkpoints written before this feature carry no job ids; their resume behavior is unchanged (their rules re-run), and run deliberately never consults cluster_jobs — after a crashed cluster driver, use resume (not a fresh run) to re-attach.

A recorded job whose rule an intervening invocation completed and which is no longer marked in flight is treated as settled: resume drops the stale id (and persists the cleanup) instead of polling a scheduler record that may since have been purged. The in-flight mark is the discriminator: a run --rerun re-submits a completed rule and records its NEW job id while the rule deliberately stays complete, so that shape — completed AND running — is treated as live: resume polls or cancels the job instead of dropping it, and never lets a dependent run against outputs it is still rewriting. If a genuinely superseded job was in fact still live, the intervening completion already raced it — reconciling an id the checkpoint's completion set no longer needs cannot undo that, and refusing to resume forever would be worse.

Options#

Option Short Description
-j, --jobs <JOBS> — Number of parallel jobs (default: 1)
--ai-recover — Enable AI error recovery on rule failure
--ai-max-retries <N> — Maximum AI attempts for recovery when a call fails (default: 1; only a failed call is retried). Same recovery-side contract as run — the generation-side --ai-max-retries on template (default 10) is a separate knob
--workdir <DIR> -d Working directory to resume in (default: the one recorded in the checkpoint)
--keep-going -k Continue execution when a job fails (same semantics as run)
--timeout <SECS> — Timeout per job in seconds (0 = disabled), or a duration like 1h/30m
--no-report-snapshot — Skip the automatic report snapshot after the resumed run (same flag as run)
--profile <NAME> — Re-attach recorded cluster jobs through this profile (and run the remaining rules on that scheduler). Defaults to the profile the checkpoint records; without either, a checkpoint holding unsettled cluster jobs fails closed
--abandon-jobs — Cancel the scheduler jobs recorded in the checkpoint instead of re-attaching and waiting, then re-run their rules (locally when no usable profile exists)
--trust-mtime — Accept the size+mtime freshness verdict for completed rules instead of verifying their recorded output manifests. See Output verification
--background / --detach — Detach the resumed run into a background process and exit 0 immediately (see Background runs (--background)); --detach is an alias
--json — Emit one machine-readable JSON document to stdout (human logs stay on stderr); see JSON output

JSON output#

--json (the global flag) emits a single JSON document to stdout. Human narration — the banner, the Resume: line, execution progress — stays on stderr, so a monitor can parse stdout without scrubbing prose. This is the same contract as status and the rest of the run-lifecycle family (run).

{
  "command": "resume",
  "workflow": "/abs/path/w.oxoflow",
  "checkpoint": "/abs/path/.oxo-flow/checkpoint.json",
  "status": "completed",
  "completed": 3,
  "failed": 0,
  "remaining": 1,
  "skipped_by_when": 2
}
Field Meaning
command Always "resume"
workflow The workflow path recorded in (and re-checked against) the checkpoint
checkpoint The checkpoint file that was loaded
status nothing_to_resume (nothing executed yet; exit 0, nothing re-run), completed, or failed
completed Rules already complete in the checkpoint (the "already-complete" half)
failed Rules recorded as failed and retried by this resume
remaining Rules this resume expects to execute (workflow rule count minus completed; wildcards expand later). Under strict output verification a completed rule may additionally re-run when its manifest fails or is missing, so the executed count can exceed this value
skipped_by_when Present when rules were skipped by a when gate; re-judged on this resume
running Present when the checkpoint recorded rules still running (the prior run died mid-flight); they re-run
adopted Present when a cluster reconciliation ran: how many recorded scheduler jobs were adopted as completed (their declared outputs were verified first)
cancelled_jobs Present when a cluster reconciliation ran: how many recorded scheduler jobs --abandon-jobs cancelled before re-running

For a local checkpoint the non---json path is unchanged: exit codes and output are byte-identical to prior releases. A cluster checkpoint that records scheduler jobs additionally narrates the re-attach (one line per reconciled job) and may wait for live jobs before the run loop starts — that narration is new, and a fail-closed reconciliation exits non-zero. A malformed checkpoint or a missing workflow still fails with a non-zero exit and, under --json, the shared structured error envelope ({"command":"resume","errors":[{"code":...,"message":...}]}) instead of empty stdout.

Examples#

# Resume from the default checkpoint
oxo-flow resume .oxo-flow/checkpoint.json

# Resume with 4 parallel jobs
oxo-flow resume .oxo-flow/checkpoint.json -j 4

# Accept size+mtime freshness instead of verifying output manifests
oxo-flow resume .oxo-flow/checkpoint.json --trust-mtime

# Machine-readable resume status
oxo-flow resume .oxo-flow/checkpoint.json --json

Notes#

  • The checkpoint stores a reference to the original workflow file path. If the workflow was moved or renamed, resume will fail with a clear error.
  • The recorded working directory is shown as Workdir: before execution. --workdir overrides it (e.g. when the project directory was moved).
  • oxo-flow run automatically resumes from the checkpoint if one exists. The standalone resume command is useful for explicitly re-running after inspecting the checkpoint state.
  • Use oxo-flow status to inspect the checkpoint before resuming.
  • Rules whose when gate recorded false are reported as skipped, not failed, in the resume banner — their stale failure entries from older checkpoints don't count toward the failed total, and the gate is re-judged on this resume anyway.
  • A rule recorded as still running in the checkpoint (its process was killed mid-execution) is always re-run on resume — its partial outputs never pass the freshness gate. On a cluster checkpoint this holds only for rules whose scheduler job the re-attach could not reconcile; a job confirmed completed is adopted instead (see Cluster runs: re-attach or abandon).
  • --background / --detach detaches the resumed run (see run's Background runs section).

See Also#