Repository navigation
Hosted bridge stops itself when idle or at a daily hour (#1059, phases 1–2) - #1063
Merged
Merged
Conversation
… daily hour (#1059) Phases 1 and 2 of #1059, off by default until the paid round trip. Guest (image sources): with --hosted the bridge writes when a device last called a command and how many run to activity.json in its tmpfs (no listener). belege-bridge-auto-stop checks once a minute whether the quiet time or the daily hour (IANA zone, tzdata) is due, never while a command runs or before "postponed until", and then sends the FORGET of this VM that the owner's browser pre-signed (secret auto_stop, moved to a root-only tmpfs, never logged). status.json says capabilities.autoStop and only the reason and a time. App: "Selbst beenden" under Gehostete Bridge, kept in the sealed settings; auto_stop with a FORGET signed for the VM's payer goes with the unlock and, after a fresh attestation, at each change; a warning ten minutes before with "1 Stunde später"; the next opening recognises the VM's own FORGET, records the stop at its reception_time and takes the bridge off the devices. A bank linked on a hosted bridge lived only in its tmpfs: the new stream-only enablebanking.sealed lets an owner's device keep the sealed file in the books. Carries docs/hosted-auto-stop.md over from #1060, updated to what was built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NiKrause
force-pushed
the
feat/hosted-auto-stop
branch
from
November 28, 2026 15:41
4080105 to
6f03f32
Compare
NiKrause
marked this pull request as ready for review
November 29, 2026 08:42
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.
Phases 1 and 2 of #1059: a hosted bridge (Aleph confidential VM) that ends itself after a quiet time or at a daily hour, by sending a FORGET that the owner's browser pre-signed for exactly this VM. Off by default until the paid round trip (phase 3) has passed.
Builds on the concept merged in #1060:
docs/hosted-auto-stop.mdis updated here to what was built.Step 0: checked before building
Run-time state that lives only in the tmpfs
bridge_auth) is derived again at every unlock. Its peer key is kept in the sealed settings. A hosted bridge has no handover: it starts armed. Nothing to keep.device-grants.json) come back with the device list handed over at the unlock, with each device'sinitialscopes. On a hosted bridge no device holds the pairing scope, so nothing narrows scopes at run time. Nothing to keep.settings.exportcannot take it back, because a hosted bridge has no holder. Decision: written back to the books.enablebanking.sealed(hosted bridge only, scopebridge:bank:link) answers the sealed file as it is.enablebankingkey the books already hold.The FORGET's time and the delegation (read in pyaleph main ee62fc9; no message sent)
check_timeonly parsestime; there is no bound either way.ForgetMessageHandler.check_permissionschecks the sender withis_sender_authorized_for_owneragainst the owner's currentsecurityaggregate, at processing.timeis its signing time. The app therefore takes the stop's time fromreception_time, which every pyaleph message status carries.Phase 1: guest (image sources; nothing published)
bridge/src/activity.js. With--hosted, the bridge writesactivity.jsonbeside its config, in the VM's tmpfs (0700). It holds the last command's time and how many commands run. It is a file, not a listener, so nothing new faces the network andbelege-bridge-checkis unchanged.request), from the moment it is authorized until it ends.bridge.health,backup.status,llm.status,lanRelay.status, the node's own UCEP commands, relay pings and reservations, and/attest.belege-bridge-auto-stopruns once a minute as a systemd loop unit, like the others.auto_stopout of/tmp/secretsinto a root-only directory in/runand zeroes the copy.zoneinfo,tzdataadded to the image) after ten quiet minutes.postponeUntil./bridge/status.jsongetscapabilities.autoStop: 1andautoStop: { reason, at, stopping }: the reason and one time, nothing else.bridge/test/auto-stop.test.js, with a fake clock against the fake Aleph using real signatures. The fake now answersreception_time, hasrevoke(), and checks the right when the FORGET comes.bridge/test/node.test.jschecks that a command counts and a status read does not.Phase 2: app
bridge/hosted-auto-stop), off by default and owner-only.auto_stop: the setting plus a FORGET of this VM, signed by the books' key for the INSTANCE's payer, with the fixed reasonbelege: hosted bridge stopped itself. It goes only while it fits the agent's 16-secret limit./attest(attestGuest+injectSecrets, no passphrase), and hands overauto_stopalone with a new FORGET.HostedAutoStopWarning.svelte, polling the VM's status page once a minute only while a setting is kept), with "1 Stunde später".reconcileHostedVmrecognises the VM's own FORGET (reason + this VM). It records the stop at that FORGET'sreception_timewithstoppedItself, the card says "Hat sich … selbst beendet", and the bridge leaves the device list.de.js/en.js.api2.aleph.im), so there is no version bump.app/e2e/hosted-auto-stop.spec.js), against the fake Aleph, a fake attestation agent and a stand-in status page:auto_stopand a correct FORGETSecurity
belege.e2e.hostedStatusUrl) works only behindVITE_E2E.BELEGE_AUTO_STOP_TEST_APIis an env var the unit never sets (as in Paperless).Not in this PR (needs Nico's word)
bridge-image.yml). Running VMs ignore the setting until then.bridge-try.yml): an idle VM sends its FORGET on api2, the CRN drops it, and the next opening sees it.🤖 Generated with Claude Code