Repository navigation
bridge-try: try auto-stop on a confidential node (#1059, phase 3) - #1064
Merged
Merged
Conversation
bridge-try.yml takes auto_stop_minutes (empty = as before, else 15-60). The unlock then hands over `auto_stop` in the same injection: those idle minutes and a FORGET of the new INSTANCE, pre-signed with the workflow's key, built with the app's own forgetContent, signedMessage and autoStopSecret (bridge/rootfs/test/auto-stop-secret.mjs). After the checks the run sends the VM nothing; wait-self-stop.mjs reads /bridge/status.json and asks Aleph (the app's instanceStatus and selfForgetOf) until the VM's own FORGET is processed, for at most idle + 15 minutes, and writes its reception_time and the time since the hand-over to the summary. The run passes only if the VM forgot itself; "Forget the instance" still runs on any failure and does nothing after a self-stop. The scripts and the app modules they import are copied at their repo paths, with this checkout's packages/ledger linked. Tests run the hand-over through belege-bridge-auto-stop against the fake Aleph and cover the wait's verdicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NiKrause
marked this pull request as ready for review
November 29, 2026 11:23
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.
Phase 3 of #1059: lets "Bridge on a confidential node" run the paid round trip in which the VM forgets itself. Not dispatched: that needs the maintainer's word, and an image with auto-stop.
What changes
bridge-try.ymlgetsauto_stop_minutes. Empty (the default) keeps today's behaviour. Otherwise it must be 15–60, checked likekeep_minutes.attest-live.mjs, envAUTO_STOP_MINUTES) also hands over the secretauto_stop, in the same injection as the other secrets. It holds those idle minutes and a FORGET of the new INSTANCE, pre-signed withALEPH_PRIVATE_KEYfor the INSTANCE's payer (the same key in CI). The run fails if the unlock did not report the hand-over.wait-self-stop.mjs. It readshttps://<host>/bridge/status.json(autoStop) and asks Aleph until Aleph has processed a FORGET with the fixed reason that names this VM. It gives up after idle minutes + 15, and the step also has a timeout. It fails at once on an image withoutcapabilities.autoStop, after 5 minutes if the status page never shows the setting, and if another FORGET forgot the VM.reception_time, the time from the unlock (hand-over) and from the run's last contact with the VM, and the first and lastautoStopthe status page showed.dial.mjsdials as a stranger and calls no command, so the bridge's quiet time counts from the hand-over.always(): it runs on any failure or timeout. After a self-stop it notes that the VM is already forgotten and does nothing.Reuse, no second builder.
bridge/rootfs/test/auto-stop-secret.mjsbuilds the secret with the app's ownforgetContent,signedMessage,autoStopSecretandSELF_STOP_REASON.wait-self-stop.mjsrecognises the FORGET with the app'sinstanceStatusandselfForgetOf, as the app does at the next opening. The workflow copies these scripts and the three app modules into one directory at their repo paths (type=module), and links this checkout'spackages/ledgerthere instead of pulling it from the registry.Tests:
bridge/test/try-auto-stop.test.js(node --test, in bridge.yml):belege-bridge-auto-stopagainst the fake Aleph: with no command for 15 minutes on a fake clock, the VM sends the FORGET, and the wait reports it with itsreception_time;The bridge's own install does not link
@le-space/ledger, so the test resolves it topackages/ledgerwith aregisterHooksresolve hook.Docs:
docs/hosted-auto-stop.md(how phase 3 runs, the new test) andbridge/rootfs/README.md("Trying it").Checked locally
node --testfor the new test file andauto-stop.test.js: 26 passed. Run with noapp/node_modules, as in bridge CI.pnpm --filter @belege/bridge lint,scripts/check-workflow-shell.rb,scripts/workflow-pins.test.mjs.attest-wasmandethers: both CLIs load, and an ethers-signed secret builds. This caught a CommonJS root fromnpm init, now fixed withnpm pkg set type=module.Not in this PR
HOSTED_IMAGEstays as it is. Its bump to the image from v0.66.0 comes as its own small PR once the STORE hash is known.bridge-try.ymlorbridge-image.yml, no merge, no release.🤖 Generated with Claude Code