fix(snapshot): make environment restore complete and atomic - #72
Merged
fuller-stack-dev merged 1 commit intoAug 11, 2026
Merged
Conversation
Member
Author
|
Merged as |
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This builds on the whole-root checkpoint and cold-lifecycle direction explored by @hannesrudolph in #60, while keeping that PR's broader companion, build-local, and supervisor-policy work out of this change.
Problem
Current snapshots archive selected OpenClaw paths but restore by replacing the complete environment root. On
d1c36adda05c1129af9788be35528bc1240d95da, restoring a snapshot deleted.openclaw/.env, secrets, unknown future state, and symlinks that the archive omitted. A foreign directory matching the predictable restore-backup name also caused restore to fail.Transaction invariant
The displaced pre-restore root remains recoverable until service acceptance succeeds. If acceptance fails, OCM:
Scope
This PR deliberately excludes runtime build-local changes, supervisor convergence retry policy, companion management, and unrelated cleanup. It preserves the runtime mutation and rollback ordering from #66.
Validation
d1c36adda05c1129af9788be35528bc1240d95dacargo test --locked -- --test-threads=1cargo check --workspace --all-targets --lockedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings -A clippy::question_mark -A clippy::large_enum_variant -A clippy::too_many_argumentscargo fmt --checkgit diff --checkfailed_named_runtime_target_in_backoff_is_not_rewritten_during_rollback.db, foreign collision, failed acceptance rollback, legacy tar, and failed-upgrade rollback all passedIsolated synthetic Rosita-shaped benchmark, without reading or touching live Rosita: