fix(upgrade): stage runtime work before cutover - #78
Merged
fuller-stack-dev merged 1 commit intoAug 14, 2026
Merged
Conversation
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 intentionally does not change delayed stop acknowledgement, desired-versus-observed start state, health convergence, or false-rollback behavior. Those remain in the separate convergence owner lane.
Canonical transaction boundary
Pre-cutover now contains target resolution/staging, complete snapshot preflight, and runtime rollback backup. Cutover begins immediately before source service quiescence, then captures the complete rollback snapshot, atomically publishes the staged runtime, performs config repair/finalization, restores the requested service policy, and verifies health/RPC readiness. Any failure after publication retains the existing fail-closed rollback path.
Finalization stays cold because it can mutate OpenClaw config, SQLite state, and plugins. Snapshot capture stays after quiescence for point-in-time consistency.
Availability evidence
Same deterministic fixture: 1.5s target preparation delay, 1.5s finalization delay, continuous health polling.
Untouched canonical
mainat614f6cb4b9c40d70342aecb1af01286feff613fb:This head at
739cac55cb1610177652093c2ce785e5d9371a17:The deterministic cutover interval drops by 1.350s (~35%). Absolute host setup time varies; the contract asserts phase ordering and continuous health rather than a flaky wall-clock threshold.
Related work
PR #60 overlaps some upgrade/runtime files but combines broader gateway lifecycle and runtime changes. This PR keeps the transaction-ordering fix isolated and does not absorb the separate convergence workstream.
Validation
cargo fmt --all -- --checkcargo test --test upgrade_availability_tests -- --nocapturecargo test --test upgrade_command_tests -- --test-threads=1(46 passed)cargo test --test runtime_command_tests -- --test-threads=1(46 passed, including current-main source-extension coverage)cargo test --lib -- --test-threads=1(296 passed)cargo clippy --all-targets -- -D warnings -A clippy::question_mark -A clippy::large_enum_variant -A clippy::too_many_arguments