Let Dev Updater supervise the backend, now that the switch can be sequenced

Re-applies the change reverted in d5a0f67. It was right then and only
mistimed: something was reading this working tree live, so deleting the
script took the backend card to "couldn't check" immediately rather than
on a pull. Iris has now uninstalled the service while the script was still
the declared one, which is the step that stops the old unit being orphaned
under a name nothing points at any more.

`Managed` runs the command with dev-updater's built-in service script,
resolved against the component's cwd. ai-app's own script was the generic
case exactly -- ExecStart=$BINARY with no arguments and no environment --
so it was 233 lines of init-system detection kept in step with an
identical copy next door.

Deleting it loses nothing, and that was checked rather than assumed: all
three findings the test guest produced today are in the built-in --
reading OpenRC's status exit code instead of grepping text it prints to
stderr, treating an uninitialised user softlevel as "couldn't find out"
rather than as stopped, and assigning through `|| code=$?` so `set -e`
cannot kill the script before it reads the code.

The one thing the script said that the built-in cannot is already in
AGENTS.md: Stop on this card takes down the server a phone reaches through
the tunnel, while Dev Updater itself is unaffected because it uses its own
port.

Install from the backend card after taking this.
This commit is contained in:
iris committed 2026-08-28 19:52:42 -04:00
1 parent a8b6c13b01
commit 3cf6925d90
3 files changed
+26 -275

No files matched your search

+15 -4
View File
@@ -48,10 +48,21 @@ repo is in PLAN.md's "Backend layout" section.
event model mirror; `ServerConfig.kt` settings + Keystore-sealed token;
screens in `SessionListScreen/SessionScreen/SpawnScreen/SettingsScreen`.
- `.dev-updater.ron` — what Dev Updater is asked to do with this checkout:
the backend (built in `server/`, installed and controlled through
`server/service`) and then the APK (built in `app/`), in that order. The
project it serves is the repository, not either half of it, which is why
this sits at the root rather than in `app/`.
the backend (built in `server/`, run as `service: Managed(...)`) and then
the APK (built in `app/`), in that order. The project it serves is the
repository, not either half of it, which is why this sits at the root
rather than in `app/`.
`Managed` means Dev Updater supervises `ai-server` with its own built-in
service implementation rather than a script kept here. ai-app had such a
script until 2026-08-28 and it was the generic case exactly — no
arguments, no environment — so the two projects were maintaining one
behaviour twice, including the OpenRC branch neither can test from a
systemd machine.
Worth knowing before pressing it: **Stop** on the backend card stops the
server that a phone reaches through the tunnel, so on that phone it stays
down until someone starts it again from Dev Updater. Dev Updater reaches
it over its own port and is unaffected, which is what makes the button
safe to press and easy to regret.
- `wg-app-link/` — a **git submodule**, and the half of this backend that
dev-updater also needed: the pinned CA and leaf (`certs`), QR enrollment
and the bearer token (`enroll`), wg0 binding and the certificate's SANs