Moving a crate out of nife: the runbook
Name: provisional. The file name says what the page holds: the steps of one move.
This page takes one crate from crates/<crate> to a repository of its own, partsfoundry/<crate>, and
back into nife as a pinned dependency, then through its soak to publication. Every step names its
command, the result that says it worked, and who takes it. A lane is an agent working a
milestone; calef marks a step only the architect takes, because it creates something, holds a
credential, or publishes. Journey 5 says
why crates leave and in what order, and
milestone 857 (crates released on their own)
holds the rulings. The pilot is jh7110_entropy of
milestone 818 (proven JH7110 TRNG logic, released on its own).
script/crate-move does the mechanical part of a move.
The rules every step keeps:
- Bottom-up. A crate leaves only when nothing it depends on is still in this tree. A program package leaves as soon as its own crates have left.
- No record of names travels. The move commit deletes every
Name:block. Git history in this tree, with the ratifying pull requests, is the only provenance record; the crate repository carries no table and no provenance file. - The crate never mentions nife, in its source, README, docs, manifest or commit messages. A wire
literal (bytes already on a wire or in built programs, such as an owner string) may keep the
word on a line that ends
// wire literal; the lint lists those lines. Prose never names nife. - The naming gates run in the crate repository, through the shared template
partsfoundry/crate-workflowspinned at a release commit. - The owned runners never run fork code. A crate repository runs on GitHub-hosted runners only, and a fork's pull request waits for a maintainer's approval before any workflow runs.
- A pin cites a landed commit. nife depends on
partsfoundry/<crate>byrev, at the commit of a tag whose manifest carries the version, with that version stated beside it.
The dry run
script/crate-move --dry-run --into <empty dir> <crate> builds the crate repository's first tree
locally and creates nothing. It copies the crate's tracked files and adds the template's scaffold,
with every caller pinned at the newest template release. It deletes the Name: blocks, regenerates
each falsification patch over the stripped source for -p1, sets repository in the manifest and carries the crate's mutation baseline row into .github/mutants-exempts as a comment. Then it builds
and tests the copy at its rust-version, runs the template's clippy job, and runs the template's
cheap checks from that release.
The checks are every helper the release's check / standalone job enforces, at ceiling 0 on the
staged tree. A crate that nife's helpers/template_report_baseline.txt counts as baseline therefore
fails the dry run until a lane fixes its findings. The dry run reads the list from the release's check.yml; a
helper without a runner here fails the run as template coverage. A clean run means a green first
check / standalone, except for the shellcheck step and a missing typos, which the run reports.
It ends
with the nife-side follow-up: each consumer manifest's new line and every other file that names
the crate. The script's header lists what it skips.
A finding is a change to make before the move. A lane fixes a finding against the crate itself, in
nife: a README section or a sentence over the prose limits, a mention of nife in the crate's text.
The template takes a finding against the template (see BUGS). The dry run regenerates each
falsification patch, so its hunk headers carry the stripped file's line numbers, and it refuses to
finish when any patch applies at an offset, with fuzz or not at all under patch -p1 --dry-run -F0.
It also moves each Falsification: line to the head of its
harness's comment, where the template reads it, so those records pass falsify.py --check.
Before the move, in nife
- The architect has ratified the names (lane).
script/names <crate>printsratifiedunder the crate's line, andscript/crate-standalone <crate>exits 0 with Kani: every harness proves on the copy and every falsification patch turns its harness red. - Nothing it depends on is still here (lane). The
manifeststep ofscript/crate-standalonepasses: no path dependency leaves the crate. - The text stands alone (lane).
script/crate-move --dry-run --into "$TMPDIR/<crate>-move" <crate>exits 0. Fix each finding in nife, through an ordinary pull request, so the move commit stays mechanical. A finding against the template goes to the template. - The architect clears the crate (calef).
script/crate-review-packet <crate>writes the packet; the review packages hold the current ones. The clearance is also the approval to create the repository; no standing approval covers the order.
Creating the repository
-
Create it (calef).
gh repo create partsfoundry/<crate> --public --description "<one line from the manifest>"Expected:
gh repo view partsfoundry/<crate> --json isEmpty --jq .isEmptyprintstrue. -
Install the
nife-smelterapp on it (calef, as an organization owner, in the app's repository access settings). The release workflow's tag job authenticates as the app, and the tag ruleset accepts the app as its bypass actor only once the app sits on the repository. -
Grant the two organization secrets that have selected visibility (calef, with an
admin:orgtoken).NIFE_SMELTER_APP_IDis open to every repository and needs nothing. The list ofNIFE_SMELTER_PRIVATE_KEYandSETTINGS_TOKENgrows by one per crate:script/grant-org-secrets <crate>The script resolves the repository id, makes both grants (granting twice changes nothing), lists each secret's repositories and exits 1 if the crate is missing.
--dry-runshows what it would do. It refusesnifeand any name that is not an existing repository of the organization. The fine-grained token behindSETTINGS_TOKENhas access to all repositories of the organization, so the secret's repository list is the only setting a move changes; the token needs no per-crate widening. No agent handles any key value.
The move
-
Stage from the merged tree (lane). From
mainat the commit the move will cite:script/crate-move --dry-run --into "$TMPDIR/<crate>-move" <crate>Expected: exit 0 and
<crate>: clean. The staged tree has git initialized, every file added and nothing committed. It builds each fuzz target withcargo +nightly fuzz buildand runs it once over its corpus, which needscargo-fuzzand nightly. A target moves if it links only the crate and its dependencies. The staged fuzz caller setspublic-crash-inputs: trueonly for a crate withoutunsafe, the weekly fuzzing opt-in the maintainers ruled; any other crate getsfalse, and the run says why. -
Commit and push (lane). The message names the template release and nothing of nife:
cd "$TMPDIR/<crate>-move" git config core.hooksPath .githooks git commit -m "Adopt the shared crate workflows at crate-workflows <release>" \ -m "Co-Authored-By: <model> <noreply@anthropic.com>" git remote add origin git@github.com:partsfoundry/<crate>.git git push -u origin mainExpected:
git ls-remote origin refs/heads/mainprints the localHEAD, and the push starts thecheckandproofsruns onmain. The repository starts with one root commit; nothing of this tree's history travels. -
Apply the settings (lane, with repository administration). From a checkout of the template at the pinned release:
script/apply-settings partsfoundry/<crate> script/check-settings partsfoundry/<crate>Expected:
apply-settingsreports nothing it could not set, andcheck-settingsexits 0. That gives both rulesets, thecrates-ioenvironment with calef as required reviewer, the labels, thecrate-maintainersteam, and the fork approval policy for every outside contributor. -
The first runs are green (lane). End the turn with
WAITING partsfoundry/<crate>:<run id>... on check and proofs. Expected:gh run list -R partsfoundry/<crate> --branch main --limit 4showscheckandproofssucceeded. A pull request in the crate repository fixes a red job, and the maintainer gates and merges it as in nife.
11a. Run the outside review (a fresh lane the maintainer launches, on the most capable model
available; never the lane that wrote the crate or took part in its extraction). It runs once the
repository exists and before its first tag or publish. The pass is read-only on the crate
repository: no push, no pull request, no issue, no tag. It reads the crate's review package
for the accepted baseline, so it does not raise a settled decision again. It covers:
- public API and names, against the naming rules;
- correctness and soundness;
- proofs and their falsification patches, tests and mutation results;
- the README and documentation, read as a stranger would;
- Cargo metadata for publishing, the template pin and the workflow wiring;
- the no_std posture and performance;
- prior art on crates.io;
- which checks need real hardware. The pass never claims one done without it.
Its output is one draft milestone in the roadmap format. Each item carries a priority: P0 blocks any publish, P1 comes before the first release, P2 can follow later. Each item gives the finding, the evidence, the change, the door (one-way or two-way) and the effort. The milestone also carries a prior-art box and acceptance criteria. The maintainer promotes it into the roadmap, and a lane addresses its items. Only the one-way doors go to an architect, one at a time, each with a recommendation.
Three safeguards apply. A lane checks every finding against the code before it acts on one, since a pass can be wrong, for example about what a CI run shows. The pass marks a claim it could not verify as unverified. It reports a possible vulnerability to the maintainer alone and leaves it out of the milestone. It never reads fuzz findings, seeds or crash inputs. Expected: the draft milestone exists and its P0 items stand closed. The combine review checks both for each crate.
The stranger test and the tag
-
Run the stranger test (a fresh-context agent the maintainer launches, never the move lane). It clones the repository and follows the README alone to a build, the tests and the proofs; the protocol is the stranger test's. The lane records the run as a pull request in the crate repository that sets
Last run: <date>indocs/stranger-test.mdand adds the run's appendix beside it. Expected:release / gatestops refusing, since it refuses a record that readsnone. -
Tag the version (calef). The tag ruleset refuses a hand-made
v*tag, so the release workflow makes it:gh workflow run release.yml -R partsfoundry/<crate> -f version=0.1.0 -f dry-run=falseThe gate and the tag job run, and the publish job waits in
crates-io. calef cancels the run there (gh run cancel <run id> -R partsfoundry/<crate>), so nothing publishes. Expected:gh api repos/partsfoundry/<crate>/git/ref/tags/v0.1.0resolves, and the soak holds its first semver baseline.
The nife side
-
Replace the path dependency (lane, one pull request in nife). Take the commit of the tag:
rev=$(gh api repos/partsfoundry/<crate>/commits/v0.1.0 --jq .sha)In each consumer manifest the dry run listed, the line becomes
<crate> = { version = "0.1.0", git = "https://github.com/partsfoundry/<crate>", rev = "<rev>" }keeping any other key the old line carried. Remove
crates/<crate>from the workspace members and delete the directory withgit rm -r crates/<crate>. The same pull request reads every other file the dry run listed. For the pilot and the FAT crate those are:-
the
script/verifytable and the Kani reach list in.github/workflows/kani-reach.yml; -
helpers/trust_boundary_crates.tsvandpackages/*.package.toml; -
the mutation baseline, the
deny.tomlwrappers and_typos.toml; -
the fuzz targets, which the dry run staged in the crate repository's
fuzz/(milestone 1043 (a moved crate is fuzzed in its own repository)). The dry run's last list names each removal:- the
[[bin]]sections offuzz/Cargo.toml, and the crate's dependency line there when no remaining target links it; fuzz/fuzz_targets/<target>.rs, and the targets' names and fixtures case inscript/fuzz;fuzz/seeds/<target>, the seed scripts and their paragraphs infuzz/seeds/README.md;- the targets' sections of
notes/fuzzing/targets.md.
Afterwards
script/fuzz --listnames none of them. - the
-
citations into
crates/<crate>/src, which repoint to the repository at the tag, by symbol. -
nothing, for a crate the
stdfarm copies into its platform layer (COPIED_FILESinxtask/src/farm/copied.rs, which the dry run lists because it names the package). The farm finds each package's directory throughcargo metadata, so it reads the moved crate from Cargo's checkout of the pin, as long as a workspace member still depends on it; with none,cargo xtask std-srcstops and names the missing package. The stamp then hashes the files as<crate>/src/...instead ofcrates/<crate>/src/..., so the farm rebuilds once.
The crate's milestone block states the soak's state. Expected:
cargo tree --locked -i <crate>prints the git source atrev,git grep -n 'crates/<crate>' -- '*.toml'prints nothing,cargo xtask std-srcexits 0,script/lintexits 0, and the merge queue lands it. -
-
Bump basalt's pin (lane, a separate pull request in
nifeos/basalt). It cites the landed commit asnifeos/nife@<sha>and names the nife pull request it waits for.
A later bump of the crate's pin is its own nife pull request, citing partsfoundry/<crate>@<sha> of a
tagged commit.
The soak's five end conditions
Every crate soaks as its own repository before it publishes (ruled 2026-10-17 UTC; ยง305 (git
dependencies are allowed on nifeos/* only, pinned to a landed commit)). The soak ends, with no
duration, when all five conditions hold (condition 5 ruled 2026-11-26 UTC, nifeos/record#48).
Condition 5 does not read weekly / semver, which succeeds whatever it finds.
| condition | check | who |
|---|---|---|
| 1. nife builds and passes CI against the pinned commit, with no path dependency left | git grep -n 'path = .*crates/<crate>' -- '*.toml' is empty, and gh run list -R nifeos/nife --branch main --workflow ci.yml --limit 1 shows success at or after the step 14 merge |
lane |
| 2. the template's weekly run is green | gh run list -R partsfoundry/<crate> --workflow weekly.yml --limit 1 --json conclusion prints success; gh workflow run weekly.yml -R partsfoundry/<crate> starts one early |
lane |
| 3. a release dry run is green | gh workflow run release.yml -R partsfoundry/<crate> -f version=<manifest version> -f dry-run=true, then that run's gate succeeds and it creates no tag |
lane |
| 4. the stranger test builds and proves the crate from its README alone | grep '^Last run:' docs/stranger-test.md in the crate repository prints a date, with that run's appendix beside it |
step 12 |
| 5a. every consumer in nife builds against the tagged release, unpatched | git grep -n '^<crate> = ' -- '*.toml' in nife, tools/ included: each rev is tag v<version>'s commit, each version that tag's; no [patch] names it |
lane |
5b. cargo-semver-checks finds no break from that tag to main |
cargo semver-checks --baseline-rev v<version> --release-type minor passes a nonzero count; a pre-release without --release-type skips every check |
lane |
| 5c. no open issue, milestone or BUGS entry proposes a break | read the crate's open issues, gh search issues --owner nifeos --owner partsfoundry --state open <crate>, its BUGS and each unbuilt milestone naming it |
lane |
Publication and consumption by version
Each publication waits for its soak and its turn in the ruled order, and a contract crate never publishes.
- Allow the publication (calef approves; a lane writes the line). The crate joins
crates/publish-allowlist.txtin nife, and a pull request in the crate repository removespublish = falseandallow-unpublished: true. - The first-publish token (calef). crates.io binds a trusted publisher only to a crate that
exists, so 0.1.0 publishes with
CRATES_IO_FIRST_PUBLISH_TOKEN, apublish-newtoken limited to the crate's name with a short expiry, stored on the repository'scrates-ioenvironment. - Publish (calef).
gh workflow run release.yml -R partsfoundry/<crate> -f version=<version> -f dry-run=false, then approve thecrates-iodeployment. Expected:cargo search <crate> --limit 1shows the version. - Bind the owners and the trusted publisher, and delete the token (calef).
cargo owner --add github:partsfoundry:crate-maintainers <crate>; on crates.io, a trusted publisher forpartsfoundry/<crate>, workflowrelease.yml, environmentcrates-io; then delete the secret. Every later release publishes through trusted publishing alone. - nife consumes the release (lane). Each consumer line becomes
<crate> = "<version>", and a lint fails any[patch]onmain. Expected:cargo tree --locked -i <crate>resolves from crates.io andCargo.lockrecords the checksum. The milestone's exit holds.
What calef does, in one list
- Clear the crate's review, which approves creating its repository (step 4).
- Create
partsfoundry/<crate>(step 5). - Install the
nife-smelterapp on it (step 6). - Run
script/grant-org-secrets <crate>to grantNIFE_SMELTER_PRIVATE_KEYandSETTINGS_TOKENto it (step 7). - Dispatch the release that makes each tag, and cancel its publish (step 13).
- Approve each publication onto the allowlist (step 16).
- Create the first-publish token on the
crates-ioenvironment (step 17). - Approve the
crates-iodeployment that publishes (step 18). - Add
github:partsfoundry:crate-maintainersas the crates.io owner, bind the trusted publisher and delete the token (step 19).
BUGS
- The template's orphan check misreads modules declared in
foo.rs. Amod tests;insrc/foo.rsresolves tosrc/foo/tests.rs, and the check looks forsrc/tests.rs. It reports 35 false orphans infile_allocation_table, socheck / standalonewould fail its first run. - The template's scaffold mentions nife. The commit hook,
rustfmt.toml,deny.tomlanddocs/stranger-test.mdname it, and the pull request template names the architect. Every crate repository inherits those lines. - The mutation baseline travels as counts only. The dry run copies the crate's row from
.cargo/mutants-baseline.txtinto the staged.github/mutants-exemptsas a comment, and the follow-up list says to delete the row here. The template's gate wants one<file>:<line> # <reason>line per surviving mutant, and the census records four counts (caught, missed, timeout, unviable) and no locations, so the lines cannot be written mechanically. The firstweekly / mutationrun fails on each survivor and names it; the move lane lists them in one pull request. - The dry run's nife check passes an identifier such as
NIFE_DATA. Readhelpers/lint_externalized_crates.py's count for the crate as well.