The VM crates are layered

One ABI leaf every party links (core and synod included); one guest program with no exec and no argv; the gate owns the ledger and the agent reads one bit; the privileged service is its own crate. This decision supersedes nothing.

Amended 2026-11-24. See windows-runs-openvmm. There is no privileged service: the synod-machine-broker crate, its row in the table below and its tempfile dev-edge are gone. vm-manager owns every machine, and on Windows it spawns openvmm.exe itself. vm-manager dropped serde and serde_json and gained no crate. The other rows stand.

Amended 2026-12-01. The guest supervisor (exarch::vm) moved into exarch behind its default vm feature, which static musl guest builds (--no-default-features --features coreutils) leave out. The shared GUI shell is the desktop crate (desktop); synod and exarch-gui are thin products over it, chosen by &'static Product. The synod row below is replaced by these, and exarch gains guest-abi:

CrateMay depend on
exarchral-core, guest-abi; with vm, also vm-manager, netgate
desktopexarch (with vm), ral-core, vm-manager, netgate, guest-abi
synoddesktop, exarch, ral-core, vm-manager, guest-abi
exarch-guidesktop, exarch, ral-core, vm-manager

The dev-only edges are {desktop, synod, exarch-gui} → {exarch, ral-core}[test-util], in place of synod’s.

Why

Shared facts need one owner, and each layer should require only the authority it exercises. The previous structure admitted five avoidable defects:

  • Host and guest spelled runtime constants independently, allowing drift.
  • The broker checked the pipe version after a privileged boot.
  • Direct machines requested 6 GiB while broker-owned machines received 4 GiB.
  • Host-mode exarch opened an audit ledger it never wrote.
  • Exarch and synod applied separate tuning-mask laws.

The ABI leaf, version refusal before boot, shared SIZE, gate-owned ledger and Tuning::masked each remove the corresponding second source of truth.

Decision

  • guest-abi is std only. The host, guest PID 1, engine, synod and image build-tools share the runtime agreement through this leaf.
  • ral-guest combines assembly and service in one PID 1; its net pump is two threads, and its first act refuses execution outside PID 1.
  • Core owns egress policy data, netgate owns its ledger, and exarch loads policy and reads the search bit.
  • vm-manager owns machines and their lifecycle; synod-machine-broker owns the privileged service. Synod’s guest seam composes their capabilities.

Dependency invariant

These are the allowed normal dependencies between workspace crates:

CrateMay depend on
guest-abinone (std only)
ral-coreguest-abi
ral-guestguest-abi
vm-managerguest-abi
netgateguest-abi, ral-core
exarchral-core
ral-vm-image-build-toolsguest-abi, ral-core
synod-machine-brokervm-manager
synodexarch, ral-core, vm-manager, netgate, guest-abi

Dev-only edges are vm-manager → ral-core for boot-smoke, netgate → netgate[test-util], synod → {exarch, ral-core}[test-util] and synod-machine-broker → tempfile. The removed edges are guest-net → exarch and the dependencies on ral-daemon from synod, ral-initramfs, vm-manager, guest-net and build-tools. cargo tree -p netgate -e normal must show no exarch dependency; cargo tree -i guest-abi --depth 1 -e normal checks the leaf’s direct users.

Where

  • guest_abi: guest-abi/src/lib.rs declares boot, ports, link, layout and packet. A change to boot, ports::FACTORY, layout or packet bumps boot::CONTRACT.
  • ral-guest/src/main.rs: one binary calls assemble::assemble then init::serve in the same PID 1. Admission and shutdown live in init/{fleet,halt}.rs; reap::fail records the first fatal notification.
  • vm-manager/src/spec.rs: boot_line constructs the shared Boot and calls its sole writer; machine.rs owns Booted and the required machine methods, including Machine::dial_engine. error.rs owns GuestConsole::report; the crate root exports the public facade.
  • netgate/src/lib.rs: the host CONNECT gate exports its session, dialer and ledger API; stack.rs owns Config, pipe.rs owns Wake, and private refusal.rs supplies both decoder and vetter. Device access requires test-util; ledger.rs owns records, and core owns egress policy data.
  • vm-manager/src/openvmm/: OpenVmm, the Windows backend, spawns and owns one unprivileged openvmm.exe per machine.
  • exarch/src/vm.rs (feature vm): Guest, the machine’s factory, boot_media, available and Folder, the one VM harness for exarch --vm and both desktop products.
  • desktop/src/lib.rs: the shared shell over folder, wire, assistant, seam and the feature-gated window; wire.rs exports the TS bindings to desktop/ui/js/bindings/.
  • synod/src/{main,lib,grant,prompt}.rs and exarch-gui/src/{main,lib}.rs: each product’s &'static Product, handed to desktop::run.

Known follow-up

Rootfs-publication eviction and abandoned .tmp stage cleanup remain open. Old cache files and flat session disks are left for the owner to remove.

See also

boot-contract-is-versioned, synod, egress.