roadmap BUILT

595. The shell runs a std program, and rg pattern works at the prompt

Minted 2026-09-25 by the maintainer's lane maintainer/shell-runs-std, from the gap #1314 recorded in notes/foreign-program-arguments.md's BUGS section. (Number and title provisional: the integrator mints the number at merge, and the title is a draft until an architect names it.) The progenitor's std layout was built on 2026-09-26 by lane milestone/595-std-layout. Its x86_64 half was promoted from the proposal the-x86-64-progenitor-serves-entropy-from-rdseed and built the same day by lane milestone/595-x86-std. Lane milestone/595-rg-at-prompt finished it on 2026-10-07. See "What is built" below.

The gap, checked 2026-09-25

The shell could not launch a std program at all: every program swish could name was native. ripgrep ran only from the kernel test harness, which builds the address space std expects (the eight slots patches/std-nife/overlay/std/src/sys/pal/nife/rt.rs fixes, the file-service page, 32 stack pages). The progenitor's loader had never built a child in that layout.

The goal

From the prompt, rg needle docs runs confined to the directories the line granted and prints its matches. A path outside the grant is not found, because nothing names it. This holds on aarch64, riscv64 and x86_64 per DECISIONS §19 (architectural parity is a tenet), or a scope note says which architecture is missing and why.

What is built (2026-09-26, lane milestone/595-std-layout)

The progenitor builds a std child, and std_exerciser runs from the prompt. Proven by two script/swish-check lines on aarch64 and riscv64, through the real crates/system_initializer rather than the kernel's harness:

What it took:

What is built on x86_64 (2026-09-26, lane milestone/595-x86-std)

std_exerciser runs from the x86_64 prompt, and so do the four uuid lines that leg had omitted since milestone 182 (x86_64's own interactive-boot entry point). script/swish-check --arch x86_64 now types 81 of 85 lines on its first boot; the four it omits need a NIC (two network runs, two package fetches). Green on patagonia under OVMF three times, the last after rebasing onto #1318's merge (442 s for the first boot).

The gap was entropy. The progenitor built its entropy service only from a virtio-rng on a virtio-mmio slot, and q35 has no mmio bus.

Who confirms RDSEED exists: the kernel

The proposal's open question, decided as reversible, for three reasons not about effort:

How it reaches the progenitor: a built service, not a flag

kernel::user::boot_instruction_entropy (provisional) calls entropy_service::ensure(Bus::Instruction) when no virtio-rng was granted, reads the readiness report before the progenitor starts, and grants the request endpoint at slot 16, BootEndowment::entropy_ep (provisional). This is the file service's shape (fs_ep, slot 5). The three START words are spent, and a bit in a page would be a second format for one fact. No new system call, method or object type. The progenitor probes slot 16 before its first retype, because after that a first-free object could sit there.

A machine without the instruction refuses loudly

Falsified once with NIFE_CPU='max,-rdseed'. The kernel printed entropy : NONE. No virtio-rng device, and this CPU has no seed instruction (RDSEED, RNDRRS), so nothing at the prompt can draw random bytes and there is no login. Then the gate's new entropy-source check failed on that sentence, and std_exerciser died with std::random's own refusal. A first draw of all zeros gets a REFUSED sentence and no grant. There is no fallback to RDRAND or to software.

The gate now reads the source on every leg: swish-check asserts the progenitor's entropy service up sentence, naming a virtio-rng on aarch64 and riscv64 and the seed instruction on x86_64, with the kernel's refusal as the negative.

The machines, and the login stack

QEMU's -cpu max implements RDSEED, so no -cpu change was needed. xenon's i5-7500T (Kaby Lake) has it per Intel's documentation, not read on xenon. With entropy, x86_64 builds the login stack at boot for the first time: one more line before the prompt, and a capability-slot peak at hand-over of 22 of 24 (17 before), read by a temporary instrument, matching aarch64 and riscv64.

What it waited on, and what finished it

Every fork was ruled by 2026-09-27. §219 (how the shell names an installed program to the spawner) option D lets an unvouched rg run by its path; installing it with jig is milestone 121 (ripgrep and enumeration)'s, on calef's 2026-10-07 ruling. Milestones 205 (how a foreign program is told what to do), 665 (designating a foreign program's words) and 206 (a program image has under 896 KiB) gave it words, a grant from a word, and room.

What is built: an image as large as rg (2026-09-27, lane milestone/595-std-image)

spawnproto::IMAGE_MAX_PAGES went from 64 pages to 1024 (4 MiB), and rg's image is about 670. Proven by script/swish-check: installed/std-echo-large big, std_echo padded with zeros to 768 pages, prints its words. The kernel harness already loads a segment that large; this proves the path from the prompt.

What is built: rg at the prompt (2026-10-07, lane milestone/595-rg-at-prompt)

Unmodified ripgrep 14.1.1 from crates.io, run by its path at the prompt, searches the directory a word on the line granted and nothing else. Proven by script/swish-check on aarch64, riscv64 and x86_64 under TCG on patagonia, 2026-10-07, after helpers/build-ripgrep.sh. The aarch64 transcript (riscv64's and x86_64's are the same, byte for byte; x86_64 typed 150 lines in 516.9 s):

$ /installed/rg needle docs ../hay/secret.txt
  rg: ../hay/secret.txt: IO error for operation on ../hay/secret.txt: `..` would leave the granted directory, which no capability designates
docs/n.txt:find the needle here
$ /installed/rg needle
  rg: failed to get current working directory: operation not supported on this platform
did your CWD get deleted?

secret.txt sits beside docs in /hay and holds the needle too. caps /installed/rg needle docs previews cap 4 endpoint dir /hay (only docs in it, named on the line), read-only, and provenance: unvouched.

What it took:

What it unblocks

Which fatal risks it serves

Risk 1 (only software written for nife runs on nife): a stranger's program now does its job at the prompt, where a stranger would type it. Risk 7 (the confinement claim is false) gets its most legible test: a search that cannot see outside its grant.

The gate that proves it

Two halves, because rg is absent from CI. Both are script/swish-check lines rather than the kernel boot test (shell_runs_std_tests.rs) this block first proposed, because swish-check types at the real prompt through the real crates/system_initializer, which a scripted shell in the kernel harness would only imitate.

The answers are substrings of the transcript, as for every swish-check line, not the byte-for-byte comparison first proposed.

BUGS

Follow-on

Index row

The shell could not launch a std program, and ripgrep ran only from the kernel test harness. Now unmodified rg from crates.io runs by its path at the prompt and searches only the directories its words granted, on all three architectures, proven by script/swish-check wherever rg was built. It built on §219's option D, milestone 205 (how a foreign program is told what to do) for arguments and milestone 206 (a program image has under 896 KiB) for image size. It unblocks milestone 121's remaining items and milestone 123's demonstration.