decisions AMENDED

235. The OS is built and updated from packages, and its source divides by purpose

Raised 2026-09-26 (UTC) by calef, who asked for milestone 607 (provisional number): nothing ties together how packages build and update the OS and how the monorepo splits into divisions. The measurements and the prior art are in notes/packages-and-divisions.md; this section holds the forks and does not restate the numbers beyond what a fork needs.

The rulings

calef ruled on every fork on 2026-09-27 (UTC), in the maintainer session, relayed in comments on pull request #1389. What is left open is a follow-on, not a fork.

What is already decided, and holds under every option here

The premise, checked

The question assumes packages could build the OS and the tree could split along release lines. Three facts from the tree qualify that. Each is measured in the note.

  1. The kernel binary is a function of every base program. kernel/build.rs compiles the digests of the progenitor and of PROGRAM_MEASUREMENTS into TRUST_ROOT. Any base service change relinks the kernel. §151 calls the kernel an independently released component; the build makes it the last link of the image.
  2. The kernel crate is also the integrator and the test harness. kernel/src/user/ is 28,441 of the kernel's 89,885 lines. The kernel depends on nine service crates and three fixture crates, and half of the commits in that directory touch another crate.
  3. Contracts still move with their consumers. Of 215 commits touching a contract crate in 60 days, 76% touched another division too. That churn holds no move under §151 (the goal of the repository split is independent release)'s bottom-up order: a contract crate leaves carrying a version that each consumer checks.

None of these makes the question wrong. They say where the work is, and fact 1 decides which forks are live.

Fork 1: what an OS update ships

What a slot receives. The on-disk layout and the update manifest are formats the updater and the booting system agree on.

option shape what it costs
U1. The image stays the unit (not taken) Packages are only a build input; a slot receives the whole image Every base fix is a full image, about 10 MB.
U2. One shared store (refused 2026-09-27) Both slots read one content-addressed store of base packages (Fuchsia, OSTree). A mistake in the store's collection rule bricks both slots. The disk saved is not worth that.
U4. Packages downloaded, each slot a full copy (ruled) Packages are the download unit, as in U2, but a slot holds its own full copy of every base package. The inactive slot is wiped whole before it is reused, then filled from the new manifest. No collection rule, so nothing can delete a blob the other slot needs, and the slots stay independent. Disk holds two full base sets. A download can still skip packages whose digests match the running slot, by copying them locally.
U3. Two tiers (not taken) U1 below the package manager, §208 activation above it A tier line to maintain, and two rollback mechanisms.

Every option keeps 525's slots. U1 and U3 need no new boot format; U2 and U4 each need one. The ruling takes packages as the unit and U4 as the slot layout, per the table above.

A slot holds only the kernel and what nothing can restart, and every other program is a package that updates without a reboot (§159 (only a new kernel needs a reboot), 2026-10-07 UTC).

The base image is the resolved lock of a dependency graph. Resolution happens at build time, not on the device, the way Cargo.lock and a Nix closure work and apt does not. Programs outside the base are resolved at install time and pinned by digest under §220. An installed package can fill a service's role through a grant (§208) without changing the base list. And an owner-pinned base, built from §220's scoped keys, is a door T4 with T2 leaves open, since the progenitor checks whatever manifest digest the loader hands it.

Fork 2: where the trust root lives

This decides whether the kernel can ever release on its own. The kernel and the progenitor agree on it, so it is irreversible once an installed machine boots it.

option shape what it costs
T1. Compiled into the kernel (today) TRUST_ROOT pins the progenitor and the table Kernel and base image release as one unit.
T2. Handed over by the loader The slot carries one manifest digest, the loader passes it to the kernel, and the kernel checks the progenitor and table against it The kernel binary stops depending on userspace. Trust moves to the loader, which only Secure Boot (milestone 500 (a stick that boots with Secure Boot on)) or the slot checksum protects. Three handoff paths to change: a device tree /chosen on aarch64 and riscv64, PVH on x86_64. Milestone 525 records that the device-tree path has one initrd slot.
T4 with T2 (ruled) The loader hands over the progenitor digest and the manifest digest. The kernel checks only the progenitor. The progenitor checks the base set against the manifest digest. The kernel binary stops depending on the base set, and the checking of it moves to userspace, which already refuses unlisted programs (milestone 104 (the measurement continues past init)). T2's costs stay: trust in the loader and three handoff paths. The kernel still depends on the progenitor, so the two release together.
T3. A signature over the system manifest The kernel verifies a vendor key Reopens milestone 450's refusal: keys and verification code in the kernel.

T1 fits U1 and U3 without change. U2 works under T1 too: the kernel pins the manifest's digest, and the manifest pins the blobs. So Fork 2 is about the kernel's independence, not about packages. The ruling makes the kernel independent of the base set, though not of the progenitor.

Fork 3: the divisions, and whether they become repositories

