1017. The contract crates leave in this order
Raised 2026-11-01 (UTC) by the lane lane/contract-crates-move-order. It answers in what order the
22 crates the first cut's programs link could leave this repository, and what policy makes
breaking change safe across repositories. It moves no crate and changes no code. Every new
name below is provisional.
Reuse: cargo metadata, git's rename detection, milestone 610's series, milestone 956's constants,
the crate template and basalt's gate.
Two directions from the architect, both dated 2026-11-01 (UTC), frame it:
- Crossing repositories is the goal of the split (§151 (the goal of the repository split is
independent release)), not a cost to avoid, and the project should become good at changes that
span two repositories. Contract crates should carry versions and may leave
nifeos/nife, so others can write alternative implementations. Waiting for a crate to settle is not a criterion. - Anything that leaves must not reference back into nife. So a crate leaves bottom-up in the dependency graph, before or with every program that links it, and nothing that has left depends on a path or a pin into nife.
The second direction inverts the order of 2026-10-04 in milestone 756 (process-tools,
core-tools and disk-tools are the first code to leave this repository). Programs first and
the SDK last maximizes references back: each program repository would pin nife.
Appendices: measurements, prior art and questions for the architect.
What the measurements say
Measured at nifeos/nife@a8b7524d7 with one script, reproduced in the measurements appendix.
- Through normal dependencies the 22 link no other nife crate. Fifteen are leaves, four sit one layer up and three sit two up.
- 39 crates that stay link at least one of the 22.
moho_abialone has 12, the kernel among them. - In 30 days 348 focused commits touched the 22. 244 of them (70%) also changed code outside the 22. Only 5 spanned two of the 22 and stayed inside them, so grouping them saves almost no crossings.
grant_plandominates: 151 commits in 30 days, 120 crossing, 227 breaking API items in four weeks.file_system_contractfollows with 263, item-level churn that milestone 610's note attributes to the fixture extraction and the file splits.- Identity values (a
MAGIC, aVERSION) changed five times in 90 days. Two reverts followed within a day,current_cpu_contracton 2026-10-21 andprogram_argument_contracton 2026-10-30, because basalt's published programs still compared the old value. - The packages differ.
disk-toolsreaches 12 of the 22 and notgrant_plan.process-toolsreaches 13 andcore-tools15, both throughgrant_plan. Pull request #3022'sINTERFACESmacro was incapability_manifest_note, which reachesgrant_plan, taking each package to 16 to 18. The note type is now ininterfaces_note, a leaf and a 23rd contract crate in this tree, so with the macro the packages reach 13, 14 and 16 crates.
What a crate references in nife that blocks its move
All 22 inherit license and lints from nife's workspace manifest; each move writes them as
literals, as jh7110_entropy did. system_tests is a dev-dependency of 17 of them; that edge
points from nife to the crate, which the direction permits. Beyond those, five references would block:
| crate | reference back | resolution |
|---|---|---|
address_space_layout |
a test reads ../../user_mode_runtime/link.ld |
the test moves to user_mode_runtime |
byte_sink_contract |
dev-dependency on moho_abi |
leaves after moho_abi |
file_system_contract |
dev-dependency on file_system_fixture, which links it |
the two leave together |
grant_plan |
dev-dependency on primitive_benchmark_contract, which stays |
that test moves, or the crate leaves too |
capability_manifest_note |
a test reads ../../fuzz/seeds/, and nife's fuzz workspace builds it |
its seeds and fuzz target leave with it |
Six more of the 22 have fuzz targets in nife's fuzz/ workspace. Those point from nife to the
crate and do not block.
The recommended order
The architect reads each crate's code by hand before it leaves, at first every crate (condition 4
of §247 (the split begins with basalt holding nife, and procps moves first), ruled 2026-11-01
(UTC)). A crate also needs a tagged release whose commit carries its Cargo version, the baseline
for cargo-semver-checks --baseline-rev. The pilot, jh7110_entropy, moved on 2026-10-31 (UTC)
with no tag, so milestone 818 tags it first. A crate whose interface still breaks may leave, each
break a new tagged release.
The rule: a crate leaves when every crate it links (normal, build and dev) has left or leaves with
it, and no file in it names a nife path. Within a layer, the cheapest coordination goes first. Ruled 2026-11-01 (UTC): each
package leaves as soon as the shared crates it links have left, in the order disk-tools, process-tools,
core-tools, replacing milestone 756's single cut, and block_roster_contract stays the first crate a
consumer outside nife reads. Ruled the same day: one repository per contract crate, created when
the crate moves and only with the architect's approval of that exact repository. No lane creates
one. A repository per package or per layer is refused. The four crates whose disposition is contribute
(globally_unique_identifier_partition_table, byte_glob, domain_name_system, calendar) move in this
order too (ruled 2026-11-01 UTC); only the offer waits.
| step | crates | why here |
|---|---|---|
| 0, the review pilot | jh7110_entropy |
tag it, then the architect reads it; the others follow only as each review clears |
| 1, the contract pilot | block_roster_contract |
a leaf with no blocking reference; one writer in the kernel, one reader in disk_surveyor; its magic carries its version, so a reader refuses a mismatch today |
2, leaves for disk-tools |
entropy_contract, clock_contract, socket_contract, globally_unique_identifier_partition_table, counter_frequency_contract, then file_system_contract with file_system_fixture, then moho_abi |
cheapest first by crossing commits and outside dependents; moho_abi last, at 66 crossing commits and 12 dependents |
| 3 | address_space_layout, then current_cpu_contract, then user_mode_runtime, then interfaces_note |
after the link.ld test moves; user_mode_runtime links six crates of step 2. interfaces_note, the INTERFACES leaf crate (provisional), leaves like any leaf (below) |
| 4, first package | disk-tools |
leaves as soon as its 12 crates and interfaces_note have left; milestone 756's condition 4 has it carry the INTERFACES macro, and it never waits for grant_plan |
5, leaves for process-tools |
byte_sink_contract, byte_glob, program_argument_contract, domain_name_system |
leaves |
| 6 | machine_statistics_contract, domain_name_resolution_contract, grant_plan, then capability_manifest_note |
grant_plan is the largest coordination cost of all 22 |
| 7, second package | process-tools |
leaves once its shared crates have, taking number_writer |
| 8 | calendar, environment_contract, then core-tools |
the last two crates core-tools reaches; the kernel links both; the third package leaves as soon as they have |
9, redoxfs |
subtree_scope and memory_region_heap, then redoxfs |
each of the first two leaves on its own clearance as one repository or two, decided at the move (ruled 2026-11-20 UTC); redoxfs keeps its own track, as one repository (ruled 2026-11-01 UTC); talc becomes a pinned upstream dependency (below) |
| 10 | intrusive_queue, then inter_process_communication |
intrusive_queue is a leaf (milestone 1097 (intrusive_queue: what an outside maintainer would fix before its first release)) |
sealed_pair is not one of the 22. It leaves after nifefs and measured_boot have repositories
and gets none now (milestone 1107 (sealed_pair: what an outside
maintainer would fix before it leaves)).
jh7110_entropy stays the leaf pilot (milestone 818 (jh7110_entropy: proven JH7110 TRNG logic,
released on its own)). It proves a leaf crate builds from its own repository and nife pins it by rev. It does not prove the contract case: no
consumer outside nife, so no two pins must agree, and no version check has refused a real mismatch
across the boundary. block_roster_contract proves both once disk-tools leaves.
Two findings want lanes of their own:
- The slot constants programs use (
DOMAIN_SLOT) andgrant_plan::Manifestlive ingrant_plan. A leaf crate holding them would letprocess-toolsandcore-toolsshed the planner. - A contract crate's tests that drive nife's own implementation live in
system_tests. A third party needs tests in the contract crate that drive any implementation.
The version policy
Two numbers, two checkers, already separate in this tree:
- The Cargo version covers the Rust API. A move starts each crate at
0.1.0. A break bumps the minor number and an addition bumps the patch, per Cargo's rule that the left-most nonzero number marks an incompatible change. Cargo's resolver then refuses to unify two incompatible versions. Ruled 2026-11-01 (UTC): a Rust-API break that bumps the minor needs no architect. - The wire identity covers what a peer checks:
INTERFACE_IDand the crate'sVERSIONconstant (milestone 956 (the linked interfaces carry checkable versions)). A wire break bumps both the constant and the Cargo minor. A Rust-only break bumps only the Cargo minor.
The rule a peer checks is the one milestone 979 (interfaces a peer can check) ruled on 2026-10-29 (UTC). The system call ABI must match at spawn and never dual-serves. A shared page stays single-version and its reader refuses another magic. A message contract serves N and N-1. This proposal decides no wire format.
One rule is new, ruled 2026-11-01 (UTC): one revision per contract per image. basalt refuses an
image whose components pin different revisions of one contract, and the bump pull request that
moves a contract moves every pin of it together. Overriding the pins and building each as pinned
are refused. The image is then the coherent set that §235 (its source divides by
purpose) names. A pin is a git dependency on nifeos/<crate> by rev with its version stated.
Two checks move with each crate. nife's diff check, which fails a moved magic without its version
constant (milestone 956's step 4), joins the crate template. The template's cargo-semver-checks
compares against the last published release, but these crates stay unpublished while nife pins them
by rev (§305 (git dependencies on nifeos/* only, pinned to a landed commit)), so it never fires.
jh7110_entropy's pull request #5 renamed five public constants and drew no hold. The fix is to
compare against the commit whose manifest last changed version (--baseline-rev). Inside nife,
cargo-semver-checks stays refused.
Ruled 2026-11-01 (UTC): for a contract crate the needs-architect hold applies to a wire-identity
change only (INTERFACE_ID, VERSION or a magic). A Rust-API break must bump the Cargo minor,
checked mechanically, with no hold. Other crates, jh7110_entropy among them (milestone 818), keep
the hold on every break. Telling the two apart needs an identity to compare, and 14 of the 22 have
no INTERFACE_ID (the OWED table of milestone 956 (the linked interfaces carry checkable
versions)). Those 14 get one first, and until then their breaks keep the hold.
What the integration gate must test
basalt's gate (milestone 755 (basalt v0 pins nife and runs its gate)) pins one component, nife, by
commit. It runs that commit's script/ci-build test on three architectures, builds basalt's
recipes twice for identical bytes, and boots an image.
It does not hold a second first-party pin. It cannot see two components pinning different revisions
of one contract. It reads no program's INTERFACES note against what the image serves. And it can
test a pair only after both halves merge, because a pin never names an unmerged commit. For a
contract and a consumer to land together it needs four things:
- A
pins.tomltable for each contract and each program repository. - A coherence check that refuses an image whose components' lock files name two revisions of one contract (ruled 2026-11-01 (UTC)).
- An interface agreement check: each program's
INTERFACESentries against the versions the image's kernel and servers serve. That is the spawn check, run before boot over the whole image. A server's served versions can come from its own note; the kernel carries no note today, so it needs a list of its own. - A trial run, ruled 2026-11-01 (UTC): a manual dispatch that takes candidate commits, merged or
not, of repositories in the
nifeosorganization, runs checks 2 and 3 and the system test, and writes no pin and no file. It never runs a fork's pull request, and never on a self-hosted runner for a fork. It proves a pair before either half merges. The pin rule stands: a pin never names an unmerged commit (§305 (git dependencies onnifeos/*only, pinned to a landed commit)).
How a breaking change lands across two repositories
A real one took 53 minutes (jh7110_entropy pull request #5, then nife pull request #2979). The
landing appendix works that case, then the
contract case for block_roster_contract in four steps. The page is single-version, so the three pins move
in one basalt pull request. A message contract serves N and N-1, so its steps may ship in separate
bumps.
How nife consumes a crate that left
By rev, as §305 allows. A root [workspace.dependencies] entry would pin each contract once for
every nife crate. nife pins jh7110_entropy in three manifests, which pull request #2979 had to
move together. A local [patch] serves work on both sides and never reaches main.
The real cost is the second pull request: 53 minutes in the example above. Had all 22 lived
elsewhere for 30 days, up to 244 changes would have needed one. nife's tools that walk crates/ also
lose each crate: the Kani reach list, the verify table, milestone 610 (the interface's stability is
measured weekly)'s series and the declaration check. Each must read the pinned checkout or the
crate's own repository instead.
What a third-party implementation needs
- The contract in a repository of its own with no path into nife: this order delivers that.
- The wire format as code (§311 (a contract between programs is code, not prose)); this exists.
- Tests in the contract crate that drive any implementation. Today none do.
- The version ledger, so N-1 means something to a stranger.
- basalt able to pin the alternative in place of nife's server: checks 1 to 3.
Options considered
- A. Bottom-up, one repository per crate, the order above: ruled 2026-11-01 (UTC).
- B. Programs first, the 2026-10-04 order: refused; each program repository would pin nife for 12 to 15 crates.
- C. All 22 in one move: it saves 5 crossing commits in 348 and gives no contract its own version.
- D. Highest churn first: bottom-up already fixes the place of
grant_plan. - E. Wait for crates to settle: refused.
Reversibility
A move is cheap to undo while only nife and basalt consume it: copy the crate back. Other parties
act on four things: a repository name, a published crate version (crates.io never deletes one), an
INTERFACE_ID value and a release binary that compares a magic. The two reverts above came from
the fourth. So the moved crates stay unpublished under §305 until their own release milestone, and
ratifying the INTERFACE_ID values (milestone 979) comes before the first contract leaves.
The seven questions
- Considered: the options above.
- The tree:
jh7110_entropyleft on 2026-10-31 and nife pins it byrev; the crate template exists; basalt pins nife; milestone 956 carries the constants. - Prior art: the appendix.
- The premise holds with one correction:
disk-toolsneeds 12 of the 22, not all. - Cost: the measurements appendix.
- Reversibility: above.
- At equal effort the choice stands; within a layer, cheapest first is about learning cost.
Where talc goes at step 9
Decided by the maintainer on 2026-11-01 (UTC), provisional; reversing costs one pull request, since
nothing depends on it yet. The architect approved the rule that the maintainer decides a two-way
door, and this first use. When redoxfs leaves, talc, patched to
vendor/talc today by the engine's and redoxfs_server's manifests, becomes a git dependency of
redoxfs on its upstream, pinned by rev with version. Any divergence stays a patch file in the
redoxfs repository beside the engine's, naming the upstream revision it applies to. talc gets
no repository of nife's own. Not taken: a fork (needs approval), pinning nife for it, replacing the allocator.
Read-only checks, 2026-11-01 (UTC); the questions appendix has the detail:
vendor/talcdiverges from the crates.io 5.1.1 package in two files: two overflow fixes to fit checks insrc/base/mod.rsand one new test. That is upstream pull request 57, still open.- In nife,
allocation_cache,memory_region_heapandredoxfs_serverdepend ontalc. Onlyredoxfs_serverandtools/redoxfs_hosttouchredoxfs; the rest stay onvendor/talc. - Upstream states no AI-submission policy in its root files; issues and discussions are unverified.
Its
lock_api0.4 requirement lags 0.5.0 by 11 days;allocator-api2is current. - Open and unverified: how the patch applies to a git pin.
The review packet
script/crate-review-packet <crate>... writes one packet per crate to
target/crate-review-packets/<crate>.md, never committed: the facts a reading needs, and a checklist
for the judgments. The API comes from rustdoc JSON, since cargo public-api is not installed. The
name is a provisional maintainer decision.
BUGS
- Proposed milestone, provisional and unnumbered: the crate template, which holds every
cargo-semver-checksbreak, labels only a movedINTERFACE_ID,VERSIONor magic, and fails a Rust-API break that leaves the Cargo minor alone. It waits on the 14 crates getting anINTERFACE_ID. - Proposed milestone, provisional and unnumbered, following milestone 756: move the note type and update the declaration check and the 15 programs. The leaf crate is a 23rd contract crate; its repository waits for the architect's approval.
- Proposed milestone, provisional and unnumbered: the QEMU runners start
redoxfs_serverfrom a pinned image, not a tree path. It blocksredoxfs. - The packet omits the test list, the license notices and the
cargo-semver-checksoutput.
Index row
The order in which the 22 crates the first cut links leave this repository: bottom-up, one
repository each, block_roster_contract as the contract pilot, disk-tools as the first package. It sets
the version policy and the gate that let a breaking change land across two repositories.