Skip to content

feat(grid): continuum service — run the node as a logout/reboot-surviving OS service - #1639

Closed
joelteply wants to merge 3 commits into
feat/launch-mode-settingfrom
feat/node-service-survive-logout
Closed

joelteply wants to merge 3 commits into
feat/launch-mode-settingfrom
feat/node-service-survive-logout

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Why

A grid node must continue when the human logs out or the box reboots. A real node (BIGMAMA, Windows/RTX5090) went down when a user account was logged off — because the node was tied to an interactive login session. That's a direct contradiction of headless-first, and the install registered no session-independent service anywhere.

What

continuum service {install,uninstall,status} — one interface, per-OS implementations (the adapter pattern in shell):

OS Mechanism Survives logout?
macOS LaunchDaemon in /Library/LaunchDaemons (RunAtLoad+KeepAlive, system scope — not a LaunchAgent) ✅
Linux systemd system unit (Restart=always, WantedBy=multi-user.target) + enables docker at boot ✅
Windows Register-ScheduledTask -AtStartup as SYSTEM (recipe printed; validate on BIGMAMA) ✅ (pending validation)

Honest about the engine caveat

The node is docker compose up -d, so what must survive logout is the Docker engine. Linux dockerd is already a system service ✓. Docker Desktop on macOS/Windows is user-session-bound, so full logout-survival there needs a boot-independent engine (colima as a daemon, or a native headless core). status reports this truth rather than a fake all-clear — and on a box with no service installed it says so plainly: "node dies on logout. Fix: continuum service install."

Validated without touching the live system

  • --dry-run generates the artifact and (macOS) plutil-lints it — no sudo, nothing written to /Library/LaunchDaemons or /etc/systemd.
  • bin/tests/service.test.sh drives all three OS branches by shimming uname, asserting each emits a system-scope, boot-time, auto-restart service (13 assertions, all green).
  • Live install (sudo) is left to the operator; auto-wiring into install.sh is a deliberate follow-up — installing a boot daemon on someone's machine should not be silent.

Closes the node-resilience gap from the BIGMAMA-logoff event; complements the cluster-resilience layer (airc transport #1210, boot-health #1634).

🤖 Generated with Claude Code

joelteply and others added 3 commits June 15, 2026 19:37
…ving OS service

A grid node must continue when the human logs out or the box reboots. A real
node (BIGMAMA) died when a user account was logged off, because the node was
tied to an interactive login session — a direct contradiction of headless-first.
The install registered no session-independent service anywhere.

Adds `continuum service {install,uninstall,status}` (one interface, per-OS impls):
- macOS  → LaunchDaemon in /Library/LaunchDaemons (RunAtLoad + KeepAlive, SYSTEM
           scope — NOT a LaunchAgent, which dies on logout). plutil-linted.
- Linux  → systemd SYSTEM unit (Restart=always, WantedBy=multi-user.target) and
           enables the docker engine at boot.
- Windows→ Register-ScheduledTask -AtStartup as SYSTEM (recipe printed; validate
           on BIGMAMA).

Honest caveat surfaced by `status` + after install: the node is `docker compose
up -d`, so what must survive logout is the Docker ENGINE. Linux dockerd is
already a system service; Docker Desktop on macOS/Windows is user-session-bound,
so full logout survival there needs a boot-independent engine (colima as a
daemon, or a native headless core). We report that truth, not a fake all-clear.
`status` on a box with no service installed says so plainly ("node dies on
logout. Fix: continuum service install").

Validated WITHOUT activating any live daemon: `--dry-run` generates the artifact
and (macOS) plutil-lints it; bin/tests/service.test.sh drives all three OS
branches by shimming `uname` and asserts each emits a SYSTEM-scope, boot-time,
auto-restart service (13 assertions, green). Live install (sudo) is left to the
operator / a follow-up install.sh integration — auto-installing a boot daemon is
intentionally not silent.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…Node-independent

The first cut had the boot service run `continuum start` = `docker compose up -d`,
which brings up node-server (the TypeScript/Node orchestrator) too — dragging
Node into the headless node. That contradicts headless-first: the node is the
Rust core, independent of Node entirely; node-server/widget-server are the
DEPENDENT UI shell (node-server depends_on continuum-core, never the reverse).

- Add `continuum start --headless`: brings up ONLY the continuum-core service
  (no node-server, no widget-server, no Node), waits on the core's health, skips
  the browser. This is what a grid node / boot service runs.
- Repoint the service generators (macOS plist ProgramArguments, Linux unit
  ExecStart, Windows scheduled task) to `start --headless`.
- Engine caveat reworded: the service is core-only; the remaining caveat is just
  the Docker Desktop engine being session-bound on macOS/Windows.

Tests now assert every platform's service runs `start --headless` (Rust core
only, no Node). 16/16 green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…rrides, setting is default

Per "we decided to have a config.env setting for this": the headless-vs-ui
decision is the ONE config.env setting (CONTINUUM_LAUNCH_MODE), not a bare flag.

- `continuum start`: explicit --headless/--ui wins; otherwise resolve via
  launch_mode (the config.env setting → auto-detect → persist). headless →
  Rust core only (Node-independent); ui → full stack incl the Node desktop.
- `continuum service install [--headless|--ui]`: optional param PINS the
  service's mode (baked into the plist/unit/task); default (no param) runs
  plain `continuum start`, so the config.env setting governs at boot. "Take the
  param, use the setting as default."
- Service generators thread the optional mode; status/caveat reworded to say the
  service honors CONTINUUM_LAUNCH_MODE (headless on a server → no Node).

Stacked on feat/launch-mode-setting (needs launch_mode/config_get). Tests:
service.test.sh now asserts default pins NO mode (honors the setting) on all
three platforms AND that --headless override bakes it in (20 green); launch-mode
.test.sh still 18 green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply force-pushed the feat/node-service-survive-logout branch from 587f4c3 to 18eaa1f Compare June 16, 2026 00:41
@joelteply
joelteply changed the base branch from canary to feat/launch-mode-setting June 16, 2026 00:41
@github-actions github-actions Bot added size: XL and removed size: L labels Jun 16, 2026
@joelteply
joelteply deleted the branch feat/launch-mode-setting June 16, 2026 01:31
@joelteply joelteply closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant