roadmap BUILT

1082. capability_manifest_note: what an outside maintainer would fix before it leaves

Raised by a read-only review of crates/capability_manifest_note, done as a stranger meeting the crate for the first time would, on a fresh shallow clone of nifeos/nife at the head of main (the merge of #3514). It changes nothing; it lists what the next lanes change before the crate moves to nifeos/capability_manifest_note and what can wait until after.

There is no review package for this crate in notes/crate-reviews/, so this block has no settled baseline to stand on. It treats as settled, and does not reopen, what the crate's own text records as ratified. That is the crate name, the owner string nife, the note type numbers 1, 2 and 3, the version 1 layout and its field order, and the version 2 layout and number. It also covers MAXIMUM_VERBS, MAXIMUM_ZONES and ZONE_MAXIMUM as values, MAXIMUM_DECLARED_SHORT_OPTIONS and INTERFACE_ID 7. Everything else in the crate is marked provisional by its own Name: blocks. The crate is on crates/externalization-list.txt, in step 6 of milestone 1017 (the contract crates leave in this order): after machine_statistics_contract, domain_name_resolution_contract and grant_plan.

Reuse: script/crate-move --dry-run, the template partsfoundry/crate-workflows and its scaffold and helpers, Kani, cargo-fuzz, the crate's own encoders as seed writers. No new tool.

Finding status

No finding remains Open or Waiting. The move itself is step 6 of milestone 1017: it creates nifeos/capability_manifest_note from the cleared review package and does the At the move lines.

Open decisions

None.

Goal

A stranger who finds the crate in its own repository can tell in one screen what an ELF manifest note is, and can build and prove the crate from the README alone. The stranger can trust the one claim the crate makes: that one manifest has exactly one encoding, in both directions. What the compiler accepts into a program's bytes, the reader accepts; what the reader refuses, the compiler refuses. The repository's gates are green for the crate's own reasons.

What was checked, and how

The tools run, the sources read and what was not run are in the appendix.

Prior art

The comparison with nearby work is in the appendix.

The items

Effort: XS is under an hour for a lane, S is half a day, M is a day or two. A door is one-way when somebody outside the repository acts on it after the release (a public name, a wire byte, a dependency, a license); everything else is two-way and the maintainer decides it.

P0: blocks the move

The P0 items are in the appendix.

P2: later

The P2 items are in the appendix.

P1: before the tag

The P1 items are in the appendix.

Decisions for the architect

The architect ruled the review clearance, the _BYTES names, asks_service, BARE_VERSION and the wire literal, below.

The review clearance

Ruled 2026-11-20 UTC (option A): the review package is cleared. The go is given to create nifeos/capability_manifest_note with publish = false; no tag and no publish. The move waits for its place in step 6 of milestone 1017, after machine_statistics_contract, domain_name_resolution_contract and grant_plan. The move pull request carries the stranger run (P0-2) and the fuzz workspace (P1-8).

Prior art: the Rust project moved libc out of the compiler's tree into a repository of its own, and the compiler consumes it back by version. Where nife differs: a review package checks that the crate stands alone before it leaves. Example: jh7110_entropy, cleared on 2026-11-01 (UTC), lives in partsfoundry/jh7110_entropy, and nife depends on it at a pinned revision.

The _BYTES names

Ruled 2026-11-19 UTC (option A): the eleven names stand as built. A public length carries its unit in the suffix _BYTES, as the units rule says, and a function that measures a descriptor says descriptor and one that measures the whole note says note. The constants are DESCRIPTOR_BYTES, NOTE_BYTES, SUBTREE_GRANTS_BYTES, SUBTREE_GRANTS_NOTE_BYTES, VERB_RECORD_BYTES and MAXIMUM_ZONE_BYTES. The functions are zoned_descriptor_bytes, serviced_descriptor_bytes, zoned_note_bytes, serviced_note_bytes and verbs_descriptor_bytes. The callers in nife (program_asks, system_initializer, jig, xtask) use them.

Prior art: std names a constant by what it counts (u32::BITS), and POSIX names a limit by thing and unit (NAME_MAX, PATH_MAX). The Linux kernel's ELF code says n_namesz and n_descsz after the specification, keeping "desc" to tell the descriptor from the note. Where nife differs: the name spells the unit out. Example: a reader of const D: [u8; capability_manifest_note::zoned_descriptor_bytes(ZONES)] learns at the call that the number is bytes of descriptor, not a count of zones.

asks_service

Ruled 2026-11-19 UTC (option A): asks_service stands as built. pub fn asks_service(d: &[u8]) -> Result<bool, Error> answers whether a program's manifest asks to run as a service, and a function that answers yes or no takes a third-person verb phrase. The crate's own word for the request is service, and the manifest only asks; the reader may refuse. zones keeps its name, since it returns a view. Its callers are program_asks and jig.

Prior art: std's Path::is_absolute and Metadata::is_dir; the crate's own Zones::has_root and Verbs::is_empty follow the same rule. Example: if capability_manifest_note::asks_service(d)? { ... } reads as the condition it is.

BARE_VERSION

Ruled 2026-11-19 UTC (option A): BARE_VERSION stands as built. The note's descriptor has three layouts: version 1 has no zones and no service byte, version 2 (ZONED_VERSION) adds zones, and version 3 (SERVICED_VERSION) adds the service byte. The name of version 1 says it is the layout with nothing added, so a stranger does not read it as the current version of the crate or of the format. The value is a wire byte, 1.

Prior art: FreeBSD's NT_FREEBSD_ABI_TAG names what the version is of, and GNU's GNU_PROPERTY_* constants name the property, never a bare VERSION. Example: match version { BARE_VERSION => ..., ZONED_VERSION => ..., SERVICED_VERSION => ... } reads as three layouts.

The wire literal nife in a crate that may not mention nife

Background: every manifest note begins with the owner string nife and its NUL; every program basalt has built carries those bytes, and every reader compares them. The macro places the note in a section named .note.nife.manifest, and the link script keeps .note.nife.* in the PT_NOTE. The rule for a leaving crate is that it never mentions nife; the externalization lint holds this crate at a ceiling of 37 hits, of which the lines in src/lib.rs that carry these literals are the ones that must stay. The prose mentions can all go (item 4). The literals cannot change without a new owner string, which is a wire break. A progenitor reading the new string would find no note in any program built so far. A program carrying the new string would be a native program with no authority to an old progenitor.

Ruled 2026-11-14 UTC (decision O): the owner string and the section name keep their bytes. Bytes that already sit on a wire or in built programs may spell nife after the crate leaves. This is the one exception to the rule that a leaving crate never mentions nife, and it covers wire literals only: owner strings, section names, magic values and the tests that assert those bytes. A line that holds one ends with the comment // wire literal (provisional spelling). The externalization lint and script/crate-move accept a marked line and refuse an unmarked mention. The lint prints every marked line. The lane removes every prose mention, and prose says "the owner string" without repeating the word. The README says, once, that the owner string is the name of the operating system that defines the note, as FreeBSD, GNU and FDO are. The marker is already on the lines of boot_ladder, system_log_contract and user_mode_runtime/link.ld; the lint lists them once those crates join the externalization list (it scans only listed crates, and only their Cargo.toml, README and src/).

Prior art: the owner string namespaces ELF notes, and the owner is the project that defines the descriptor: FreeBSD for NT_FREEBSD_*, GNU for NT_GNU_PROPERTY_TYPE_0, FDO for the package note, Go for the build identifier. None of those projects renamed its owner string when the code that writes it moved repositories.

Example: a program built today carries 05 00 00 00 | 38 00 00 00 | 01 00 00 00 | "nife\0" 00 00 00 | <56 bytes>. If OWNER became anything else, elf.note(OWNER, MANIFEST) on that program returns no note, and the shell runs it as a native program that hears no words.

Done when

The checks are in the appendix.

Follow-on

BUGS

Index row

An outside review of capability_manifest_note before it leaves. Three items block the move (a manifest that cannot stand alone, no README, and two encoders that build notes their own decoder refuses). Six land before the first tag. They are project-internal citations in shipped text, stale documentation, private names against the spelled-out rule, tests bound to nife's program catalog, the fuzz target and seeds left behind, and the template's unsafe scan refusing the opt-in. Six more come after. Four decisions on names: the architect ruled that the wire literal nife keeps its bytes and that the eleven _BYTES names, asks_service and BARE_VERSION stand. The review package is written and cleared (2026-11-20 UTC); the move waits for its place in step 6 of milestone 1017.