1094. grant_plan: what an outside maintainer would fix before it leaves
Raised by a read-only review of crates/grant_plan as a stranger to this tree would meet it:
the crate an outside maintainer finds when partsfoundry/grant_plan appears, with no nife checkout
beside it. The review changes nothing; it lists what the move lane and the lanes after it change.
There is no review package for this crate in notes/crate-reviews/, so there is no settled
baseline of ratified names and open questions to start from. This block starts from the code, from
design/naming.md, from the externalization list (crates/externalization-list.txt, where the
crate is listed) and from milestone 1017 (the contract crates leave in this order). Its
measurements already name grant_plan as the largest coordination cost of the 22 crates (151
commits in 30 days, 120 of them crossing, 227 breaking API items in four weeks). Its order places
the crate in step 6. Where a name below is already ratified, this block does not reopen it unless a later rule
(units spelled out, standard-library spellings) contradicts it, and says so where it does.
Reuse: the template partsfoundry/crate-workflows and its scaffold and helpers (standalone.py,
spelled_out.py, register_names.py, british_spelling.py), cargo-mutants, Kani, and the crate's
own test_support::plan_line. No new tool.
Finding status
Every item not Done blocks the first crates.io publish, under the publishing hold.
- P0-1, split the catalog from the planner: Done, #3584.
- P0-2, the documentation does not build with warnings denied: Done, #3566.
- P0-3, the manifest and the repository root are the workspace's: Done. The tests plan
against rows of their own and the
program_tabledev-dependency is gone (#3961);ISOLATION_WORDlives inprogram_table. Both repositories carry a literal manifest withrust-version, a README and both license files. - P1-4, the tokenizer drops a seventeenth token: Done, #3559.
- P1-5, no proof: Open. Neither
grant_plannorgrant_contracthas a Kani harness yet. By the 2026-11-22 (UTC) ruling (#3977), a lane writes one per claim in each new repository before any tag; the twojob_windowspatches inprogram_tablereplay host tests. - P1-6, limits carry their unit, and four fields named
len: Done (ruled by the maintainer, provisional, 2026-11-19 UTC; two-way until the first publish). Every limit now ends in_BYTESor_POLLS,MAXIMUM_VERB_BYTESandMAXIMUM_HOLDER_NAME_BYTESamong them, and the fields that held a length arelength_bytesorname_length_bytes. The names are provisional until the architect ratifies them from the review packages. - P1-7, public names that need a decoder: Done (ruled by the maintainer, provisional, 2026-11-14
UTC, #3589). The modules are
navigation,rm_options,spawn_protocolandjob_channel_page;BindEntry::position,COOPERATIVE_GRACE_POLLS,RIGHTS_BITS_DO_NOT_OVERLAPandprogram_idfollow. The names are provisional until the architect ratifies them from the review packages. - P1-8, British spellings: Done, #3566.
- P1-9, documentation for a stranger: Done. #3566 and #3961 close the
missing_docsworklists of all three crates; both repositories carry a README with an examples section and hold no citation, quotation orName:line. - P1-9b,
missing_docsin the split crates: Done, #3961. Neithergrant_contractnorprogram_tableallowsmissing_docs. - P1-10, numbers in refusal sentences: Done, #3566.
- P1-11, two-kilobyte values by value: Done, #3566 and #3961. The planning functions take
&ShellHoldings,&Expansionand&Streams, provisional until the release review; the move writes the sizes into the README. - P1-12, narrow length fields: Done, #3566.
- P1-13, an undeclared widening option: Done, #3566 and #3961. A
constassertion inprogram_tablechecks every row withManifest::is_well_formed, and the note decoder already refuses an undeclared subtree letter. - P1-14, the mutation record predates the split: Open. By the 2026-11-22 (UTC) ruling
(#3977), the first mutation run of
grant_planandgrant_contracthappens in their own repositories before any tag, and gives the figure the release gate asks for. - P2-15,
NameSet'sDebug: Done, #3566. - P2-16,
Result<_, ()>operands: Done, #3961.job_operandandkill_operandsreturn the errorNoJobNamed, provisional. - P2-17, an unchecked window shift: Done, #3566.
- P2-18, tests pin thirteen of twenty-eight wire ids: Done, #3566.
- P2-19, no runnable example: Done, #3961.
examples/plan_a_line.rsplans a pipeline against a caller's manifest; the move adds the README's examples section. - Decision, where the crate boundary falls: Done, #3584, ruled 2026-11-14 (UTC).
- Decision, public names that need a decoder: Done, #3589, maintainer provisional 2026-11-14 (UTC).
- Decision, limits carry their unit: Done, #3822, maintainer provisional 2026-11-19 (UTC).
- Decision, the names
grant_contractandprogram_table: Done, #3822, ruled 2026-11-19 (UTC), both as built. - Decision, review clearance and the repositories: Done, #3977, ruled 2026-11-22 (UTC). The
architect cleared
grant_planandgrant_contracttogether, which approves creating both repositories withpublish = false, no tag and no publication.grant_contractmoves afterprogram_argument_contracthas its own repository, since it depends on that crate. - The move of
grant_contract: Done as a pin, #4016. partsfoundry/grant_contract exists, and nife depends on it at commit d4e9ca29d51bc71d678aadaa00411eba953202b3 (version = "0.1.0",publish = false). No tag and no publish; a pre-release tag moves the pin later. - The move of
grant_plan: Done as a pin, #4018. partsfoundry/grant_plan exists, and nife depends on it at commit a5d87c426ec0aeebeb51a13d3ffb116caebd73c9 (version = "0.1.0",publish = false). No tag and no publish; a pre-release tag moves the pin later. - Decision, the names of both crates: Done, #3868, ruled 2026-11-20 (UTC). Names with no block wait on rulings by family.
Open decisions
None. The review packages carry the ratification of the provisional names and the clearance.
Goal
A stranger who finds grant_plan on its own can tell in one screen what it is. It is a no_std,
allocation-free parser and planner that turns one line of bytes into a typed grant or a typed
refusal, against a manifest the caller supplies. The same stranger can build it, run its tests and
read its public names without a glossary. Nothing in the crate names a program, a package, a path or
a person from the tree it came from. 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, L is a week or a lane of its own. A door is one-way when somebody outside the repository acts on it after the release (a public name, a published behavior, a layout, a wire value, a dependency); everything else is two-way and the maintainer decides it.
P0: blocks the move
-
The crate is not separable from nife's program catalog as it stands. Finding:
Program(src/program/catalog.rslines 157 to 437) is an enum of 28 nife programs with wire ids, archive names and, insrc/program/manifests.rs, each one's manifest and verbs.Endowment::program(src/command.rsline 175) ties the planner's one output type to that catalog;NO_NOTE_MANIFESTisProgram::Uptime.manifest()(src/image.rsline 24) andIMAGE_ROWisProgram::Uptime(line 37);spawn_protocol::held_sharestakes aProgram(src/spawn_protocol.rsline 925);ISOLATION_WORDis the shell's own name (src/planning.rsline 56) andMOUNTED_TREE_NAMEa mount point of one machine's boot shell (src/spawn_protocol.rsline 236). The region budgets (JOB_REGION_PAGES,DIRECTORY_JOB_REGION_PAGES,STD_REGION_PAGES,JOB_POOL_PAGES,SHELL_BUDGET_PAGES,IMAGE_MAXIMUM_PAGES) are one progenitor's numbers. The externalization lint waives 103 consumer-name hits for this crate;standalone.pycounts 96 lines naming a path into this tree and refuses the crate. The lint's rule is that a crate on the list "may not mention nife, a nife program or a nife package". This crate is a table of them. Milestone 1017 already records the half of this that programs feel: the slot constants andManifestlive here, soprocess-toolsandcore-toolscarry the whole planner to read a slot number. Evidence: the files and lines above;helpers/lint_externalized_crates.pylines 32 to 50;design/roadmap/1017-the-contract-crates-leave-in-this-order.mdlines 116 to 121. Change: split before the move, as the ruled boundary decision lays out. What leaves asgrant_plan:word,lexing,parsing,line,expand,navigation,planning,refusal,commandandescalation. They plan against aManifestthe caller passes.Endowmentcarries theManifestits plan used instead of aProgram, which also closes theIMAGE_ROWfoot gun its own doc describes. What becomes a leaf crate: theManifesttypes, the slot constants andverbs, withVERSIONandINTERFACE_ID17 beside them, since that is the interface programs declare. What stays in nife: theprograms!table and its manifests,spawn_protocol,job_windows,job_channel_page,imageand the region budgets, which are the shell's and the progenitor's agreement with each other. Door: one-way (crate boundaries and the public API of a released crate). Effort: L. -
The documentation does not build with warnings denied. Finding:
ASK_NETWORK's doc comment links[pack_name], a private function.cargo doc --no-depswith-D warningsstops there. The template'sstandalonejob denies onlyrustdoc::broken_intra_doc_linksandrustdoc::invalid_html_tags, so under the template this is a warning in the log, not a red job; whether nife's own lint denies it was not checked. Evidence:src/spawn_protocol.rsline 650;.github/workflows/check.ymlof the template, line 233. Change: linkpack_nameas plain code, or make the packing a public function with its own doc, which the fourASK_*constants andrefused_ask_wordsalready describe. Then add-D rustdoc::private_intra_doc_linksto the repository's documentation gate so the gate catches the next one. Door: two-way. Effort: XS. -
The manifest and the repository root are the workspace's, not a crate's. Finding:
standalone.pylists no README, noLICENSE-MIT, noLICENSE-APACHE,license.workspace = true,lints.workspace = true, norust-version,publish = false, and nodescription,repository,keywordsorcategories. The crate's one dev-dependency onprimitive_benchmark_contract(formap_el0_declares_the_budget_the_bench_contract_measured) points at a crate that stays in nife. Milestone 1017's table already names it as the move's blocker for this crate. It goes with the catalog (item 1), so the planner that leaves needs no such test. Evidence:Cargo.tomllines 1 to 32; thestandalone.pyoutput above;src/program/tests.rs. Change: add the scaffold's files. Write outlicense = "MIT OR Apache-2.0"and the lints. Setrust-versionat the template's floor. Add adescriptionthat says "a no_std parser and planner that turns one command line into a typed grant or a typed refusal, against a manifest the caller supplies". Keeppublish = falseonly until the hold on publishing lifts, with a comment a stranger can act on. Door: two-way, except the license, which the architect ruled for every crate of the organization. Effort: S.
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 rules in force, with their background and prior art, are in the appendix:
- Where the crate boundary falls: ruled 2026-11-14 (UTC) and built.
grant_planis the planner,crates/grant_contractthe leaf a program links, andcrates/program_tablethe catalog that stays in nife. - Public names that need a decoder: the maintainer's provisional ruling of 2026-11-14 (UTC). The
eight renames hold, with
job_page_framebecomingjob_channel_page. Built. - Limits carry their unit: the maintainer's provisional ruling of 2026-11-19 (UTC), two-way until the first publish.
- The names
grant_contractandprogram_table: ruled 2026-11-19 (UTC), both as built. - Review clearance and the repositories: ruled 2026-11-22 (UTC). The architect cleared both
reviews together, which approves creating the two repositories with
publish = false, no tag and no publication. The proofs (P1-5) and the first mutation run (P1-14) happen in the new repositories before any tag, andgrant_contractmoves afterprogram_argument_contracthas its own repository. - The names of both crates: ruled 2026-11-20 (UTC) and built.
expandisexpansion,CwdisDirectoryPath,WhichisGrantSide,RefusedisPathRefusal,verb_ofisline_verb,page_verbanddelegated_identityare the grant_contract spellings, the builtin variants ofCommandkeep the typed word, and every name those rulings cover carriesName: ratified. Names with no block wait on rulings by family.
Done when
The checks are in the appendix.
BUGS
- This block has no review package to inherit from, so its list of ratified names comes from the
Name:blocks in the source, not from a packet that an architect has read. The review packages undernotes/crate-reviews/now carry that list. - Item 4's defect came from reading
parse_runand from the shape of the shipped manifests, not from a failing test. The change includes the test. - Item 5's uncertainty about the template's
falsifypairing was not resolved; the change holds either way, since a harness per claim is the stated standard. - The mutation figures are the tree's records, not a run of this review. The split moves code across files, so the first run after it is the one that counts.
- The prior-art table's rows for POSIX, zsh, Plan 9, Shill and Plash come from memory, not a re-read; the download figures come from crates.io.
ISOLATION_WORD(b"swish") is inprogram_table, so the catalog can refuse the word before resolving it. It names nife's shell and stays in nife.- The review measured the sizes with the tree's nightly on one 64-bit host. They match on every 64-bit target by construction (no pointers in the values), and the review measured no other.
Follow-on
- Done. P0 item 1, the split, in #3584:
grant_plan,crates/grant_contractandcrates/program_tablebuild and test on their own. - Done. The tree builds the limits rule (P1-6), the eight renames (P1-7) and the 2026-11-20 name rulings, and the two review packages carry the clearance; the repositories follow it with no tag and no publish.
- Outstanding. Every finding marked Open or Waiting on under "Finding status", each checked against the three crates' sources on main.
- Done.
crates/externalization-list.txtnames both crates that leave (#3961);program_tablestays in nife and needs no row.
Index row
An outside review of grant_plan before it leaves. Three items block the move: the crate is a table
of nife's programs and cannot stand alone, the documentation does not build with warnings denied,
and the manifest is the workspace's. Eleven items land before the first release, and five are for
later. The eleven cover these. A tokenizer that drops a seventeenth token. The absence of any proof.
Eight limits without units and eight public names that need a decoder. Five British spellings.
Documentation written for a reader inside this tree. Refusal sentences that spell constants by hand.
Two-kilobyte values passed by value. Three unasserted narrow casts. A silently narrowed manifest. A
mutation run the release gate will ask for. The split along the ruled boundary has landed; the units, the
names of the split crates and review clearance are ruled, and a rename lane and the review packages
carry them out.