Repository navigation
fix(substrate): report and enforce observed snapshot fidelity - #181
Anish Ramasekar (aramase) merged 7 commits into
Conversation
Anish Ramasekar (aramase)
left a comment
There was a problem hiding this comment.
Thanks Tom. The reporting half looks right: URI and fidelity come from the same selected entry, Memory is true only for observed MEMORY, and the #153 lost/replaced-actor checks still run first. Two things on the enforcement half before this goes in (inline):
- The fidelity check runs after
SuspendActorand records nothing, so the next Create/Restore resumes the snapshot that was just refused. WithWithVolumesOnlythat brings back process memory; on a memory-tier session it resumes a VOLUMES snapshot under the same UID, which passes the instance check and runs the turn without its RAM state. - The new refusals are untyped errors, so a stateful Fork refusal that used to be FAILED_PRECONDITION is now INTERNAL, and the test that pinned the code was loosened.
Smaller: the record-before-validate comment at placement/placement.go:1488-1491 is stale now that substrate validates inside Snapshot. Also, does a fork child's borrowed snapshot entry carry fidelity?
|
Updated the stale Placer comment. On borrowed fidelity: at the pinned Substrate the tag copies fidelity and the child's borrowed generation keeps it, so fork children get no exemption. |
Anish Ramasekar (aramase)
left a comment
There was a problem hiding this comment.
The fence fixes the earlier comments. One regression inline for sessions that main already suspended, plus two doc nits.
There was a problem hiding this comment.
🔵 Needs a closer look
Recovery validation checks durable metadata rather than the effective resume source, requiring correction and human review of stateful recovery behavior.
1 open issue
What changed in this PR
Reports observed Substrate snapshot fidelity and enforces checkpoint requirements for memory-dependent and files-only sessions.
Changes:
- Carries snapshot URI and fidelity from the same completed generation.
- Adds VOLUMES-only admission and checkpoint validation.
- Updates error mapping, regression tests, and compatibility documentation.
| File | Description |
|---|---|
| spec.md | Documents fidelity and recovery requirements. |
| session/service.go | Maps invalid checkpoints to failed preconditions. |
| session/memory_state_lost_test.go | Generalizes the control-client helper. |
| session/fork_wake_test.go | Supplies snapshot evidence in test controls. |
| session/checkpoint_fidelity_test.go | Tests refusal without journal changes or revival. |
| runtime/substrate/substrate.go | Adds fidelity reporting and checkpoint enforcement. |
| runtime/substrate/substrate_test.go | Covers fidelity validation and compatibility. |
| placement/suspend_test.go | Tests legacy stateless checkpoint recovery. |
| placement/placement.go | Classifies refused fork checkpoints. |
| placement/placement_test.go | Tests checkpoint refusal before journaling or cloning. |
| placement/harness_identity_test.go | Supplies held-snapshot evidence. |
| integrations/substrate/fork_test.go | Updates incomplete-checkpoint expectations. |
| integrations/substrate/adapter.go | Extracts fidelity and snapshot-history evidence. |
| integrations/substrate/adapter_test.go | Tests selection and evidence mapping. |
| docs/substrate-conformance.md | Explains files-only configuration and limitations. |
| CHANGELOG.md | Records behavior and compatibility changes. |
| api/runtime.go | Defines the invalid-checkpoint sentinel. |
Review effort: Balanced
Anish Ramasekar (aramase)
left a comment
There was a problem hiding this comment.
Re-reviewed at 70d048b. All of my earlier threads check out. I confirmed the refuse-after-capture fence holds across a host restart (a fresh host on the same control plane and journal refuses Exec, Resume, Fork and Suspend), and that a stateless journal written by main resumes again with VOLUMES and UNKNOWN actors. LGTM from my side; two doc nits below, fine as a follow-up.
On the effective-resume-source question I answered in the thread: follow-up.
465e821
into
agent-primitives:main

Refs #170
Reports observed Substrate snapshot fidelity and enforces memory/VOLUMES-only checkpoint requirements while preserving legacy stateless recovery.
Compatibility: custom clients must report fidelity; invalid checkpoints return FAILED_PRECONDITION. Paused actors may resume local rather than validated durable checkpoints; this remains a known limit.
Verification: root/nested race suites, vet, lint/staticcheck, generation, docs and integrity checks passed; no new local live-cluster run.