P0 and P1: before the move
An appendix to the milestone.
P0: a claim the crate makes is false
- The reader panics on a length byte past its field, and the documentation says it cannot.
Finding:
read_field(src/lib.rsline 304 to:310) slicespage[data_off..data_off + n]withnread from the page.bytes()is exactlyPAGE_BYTES(107) long, so aTERMlength above 32, aLANGlength above 57 or aTZlength above 98 indexes past the slice and panics. The doc comment at:300to:303says a foreign or corrupt page answers "absence rather than a panic". The test comment at:523to:529says the page "must not read out of bounds or panic" and then tests only a length of zero. The crate docs ofprogram_argument_contractcite this reader as the "default-honest shape" that checks "every length against what is left". Reached fromsys/env/nife.rs'sseed()beforemain, fromprintenvand from the shell'scapspreview. Only the progenitor writes the page today, so no untrusted writer reaches it. The defect is a false claim and a startup abort on a corrupt frame, not a memory-safety hole, since the code checks the index. Change: giveread_fieldthe field's cap and answerNonewhennis zero or above the cap. Add one test per field with a length one past the cap and one with 255. Reword the two comments to state the bound. Thenprogram_argument_contract's citation becomes true. Door: two-way; no pagePageBuilderwrites has such a byte. Effort: S.
P1: before the move
-
The closed domain is a writer-side guarantee only. Finding:
tz(),lang()andterm()(src/lib.rsline 380 to:398) return whatever UTF-8 the length byte covers. With item 1 fixed a length under the cap still returns a value with trailing NUL bytes, or any string a writer other thanPageBuilderput there. ยง111's reason for the domains is that no shape tells bytes on a page apart. The domains live in this crate and cost 20, 12 and 11 string compares, once, at process start. Change: an accessor answersSomeonly for a member of its key's domain (domain::is_valid_tz(value).then_some(value)), and the doc comments say a reader never sees a value outside the set. Add a test that a recognized page carrying a non-member reads as absent. The alternative, leaving the reader raw and documenting that callers check the domain, is the shapecounter_frequency_contractkept forhertz(). Here the domain is the whole point of the contract, and a later release can loosen the stricter reader, but once a program depends on the looser one, no release can tighten it. Door: two-way until the move, since only pages a conforming writer never produces change behavior. The maintainer can decide it. Effort: S. -
The pre-ruled family and rule names. Finding:
PAGE_BYTES(src/lib.rsline 162) is 107 bytes of content, and the page contract family rule indesign/naming/crates.mdnames thatPAGE_CONTENT_BYTES, reservingPAGE_BYTESfor a real page size.helpers/name_release.py --draftprints the rename as pre-ruled.ConfigPage(:337) breaks the spelled-out rule (config) and sits indesign/naming-rule-baseline.txt.ConfigPage::new's parameterva(:359) is on the spelled-out list, and the family rule names the parametervirtual_address. The template'sspelled_outgate would refuse the last two on the repository's first pull request. Change:PAGE_CONTENT_BYTES,ConfigurationPage,virtual_address, eachprovisionaluntil the name review, withcrates/swish/src/preview/tests.rs,components/src/printenv.rs,crates/swish/src/endowment.rs,crates/swish/src/preview.rs,components/src/swish/capabilities.rs, the overlay'ssys/env/nife.rsandsys/pal/nife/mod.rs, and the two baselines moving in the same change.grant_plan::Manifest::configurationandSHELL_CONFIGURATION_SLOTalready use the spelled-out word. Door: public names, one-way after the move and two-way now. The rules that decide them are already ruled, so nothing new needs deciding. Effort: S. -
The abbreviated accessor family:
tz,lang,term. Finding: the public functionstz,lang,term(on bothPageBuilderandConfigPage),is_valid_tz,is_valid_lang,is_valid_term, the variantsUnknownTz,UnknownLang,UnknownTerm, and the privateOFF_TZ*andOFF_LANG*constants carry none of the words the ratified constants spell out (TIME_ZONE,LOCALE,TERMINAL_TYPE).TZ,LANGandTERMare POSIX's own variable names, which the naming rules let a name keep only with the expansion in the doc comment and a#[doc(alias)]. The accessors carry neither (the aliases sit on the constants).abbreviationsreports all 19 components. NoName:block covers any of them. Change: the names the milestone's accessor decision rules, provisionally. Each accessor gains#[doc(alias = "TZ")],"LANG"or"TERM", and the overlay'sseed()moves in the same change. Door: two-way before the first tag; the architect may revisit the names. Effort: S after the ruling. -
No proof, and the one that matters would have caught item 1. Finding: the crate has no
#[cfg(kani)]module and nofalsifications/;crate-standalonefailsproofs, and the template'sproofs.ymlwould run nothing.block_roster_contract'sread_is_total_and_every_counted_entry_is_gettableis the shape this crate lacks: for any bytes,readneither panics nor indexes out of bounds. The review's trial of that harness over a fully symbolic page did not finish in seven minutes ("What was checked"). The expensive part isfrom_utf8over a symbolic slice of up to 255 bytes, and it is also the part that does not matter: the bound to prove is on the slice, not on its decoding. Change: averificationmodule with three harnesses, each with a falsification patch the template'sfalsifyjob replays red. One: for any three length bytes and a correct magic, the sliceread_fieldtakes lies inside the page (prove the bound on the index arithmetic with the bytes of the fields concrete, so the UTF-8 loop is not symbolic). Two: for any choice of one member per domain, build then read returns the same three members. Three: after item 2, any value an accessor returns is a member of its domain. Measure the run with/usr/bin/time -vfor the README, as the scaffold asks. Door: two-way. Effort: M. -
The crate does not stand alone. Finding:
crate-standalonelists the rows. The manifest inheritslicenseandlints, has norust-version,description,repository,readme,keywordsorcategories, and itspublish = falsecomment points atcrates/publish-allowlist.txt. There is no README,LICENSE-MITorLICENSE-APACHE.src/lib.rscitesnotes/env-config.md(:7), three decision sections, two milestones,script/lint,clock_contract::MAGIC,clock_contract::status,file_system_contract,PageFrame,initand "thestdPAL", and itsName:blocks name the architect, which the template'sstandalonecheck refuses as a finding of its own. The template refuses a fuzz opt-in for a crate withunsafe, and this crate has three sites (new,bytes, theSend/Syncimpls), so the README must say fuzzing stays off and why. Change: the manifest rows asclock_contractwrites them (rust-version = "1.88", literallicense, the[lints]tables inlined,description,readme,keywords,categories). A README in the scaffold's shape (one line, the contract as a bullet list with the layout table,## EXAMPLES,## What is proven,## Building and testing,## BUGSwith the curated-list policy and how to add a zone,## Minimum Rust version,## License). Both license texts. Every citation rewritten in the crate's own terms ("the assembler", "the reader", "a frame mapped read-only"), and theName:blocks stripped byscript/crate-moveas the runbook already does. Door: two-way. Effort: M. -
The identity is provisional and unpinned. Finding:
INTERFACE_ID(13) andVERSION(1) carry provisionalName:blocks, andscript/names --unratifiedlists both crossing intocomponents. Milestone 1017 asks for ratified identity values before a contract crate leaves. No test pinsMAGIC,VERSIONandINTERFACE_IDas literals (clock_contracthas one), and nothing ties the digitMAGICcarries toVERSIONalthough the doc comment onVERSIONsays they move together. Change: the identity decision in the milestone; then a host test that asserts the three literals, and aconstassertion thatMAGIC[7] == b'0' + VERSION as u8. Door: one-way; the identity is what a release binary compares. Effort: S after the ruling. -
The truncation path writes a plausible wrong value. Finding:
write_field(src/lib.rsline 292 to:298) truncates a value to the field's cap and writes the cap as its length. A domain member longer than its cap would reach the page cut short, which, after item 2, a reader refuses. Before it, a reader returns the cut string as configuration. The crate'sBUGSsays a host test catches this first, which is a gate (rung 2) where a compile-time check (rung 1) costs the same. Change: aconstblock that walks each domain and asserts every member's length against its cap, so a list grown past its cap fails to compile. Thenwrite_fieldasserts instead of truncating, and theBUGSentry and thevendored_name_gates.pyexemption forcapgo. Rename the parameters while there:capreads as capability in this tree and the template'sspelled_outrefuses it.val,len_offanddata_offspell out tovalue,length_offsetandvalue_offset.OFF_TZ_LENand its siblings toTIME_ZONE_LENGTH_OFFSETandTIME_ZONE_OFFSET, which also clears the threeregister_namesrefusals. Door: two-way; private names. Effort: S.