roadmap PARTIAL

1100. memory_region_heap: what an outside maintainer would fix before it leaves

Raised by a read-only outside review of crates/memory_region_heap as a stranger meeting it for the first time would. It changes nothing; it lists what the next lanes change. The number is the recording lane's to assign.

The review took its baseline from notes/heap.md ("The memory_region_heap crate's contract"), from milestone 1017 (the contract crates leave in this order), step 9 and its appendix on where talc goes, and from the vendoring record in vendor/README.md and vendor/talc.pin. It raises none of the decisions those settle. Those are the algorithm (talc 5.1.1's core, Manual source), the geometric growth with a floor of eight pages and the one contiguous heap. They also include the untyped slot as part of the program's capability contract, and the step at which the crate leaves. The review package is notes/crate-reviews/memory-region-heap.md.

Reuse: the template partsfoundry/crate-workflows and its scaffold, script/crate-standalone, script/crate-review-packet, helpers/name_release.py, cargo-mutants, Kani, and the std farm's copied-file list (xtask/src/farm/copied.rs). No new tool.

Finding status

Open decisions

Ratify the names the later items added (ruled 2026-11-19 UTC)

The rule in force, option A. The thirteen names the fixes for items 5 to 13 added stand as built: Short, PageSource, MemoryRegionPages, Refusal, WiringRefusal, base_virtual_address, maximum_bytes, initialize_source, with_source, is_budget_spent, is_initialized, last_refusal and map_page. Each public item's Name: block reads ratified. The unpublished fuzz crate's names (the modules src, policy and sequence and the function run) stay provisional, since that crate never publishes.

Prior art. dlmalloc names its page seam Allocator, and rlsf names it FlexSource; both crates settled the name before 1.0. Vec::try_reserve returns a named error type, which is the shape Short and Refusal follow. nife differs in ratifying every public item, not only the ones a README shows. Concrete example: a consumer writes MemoryRegionHeap::with_source(source) and matches Refusal from last_refusal(); those spellings are what it compiles against.

Fork talc if upstream stays silent (ruled 2026-11-25 UTC)

The rule in force, option A. The crate keeps the unpatched crates.io talc 5.1.1 dependency and the README sentence that states the gap, and nife keeps watching upstream. nife makes no fork. nife reconsiders a fork only if a 32-bit target arrives or its maintainer declares upstream abandoned.

Background. The crate's allocator core is talc 5.1.1 from crates.io. nife builds a patched copy (vendor/talc, carrying upstream pull request 57, two fit-check overflow fixes), but a [patch] table does not travel with a library, so outside nife the crate builds the unpatched release. Upstream pull request SFBdragon/talc#57 has had no comment since 2026-09-24, and the last upstream commit is 2026-09-09. The overflow needs addresses that wrap at the top of a 64-bit space, so no 64-bit process meets it. nife's images build the patched vendor copy.

Door: one-way for B and C (a published crate and a dependency other repositories build); A changes nothing.

Prior art. Rust's std depends on crates.io dlmalloc 0.2 for its wasm targets with no patch, and takes fixes only through releases. Debian and the BSD ports keep a patch at the distribution, which is the shape nife's root [patch] has today. A fork is the usual answer when an upstream has stopped, but here the fix does not reach a 64-bit process, so a fork would add a crate, a repository and a maintenance duty for no reachable gain. Concrete example: the crate's own repository runs its host tests against unpatched 5.1.1 and passes, while basalt's image, built in nife's workspace, links the patched source.

Clear the review package and approve the repository (ruled)

Ruled 2026-11-20 (UTC), option A: the architect clears the package, and the clearance creates the repository, nifeos/memory_region_heap, with publish = false. No tag and no publish. The move waits for moho_abi, address_space_layout and user_mode_runtime to get repositories. It leaves on its own clearance, as one repository with subtree_scope or as a repository of its own, decided at the move (ruled 2026-11-20 UTC), and before redoxfs, which keeps its own track.

Background. A crate leaves this tree for its own nifeos repository only when the architect clears its review package; that clearance approves the repository. A package lists every public item with its signature, and script/crate-review-packet writes it. The package for this crate is memory-region-heap.md, written under the recommendation below. The components, the fixtures and the RedoxFS server all depend on it, so it serves several consumers and meets the bar for leaving.

Recommendation: A. A package written after the names are ratified shows the architect the crate as it will ship.

Door: one-way. Creating a public repository and moving the crate there are outward steps that other pins then follow.

Prior art. The Rust library team reviews a new std interface through an API change proposal before it stabilizes, and Fuchsia's API council reviews a library before it enters the SDK (both recalled, not re-read). nife differs in reviewing a whole crate once, before its first publish. Concrete example: the architect cleared generational_table on 2026-11-08 (UTC), and its repository partsfoundry/generational_table dates from that day.

Blocks: the move.

Goal

A stranger who meets memory_region_heap in its own repository can tell in one screen what pays for the heap, where it lives, how it grows and when it refuses. The same stranger can build and test the growth policy on a host without a kernel, can read every unsafe block against a stated invariant that holds, and sees the template's gates green for the crate's own reasons.

How the review checked

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 move (a public name, a published behavior, a dependency). Everything else is two-way and the maintainer decides it.

P0: blocks the move or turns the template's first run red

  1. Seven names are not ratified, and five public items carry no Name: block. Finding: script/crate-standalone step 0 fails on the crate name (provisional) and on initialize (provisional). DEFAULT_BASE, MemoryRegionHeap, new, commit_all and committed_bytes have no block at all, so they never entered the worklist. A crate that leaves is a third-party crate and the move commit strips the blocks, so every name must read ratified first. Evidence: crates/memory_region_heap/src/lib.rs lines 11, 29, 54, 80, 98, 119, 128. design/module-block-baseline.txt lines 5190 to 5198. helpers/name_release.py --draft. Change: one lane writes the five missing blocks, brings the seven names to the architect as one table (Decision A below carries the recommendation), and applies the ruling. Door: one-way (public names). Effort: S plus the ruling.

  2. The talc dependency does not survive the move as written, and three path dependencies point into nife. Finding: the manifest asks crates.io for talc = "5.1.1" and relies on the nife workspace's [patch.crates-io] to build vendor/talc, which carries upstream pull request 57 (two fit-check overflow fixes; the first fixes undefined behavior that Miri reports). A [patch] table applies only in the root workspace, so a repository of the crate's own, and every workspace that consumes it without the patch, silently builds the unpatched package. The pull request has been open for seven weeks at the time of the review with no maintainer comment, which is a reliability signal for the upstream. moho_abi, address_space_layout and user_mode_runtime are path dependencies. The order of milestone 1017 moves them at steps 2 and 3, before this crate at step 9, so their repositories will exist, and the lines become git and rev pins with version beside them. Evidence: crates/memory_region_heap/Cargo.toml lines 19 to 28. vendor/talc.pin. design/roadmap/1017-the-contract-crates-leave-in-this-order.md, "Where talc goes at step 9". Change: Decision B below. Whatever the ruling, the move lane states in the README which talc the crate builds against and what the unpatched package lacks. Door: one-way (a dependency). Effort: S.

  3. The manifest and the files a stranger needs. Finding: no README, no LICENSE-MIT, no LICENSE-APACHE, no rust-version, license and lints inherited from the workspace, no description, repository, keywords or categories. The publish = false comment points at crates/publish-allowlist.txt, a file that is not in the crate's repository. The crate docs link notes/heap.md by path. The manifest comment names the architect and a decision section. Evidence: Cargo.toml lines 2 to 28. src/lib.rs line 2. script/crate-standalone output, 15 of its 16 failures. Change: fill in the scaffold's README-crate.md (what pays, where it lives, how it grows, the minimum useful cap, what a null return means, the talc it builds against). Add both license files, an explicit license = "MIT OR Apache-2.0" and a rust-version. Write a manifest comment a stranger can act on. The license and the version policy are already ruled for every crate that leaves. Nothing here reopens them. Door: two-way (the license is one-way and already ruled). Effort: S.

  4. The template's check workflow goes red on the first pull request for the crate's own reasons. Finding: two naming helpers fail at the template's ceiling of 0. The local binding va is on the spelled-out list (virtual_address), and commit_all returns bool through a shared reference, which question_shape reads as a getter with a question's answer. nife holds commit_all in design/naming-rule-baseline.txt. The template has no baseline. Separately, [lib] test = false and doctest = false mean the tests job runs nothing. The coverage job floors each file at 85 percent of lines covered. With no test binary the report is either empty or shows src/lib.rs at zero (unverified which). Either reads as a red or a vacuous green. Evidence: src/lib.rs lines 119 and 165. Cargo.toml lines 11 to 14. The template's helpers/spelled_out.py, helpers/question_shape.py, helpers/coverage-floor.sh. Change: rename the binding to virtual_address now (XS). For commit_all, Decision A carries the recommendation. For the tests, item 8 is the real fix. Until it lands, the move lane either exempts src/lib.rs in .github/coverage-exemptions with the stated reason ("every path ends in a system call; tested under QEMU") or lands item 8 first. Door: va is two-way. commit_all is one-way (a public name). Effort: XS, plus item 8.

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 both one-way doors. No decision stays open.

A. The seven public names, and the shape of commit_all (ruled 2026-11-14 UTC)

The rule in force, option A (block 1100 decision A):

Prior art. Vec::try_reserve returns Result<(), TryReserveError> for exactly this shape: act, and say how it failed. std_runtime_contract::HEAP_BASE is the same value as the heap's default base under another spelling; the move is the moment to make the two agree or to make one defer to the other. address_space_layout::HEAP.start is where both come from.

B. Which talc the crate builds against outside nife (ruled 2026-11-14 UTC)

The rule in force, option A (block 1100 decision B):

The evidence, background, prior art and the options not taken are in the appendix.

Follow-on

Done when

The checks are in the appendix. Each item's state is under "Finding status" above.

BUGS

Index row

An outside review of memory_region_heap before it leaves. Every code and documentation fix has landed: a page-source seam, host tests, three Kani harnesses, one copy of the growth arithmetic that std generates from, a README and both licenses. What remains is the move: path dependencies that become pins once their crates leave, and clearing the review package.