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.
- P0-1, the manifest cannot stand alone: Done, #3643, #3951. The only path dependencies left are the
crate's own two,
grant_contractanddomain_name_resolution_contract, which the move converts togitandrev. - P0-2, there is no README: At the move. The README is in the scaffold's sections (#3643); the move
pull request records the stranger run in
docs/stranger-test.md, which the template's scaffold supplies, and brings the README under the template's prose caps. - P0-3, the encoders accept manifests the decoder refuses: Done, #3565, #3643.
- P1-4, the shipped text names a person and cites the tree: Done, #3643. Only the
Name:blocks remain, and the move strips them. - P1-5, stale documentation: Done, #3643.
- P1-6, private names break the spelled-out rule: Done, #3643.
- P1-7, the tests and examples depend on nife's catalog: Done, #3643, #3951. The unit tests, the verb
tests, the doctests, the README example, the seed writer and the fuzz target build their own
manifests from
grant_contract;every_compiled_in_manifest_round_tripsruns incrates/program_table, which holds the catalog. - P1-8, the fuzz target and seeds stay behind: At the move.
script/crate-movestages the target, its 14 seeds asfuzz/corpus/, and afuzz/Cargo.tomlwith the crate's own dependencies, and rewrites the seed test to readfuzz/corpus/(#3951); the move pull request drops the target from nife's fuzz workspace. - P1-9, the template refuses the fuzz opt-in over
carry!: Done, #3643. The maintainer ruled it a two-way door: the weekly opt-in stays off, the project's own host fuzzes the crate, and the template's scan does not change. - P2-10,
Erroris notDisplayorError: Done, #3565, #3643. - P2-11,
Zoneslackslen, and the views differ on lifetimes: Done, #3643. - P2-12, the proofs cover version 1 only: Done, #3643.
- P2-13, the note header written four times: Done, #3643.
- P2-14, the
interfaces_notedev-dependency: Done, #3643. - P2-15,
stdinside ano_stdcrate: Done, #3643. - The wire literal
nife: Done, #3575, ruled 2026-11-14 (option A). - The
_LENfamily: Done, #3643, ruled 2026-11-19 (option A). The_BYTESnames stand as built. serviceas a yes-or-no function: Done, #3643, ruled 2026-11-19 (option A).asks_servicestands as built.VERSIONas the name of version 1: Done, #3643, ruled 2026-11-19 (option A).BARE_VERSIONstands as built.- BUGS, the two statics
carry!emits: Done, #3817. They areMANIFEST_NOTEandSUBTREE_GRANTS_NOTE, provisional (a two-way door, ruled by the maintainer).globally_unique_identifier_partition_table'sNIFE_DATAandNIFE_BOOTare that crate's own. - The review clearance: Done, ruled 2026-11-20 (option A). The review package is
notes/crate-reviews/capability-manifest-note.md.
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
- Milestone 1017. Its step 6, the move, does the At the move lines under Finding status.
BUGS
- Identifiers that spell the word are not wire literals, so the marker does not cover them: the
NIFE_DATAandNIFE_BOOTconstants ofglobally_unique_identifier_partition_table. Each needs a rename lane before its crate leaves; the lint counts them until then. - The review inferred item 8's failure of
tests/fuzz_seed.rsin the staged repository. The dry run's build step stopped at the manifest before any test ran. The fix is right whether or not the inference is. - With item 9's opt-in off, the version 2 and 3 zone walk gets fuzzing only on the project's own host. Kani covers a version 3 descriptor with one zone; past that, if the host stops running the target, the walk's coverage is the hand-written tests and the seeds alone.
- The prior-art rows marked unverified (GNU property alignment and ordering, the OpenBSD, NetBSD
and Go type numbers) are from memory. The README cites only the owners
FreeBSD,GNUandFDO, and none of those rows. - This block does not review
grant_plan::Manifest, whose fields the layout spells. If someone adds a field there without a byte here,every_compiled_in_manifest_round_tripsrefuses it at compile time. That holds only while that test lives in a tree that holds both crates (it lives inprogram_table's tests).
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.