Operation Lifecycle
Every cell lifecycle request creates or reuses an operation. SQLite is the source of truth for operations, events, steps, idempotency keys, and cell state.
durably acceptedsteps + eventsfinal resultrunning work or interrupted requests terminate as failedRecords
Section titled “Records”operationsstores the high-level operation state and target id.operation_eventsstores append-only state and domain events such asoperation.running,cell.ready, andoperation.succeeded.operation_stepsstores explicit step records such aspersist-cell,create-machine,start-machine,stop-machine, anddestroy-machine.idempotency_keysscopes request replay by operation kind and key.
Idempotency
Section titled “Idempotency”Idempotency is per endpoint kind. Repeating CreateCell with the same key returns the original create operation. Reusing the same key for StartCell and StopCell produces independent operations because they are different operation kinds.
Startup Reconciliation
Section titled “Startup Reconciliation”When celld starts, it loads persisted non-destroyed cells and asks the selected backend to reconcile desired state with host reality:
readycells become ready machines;runningcells become running machines;stoppedcells become stopped machines;destroyedcells are not restored into the backend.
The fake backend rebuilds in-memory machines. The container backend rehydrates live Docker-backed machines and workspace paths. The Firecracker backend compares runtime descriptors with live processes, TAP devices, and vsock sockets, then cleans orphans and marks missing expected runtimes failed.
Operations left in requested or running are conservatively marked failed and receive a startup-reconciliation failed step. DevCell records the interruption rather than silently replaying privileged work.