fix: converge asynchronous supervisor transitions - #75
Merged
fuller-stack-dev merged 1 commit intoAug 13, 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
Root cause
Supervisor actions publish desired policy before the child transition is necessarily observable. Snapshot creation treated a still-running advisory stop result as final before its existing quiescence wait. Upgrade did the inverse: it skipped health convergence when start/restart returned desiredRunning=true with running=false, then probed the gateway early and rolled back on ECONNREFUSED.
The owner-level invariant is now: policy decides what state OCM must converge toward; observed child and gateway state decide when maintenance is safe or successful.
Compatibility and failure boundary
This PR intentionally excludes the separate cold-finalization/long-outage transaction-ordering work in #60.
Proof
Canonical base: f6dea9f
On that exact unmodified base, the delayed-stop fixture aborted before bounded quiescence with managed service remained running after the snapshot safety stop; the delayed-start fixture rolled back after an early ECONNREFUSED probe. Canonical main remains that same SHA, and #60 current head retains both broken gates.
On this head:
No Crabbox was used; the local fake launchd/supervisor contract exercises the same JSON policy/runtime boundary without platform-specific behavior.