roadmap PARTIAL

695. The kernel trusts two digests handed to it by the loader

Title and slug are drafts. Branch: milestone/695-the-kernel-trusts-two-digests-from-the-loader.

Item 6 of milestone 607 (nife is built and updated from packages), with milestone 697 (the trust root leaves the kernel binary). §235 (the OS is built and updated from packages) ruled the shape on 2026-09-27 (UTC), T4 with T2. This block is the boot-path half; 697 is the build half and holds the measurements.

Reuse: crates/measured_boot's digest text, the device_tree_blob package's /chosen walk, crates/device_tree_patch's rewrite, uefi_loader's command-line writer and build script, and the three QEMU runners. One new crate, crates/base_digest_contract, written because the page it defines is new boot ABI that the kernel and the progenitor must share (§311 (a contract is code, not prose)); no new dependency.

What changes

The loader hands the kernel two digests on all three architectures, as two words on the kernel's command line: nife.progenitor=sha256:<hex>, the progenitor's, and nife.base=sha256:<hex>, the digest of the archive's program_measurements table. The architect ruled on both words and their spelling on 2026-11-01 (UTC), and §235's "manifest digest" reads as this table digest. On a device tree they sit in /chosen/bootargs; on x86_64 in the PVH command line. measured_boot::loader_digests is the one grammar every writer and the kernel use.

The kernel records the words while its front end still maps the line, and trust::require holds the progenitor and the table to them before it enters userspace. A boot whose loader handed no words, a repeated word or a malformed digest halts with MEASURED BOOT REFUSED, naming which. The kernel then hands the base digest to the progenitor as a read-only page in slot 34 (base_digest_contract), and the progenitor checks the table against it before reading it, refusing the boot with the reason on the UART otherwise. TRUST_ROOT still holds both entries too, and both sources must agree until 697's part 2 removes it. Only Secure Boot (milestone 500 (a stick that boots with Secure Boot on)) or the slot header's CRC-32 protects the loader, and §235 accepted that cost. Signatures stay where §220 (signed builds) put them, at install and update time.

Four writers copy the words; none computes them at boot. cargo xtask writes <archive>.loader-digests beside every archive it packs, read back from the packed bytes. The QEMU runners pass it as -append. uefi_loader/build.rs embeds it beside the archive, after holding it to the archive's two entries. The board's U-Boot scripts set bootargs to the card's copy, and the TH1520 FIT's environment carries it as usr_bootargs.

Comparable system: Fuchsia checks the system_image Merkle root, carried in its boot arguments, in userspace rather than in the kernel.

What is calef's

Both questions of how-the-loader-hands-the-kernel-two-digests.md have answers from the architect, given 2026-11-01 (UTC). Question 1, the bytes of the handoff: the architect ruled option A, the two command-line words nife.progenitor= and nife.base=, which the code here builds. The maintainer made the spelling nife.progenitor provisional on the same date: only the tree reads the word, and reversing it costs one pull request. Question 2: option A, the composer records the digests and every loader copies them.

A third question follows and stays separate. Once the kernel can update apart from the base, the system call surface becomes a versioned ABI that installed programs rely on.

The consumer, and the condition the code waits on

The first caller is milestone 976 (an OS update is a set of packages that lands through a slot), part 4, the updater. The architect directed on 2026-11-01 (UTC) that this lane and 697's launch before part 4 shows what a kernel download costs per update; that direction lifts the earlier hold. Nobody has taken that measurement, so nothing here depends on it, and each piece reverts on its own. A milestone names its consumer. It is not BUILT until a record cites its first use.

The plan in parts

part what needs a ruling? size
1 A contract crate for how the kernel hands the base digest to the progenitor, and the progenitor's check of the table against it, host-tested. The two release together. ruled 2026-11-02 (UTC): a read-only memory capability in a new slot about 200 lines and host tests in crates/ and crates/system_initializer
2 The parser and writer for the handoff's two words, measured_boot::loader_digests. question 1, decided about 150 lines and host tests
3 The kernel reads the two words on each path and holds the progenitor and the table to them. question 1, decided about 150 lines, one QEMU suite per architecture
4 The writers: xtask and the QEMU runners, uefi_loader, the board's U-Boot scripts, and 976's slot writer. question 2, decided about 300 lines; the board half needs a bench boot

Follow-on

Index row

The loader hands the kernel the progenitor's digest and the program_measurements table's digest, on all three architectures, and the progenitor checks the base set (§235, T4 with T2). The boot-path half of 607's item 6; its first consumer is 976 part 4. The architect answered both handoff questions on 2026-11-01.