The names of divisions and repositories are calef's; those below are provisional. Seven candidates come out of the dependency graph: kernel, contracts, runtime, boot, services, fixtures and host. Proofs are not a division: each lives beside its code in 28 places.

option shape what it costs
R1 (ruled, until each piece leaves). What has not left stays in one repository, boundaries enforced inside it Each package's boundary is drawn in-tree and checked by lint, in the spirit of milestone 39 (repository structure for a loosely-coupled OS)'s option B. script/test stays one command. A piece leaves only in the bottom-up order, and this repository pins each piece that has left.
R2. Split out the SDK alone (not taken) Contracts and runtime move out 76% of contract commits touch another division, so most become two pull requests.
R3. Split along all seven (not taken) Milestone 39's option C, with basalt as the gate 27% of code commits cross a division.
R4 (ruled, the end state). Everything leaves The kernel, the programs, the tooling and the crates each leave for a repository with one purpose, bottom-up; each package has a required home, no default Forces a decision per piece rather than a default of staying. nifeos/nife keeps only the history.

Two things stay single-tree under every option. One script/test proves every architecture (§19 (architectural parity is a tenet)), and the integration test suite needs every division at a known version to run. R1 keeps both. The end state has to rebuild them wherever the base's gate goes.

How big a repository is

A repository has one purpose, and its purpose sets its size. A package is the unit of install: it is what releases together, and it may hold several programs. A repository is the unit of source: it may be finer than a package, and one package may be assembled from several single-purpose repositories. A program package's own source, its programs and the crates only it uses, is one purpose and leaves as one repository. A crate published on its own or consumed by more than one repository is another purpose, with a repository of its own (§316 (a program package leaves as one repository, with the crates only it uses), ruled 2026-11-04 UTC). One repository per division is refused: a division comes from the dependency graph, not from a purpose ("The premise, checked" above measures 76% of contract commits crossing one).

Milestone 610 (the interface's stability is measured weekly) carries a per-package co-change column beside its division figure. The column informs how packages group: what changes together is a candidate to release together. It gates no move, since each piece leaves in the bottom-up order of §151 (the goal of the repository split is independent release).

Every .package.toml file's provisional home field stays provisional. packages/homes.toml's header cites this.

Fork 4: how a third party builds against the ABI

This is milestone 198 (a package manager)'s SDK gap: an outside author must clone this repository to get the toolchain. The closure a std program needs is ten crates, about 24,400 lines, plus the 4,486-line std overlay, the target files and the linker script.

option shape what it costs
S1. Publish crates and a toolchain (not planned) The ten crates on crates.io, plus a toolchain archive A semver promise to strangers, and it still needs S2 for the overlay.
S2. One SDK archive per release (ruled, now) Fuchsia's IDK and Genode's api archive: the crates and toolchain pieces in one file, used through [patch] or a path. Nothing published to a registry. A bespoke install step for every third party.
S3. An upstream Rust target (ruled, the destination) The std overlay moves upstream as a tier 3 target. Upstream review, and a claim that the ABI is stable enough for someone else's tree. Months, not a milestone.

Under the ruling, a program carries the ABI revision it was built against, in milestone 597's manifest note, so the progenitor can refuse one it no longer supports.

Recommendations on the reversible parts

Sequencing is reversible, and so is the first step, because it lives on the host and leaves the machine in no form.

Three pieces are right under every option, and cost nothing on the device. P1 builds the image from packages. P2 pulls the integrator and the test harness out of the kernel crate; decided, in a lane. P3 cuts the two contract-to-runtime edges. Descriptions are in the table below. Then comes the ruled work: the SDK archive (P4), the update path (P5), the trust handoff (P6) and the package boundaries (P7).

The proposals, none minted:

id proposal waits on
P1 The image is assembled from base packages by digest nothing
P2 The kernel crate stops carrying the bring-up and the system tests decided; in the lane milestone/609-system-tests-leave-the-kernel
P3 A contract never links the runtime nothing
P4 A third party builds greeting from the S2 archive, with no clone of this repository nothing (S2 and the note field ruled)
P5 An OS update is a set of packages that lands through a slot P1 (U4 ruled)
P6 The loader hands over two digests, and the progenitor checks the base set (T4 with T2) P2
P7 Package boundaries drawn in-tree, lint-checked, each with a required home built, milestone 611

The seven questions

In seven-questions.md, with the refusals each question turned up.

What cannot be undone, and what can

The update manifest and store layout (Fork 1), the trust handoff (Fork 2), repository boundaries and their names (Fork 3), and anything published to a stranger (Fork 4) are irreversible once a machine or a person outside acts on them. Everything in P1 to P3 is host code and can be reverted.

What this unblocks

Every proposal above. Milestone 198's rung 4 (the web page) can say the SDK is an S2 archive. Milestone 39 has its answer: R1 for what has not left, and everything out in the end, in the bottom-up order of §151 (the goal of the repository split is independent release).

Follow-on

Open, and none of them a fork of this section:

BUGS