Skip to content

bridge-try: try auto-stop on a confidential node (#1059, phase 3) - #1064

Merged
NiKrause merged 1 commit into
mainfrom
claude/try-auto-stop
Nov 29, 2026
Merged

NiKrause merged 1 commit into
mainfrom
claude/try-auto-stop

Conversation

@NiKrause

Copy link
Copy Markdown
Contributor

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.yml gets auto_stop_minutes. Empty (the default) keeps today's behaviour. Otherwise it must be 15–60, checked like keep_minutes.

    • The unlock (attest-live.mjs, env AUTO_STOP_MINUTES) also hands over the secret auto_stop, in the same injection as the other secrets. It holds those idle minutes and a FORGET of the new INSTANCE, pre-signed with ALEPH_PRIVATE_KEY for the INSTANCE's payer (the same key in CI). The run fails if the unlock did not report the hand-over.
    • After the checks the run sends the VM nothing (no SSH, no stream). The new step "Wait for the VM to forget itself" runs wait-self-stop.mjs. It reads https://<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 without capabilities.autoStop, after 5 minutes if the status page never shows the setting, and if another FORGET forgot the VM.
    • The step summary shows the FORGET's hash (and whether it is the one handed over), its reception_time, the time from the unlock (hand-over) and from the run's last contact with the VM, and the first and last autoStop the status page showed. dial.mjs dials as a stranger and calls no command, so the bridge's quiet time counts from the hand-over.
    • "Keep it running" is skipped with auto-stop. "Forget the instance" stays always(): it runs on any failure or timeout. After a self-stop it notes that the VM is already forgotten and does nothing.
    • The job timeout goes from 120 to 150 minutes (boot and checks about 30, plus up to 75 of waiting).
  • Reuse, no second builder. bridge/rootfs/test/auto-stop-secret.mjs builds the secret with the app's own forgetContent, signedMessage, autoStopSecret and SELF_STOP_REASON. wait-self-stop.mjs recognises the FORGET with the app's instanceStatus and selfForgetOf, 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's packages/ledger there instead of pulling it from the registry.

  • Tests: bridge/test/try-auto-stop.test.js (node --test, in bridge.yml):

    • the secret's shape and bounds;
    • the secret handed to the image's real belege-bridge-auto-stop against the fake Aleph: with no command for 15 minutes on a fake clock, the VM sends the FORGET, and the wait reports it with its reception_time;
    • the wait's verdicts: its own FORGET passes; another FORGET, the reason on another VM, an image without auto-stop, a hand-over that never shows and a timeout fail; Aleph out of reach for a while is no verdict.

    The bridge's own install does not link @le-space/ledger, so the test resolves it to packages/ledger with a registerHooks resolve hook.

  • Docs: docs/hosted-auto-stop.md (how phase 3 runs, the new test) and bridge/rootfs/README.md ("Trying it").

Checked locally

  • node --test for the new test file and auto-stop.test.js: 26 passed. Run with no app/node_modules, as in bridge CI.
  • pnpm --filter @belege/bridge lint, scripts/check-workflow-shell.rb, scripts/workflow-pins.test.mjs.
  • The workflow's staging copied by hand into a scratch directory with the pinned attest-wasm and ethers: both CLIs load, and an ethers-signed secret builds. This caught a CommonJS root from npm init, now fixed with npm pkg set type=module.

Not in this PR

  • HOSTED_IMAGE stays as it is. Its bump to the image from v0.66.0 comes as its own small PR once the STORE hash is known.
  • No dispatch of bridge-try.yml or bridge-image.yml, no merge, no release.

🤖 Generated with Claude Code

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
NiKrause marked this pull request as ready for review November 29, 2026 11:23
@NiKrause
NiKrause merged commit 1f97eca into main Nov 29, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant