roadmap PARTIAL

1155. grant_plan: the release review's findings

(The number and the slug are provisional.)

The release review of partsfoundry/grant_plan at commit 69aedfbc, version 0.1.0 (unpublished), under milestone 1129 (the combine review), whose block sets its form. The baseline is milestone 1094 (what an outside maintainer would fix before it leaves), its block and the cleared package notes/crate-reviews/grant-plan.md. 1094's rulings stand: the three-crate boundary, the limits that carry their unit, and the names ratified on 2026-11-20. 1094 left one choice to this review, the arguments plan_against takes by reference (D9). The release-review rule reopens two ratified names (P0-8).

Reuse: the crate's own tests and example, and two scratch crates, a probe and a benchmark.

Finding status

Open decisions

The one-way doors D1 to D10 below.

Goal

A stranger who writes a shell for a capability system gets a line read, a grant planned and a refusal worded, with no allocator. The types refuse the wrong finish and the forged parse, each refusal says where it stands, and the interface can grow.

What the review read and ran

The appendix holds the crate's files, the commands, the probe, the benchmark and each comparator file read. The guidelines table marks the 54 items.

Prior art

Measured from the crates.io API on 2026-11-26 at 22:49 (UTC). The crate's problem has two parts. The first is reading a typed line, and three Rust crates rank for it. The second is deciding what the line grants against a program's declaration. No Rust crate solves that: fourteen searches found none. The bar for it is the shell of Plash, outside Rust.

crate or system role version read total 90 days reverse dependencies updated
shlex ranked 1: splits a line into words 2.0.1 1,166,214,781 396,658,502 846 2026-05-17
shell-words ranked 2: the same job 1.1.1 189,653,529 51,611,713 921 2025-12-10
brush-parser ranked 3: a whole shell grammar, with pipes and redirections 0.5.0 1,036,344 532,786 34 2026-11-26
yash-syntax comparator: a POSIX shell grammar 0.25.0 64,591 20,208 6 2026-09-06
clap_lex neighbor: classifies options in an argument list 1.1.2 1,103,581,987 273,096,242 37 2026-11-16
lexopt neighbor: the same job, with typed errors 0.3.2 15,914,452 3,760,889 211 2026-02-28
cap-std neighbor: directories held as capabilities 4.0.3 37,324,536 19,185,273 370 2026-08-20
Plash pola-shell, src/shell.gram and src/shell.c outside Rust: a shell whose line is the grant commit 1d77bb2f

The crate integrates with no crate on crates.io. Its three dependencies are the organization's own: byte_glob, grant_contract and program_argument_contract (P1-7).

What grant_plan does better

The items

Effort is S (half a day), M (a day or two) or L (longer). Every P0 below changes a public item of grant_plan that a caller would depend on once 0.1.0 is out, so none of them can wait for a later release.

P0: the 0.1.0 interface

P0-1. A batched expander can finish as a whole set

Verified by running the probe (src/expansion.rs, lines 406 to 442). Expander::new and Expander::batch build the same type, and finish and finish_batch each suit one of them. A debug_assert! guards the wrong pairing. In a release build Expander::batch(..) offered ten matches answers finish() with Ok and eight names. That is the grant of a prefix of what matched, which the crate's documentation calls its worst outcome. In a debug build the same call panics. Change: two types, one per collection policy, each with the one finish that suits it (the second type's name is provisional). Door: one-way (D1). Effort: S.

P0-2. No public enum or struct can grow

Verified in source: grep -rn non_exhaustive src finds nothing. Refusal has 43 variants and CommandLine 22, and a new variant breaks a caller's match on either. CapabilityKind has one variant, and its documentation says more will come. Endowment has twelve public fields, and six more structs are all public fields. shlex::QuoteError, brush_parser::ParseError and yash_syntax's SyntaxError are #[non_exhaustive]. Change: #[non_exhaustive] on Refusal, CommandLine, PathRefusal, BindRefusal, CapabilityKind, InterruptAction and UserVerb, and on the structs the crate hands out: Endowment, FileGrant, DirectoryGrant, Batch and TouchOperands. The caller builds ShellHoldings and Streams, and the attribute forbids a struct literal outside the crate, so they get a constructor and setters with private fields. Door: one-way (D2). Effort: M.

P0-3. The refusals implement no error trait and carry no place in the line

