Context
Canonical spec: SourceOS-Linux/sourceos-spec specs/local-agent-runtime.md.
The node-commander incident showed that Nix activation can reproducibly install an operationally unsafe service if preflight is not part of activation. A Nix-generated wrapper was installed behind launchd before Podman machine/socket/auth conditions were safe.
Required boot/activation behavior
Nix activation for local agents must run in this order:
- Evaluate local-agent declaration.
- Generate wrapper.
- Lint wrapper.
- Generate launchd plist or systemd unit.
- Lint service definition.
- Run preflight.
- Install only if preflight passes.
- Enable only if install succeeds.
- Start only if enable succeeds.
- Emit status.
If preflight fails, activation must stage the service but must not enable persistence unless explicitly requested.
Deliverables
- Add activation guard hooks for SourceOS local agents.
- Add
stage-only mode for failed preflight.
- Add clear status output for staged, installed, enabled, and running states.
- Add policy checks preventing direct
/Library/LaunchAgents root-owned user agents, /tmp logs, and unbounded KeepAlive=true.
Acceptance criteria
- A missing/stopped Podman machine prevents active service installation.
- Noninteractive credential-helper failure prevents service enablement.
- Failed preflight creates a staged artifact and clear remediation output.
- Activation never leaves a half-enabled respawn loop.
Context
Canonical spec: SourceOS-Linux/sourceos-spec
specs/local-agent-runtime.md.The
node-commanderincident showed that Nix activation can reproducibly install an operationally unsafe service if preflight is not part of activation. A Nix-generated wrapper was installed behind launchd before Podman machine/socket/auth conditions were safe.Required boot/activation behavior
Nix activation for local agents must run in this order:
If preflight fails, activation must stage the service but must not enable persistence unless explicitly requested.
Deliverables
stage-onlymode for failed preflight./Library/LaunchAgentsroot-owned user agents,/tmplogs, and unboundedKeepAlive=true.Acceptance criteria