Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Concepts

Model

One plain object. The kernel reads it through a state cell and writes it with commit(patch) or replace(next); every write notifies subscribers. Nothing in the kernel keeps its own copy — a local let state = getState() in an async function is a snapshot that silently goes stale after the first await, and it was the single most repeated defect in the port CVN came from.

update is total and synchronous

An action runs to completion without waiting. It may commit to the model and it may emit Cmds; it may not fetch, sleep, read a clock, roll dice, or touch storage. Those are host capabilities, and the kernel's purity gate refuses a kernel module that names one.

Cmd

A Cmd is data: { kind: 'persist', key, value }. The kernel says what; the host decides how. A Cmd the host cannot route is reported[cmd] not performed: no persist port — never dropped, because a dropped Cmd is exactly the silent no-op this shape exists to make impossible.

Dispatcher

While an action is running, perform(cmd) records. When the outermost action finishes, the dispatcher drains every recorded Cmd through the host's performNow, in order. A nested dispatch keeps the outer list. Outside any dispatch, perform is immediate. See Dispatcher.

Host and ports

A host is an object implementing HostPorts: store, now, defer, every, fetch, randomBytes. An application adds its own ports (its adapters, its crypto) as declared names the kernel destructures; the port-contract gate keeps declared, supplied and travelled sets equal.

Declaration

rt.declaration // { owned: [...], delegated: [], hostCapabilities: ['performNow'] }

delegated is the measure. A method is owned when the kernel does the thing — not when the host's function is reachable through a kernel-shaped door. A fallback that quietly calls the host while the kernel claims ownership is how a list reads empty while the work remains.