article feature
Daemon: detached execution and crash recovery
A local daemon owns root session trees through supervisor and worker processes connected by a local socket. Resident workers outlive the TUI, and supervisors can adopt live workers or restart crashed ones from JSONL transcripts plus kernel snapshots. Process separation is lifecycle isolation, not a security boundary.
Pinned repository file/line or test referenced in the audit.
Supervisor and workers
The local daemon owns each root session tree through a supervisor and session workers connected over a local socket. This separates session execution from the terminal interface and gives the runtime a process responsible for lifecycle management.
A worker executes session activity; the supervisor tracks and recovers that activity. Their separation limits some crash effects but leaves both inside the same user trust boundary.
Detach and reattach
Resident workers can outlive the TUI, so closing or detaching the interface does not necessarily end the session. Reattaching reconnects a client to work still owned by the daemon.
This supports long-running operation without tying progress to one terminal window. It still depends on the daemon and worker remaining healthy and protocol-compatible.
Crash recovery
When a worker crashes, the supervisor can adopt a worker that is still alive or restart a failed one. Recovery draws on the append-only JSONL transcript, child registry, and any available kernel snapshot.
Recovered state can be incomplete when an artifact is missing, unreadable, or older than the latest in-memory work. Important sessions should therefore keep durable outputs outside the live kernel as well.
Leases and journals
Lifecycle records such as leases and journals help the daemon determine which process owns a session and what recovery action is appropriate. They reduce the chance that two supervisors treat the same resident work as independently owned.
These records support coordination and diagnosis; they do not replace the transcript or kernel snapshot as the session's recoverable content.
Version boundary
The client, daemon, and resident workers must speak compatible protocol versions. Updating only one component can leave a live worker unable to accept requests or resume correctly.
After a release change, align the components and restart the stack together. Back up important JSONL and snapshot artifacts before crossing a fast-moving 0.x version boundary.