roadmap BUILT

1059. block_roster_contract: the outside review's findings land before its first release

Raised by the lane milestone/1059-block-roster-contract-outside-review. A reviewer with no prior exposure to this project read the crate's repository at 436d4ce, the main after its pull request #1. The reviewer read it against the review package for block_roster_contract. Pull request #2 of the repository then renamed the crate to block_roster_contract (47ac5a9, now main), and this block cites files and symbols at that commit. This block proposes work and changes nothing in that repository. Every item below is work for a lane there.

The identity stays as frozen: INTERFACE_ID 5, VERSION 1, magic blkrosv1. Nothing below asks to change it. The names the review package ratifies, and the decisions it records, stay closed here. This crate is the contract pilot of milestone 1017 (the contract crates leave in this order), which owns the order of extraction and the reasons for it. Milestone 1034 (a runbook for moving a crate out of nife) owns the move itself. This block owns the findings that land after the move and before a first release.

Reuse: the crate's own Kani harnesses and falsification patches, cargo-mutants, and the shared crate workflows at a pinned revision do every check this block names. The one new file is a cargo-mutants configuration of two lines, in the shape of the one this tree already carries. No new tool.

Goal

The crate is small, free of dependencies, safe Rust, and its three proofs hold. Housekeeping the shared workflows already measure stands between it and a first release. The weekly run is red twice over, the template pin predates the mutation stack, and the shipped text still carries the wording of the tree it left. The three API changes ruled below land before any tag, while they cost two call sites and no version bump.

