Process lifecycle¶
A process cell is three operating-system processes in one chain: the nucleus host, a trusted cell monitor, and an untrusted runtime provider. Each is started by the one before it, each start is proved by its own receipt, and the provider begins reusable capability block execution only after all three receipts are admitted. This page covers the process chain, the startup sequence, how the processes are supervised, and how a cell is shut down.
The process chain¶
flowchart TB
subgraph TRUSTED["TRUSTED"]
direction TB
HOST["Nucleus host<br/>holds the pidfd"]
MON["Cell monitor<br/>owns the provider session"]
HOST -->|"starts from the verified closure"| MON
end
subgraph GUEST["UNTRUSTED"]
direction TB
PROV["Runtime provider process<br/>CPython is one implementation"]
CODE["Reusable capability block,<br/>libraries, native extensions"]
PROV --> CODE
end
OUT[("Bounded stdout and<br/>stderr capture")]
MON -->|"RuntimeProviderProtocolV1"| PROV
PROV -.-> OUT
HOST -.->|"pidfd, parent-death signal"| PROV
The chain has one root, and the untrusted leaf starts no further kernel
process. The monitor reaches the provider through the language-neutral
RuntimeProviderProtocolV1, so the same monitor drives any provider
implementation. See
The provider protocol.
Startup¶
Startup advances through three receipt-backed facts, in order:
ProcessStarted. The contained monitor process exists. The cell staysstarting.CellMonitorRegistered. The monitor authenticated on the control channel as the peer for this exact cell id and epoch. The cell becomesregistered.ProviderReady. The registered monitor completed protocol negotiation and provider preparation for the same cell and epoch. The receipt matches the issued preparation authority and the exact runtime closure, cell environment view, native-loader view and ordered module-root set. The cell becomesready.
All three receipts are produced on the trusted side of the chain from facts the monitor and host observed. A provider's own report of readiness is an input the monitor validates. See Cells, epochs, and lifecycle.
The nucleus records the exact runtime-closure identity on the cell record, and every cell effect carries it. The host refuses an effect whose closure, foundation, capsule, provider, provider layout, environment view, native-loader view or containment profile differs from the installed startup authority. The evidence event of a completed effect carries the host receipt digest and that same closure identity. See Cell evidence.
A startup failure before ProviderReady executes no block callable. For
CPython, preparation runs isolated initialisation once in a fresh provider
process, and a preparation fault ends that process. See
Interpreter preparation.
Dispatch to a ready cell¶
A call is eligible for a cell that is ready, installed under the same live
grant, and running the exact runtime closure and capsule the call names. The
scheduler selects among eligible cells. See
Scheduler.
The nucleus issues one DispatchProvider effect for the attempt. The host
sends a provider frame when that attempt has its own installed dispatch
authority, derived from the sealed compiled interface and the cell's prepared
closure. The monitor validates the completion and returns a declared typed
value, a declared error or a guest fault. A resource, stream or buffer the
provider offers is a proposal, promoted to a caller-visible handle by the
monitor and the nucleus. See
Provider frame validation and supervision
and
Provider resource table.
Supervision¶
- Parent-death signal. A provider whose parent dies is signalled, so no orphan outlives its cell.
- pidfd held by the nucleus host. Process exit is observed directly from
the operating system and becomes the
ProcessExitedreceipt. - Bounded output capture. Standard output and standard error are drained into captures of a fixed size, set by the cell's resource limits.
See Resource limits.
Shutdown¶
Shutdown is cooperative first and forced on a deadline:
- The monitor asks the provider to terminate through the provider protocol.
- If the provider fails to stop within the graceful-shutdown interval, the host terminates the process.
- The operating system reports the exit through the pidfd, and the cell
becomes
terminated.
A provider's cooperative termination receipt reports that it closed its local
state. The ProcessExited receipt is the proof that the process is gone.
Process exit ends the cell epoch, so a restarted cell has a new epoch and
empty tables.
For a deployed project assignment, the kernel then returns one terminal assignment receipt binding the original assignment id, fence, runtime-closure digest and process-exit receipt. A retry with that same authority returns the recorded terminal receipt. A retry with a different fence or closure is refused. The data plane uses the receipt to release the assignment's immutable artifact references before it removes the project runtime workload.