notes

Swapping the interactive stack

Which of the interactive stack's three components can be swapped live, for milestone 23 (a capability-routed component OS with live replacement). line_editor and display_terminal are swapped live by terminal_supervisor. The compositor is not, because no boot runs it: milestone 932 (swap the compositor live).

What the tree says, checked

component who builds it on a real boot who could swap it state it holds
line_editor system_initializer, out of its own budget (crates/system_initializer/src/lib.rs, item 3) system_initializer: it holds every object it routed the edit line, the kill buffer, eight lines of history, up to four queued lines, raw or cooked mode, the interrupt count: under 4 KiB, measured (see BUGS)
display_terminal system_initializer, at a graphical_terminal launch (build_graphical_terminal_session; no boot builds it, per milestone 632 (graphics on demand)); terminal_supervisor, when a spawner hands it the image terminal_supervisor, when it built it: only the kernel's test does that today the character grid and scrollback, the cursor, the rendition and the parser's state (video_terminal::Vt), up to 132 pages as a blob
compositor no boot builds it. Only the tests of milestone 33 (a compositor: one screen, mutually distrusting clients) spawn it (kernel/src/user/compositor_service.rs, #[cfg_attr(not(test), ...)]); the graphical stack (option A of milestone 177 (wire the graphical terminal stack into the real interactive boot), built at a graphical_terminal launch) has "no compositor in this path" nobody outside a test nothing it could not rebuild: each client's surface is a frame the client owns

All three run under the kernel test harness. Outside it, two are built and only line_editor has a supervisor that could swap it.

display_terminal and compositor have no capability_plan declaration. display_terminal's slots are one list every builder reads (video_terminal::component), because two of them are a map budget and frame runs, which capability_plan::Direction has no word for. A declaration for either is written against the ELF-note manifest of milestone 597 (a program carries its manifest in an ELF note).

line_editor: swapped live

Its supervisor exists, its state fits a page, and §209 (state handoff is an opaque blob over a granted frame, and it is optional) is built (notes/state-handoff.md). The terminal contract is a wire format ten programs speak (swish, mdr, window, input, keyboard_driver, console, display_terminal, compositor, terminal_sink_caretaker and line_editor itself), so its two changes were calef's. He ruled them on 2026-09-26, and on 2026-09-27 option A of milestone 661 (a terminal supervisor holds the line editor):

What is built:

What is left is the trigger. §308 (the installer asks the terminal to swap) rules it, and design/roadmap/0694-the-installer-asks-the-terminal-to-swap.md builds it.

display_terminal: swapped live through the swap reserve

calef ruled its three questions on 2026-10-19 (UTC), and milestone 23's block records the rulings. How it works:

system_tests::user::terminal_display_swap_tests is the proof, on all three architectures.

compositor: not before it has a boot path

It is the easiest of the three on paper: no state worth moving, and every surface a client owns is a capability its supervisor routed, so a replacement wired from the same declaration gets the same surfaces. But no boot runs it. Swapping it under the milestone 33 test harness alone would measure the harness.

Milestones

BUGS

terminal_supervisor's, which its module doc lists:

The note's own:

line_editor's blob is smaller than LineEditor's buffers, because it does not carry the completed-line snapshot or the browse stash. Measured by line_editor's host test on 2026-09-27: a full ring of near-maximal history lines serializes to under 2 KiB, and with four queued lines the whole blob is under 4 KiB, so it fits the one page it declares. MemoryRegion::RETYPE takes a page count anyway, DECISIONS §233 (MemoryRegion::RETYPE takes a page count), because redoxfs_server will not fit a page and swapper's fixture uses two. display_terminal's instance was measured with MemoryRegion::USAGE on 2026-10-19 (UTC): 207 to 212 pages committed, most of it the 177 pages of grid, which are in .data because a blank cell is not zero bytes.

See also