roadmap BUILT

23. A capability-routed component OS with live replacement

Every residual this block named is built, and so are the advisory warning (§231), the live swap of line_editor (§232 (the line editor swap contract)) and of display_terminal, both under a terminal supervisor that notices a hang on its own. Two pieces have milestones of their own: the installer asking the terminal to swap (milestone 694), and the compositor's swap (milestone 932 (swap the compositor live)), which waits for a boot that runs a compositor.

The idea

Every userspace component (driver, server, app) is a swappable, vendor-shippable unit behind a stable contract, and operators replace them live, with no reboot. A client names an endpoint, never a peer (§12 (call/reply IPC: a one-shot reply capability)), so a component's identity is invisible to the code that uses it. Any program that speaks the protocol and holds the right capabilities is the component. The kernel is the one fixed thing underneath an entirely swappable userland. This is Fuchsia's shape (capability-routed components, stable protocol interfaces) on a verified core.

It is also the product story. The kernel confines each component to what it was granted, so competing vendor components run safely. A Linux vendor module is ring 0, and a nife vendor component is a confined process that can touch only what the operator handed it. That is the payoff of the capability model and of milestone 22 (trusted init: verify it, and shrink what a broken one can do), and it connects to the parked competitor ambition (competitor-question.md).

Two things are deliberately not swapped this way. The kernel is the verified base and changing it is a reboot. A minimal root supervisor is the fixed point that makes swapping everything else possible; you cannot swap the swapper infinitely.

Prior art: Fuchsia (the closest match), MINIX 3's reincarnation server (live driver replacement in userspace), QNX (hot-swappable drivers), Erlang/OTP hot code loading and supervision.

What is built

Instance one: swap a console-shaped server under a talking client (2026-07-30)

DECISIONS §41 (the endpoint is the broker, and a device is revoked by taking it back), notes/live-replacement.md. An unprivileged operator (swapper) builds the replacement, drains the incumbent, takes the device back, and starts the replacement. A client (chatty) talks across the swap and is its own witness. An attacker holding the client's exact capabilities cannot become the server. The outgoing instance reads the UART after the revoke and faults at the device's own page. And the replacement is written in C over §31 (the foreign-language seam: C holds no capabilities and makes no system calls), so what held across the swap is the contract.

Three things the build settled. No forwarding process is needed as the broker: endpoint-only naming makes the endpoint object the stable name, so a swap costs nothing in steady state and the kernel's sender queue buffers the down window. The roadmap's step order (start the new server, then revoke) does not survive contact, because revocation is by physical page; the endowment moves past the revoke while the build stays first. And revoking a device means take-back, not destroy.

The latency ladder, and an opt-in queue broker

broker is the middle rung: a queue server that buffers in its own budget while a backend is down, so a producer never blocks on an absent consumer. It costs a second hop, priced by broker_rtt, so it is opt-in per channel and passes through when both ends are up. The fast rung is the direct endpoint; the slowest, a durable queue that writes to storage, is not built. The kernel stays synchronous rendezvous; the queue is userspace policy bounded by the broker's own untyped.

The component manifest (2026-08-17)

crates/capability_plan, notes/component-manifest.md. swapper holds no endowment literals: each contract declares its capability half in hot_swap_contract, and the operator says only which of its own objects answers to which role name, per child. A manifest is a request and the provisions are the authority (Fuchsia's use/offer split), so a vendor's declaration cannot widen its own authority. The role name is the component's and the object is the supervisor's, which makes a component's peer substitutable too. A manifest is still compiled in rather than shipped beside a binary; see Follow-on.

The hung component (2026-08-17)

notes/hung-component.md. Against an incumbent that stops answering without dying, three of the four steps are unchanged: the one that needs its cooperation, the drain, is the one a hang makes redundant. So a supervisor restores the service with no authority it did not already hold, which corrects the sentence in §32 (a supervisor may collect a corpse) that restarting a hung child needs the stronger right. Reclaiming its memory needs the region capability, which the builder holds if it keeps it. The domain reports a hang as BLOCKED, exactly what a healthy idle server reports, and Endpoint::REAP answers StillAlive for every member, so a supervisor notices only by asking: its quiesce goes unanswered within a bound. Destroying the hung component's region then finishes it in place and answers its stranded caller abi::Error::Gone.

Dependency-aware orchestration (2026-08-23)

component_plan::depends_on and dependents, notes/dependency-orchestration.md. A component names the contracts it cannot silently tolerate the absence of, and a supervisor asks the graph who to warn before a swap. Only a component that forwards synchronously while serving others ever needs an entry: a pure consumer degrades for free on the endpoint's sender queue, §41's mechanism doing a second job.

State handoff (2026-09-26)

notes/state-handoff.md, to the ruling in DECISIONS §209 (state handoff is an opaque blob over a granted frame, and it is optional). Requirements gained the optional handoff field (provisional, as §209 asked), hot_swap_contract a stateful contract, and swapper a fourth role, ROLE_HANDOFF, that tries the swap twice. First against a replacement that cannot read the incumbent's blob, which refuses, is reaped, and leaves the incumbent serving with its state. Then against one that can, which commits. The client's unchanged sequence check is the continuity witness, because the component answers with its tally. It runs on all three architectures, the first swap system to, since it has no device; the queued system lost the same inherited x86 skip.

Two findings. The handoff page cannot be deferred past a revoke like a device, because PageFrame::REVOKE is symmetric and would take the operator's own capability, so it is mapped at build in both instances and sequenced by the drain. And §209 needs a refusal it does not state: a supervisor that routes no handoff page is refused a component that declares one, since wiring it anyway is a kill-and-replace that looks like a successful swap.

§209 replaces §116 (live component state handoff is declined, for want of a customer).

The unwarned dependent, measured (2026-09-26)

ROLE_UNWARNED swaps the queued system's backend without ever warning broker. The producer loses nothing and only waits for the down window. So a dependent that will not answer its warning needs nothing done to it; the supervisor only has to not block on it, which today it does, because the warning is a CALL. notes/non-cooperative-fallback.md.

The terminal, swapped live (2026-10-19)

calef ruled four questions on 2026-10-19 (UTC), and display_terminal is swapped to them.

Measured on 2026-10-19 (UTC) with MemoryRegion::USAGE, debug images: an instance commits 207 to 212 pages and its map budget 4. system_tests::user::terminal_display_swap_tests swaps a supervised display_terminal twice on the kernel's display stand-in, on all three architectures. It compares every scanout pixel with an engine the kernel runs, and the blob carried home with the one that engine writes, byte for byte. A 24-bit color cut in half by the swap finishes on the other side. A second lend while the first is out is refused, and the retried swap commits.

The test found a fault in the scroll fast path: a write that scrolled several rows left the tail of a wider row on the screen. video_terminal::Vt::take_damage now renders the rows such a move exposes, and a host test plays the painter.

Follow-on

Index row

the flagship payoff, and a product ambition