roadmap NOT-STARTED

507. Installing a package: mutate shared directories, compose a view, or only widen what can be spawned

The decision is §208 (installing a package is granting it, and the installed programs are versioned), at design/decisions/0208-installing-is-granting.md: calef chose A3, with rollback (2026-09-23). Installing records that a package exists, its digest and manifest become spawnable, its data is a read-only directory a session binds by name, and the table of entries is versioned so an installed-programs table rolls back as a whole. §208 carries why A1 and A2 lost, what A3 obligates, and the one section it reopens.

The text below is the scoping proposal of milestone 198 (a package manager, and the trivial install), kept as its author wrote it: the options, the costs and the two namespaces are the argument the decision was made against. How installation reaches a running system is the contract every package, every program author and every future installer is written against, so it is irreversible in AGENTS.md's sense. DECISIONS §157 (a trivial install is a web page, a USB drive, and packages over the internet) defines a trivial install as growing by installing packages over the internet, which is installing onto a running system.

What is being decided

What the act of installing does: which shared state changes, who holds the authority to change it, and how it is undone. Milestone 47's conclusion is that installing a program is granting it into a namespace; design/haiku-bfs-and-packages.md notes Haiku reached a similar shape (activate, do not install) for atomicity rather than authority. This proposal checks both against what the tree actually has.

There are two namespaces, and every option must say what it does to each

Reading the code rather than the phrase found that "a namespace" is two different things here:

  1. The program namespace: which names a shell will spawn. Today it is sealed at boot. The shell resolves a name through the closed grant_plan::Program enum (PROGRAM_COUNT = 13), sends its integer id over spawnproto, and the progenitor indexes a [Option<Elf>; PROGRAM_COUNT] table it filled once, at boot, from the measured archive (crates/system_initializer/src/lib.rs, boot). Milestone 150, in flight as PR #968, generates that table from one declaration, which removes the hand-maintenance and leaves the seal: the set is still fixed when the image is built.
  2. The file namespace: directories a session can reach. Built out of granted directory capabilities plus bind, which is "a small fixed table, up to four entries, mapping a name to a (Which, Cwd) position" (grant_plan::nav::Bindings, milestone 47). It names positions; it does not union directories.

Two facts found on the way that any runtime option must answer, and neither was in the brief:

Options

What installing does Program namespace File namespace Undo Prior art (read)
A1. Mutate shared directories Write the package's files into shared directories on RedoxFS A writable table of spawnable names the spawner re-reads Files appear in place A per-package file list; no atomicity across files unless RedoxFS provides it (not checked) apk: installs change the shared filesystem in place (read: hydrogen18.com's apk post). The tree already does this on the host: cargo xtask manual writes doc/<bundle>/ and a doc/bundles index into the RedoxFS image
A2. Compose a read-only view Store the package whole and read-only; a composer presents the union of activated packages The composer's view is what the spawner reads A userspace server speaking file_system_contract over the union Keep the previous installed-programs table and select it Haiku packagefs: "a virtually extracted union of the contents of all packages"; activated-packages file; the boot loader offers an old state (read: haiku/docs/develop/packages/Infrastructure.rst). Nix: a profile is a symlink to a generation, flipped atomically; rollback repoints it (read: nix.dev/.../package-management/profiles). OSTree: read-only /usr, boot the previous entry (read: ostreedev.github.io/ostree/introduction/)
A3. Grant, do not place Record that the package exists: its digest and manifest become spawnable; its data is a read-only directory a session binds by name Widened by one entry (name, digest, manifest) bind <pkgdir> <name>; no union, one directory per package Remove the entry; nothing was written into shared space Fuchsia: components are resolved from packages by URL, and "some component resolvers are limited to base packages" (read: fuchsia.dev/.../verified_execution). Genode/Sculpt: after download "a configuration dialog ... define[s] the interplay of the new component with the system", routing each service (read: genode.org/documentation/articles/sculpt-25-10)

What the tree already does in the analogous case.

Costs, measured or bounded by the code

Reversibility, and who has acted on it

No one has installed a nife package. But milestone 150 is changing the program namespace's declaration right now (PR #968): it generates the spawnable table from Cargo.toml [[bin]] blocks and pins "the thirteen shipped wire ids". Any of A1 to A3 extends what 150 builds; none contradicts it. The pinned wire ids are the thing to watch, because a name-carrying spawn request is the alternative to an id, and an installer would add a second way to name a program beside the id 150 fixes.

The §92 test

A1 is the cheapest to describe and not the cheapest to build here, because it needs a writable spawn table, a removal list and an atomicity answer. A2 is the most expensive. A3 is between. If A3 is preferred because it is cheaper than A2, that is effort, and should be said. The non-effort case for A3 is that it is the only option in which installing changes only what may be granted, which is milestone 47 (navigation and naming)'s claim made literal. The non-effort case for A2 is Haiku's and Nix's atomic rollback of a whole system state, which A3 gets only if the table of entries is itself versioned.

If calef says no to all three

(calef chose A3; see §208. The section is the proposal's own reasoning about the stakes, which is what made the cost of a refusal legible.)

Nothing is installed at runtime; packages are build inputs to an image, and a new program arrives by reflashing. That is the first slice, and it is a complete answer for us as builders. It is not an answer for a customer who wants git without rebuilding their system. (Under DECISIONS §157 that first slice is not the answer, and a "no" here also stops rung 3; milestone 198 carries the rescoping.)

Index row

What the act of installing does: which shared state changes, who holds the authority to change it, and how it is undone.