CMP-3.7 — Checkpointing/resume¶
Status: COMPLETE — Level 1 exact-head qualified on c438a029a652fdeed42ef94b877e50b804842689.
Canonical definition¶
Checkpointing/resume.
The canonical roadmap names checkpointing/resume without redefining the frozen ComputeMarket attempt model. CMP-3.7 therefore extends the already-qualified CMP-3.6 worker lifecycle with worker-local, non-authoritative checkpoint persistence and explicit resume of the same still-authorized canonical attempt.
A checkpoint never creates a new payable unit, new attempt, result commitment, verification decision, receipt, payment entitlement, or settlement authority.
Controlling protocol boundary¶
The frozen lifecycle and worker architecture require:
- one canonical job/attempt authority;
- finite recoverable attempt leases;
- retries/replacements to use separately authorized attempts;
- no silent reopening of terminal canonical work;
- immutable work-unit/artifact identity;
- sandbox-only customer execution;
- no correctness claim from process exit or worker-local evidence.
CMP-3.7 preserves those rules.
Resume is allowed only when:
- CMP-3.6 has a local
interruptedrecord for the same attempt; - the canonical authorization is resolved again by reference;
- the same chain/provider/node/resource/worker/job/unit/root-assignment/attempt/nonce bindings remain valid;
- deadline and lease remain live;
- the exact CMP-3.5 work unit rehashes successfully;
- the latest checkpoint rehashes successfully and remains bound to that authorization/attempt/work-unit identity;
- execution re-enters through the CMP-3.4 sandbox.
A completed, failed, cancelled, expired, prepared, resuming, or running local attempt cannot be reopened through resume.
Checkpoint persistence¶
compute/worker/checkpoint.go adds private worker checkpoint storage under:
<stateDir>/checkpoints/<attemptRef>/
For each canonical attempt:
- the first checkpoint sequence is exactly 1;
- each subsequent sequence advances exactly by 1;
- duplicate or stale sequence replay is rejected;
- checkpoint payload size is positive and bounded;
- payload bytes are streamed to a private temporary file;
- SHA-256 is computed while writing;
- payload and metadata are persisted with private permissions;
- metadata is bound to exact authorization/attempt/work-unit state;
latest.jsonidentifies the latest completed checkpoint;- symlink/non-regular/private-mode violations fail closed;
- payload bytes are rehashed before every load/resume.
Checkpoint commitment¶
Each checkpoint records:
- schema version;
- authorization reference;
- exact authorization commitment;
- attempt reference and nonce;
- work-unit SHA-256;
- monotonic checkpoint sequence;
- checkpoint payload SHA-256;
- payload size;
- creation time;
- deterministic checkpoint commitment.
The checkpoint commitment is a local content/provenance commitment only. It is not CMP-3.8 result commitment or CMP-3.9 signed receipt evidence.
Resume input framing¶
CMP-3.7 defines versioned resume framing with magic:
CMP420R1
The sandbox receives:
- resume magic;
- big-endian work-unit byte length;
- big-endian checkpoint byte length;
- exact reverified work-unit bytes;
- exact reverified checkpoint bytes.
The frame has explicit size bounds and rejects truncation or trailing bytes.
This gives checkpoint-aware worker images a deterministic resume contract without adding host mounts, devices, privileged execution, or arbitrary environment injection.
Lifecycle integration¶
CMP-3.6 gains local observational state:
resuming.
Resume flow:
- resolve canonical authorization again;
- validate execution plan against the canonical snapshot;
- require existing local state
interrupted; - reject terminal/live-state reopening;
- revalidate deadline and lease;
- rehash exact work unit;
- load and rehash latest checkpoint;
- verify checkpoint attempt/nonce/work-unit bindings;
- persist
resuming; - persist
running; - execute through
Sandbox.RunWithInput; - persist one terminal local state.
If the worker crashes while resuming or running, startup recovery returns the record to interrupted.
Resume never happens automatically on startup.
Security/adversarial requirements¶
CMP-3.7 must fail closed for:
- missing canonical authority;
- wrong worker ancestry/identity;
- wrong or changed attempt ref/nonce;
- expired deadline or lease;
- checkpoint sequence zero, gap, duplicate, or replay;
- zero/oversize checkpoint;
- malformed/tampered checkpoint metadata;
- tampered checkpoint payload;
- symlink/non-regular checkpoint payload/metadata;
- wrong work-unit digest/size/path;
- tampered work unit after download;
- resume of exited/failed/cancelled/expired attempt;
- concurrent resume of prepared/resuming/running attempt;
- trailing or malformed resume frame;
- implicit retry after restart.
Raw checkpoint/work-unit bytes are not written into lifecycle records.
Real Docker qualification¶
The Level 1 fast workflow builds a local FROM scratch checkpoint-aware probe image.
The exact-head test performs:
content-addressed work unit + bound checkpoint → interrupted local attempt → explicit resume → real Docker sandbox → resume-frame parsing → exact work-unit/checkpoint SHA-256 verification → terminal local state → replay rejection
No registry pull or testnet dependency is required.
Exit criteria¶
CMP-3.7 is complete when one exact implementation SHA proves all of the following:
- checkpoint state is worker-local and explicitly non-authoritative;
- checkpoint storage is private and scoped to canonical attempt identity;
- sequence starts at 1 and advances monotonically by exactly one;
- replay/gaps/stale sequence values fail closed;
- payload size is positive and bounded;
- payload SHA-256 is computed while writing and reverified before resume;
- checkpoint metadata binds exact authorization commitment, attempt ref/nonce and work-unit digest;
- deterministic checkpoint commitment is present and revalidated;
- checkpoint metadata/payload symlink or unsafe-file states fail closed;
- resume is explicit and requires prior local
interruptedstate; - canonical authorization is re-resolved immediately before resume;
- same worker/job/unit/root-assignment/attempt/nonce/manifest/policy bindings remain enforced through CMP-3.6 validation;
- deadline and lease must still be live;
- exact work unit is rehashed immediately before resume;
- exact checkpoint is rehashed immediately before resume;
- terminal attempts cannot be reopened;
- live/prepared/resuming attempts cannot be resumed concurrently;
- crash during resuming/running recovers to interrupted without implicit execution;
- resume bytes enter only through the CMP-3.4 sandbox;
- versioned bounded resume framing preserves exact work-unit/checkpoint bytes and rejects malformed/trailing input;
- a real Docker integration test proves the resumed sandbox receives the exact verified work unit and checkpoint;
- CMP-3.1 through CMP-3.6 regressions remain green;
- targeted Go tests, vet, build, real Docker resume test and CMP-3.7 verifier pass on the same exact implementation SHA.
Qualification evidence¶
- Implementation SHA:
c438a029a652fdeed42ef94b877e50b804842689 - Compute Worker Fast Qualification: #143
- Run ID:
37256445519 - Job ID:
111594452272 - Result: SUCCESS
- Durable evidence anchor:
1971279df16ad20af1761766f67f116ceb61b866 - Evidence record: CMP-3.7 qualification evidence
Qualification model¶
CMP-3.7 is an ordinary Level 1 step.
Required owner: Compute Worker Fast Qualification.
CMP-3.6 already served as the first worker-runtime Level 2 convergence milestone. CMP-3.7 extends that qualified lifecycle with an app-local checkpoint/resume primitive and does not introduce a new shared protocol authority or cross-component dependency.
Therefore Level 2 is not required for CMP-3.7.
The broader worker integration workflow is now explicitly milestone-gated rather than running after every worker change.
Level 3 remains reserved for CMP-3.14 — Phase closeout.
Intentionally deferred¶
- CMP-3.8 result commitment;
- CMP-3.9 execution-key signed receipt;
- CMP-3.10 result/evidence upload;
- CMP-3.11 local resource controls;
- CMP-3.12 malicious workload protections;
- CMP-3.13 Windows/Linux/macOS packaging;
- complete accumulated reconciliation and Level 3 qualification at CMP-3.14.
No live/testnet dependency is required for CMP-3.7.
Next canonical step: CMP-3.8 — Result commitment.