Publishing stays held, as milestone 1050 (designware_mobile_storage's outside review) says. Nothing in this block lifts that hold, and no tag follows the rename (decision 6).

What the review covered

The reviewer ran these firsthand at 436d4ce, on a Linux host with stable Rust 1.99.1, Kani 0.68.0 (the template's .kani-version) and cargo-mutants 27.1.0:

check result
cargo test 10 unit tests and 2 doctests pass; one doctest is the README example
cargo build --lib for x86_64-unknown-none, aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf all three build
cargo clippy --all-targets; cargo doc with warnings as errors no warning
cargo kani 3 of 3 harnesses verify
the falsification patches, each applied to a copy each turns its own harness red (3 of 3)
cargo mutants 59 mutants: 34 caught, 21 missed, 4 unviable; the 21 are one in capacity_of and 20 inside the cfg(kani) module
cargo llvm-cov 98.5 percent of lines, 100 percent of functions
cargo deny check, cargo machete, typos . clean (deny notes an unmatched Zlib allowance, a warning only)
cargo package --list 38 files, 56.8 KiB, 19.8 KiB compressed
cargo +1.85 test --ignore-rust-version passes
the weekly workflow on main red: stranger cadence (no Last run: date) and mutation (survivors not exempted)
repository settings private vulnerability reporting on; the crate-maintainers team and the main and tags rulesets present

Rechecked at 47ac5a9 for this block: the manifest, the workflow pins, .github/mutants-exempts, docs/stranger-test.md, the README and the symbols each item names in src/lib.rs. The rename moved none of them. The latest weekly run is still the one on 436d4ce; check and proofs pass on 47ac5a9.

Not run: the stranger test proper, on a machine with no target preinstalled (this host had the targets already, which hides one README gap in P1-7). Also Miri (the weekly job runs it green), cargo-semver-checks (no tag exists) and the template's workflows locally; the CI results above come from the repository's runs. The reviewer pushed, tagged, branched and opened nothing.

Effort sizes: S is under an hour, M a few hours, L a day or more.

Findings, prioritized

P0 blocks any release. P1 lands before the first release. P2 follows it, in the appendix. A door is one-way where something outside the repository acts on it: a public signature, a name, the page layout or the license. The maintainers decide every two-way item provisionally.

P0: the two red weekly jobs

P0-1. The stranger test has never run

docs/stranger-test.md reads Last run: none. The release workflow at the pinned template refuses a release until a run is on record, and the weekly stranger cadence job fails closed on the same line. Change: a reader with no project context clones fresh and follows the README alone (P1-7 lists what it will trip on), fixes the README where it misled, and writes the date. Two-way. S.

P0-2. The weekly mutation gate fails on survivors nobody has triaged

Twenty of the 21 survivors sit inside mod verification in src/lib.rs, which compiles only under cfg(kani), so no host test can kill them; their verdict measures the harness, not the crate. The twenty-first swaps < for <= in capacity_of, and it is equivalent: at len == HEADER_BYTES both branches return 0. Change: a .cargo/mutants.toml with exclude_re = ["verification::"] and a comment saying why, an entry for the capacity_of survivor in .github/mutants-exempts with that reason, and the census comment carried there deleted, since the first weekly run has answered it. Two-way. S. The template's scaffold ships no cargo-mutants configuration, so every crate with an inline Kani module meets this on its first weekly run; that is work for the template, not here.

P1: before the first release

P1-1. The CI wiring predates the template's mutation stack

Every caller pins partsfoundry/crate-workflows at cd1b484. That commit is not behind release v7, so the lag check passes, but main of the template is 33 commits ahead and carries mutation.yml, check / mutation-diff and the mutation requirement of the release gate. The repository has no .github/workflows/mutation.yml caller. Change, once the template cuts its next release: bump every pin, and add the mutation.yml caller with the per-repository cron line the scaffold now has. Then apply the settings so the ruleset requires check / mutation-diff only after a run of it exists. A required check that never reports holds every pull request. Inferred, not verified: the callers carry no # vN comment after the commit, and whether Dependabot opens a bump for a bare commit is unconfirmed; the bump should add the comment. Two-way. S.

P1-2. Roster::read tells the three refusals apart

Roster::read returns None for a short page, a wrong magic and a count past the page. Those are three different bugs (a mapping bug, a version or wiring mismatch, a writer bug), and the program that reads the page reports "nobody wired me a roster" and "this machine has no disks" differently on purpose. A reader cannot say which refusal it met without parsing the page itself.

Ruled 2026-11-09. Roster::read returns Result<Roster, ReadError>. ReadError has one variant per refusal, TooShort, NotARoster and CountBeyondPage, and implements Display and core::error::Error. The harnesses keep their shape, with is_ok() in place of is_some(). The README's sentence on what read returns changes with it. The two call sites in this organization, disk_surveyor and the disk system test, change one match or expect each. One-way (public signature). S.

P1-3. The reader ignores the capacity word

read checks neither half of what write guarantees about bytes 12 to 16: that the count is at most the capacity word, and that the capacity word is capacity_of the page, clamped. The review package carries this as its first open question. A page whose count exceeds its own capacity word came from a broken writer, and a page whose capacity word exceeds what the slice holds is a mapping shorter than the page. Change: read refuses both, through a new ReadError variant or two (names provisional, minted in the pull request), with a host test at each boundary, and the crate header and the README say what the reader checks. The read harness stays total, and the write-then-read harness still holds, since write satisfies both. Two-way: it changes a refusal and no signature. S.

P1-4. TooManyDevices implements Display and core::error::Error

It derives Debug alone, so ? into the error type of a caller is awkward. core::error::Error is stable at the manifest's rust-version. Additive, two-way. S.

P1-5. Nothing enforces the absence of unsafe

The crate has no unsafe block, and the README and SECURITY.md lean on that, but the crate root carries #![no_std] alone. Change: #![forbid(unsafe_code)]. The template's fuzz opt-in (P2-4) reads the same attribute. Two-way. S.

P1-6. The two accepted name findings of the review package

Ruled 2026-11-09. The parameter of Roster::get becomes index, the word its doc comment already uses, in place of i. The three transport constants, TRANSPORT_VIRTIO_MEMORY_MAPPED_IO, TRANSPORT_VIRTIO_PCI and TRANSPORT_NON_VOLATILE_MEMORY_EXPRESS, carry #[doc(alias)] for virtio-mmio, virtio-pci and nvme, the spellings a reader searches for. These are aliases of the outside terms, not of an earlier spelling of this crate. One-way (names). S.

P1-7. The shipped text, for a stranger

Each finding is in the file and symbol named:

Two-way. S.

P1-8. Device sorts and hashes, and devices() knows its length

Device derives neither Hash nor Ord, so a listing cannot sort or deduplicate without a wrapper. Roster::devices is a filter_map over get, which loses ExactSizeIterator though the roster knows its count, and get keeps try_into().ok()? paths the proofs show unreachable.

Ruled 2026-11-09. Device derives Hash, PartialOrd and Ord. Roster::devices becomes an exact-size, infallible iterator built on chunks_exact(ENTRY_BYTES).take(count), and the unreachable try_into().ok()? paths in get go.

Ruled 2026-11-09, the sort order. The struct declares transport before ordinal, so the derived Ord sorts by the value of the transport constant and then by ordinal: a listing groups by bus. The struct declares ordinal first today, so the change moves transport above it. The page layout does not follow, since write and get name each field. A comment on the struct says its field order is the sort order and a published behavior, and a host test pins that order. One-way once published (public API). S.

Decisions this block needs

Ruled 2026-11-09, and closed here:

  1. Roster::read returns Result<Roster, ReadError> with the variants TooShort, NotARoster and CountBeyondPage; ReadError implements Display and core::error::Error; the harnesses use is_ok() (P1-2).

  2. Roster::get takes index, and the three transport constants carry the aliases virtio-mmio, virtio-pci and nvme (P1-6).

  3. Device derives Hash, Ord and PartialOrd, and Roster::devices is an exact-size, infallible iterator over chunks_exact(ENTRY_BYTES).take(count) (P1-8).

  4. Device declares transport before ordinal, so the derived Ord sorts by transport and then by ordinal; a comment on the struct and a host test hold that order (P1-8).

  5. The crate is block_roster_contract, since design/naming.md ends a wire-contract crate in _contract.

  6. Whether to tag a third pre-release for the rename of capacity_of to entry_capacity. Ruled 2026-11-19: no v0.1.0-pre.3 tag now. v0.1.0-pre.2 stays the last tag. The question returns when nife needs a newer pin or a release is near. Nothing publishes.

The maintainers' provisional calls: every two-way item above and in the appendix, and the names of the capacity-word refusals in P1-3, which go through the naming review before any tag.

The publishing hold stands.

Prior art

How NVMe, virtio, Linux, UEFI and the Rust block-device crates answer "which block devices exist", and what this crate takes or refuses from each, are in the prior art appendix.

Done when

The checks are in the done-when appendix. None needs hardware or QEMU.

BUGS

Finding status

Each line names the pull request that closed the finding in partsfoundry/block_roster_contract, read on its main.

The publishing hold keeps publish = false, and v0.1.0-pre.2 stays the last tag (decision 6).

Open decisions

None. The publishing hold stands.

Follow-on

Index row

An outside reading of block_roster_contract: two red weekly jobs block the first release (no stranger run; mutation survivors inside the Kani module). Eight items go before it. The CI pin and the mutation caller, a checked capacity word, Display on TooManyDevices, forbid(unsafe_code) and the shipped text are the maintainers' calls. A Result from Roster::read, index and three aliases, and Hash and Ord on Device sorted by transport then ordinal, with an exact-size devices(), are ruled. Eight follow it. No tag follows the rename; publishing stays held.