Repository navigation
fix(native): finish a Ctrl-C stop lost with its VM through hack down --recover (HACK-2746) - #1290
Conversation
… (HACK-2731) Low follow-ups from the #1273 and #1274 reviews: - The storage barrier reports `graph_cleanup_uncertain` only for a flush that did not confirm (deadline, lost reply or a failed guest command). `guest_identity_mismatch`, `runtime_changed` and every other error keep their own code. - `graph foreground-owner` reports `cross_boot_relay`: whether the cross-boot recovery can prove the dead relay owner (a bridge slot, or a settled relay startup). A live run with no published port and an unsettled relay is no longer advised `hack down --recover`, and the down no longer starts the pool for it; the ready-stage message (and a restart's preflight loss) asks the runtime first. - A lost start's advice parses the reply with the down's own parser (`parseNativeForegroundOwner`), so version, owner and digest checks cannot drift apart. - `hack down --recover` starts a stopped pool for a stopped run whose lost-removal repair is owed: the refused `hack up` leaves a marker beside the run mapping, and the runtime reports an unconfirmed repair (`lost_removal_pending`). A verified stop clears the marker. This ends the `hack up` / `down --recover` loop after the pool goes idle. The ForegroundLossRecovery model gains relay settlement (`settled`, `Unsettled`, `LiveRelayAdvice`) and the `live-relay` negative control, which fails on #1273's message rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e relay (HACK-2731) #1279 review: - A ready-stage loss now withholds `hack down --recover` only when the receipt is live and its relay owner is unprovable (`nativeLiveRelayUnprovable`). A VM lost during the owner's own stop (`cleanup-intent`, `stopped-data-retained`) or with a pending same-boot recovery keeps the down advice it had before, for `hack up` and for a restart lost in its preflight. - `cross_boot_relay` counts a bridge registry as holding the run's slot only when the current pool owner wrote it, as its doc says. - Removing a run mapping removes its lost-removal marker and a temporary file an interrupted marker write left beside it. The ForegroundLossRecovery README says the receipt phase at ready is out of the model's scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…--recover (HACK-2746) On a real VM, a Ctrl-C followed by the provider's death while the receipt read `cleanup-intent` left the run stuck. The advice named `hack down --recover`, which answered `runtime_not_running`, and `hack up` refused with `graph_foreground_owner_exited_unadmitted`. The owner's stop runs inside its enrolled relay cleanup, and the cross-boot dead-owner recovery already admits that receipt once the pool boots again (`interrupted_enrollment`). What was missing was a selection that showed it: - `graph foreground-owner` reports `cross_boot_stop`: the receipt is at `cleanup-intent` with a pending relay cleanup marker of one of the pool's recorded boots, the persisted bridge selection is beside it, and the dead relay owner is provable (its routes, or a settled relay startup). - `nativeCrossBootRecoverable` admits it, so `hack down --recover` starts a stopped pool and the runtime finishes the stop with data kept. The ready-stage advice (`nativeReadyLossRetirable`) names the down for `cleanup-intent` only with `cross_boot_stop` or a selected dead-owner recovery, and names no command otherwise. - The retained-start preflight reports such a run as `graph_foreground_owner_exited`, naming `hack down --recover`, then `hack up`. `hack up` then recovers it itself, as for a ready run (HACK-2456). ForegroundLossRecovery gains a `Stopping` stage (Ctrl-C while serving), the `StopRecovery` and `StopAdvice` rules, and the `no-cross-boot-stop` negative control, which fails `NoRefusedAdvice` as the VM did. The README and state chart are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…HACK-2731) #1279 review (Codex P2): a ready-stage loss the runtime cannot retire (`retirable` false) names no command, but the start's own error (the final inspection's unconfirmed cleanup) kept its "Run hack down --recover" sentence in the `(cause: …)` line. The cause's recovery sentence is now dropped for that stage too, as it already was for a requested loss. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad/ctrl-c-loss-recover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and cause only when finished (HACK-2746) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad/ctrl-c-loss-recover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
next holds #1279 squashed (986b7e9); its tree equals this branch's #1279 base (2aba1fd) plus #1280, so each conflict resolves to this branch's side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/diagrams/foreground-loss-recovery.png # docs/diagrams/foreground-loss-recovery.svg # docs/guides/native-candidate.md # packages/runtime-core/src/provider/graph/bridges/cleanup.rs # packages/runtime-core/src/provider/graph/dead_owner_cleanup.rs # packages/runtime-core/src/provider/graph/mod.rs # scripts/lib/tla-runtime-models.ts # src/backends/native-cross-boot-recovery.ts # src/backends/native-project-start.ts # tests/models/tla/README.md # tests/models/tla/foreground-loss-recovery/ForegroundLossRecovery.tla # tests/models/tla/foreground-loss-recovery/code-without-veto.cfg # tests/models/tla/foreground-loss-recovery/failed-only.cfg # tests/models/tla/foreground-loss-recovery/generic-error.cfg # tests/models/tla/foreground-loss-recovery/intent-message.cfg # tests/models/tla/foreground-loss-recovery/keep-intent.cfg # tests/models/tla/foreground-loss-recovery/keep-leftover.cfg # tests/models/tla/foreground-loss-recovery/leak-lock.cfg # tests/models/tla/foreground-loss-recovery/live-relay.cfg # tests/models/tla/foreground-loss-recovery/negative.cfg # tests/models/tla/foreground-loss-recovery/no-cross-boot.cfg # tests/models/tla/foreground-loss-recovery/pinned-relay.cfg # tests/models/tla/foreground-loss-recovery/positive.cfg # tests/models/tla/foreground-loss-recovery/restart-recovers.cfg # tests/models/tla/foreground-loss-recovery/transitional-veto.cfg # tests/models/tla/foreground-loss-recovery/withhold-preparing.cfg # tests/models/tla/foreground-loss-recovery/withhold-requested.cfg # tests/native-project-down.test.ts # tests/native-project-start.test.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Resolved to the tree tested in batch run m3:z498 (lead train sync). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…top (HACK-2757) #1291 review (High): a provider SIGKILLed with its VM leaves the pool record `running` with the dead boot until `runtime recover` writes `recovered-unclean`, and `runtime status` reads it `process-exited`. The current-boot exclusion skipped that boot too, so the owner's lost-VM advice and a plain `hack up` lost `hack down --recover`. That undid #1290's real-VM rows 1 and 2. Now the current boot is skipped only while it is live: the record says `running` and the provider is not proven gone (`identity::provider_gone`, the check `runtime status` makes). An unreadable provider counts as live, so nothing is promised then. The tests cover a `running` record with a dead provider (a cross-boot stop, and `hack up` names the down), and a live provider (neither). The case where the VM really keeps running still has no supported recovery. It is filed as HACK-2763. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes HACK-2746. When the VM is lost during a Ctrl-C stop,
hack down --recovernow finishes that stop with data kept, andhack upthen starts the run.The bug
On a real VM, a foreground
hack upreached ready and was stopped with Ctrl-C. About 50 ms later, while the receipt readcleanup-intent, the provider was killed. This failed 3 of 3 times on #1279 and 1 of 1 onnext:hack down --recover, which answeredruntime_not_running.hack uprefused withgraph_foreground_owner_exited_unadmitted.runtime recoverchanged nothing.No command got the run back.
Cause
In the kept evidence home, the receipt is at
cleanup-intent. The owner's enrolled relay cleanup marker is stillpendingfor the run's boot, and its bridge selection (relay-cleanup-bridges.json, one route) is beside it. The run's slots were already released.The runtime's cross-boot dead-owner recovery already admits exactly this receipt (
interrupted_enrollmentinprepare) once the pool boots again. But nothing in the host-file selection showed it, sohack down --recovernever started the stopped pool.Fix
graph foreground-ownerreports a new field,cross_boot_stop(dead_owner_cleanup::interrupted_stop). It is true when the receipt is atcleanup-intentwith all of the following:pendingrelay cleanup marker for one of the pool's recorded boots;nativeCrossBootRecoverableadmits that receipt, sohack down --recoverstarts the stopped pool and the runtime finishes the stop.nativeReadyLossRetirable) names the down forcleanup-intentonly withcross_boot_stopor a selected dead-owner recovery. Otherwise it names no command, and with fix(native): name only recoveries the runtime accepts after a lost VM (HACK-2731) #1279's cause-line fix, neither does the cause line.graph_foreground_owner_exited, naminghack down --recover, thenhack up.hack upthen recovers it itself, as for a ready run (HACK-2456).Model
ForegroundLossRecovery.tlagains aStoppingstage (Ctrl-C while serving) and two rules,StopRecoveryandStopAdvice.positiveholds across 752 states. The newno-cross-boot-stopnegative control is the runtime and message before this fix, and it failsNoRefusedAdviceatStopping, as the VM did. The README and state chart are updated:Real VM (at
35bc2f3e)Apple Silicon, pinned SmolVM 1.35.4, fresh isolated homes. The scenario: on a web and database project, a foreground
hack upreaches ready, Ctrl-C goes to the process group, and the provider is SIGKILLed about 50 ms later while the receipt readscleanup-intent.cleanup-intent, thenhack down --recover(3 runs)hack down --recover.down --recoverexits 0 in 2.9, 4.1 and 2.8 s: it starts the pool, stops the services with data retained, andpsshowsstopped-data-retained.hack upis then ready in 1.6 to 2.5 s, with the web page served and the database row kept. 3 of 3hack upwith nodowndownfollows93af4083, driven by this binarydown --recoverexits 0 in 4.5 s, thenup -dworks with the row kept, and the cleanup is clean. The old receipt shape recoversdowndoes not start the pool. Unchangeddown --recoverstarts the pool and removes them, thenupworks. UnchangedThe commits after
35bc2f3echange only message text (the lost-VM cause line, from #1279), add a test, or mergenext. The VM rows therefore still apply to this head.Validation
a_stop_interrupted_inside_its_enrolled_relay_cleanup_is_a_cross_boot_stopand the HACK-2746 case ina_remaining_publication_names_its_owner_state_without_effects.cleanup-intentrow ofdown --recover starts a stopped pool for a start lost before ready, the interrupted-stop rows ofnativeLostStartRetirable, and the ready-stage and restart-preflightcleanup-intentrows. Removing the TS fix fails 5 of them.a Ctrl-C stop lost with its VM names the down in advice and cause only when the runtime finishes itchecks the advice and the cause line together.git diff origin/next...HEADis this change only.nextholds fix(native): name only recoveries the runtime accepts after a lost VM (HACK-2731) #1279 as a squash, and the merge resolves to this branch's side.typecheckpasses, andcheckpasses with 111 warnings, the same asnext.cargo +1.97.1 fmt --checkpasses, and clippy-D warningspasses with default features and with--all-features.provider::graphtests under the native-bench lock pass.test:models,privacy:checkand gitleaks pass.--init): fmt, both clippy runs,test-runtime-core.shwith default features and with--all-features, andtest:modelspass.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.