Skip to content

feat(startup): system/launch-mode IPC command — headless-native, Rust-only - #1637

Merged
joelteply merged 1 commit into
canaryfrom
feat/launch-mode-command-rust
Jun 16, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/launch-mode-command-rust

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

The runtime lever for the headless-vs-UI launch preference, as a Rust IPC command in continuum-core — system/launch-mode/{get,set}.

Why Rust, not TS

The headless server is independent of Node entirely; the Node desktop is a dependent client that calls the core over IPC, never the reverse. So a headless-only node (or a persona) must be able to read/set its own launch mode with no Node in the loop — this belongs in the Rust core, not the TS command layer. (The bash bin/continuum resolver in #1636 is the unavoidable pre-core bootstrap; this is the runtime command.)

Pieces

  • modules/launch_mode.rs — LaunchModeModule (ServiceModule, registered next to HealthModule):
    • system/launch-mode/get → reports stored CONTINUUM_LAUNCH_MODE (auto when unset).
    • system/launch-mode/set → validates headless|ui|auto, persists, emits system:launch-mode:changed so a running UI attaches / tears down its own overlay (the "UI turns itself off when the last human leaves" behavior).
  • config_env.rs — in-core config.env reader + upsert writer: the mutable counterpart to the read-only, cached-at-startup secrets.rs. Same key + KEY=value format the bin/continuum bootstrap and the TS SecretManager use, so all three runtimes (shell / Node / Rust) agree on one truth — coherence across runtimes, not duplication.

The architecture it embodies

One config.env setting, edited by any first-class citizen — CLI, menu-bar tray, desktop Grid tab, mobile, persona via the SDK — through the one command; the changed-event is the UI-visible feedback. (Joel's rule: UI-manipulable action → command, UI-visible feedback → event.) Distinct from the substrate boot --mode (full-citizen/inference-only/fail-fast), which stays explicit and is never guessed ([[no-fallbacks-ever]]).

Tests

8 unit tests, green under --features metal,accelerate: config.env round-trip / upsert-in-place (no duplicates) / comment+sibling preservation / missing-file → None; mode normalization; deny unknown subcommand; reject missing & invalid mode.

Relationship to other PRs

Builds on #1636 (the bash bootstrap resolver reads the same key). Part of the headless-first startup-consolidation lane.

🤖 Generated with Claude Code

…-only

The runtime lever for the headless-vs-UI launch preference, owned by
continuum-core with ZERO Node dependency. The headless server is independent
of Node entirely; the Node desktop is a dependent client that calls this over
IPC, never the reverse — so this lives in the Rust core, not the TS command
layer.

- core/.../modules/launch_mode.rs — LaunchModeModule (ServiceModule):
  - system/launch-mode/get → reports stored CONTINUUM_LAUNCH_MODE (auto when unset)
  - system/launch-mode/set → validates headless|ui|auto, persists, emits
    system:launch-mode:changed so a running UI attaches/tears down its overlay
- core/.../config_env.rs — in-core config.env reader + UPSERT writer (the
  mutable counterpart to the read-only, cached secrets.rs). Same key + format
  the bin/continuum bootstrap resolver and the TS SecretManager use, so all
  three runtimes (shell, Node, Rust) agree on one truth.

This is the everything-is-a-command embodiment: one config.env setting, edited
by any first-class citizen (CLI, tray, desktop, mobile, persona via the SDK)
through the one command; the changed-event is the UI-visible feedback. Distinct
from the substrate boot --mode (full-citizen/inference-only/fail-fast), which
stays explicit and is never guessed.

Registered in ipc/mod.rs alongside HealthModule. 8 unit tests (config.env
round-trip/upsert-in-place/comment-preservation; mode validation; deny unknown
subcommand; reject missing/invalid mode), green under --features metal,accelerate.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit 8efef9e into canary Jun 16, 2026
4 checks passed
@joelteply
joelteply deleted the feat/launch-mode-command-rust branch June 16, 2026 01:30
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