Repository navigation
Launcher milestone 3 of 4: exec, run, env, doctor, selftest and gc - #8
Conversation
ADR 0012 lets text read from the lock or the channel fill a fact slot
only. Eight templates quoted such a value in a sentence: the glibc a
capsule needs, the version a capsule claims and the one it reports, a
lock or manifest format, the toml and lock versions in E-PIN-DRIFT, the
manifest versions in E-CHANNEL-ROLLBACK and an expiry time. Each sentence
now describes the value, which stays on its fact line in full. The fix
command `idris2x pin {toml}` keeps its value: a fix slot accepts lock
text once it has passed the version check.
The advice note lsp-mismatch quoted the pinned version twice. An
[[advice]] entry may now carry `facts`, as a [[case]] does. The generator
types a key that appears only on a fact line as Fact. The launcher and
the prototype print fact lines between the note and its silencing line,
and the prototype now fills advice text in one pass, as render.jq does.
The chaos drill for the note checks the new text and the fact line in
one assertion, so the suite still has 121 checks. The rendered catalogue
is regenerated; both launchers match it.
install reads idris2x.lock with no network (ADR 0008), downloads over https or plain http to this machine only, resumes a partial download with a Range request, checks the digest, unpacks with its own containment checks, checks sha256sums.txt, runs the two embedded probes in the reset environment (ADR 0005), and renames into the store under a per-digest file lock (I2). verify re-checks an installed capsule. fetch -o writes a bundle that install --from takes offline. Two error cases are added through errors.toml: E-PIN-NOT-FOUND unreadable-lock and E-USAGE bad-setting. Settings are strict: a value the launcher cannot read is refused, never replaced by a default. New crates: ring, rustls, ureq, flate2, tar, serde_json, signal-hook. The minimum Rust version is 1.89, for std file locks. SIGXFSZ is caught so that a file size limit is reported as E-STORE-IO. tests/install.rs drives the binary against a local HTTP server and a fake capsule: resume, cut transfers, refused mirrors, digest mismatch, bundles, offline, held locks, strict settings, bad locks, the file size limit, twelve unsafe archives and six archives that are not valid capsules. Seven protections were removed one at a time (the symlink check after unpacking, the walk through parents, the setuid check, the plain-name check, the environment reset, the SIGXFSZ handler, and keeping a bundle), and a test failed each time. The launcher line gate fails: 1,265 lines against a cap of 1,000.
The owner ruled on 2026-11-26 to raise the cap and keep standard rustfmt. Milestone 2 has 1,265 lines of our own code. All of Phase 1 is projected at about 1,700 to 1,800 lines. The gate script now fails at 2,000. Every live statement of the cap says 2,000: CLAUDE.md, the Copilot instructions, the pull request template, the workflow comment, the roadmap, the maintainers guide, two wiki pages and the DX principles. ADR 0007 gets a "superseded in part" note, as other ADRs in this repository do. ADR 0012's estimate, made under the old cap, is left as written.
Two engineering claims are added to PROOF-STATUS, both open and ungraded. STORE-1: unpacking writes only inside the staging tree. STORE-2: nothing enters the store before the digest, tree and probe checks pass. Creusot with Pearlite contracts and Verus are scoped to `plain` and `inside` for STORE-1, and to the order of checks in `fill` for STORE-2. Neither was run, and neither toolchain is installed or pinned here. Whether either handles std::path::Components has not been checked. Three boundaries are recorded: the tar crate's header parsing and ring's SHA-256 (both ASSUMED, third-party), and that the staging tree is private while an install holds its lock.
The estate-rules job failed on PR #7: asciidoctor warned that the id "case" was already in use at docs/dx/ERROR-CATALOGUE.adoc line 378. AsciiDoc reads [[name]] as an inline anchor even inside backticks, and the paragraph added in dbc7cd3 wrote `[[advice]]` and `[[case]]`. A backslash before each stops the anchor. The rendered text is unchanged. All 228 tracked .adoc files now render clean.
|
Review these changes at https://app.gitnotebooks.com/metadatastician/idris2x/pull/8 |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
🟢 clean · commit Advisory: 11 row(s), worst 🟡 medium (0 critical, 0 high in grid scope) — reported, never grading the change. Unique graded findings across gating and advisory rows: 11 (11 reporter observations; 7 without sufficient identity to corroborate). Row counts remain per reporter; unique totals do not change gating.
Hypatia scan: 5 finding(s)
panic-attack assail: 27 finding(s)
pons asinorum: 9 finding(s)
echidnabot: not_applicable — template default: enrol once the repository carries proofs and an ECHIDNA engine is configured
rhodibot (RSR compliance): 13 finding(s)
panicbot: not_applicable — panic-attack is already graded by the verdict grid's own panic-attack row, from static-analysis-gate.yml evidence; enrolling panicbot would report one scanner twice and give two rows that can disagree
sustainabot: not_applicable — reserved fleet slot; no adapter exists (gitbot-fleet bots/sustainabot/README.adoc)
glambot (presentation quality): 151 finding(s)
seambot: not_applicable — template default: enrol once a seam register exists at spec/seams/seam-register.json
finishingbot (release readiness): 151 finding(s)
cipherbot: not_applicable — template default: enrol once the repository implements cryptography
accessibilitybot: not_applicable — template default: enrol once the repository serves HTML
Scope: static findings reported by each row's tool at the named commit. The table grades only findings in files this change touches, so the colour answers "does this change introduce anything?", not "what does the whole repository still carry?". Standing findings are counted in each accordion and in report.json; the baseline filter remains the place where acknowledged debt is recorded. The lane state is the worst GATING row; advisory rows are listed and counted but never set it. Purple, red, yellow and blue grade the worst GRADED finding present; orange is evidence missing, malformed or a scanner that did not run; grey is an explicit scope exclusion with its reason. No row is a security certification. report.json, badge.json and the raw findings are in the verdict-grid artifact on the linked run. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
A glibc floor that getconf cannot check is refused as E-GLIBC-FLOOR/unknown (exit 16) instead of skipped. getconf runs with PATH only, so an inherited LD_PRELOAD cannot answer for it. A capsule.json that does not name the capsule and give its versions is refused at install as E-CAPSULE-INVALID/bad-metadata (exit 21). The versions become a heap path and a probe answer, so they pass the version check first. With IDRIS2X_CACHE, XDG_CACHE_HOME and HOME all unset there is no store: E-STORE-IO/no-cache-dir (exit 24). The launcher used to put one in the current directory. A lock without schema 1 is refused. A setting that is not Unicode text is refused, never read as unset. IDRIS2X_LOCK and IDRIS2X_CACHE go through the same strict reader as the others. Plain http is allowed only when the host itself is this machine; an address with a user part is refused. A local mirror may not redirect, and an https mirror may redirect only to https. A 3xx answer is reported, not saved as the capsule. A hard link that cannot be written is a disk failure, not an unsafe archive. PROOF-STATUS STORE-2 now names sha256sums.txt, and says which files it covers.
exec and run start the capsule's Chez Scheme with the environment reset from ADR 0005; --inherit-env keeps the code variables. env prints the same variables as shell lines, with an unset line for each inherited code variable, or as one JSON object. selftest compiles a program, runs it, then runs it again from another directory with an empty environment. Each of these installs the pinned capsule first if it is missing, from idris2x.lock alone. doctor prints one line per check (store, platform, lock, capsule, probes, each mirror) and the notes, changes nothing, and sends one HEAD request per mirror unless --offline or IDRIS2X_OFFLINE=1 is given. A store it cannot find, or an IDRIS2X_OFFLINE it cannot read, is a problem line; in the second case nothing is sent. gc removes incomplete installs and day-old staging files it wrote, lists the capsules beyond --keep-last, and removes them only after yes at a terminal or with --yes, each under its capsule's lock with .complete deleted first. New error case E-PROBE-CODEGEN/cannot-start (exit 17) and advice gc-compiled-programs. The test helpers moved to tests/common so a new file, tests/run.rs, can share them. ENV-1 and GC-1 are recorded in PROOF-STATUS as open; no verifier has run. The launcher is 1,825 of 2,000 lines.
d8cb7dc to
13b6ea9
Compare
A mirror that stops sending now fails over. IDRIS2X_NET_TIMEOUT (seconds without data, default 30) bounds every read and write, before the answer and in the middle of the file. The prototype bounds curl the same way. Each mirror now starts the file clean: bytes from one that failed are never resumed from another. The new stall test found that hole. A version may have at most 19 digits in each run, so every run fits in 64 bits. A glibc floor or any other version too large to compare is refused as malformed, never read as 0. The prototype checks the same. The checksum list must cover capsule.json, as the factory's list does. verify reads capsule.json again and reports store-modified if it no longer describes the pinned capsule. New case E-CAPSULE-INVALID/pin-mismatch: the capsule's capsule.json names a different Idris 2 than the lock pins. A Chez-only capsule names none and still installs; exec refuses it later, as before. The unsafe-path state no longer says a --from bundle was deleted. The prototype did delete it; now it keeps it, as the launcher does. ADR 0005 amended (owner ruling): LD_PRELOAD and LD_AUDIT join the reset. --inherit-env still passes them. CLAUDE.md, the Copilot instructions and the threat model say the same. The 302 test now sends a Location and checks the hop was not followed.
Brings in the fixes from review round 2 on #7: the stall bound on downloads, versions limited to 19 digits in each run so the glibc floor cannot overflow, verify reading capsule.json again, the pin-mismatch case, the --from state text, and LD_PRELOAD and LD_AUDIT in the environment reset. Resolved by hand: - src/capsule.rs keeps milestone 3's code() and reset(); code() now names LD_PRELOAD and LD_AUDIT, so exec, run, the probes, env's unset lines and doctor's ignored-variables note all use the same list. - src/net.rs keeps milestone 3's agent() helper and gives it the stall bound; doctor's mirror check keeps its 5 second limit. - tests: the new test helpers (described, stall, the redirect Location header, the loader check in the SCHEME stand-in) move into tests/common/mod.rs with the others. - src/errors_gen.rs is generated again from src/errors/errors.toml. New test: exec drops LD_PRELOAD and LD_AUDIT and passes them on only with --inherit-env.
A finished store entry was returned without checking that its capsule.json names the Idris 2 version the lock pins. A lock that tied the same digest to another version passed on a warm cache and failed on a cold one. Both cached return paths in store::install now run the same capsule::holds check as fill, and fail with E-CAPSULE-INVALID pin-mismatch. A Chez-only capsule is still reused. A new test installs a capsule, re-locks its digest as 0.7.0, and sees the refusal; it fails without the fix. The prototype now checks min_glibc as the launcher does: the version form with at most 19 digits per run, a string or nothing, and on Linux a host glibc it cannot read is E-GLIBC-FLOOR unknown, not a skip.
Summary
Milestone 3 of 4 of the Phase 1 Rust launcher:
exec,run,env,doctor,selftestandgc. Nothing is shipped: there is no release and no published capsule.This PR is stacked on #7 (milestone 2, base
claude/phase1-launcher-m2), so its diff shows milestone 3 only. I will retarget it tomainafter #7 merges.It was rebased onto the #7 review fixes (
908efb7), then took #7's review round 2 (d5299ca) by merge, with no force-push. Pushed with the owner's OK (selector, 27 Nov). Its head is12a842c, signed.Changes
One commit, Launcher milestone 3: exec, run, env, doctor, selftest and gc.
src/run.rs:exec(Idris 2) andrun(Chez) replace the launcher process with the capsule's Chez Scheme. They apply the environment reset from ADR 0005.--inherit-envkeeps the code variables, and a--after it is dropped.envprints the same variables asexportlines foreval, after anunsetline for each inherited code variable.env --jsonprints one JSON object.selftestre-runs the two probes. It then compiles a small program, runs it, moves it and runs it again with an empty environment. RefC is tried only ifccis on PATH, and never decides the exit code (as in the prototype).idris2x.lockalone (ADR 0008).src/doctor.rs: one line per check,status check: text. The checks are store, platform, lock, capsule, probes and each mirror, followed by the advice notes. A problem line ends with the error ID it would cause.--offlineorIDRIS2X_OFFLINE=1skips.--jsonprints one object.src/gc.rs: incomplete installs, and day-old staging files that idris2x wrote, go without asking.--keep-last(default 3, newest kept by install time) are listed first. They are removed only afteryesat a terminal, or with--yes;--dry-runstops after the list..completefirst.fetch.log,selftest-<pid>.src/main.rs: the usage table is oneusage|descriptionstring per command. Flag parsing is shared, and so is the missing-value error.E-PROBE-CODEGEN/cannot-start(exit 17; no new exit code): the system refused to start the capsule's Chez. New advicegc-compiled-programs(review by 2027-05-26). The rendered catalogue is regenerated, anddx-golden.shgets a sample. Runbooks, the issue form and the wiki table had no diff.src/msg.rs:Txt<Checked>::shown()is the only way to read a checked value.clean()replaces control characters.brief()is a one-line summary of a failure, for doctor.advice()now returns the text, or nothing when silenced.tests/common/mod.rs, and the newtests/run.rsuses them.CHANGELOG.adochas a milestone 3 entry, and corrects my milestone 2 projection.docs/dx/JOURNEYS.adocsays where milestone 3 differs from the doctor and gc designs.docs/status/PROOF-STATUS.adochas two new open rows, ENV-1 and GC-1, and one new boundary (advisory file locks).Line count
The launcher is 1,873 of 2,000 lines of our own code, counted with rustfmt's default layout. It was 1,825 before #7's review round 2 was merged in.
My milestone 2 projection (1,700 to 1,800 for all of Phase 1) was too low. Milestone 4 is estimated at 200 to 250 more lines.
The owner chose by selector (26 Nov) to keep the defaults and the cap, and to fit milestone 4 by tightening. If it will not fit, I stop and ask before going over. Some of the tightening in this commit is layout-driven: tuple
lets that keep rustfmt from spreading a struct literal over five lines. For milestone 4 the owner then chose "Max heuristics" (selector, 26 Nov):src/uses rustfmt's denser layout from #11 on, and the cap stays at 2,000.Departures from the bash prototype and the designs
--inherit-envis a flag, not the variableIDRIS2X_INHERIT_ENV.envquotes with single quotes, printsDYLD_LIBRARY_PATHtoo, and printsunsetlines for inherited code variables.IDRIS2_*names. Chaos drill T17 compares an exact line, so it may differ if the runner hasLD_LIBRARY_PATHset.info.idris2-lspnote names the pinned version only.IDRIS2X_OFFLINEstrictly, asinstalldoes since the Launcher milestone 2 of 4: install, verify and fetch from a lock #7 fixes. A value other than0or1is aproblem settingline, and doctor then sends no request. Before, a value such asyescounted as online, and doctor sent its HEAD requests.problem storeline and skips the capsule check.cache/staging/selftest-<pid>, not/tmp. It also re-runs the probes.Owner rulings on this PR (selector, 26 Nov)
execwill takeexec [--locked] [--inherit-env] -- <program> <args>, with programs read fromcapsule.json'sexecmap (ADR 0005) and each path checked to stay inside the capsule. This PR still has the prototype form (exec -- <idris2 args>,run -- <chez args>, no--locked), and README.adoc plus four wiki pages already show the new form. The change comes in milestone 4.msg.rsand the prototype'srender.jq. doctor, gc andbriefalready clean their own lines. The renderers are fixed in a separate PR stacked on this one.Known gaps, not fixed here
exectakes no lock, sogc --yescannot see a capsule that is running at that moment (recorded in JOURNEYS and as a PROOF-STATUS boundary).docs/status/ROADMAP.adocstill says "Phase 1 not started". Launcher milestone 4: pin, channel trust and the exec map #11 fixes it.capsule::varsreadsLD_LIBRARY_PATH,DYLD_LIBRARY_PATHandPATHwithstd::env::var. Under--inherit-env, a value that is not text is dropped without a word.analyze (actions, none)fails because the repository has CodeQL default setup on. It is not caused by this code.open.cargo vendorandcargo denyare still not set up. A Sonnet thread does that after Launcher milestone 2 of 4: install, verify and fetch from a lock #7 merges.RSR Quality Checklist
Required
just testor equivalent)just fmtor equivalent)cargo clippy --all-targets -- -D warningsunsafeblocks without// SAFETY:comments (the binary has#[forbid(unsafe_code)])believe_me,unsafeCoerce,Obj.magic,Admitted,sorry).envfiles includedAs Applicable
*_chora.deed)(status)/(maturity)updated: not changed. The phase is still incubating and nothing is shipped.(ecosystem)updated: no integration changed.(meta)and/ordocs/decisions/updated: no ADR changed. The exec-map ruling follows ADR 0005 as written.docs/status/ROADMAP.adocupdated: not in this PR (see known gaps).docs/architecture/TOPOLOGY.adocupdated: not needed for this milestone.CHANGELOGor release notes updatedsrc/errors/errors.toml) reflected in the regenerated outputs. One case and one advice added; no exit code changed.Testing
Run locally on Linux x86_64:
just test && just quality: pass.cargo test --lockedwith Rust 1.97, and the build with a real 1.89 toolchain (the MSRV): pass on13b6ea9. Run again on12a842cafter Launcher milestone 2 of 4: install, verify and fetch from a lock #7's review round 2 was merged in:just test(31 tests) andjust qualitypass.tests/run.rsruns a stand-in Chez (a shell script that also stands in for Idris 2 and the compiler) and covers:execandrunwith and without--inherit-env, a Chez that cannot start, and a capsule with no Idris 2.envlineseval'd by/bin/shwith a store path holding a quote and a space, andenv --json.--offline, the env note silenced, and a modified store in--json, anIDRIS2X_OFFLINEthat is not0or1, and no store directory. It also checks that no.doctor-*file is left behind.--dry-run, without--yes, with a held lock, and a name idris2x never writes.gen-errors-rs --check,gen-runbooks --check,gen-issue-forms --check,sync-wiki --check,dx-golden --check(plain, and through the Rust launcher),check-msg-negatives,check-advice-review,check-mint-tokens,check-spdx-headers,check-invisible-characters,check-escape-hatches,check-launcher-loc(1,825 of 2,000),check-adoc-renders,proof-claims-rows: pass.Not run: Creusot, Verus, and the chaos suite against the Rust launcher.
idris2x specifics
src/errors/errors.tomledited (exit codes append-only), thenscripts/gen-runbooks.shandscripts/gen-issue-forms.shre-run (no diff)deny.toml(no new crates;deny.tomlnot set up)docs/wikis/: no.Generated by Claude Code