Verified in source and by cargo doc. Five types stand in the error position of a public Result: Refusal, PathRefusal, BindRefusal, NoJobNamed and NameSetFull. None implements core::fmt::Display or core::error::Error; three have a message method that returns a fixed sentence. No refusal says where in the line it stands. line::split answers UnclosedQuote with no offset, and plan_against answers Unexpected while the token sits in another value. nav_refusal turns all four PathRefusal causes into Refusal::FileNotNameable, whose sentence lists three limits and cannot say which one the line met. DirectoryPath::descend returns false for three causes. NameSetFull covers four, two of them not about room. yash-syntax pairs every cause with a Location, and its unclosed-quote variants carry where the quote opened. brush-parser returns ParsingNear(SourcePosition). lexopt carries the option or value that failed. Change: Display and core::error::Error on all five, with message kept as the text Display prints. A refusal about a token carries the token's range in the line. A path refusal inside a Refusal keeps its cause. descend and ascend return the PathRefusal. Named causes replace NameSetFull. The shape is the one the errors decision of milestone 1129 picks. Door: one-way (D3). Effort: M.

P0-4. ParsedInvocation, Line and Word mix public fields with private state

Verified in source (src/parsing.rs, src/line.rs, src/word.rs). ParsedInvocation has four public fields (program, memory_grant, unexpected, misquoted) beside six private ones with getters. plan_against trusts the public ones, so a caller can set unexpected and misquoted to None and plan a line the parser refused. Line has three public fields beside four private ones. Word is two public fields, so a word is one slice of the line for good. A backslash escape or two joined quotes need a word of several pieces. shlex, shell-words, brush-parser and Plash all read escapes (D10). Change: private fields with getters on the three. Door: one-way (D4). Effort: S.

P0-5. Sequences are a fixed array, a callback and a bare index

Verified in source, by running the probe and by measurement. tokenize(line, out) fills a caller's array and stops when it is full, with no sign that tokens remain. 1094's fix covers the planner's own call; a stranger's call still loses the seventeenth token silently. for_each_word takes &mut dyn FnMut, and word::token_end takes &dyn Fn. DirectoryPath::component(level) returns an empty slice one past the end on a short path and panics there on a full one, and no method yields the components. shlex::bytes::Shlex is an Iterator. for_each_word takes 458 ns on twelve words, where tokenize with word::read takes 217 ns. Change: an iterator over a line's tokens and one over its words, which yields Result<Word, Refusal>; components() on DirectoryPath, and component returning Option as slice::get does. The array and callback forms go. Names are provisional. Door: one-way (D5). Effort: M.

P0-6. TwoRoots is public and nothing uses it

Verified in source: outside its own tests, no line of the crate or its example names it. navigation::TwoRoots composes two labeled roots; MountedTree and ShellHoldings do that job for the planner. It derives nothing, and the documentation of GrantSide rests on its arguments. The changelog records the removal of two of its methods for the same reason. Change: remove TwoRoots before 0.1.0, and document GrantSide by the mounted tree. Door: one-way (D6), since a removal after 0.1.0 is a breaking release. Effort: S.

P0-7. One shell's refusals and one program's protocol sit in the interface

Verified in source and by a count over src/. Seven of Refusal's 43 variants are never returned by the library: EmptySegment, TooManySegments, ScopeMalformed, ScopeTooDeep, ScopeCannotRestore, GroupingParentheses and IsolationNotBuilt. A shell returns them. Three of their sentences name that shell's program ('swish -c'). Two quote limits this crate cannot see (three nested blocks, eight commands), and the crate's own test says so of the second. rm_options names the option order of one program's declaration. rm_report is the reply protocol between that program and its spawner: a slot number and a status word. CommandLine holds the builtins of one shell, among them vouch, user and apropos. brush-parser and yash-syntax name no program. Plash's grammar fixes five commands. Change: the seven variants and their sentences move to the shell that returns them, which wraps Refusal in its own type. rm_options and rm_report move to where the program and its spawner share them. The crate page says the builtin list is one shell's. Door: one-way (D7). Effort: M.

P0-8. The names this review reopens, and the provisional ones

Verified in source, read against design/naming.md.

Every other name passes the rules in force. Change: the architect rules each. Door: one-way (D8). Effort: S.

P1: before the first release

The appendix holds the nine in full. P1-1 to P1-3 change what the crate answers; the rest are text, packaging and traits. Each is a two-way door.

P2: may follow

The later items hold the six in full.

Measured performance

Reading twelve words takes 217 ns against 482 ns for shlex 2.0.1, and a 40-byte pipeline 365 ns against 5,048 ns for brush-parser 0.5.0. Parsing and planning one file grant takes 592 ns, and copying the 4,344-byte Endowment it returns takes 57 ns. The host, the inputs and the full table are in the appendix.

One-way doors

Evidence for the shared decisions

Follow-on

Done when

script/review-status shows this block BUILT, with each P0 and P1 line at Done or at Will not fix beside its ruling, and D1 to D10 each carry the architect's ruling.

BUGS

Index row

The release review of grant_plan against shlex, shell-words, brush-parser and yash-syntax for reading a line, and against Plash's shell for granting from one, since no Rust crate does that. Eight one-way changes come before 0.1.0, among them two expander types, room to grow, refusals with a place in the line, private fields on the parse, and iterators. Nine fixes land before the release, six may follow, and ten doors are for the architect.