Repository navigation
Launcher milestone 1 of 4: messages, byte for byte with the catalogue - #6
Conversation
The Rust launcher now renders every message in src/errors/errors.toml exactly as the prototype does. The rendered catalogue is the contract, and CI checks it through both launchers. - scripts/gen-errors-rs.sh generates src/errors_gen.rs from errors.toml: one Fail variant per case, one field per placeholder, so a missing value is a compile error. It also builds the explain text. - src/msg.rs types context text by provenance (ADR 0012). A private module holds the policy table. Six compile_fail doctests show the refused flows, and scripts/check-msg-negatives.sh checks that each fails with its stated error code. - The launcher answers explain, help and version, and the hidden __render hook that dx-golden.sh drives. - render.jq fills each template in one pass, so a value is never scanned again and cannot pull in another key's value. The Rust renderer does the same, and a CLI test covers it. - dx-golden.sh takes IDRIS2X_BIN. The wiki-sync check job now runs the generator check, the golden check through the Rust launcher, the 1,000-line gate and the negatives check. - PROOF-STATUS: DX-PROV-2 stays open. Creusot with Pearlite, and Verus, are scoped but not run.
A full disk, or a reader that stopped early, made the launcher panic. The panic hook then reported E-INTERNAL, which tells the user the bug is in idris2x. That is not true. - errors.toml: new error E-OUTPUT, exit 25 (the next free code), with one case, write-failed. Runbook, issue form, wiki table, Rust table and rendered catalogue are regenerated from it. - src/msg.rs: out() is the one way to write to stdout. explain, help, version, advice and the __render hook all use it. A failed write or flush becomes E-OUTPUT with the system's own error text. - tests/cli.rs: writing to /dev/full gives exit 25 and E-OUTPUT, never E-INTERNAL (Linux only). A closed stdout is still not detected: the Rust runtime reopens it as /dev/null before main runs. The catalogue page says so.
|
Review these changes at https://app.gitnotebooks.com/metadatastician/idris2x/pull/6 |
|
Caution Review failedThe pull request is closed. 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: 9 (9 reporter observations; 3 without sufficient identity to corroborate). Row counts remain per reporter; unique totals do not change gating.
Hypatia scan: 5 finding(s)
panic-attack assail: 24 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): 149 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. |
Hypatia flagged two expect() calls in src/msg.rs (CWE-754).
wrap() kept a list of lines and asked for the last one. It now keeps the
current line's length, so there is nothing to unwrap. Its output is
unchanged: 552 renders by both launchers, both styles, six widths from
40 to 80 columns, gave 0 differences.
fail() expected render() to succeed. render() could fail only when a
value was missing, and a Fail variant always carries every value its
case uses, because the generator builds it that way. The check now lives
in its own function, missing(), which only the __render hook calls, since
its values come from the command line. render() cannot fail, so fail()
has no branch that never runs.
The JSON renderer wrote "context":{{{cx}}}, which check-mint-tokens reads
as an unfilled template token. A small helper now adds the braces.
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. |
Summary
Milestone 1 of 4 of the Phase 1 Rust launcher: messages. The launcher now renders every message in
src/errors/errors.tomlbyte for byte as the prototype does. The rendered catalogue is the contract, and CI checks it through both launchers. It also adds one error, E-OUTPUT (exit 25), for a failed write to standard output.This is the first of 4 stacked draft PRs (the owner approved the plan by selector on 26 Nov): 1 messages, 2 install from a lock, 3 exec/run/env/doctor/selftest/gc, 4 pin and channel trust, with the chaos suite as a required check. Nothing is shipped: the launcher answers only
explain,helpandversion.Changes
scripts/gen-errors-rs.shgeneratessrc/errors_gen.rsfrom errors.toml. There is oneFailvariant per case and one field per placeholder, so a missing value is a compile error. Each field's type is the slot class ADR 0012 allows. The generator also builds theexplaintext.src/msg.rstypes context text by where it came from (ADR 0012). A private module holds the policy table. Sixcompile_faildoctests show the refused flows.scripts/check-msg-negatives.shchecks that each one fails with its stated error code, because stable rustdoc passes acompile_failtest on any error.src/main.rs:explain,help,version, and the hidden__renderhook thatdx-golden.shdrives. A panic is reported as E-INTERNAL (exit 70).write-failed.msg::out()is the one way to write to stdout. A failed write or flush becomes E-OUTPUT with the system's own error text. Before this, a full disk made the launcher panic and report E-INTERNAL, which wrongly blamed idris2x. Runbook, issue form, wiki table and rendered catalogue are regenerated from the TOML.scripts/proto/render.jqfills each template in one pass, so an inserted value is never scanned again. The Rust renderer does the same. No existing rendered message changed.scripts/proto/dx-golden.shtakesIDRIS2X_BIN. Thewiki-sync.ymlcheck job now runs the generator check, the golden check through the Rust launcher, the 1,000-line gate (scripts/check-launcher-loc.sh) and the negatives check.docs/status/PROOF-STATUS.adoc: DX-PROV-2 stays open and ungraded. Creusot (with Pearlite contracts) and Verus are scoped tocheck_digest,check_version, the template fill andshq. Neither was run.src/msg.rshas noexpect()left (Hypatia, CWE-754).wrap()tracks the current line length instead of asking for the last line.render()cannot fail: the missing-value check moved tomissing(), which only the__renderhook calls, because aFailvariant always carries every value its case uses. The JSON renderer no longer writes{{{cx}}}, whichcheck-mint-tokens.shread as an unfilled template token.Departures to note
wiki-sync.yml, notrust-ci.yml, becauserust-ci.ymlis managed by the actions lock.helplists only the commands this build has. Each milestone adds its own.rust-toolchain.toml. MSRV stays 1.80, checked with a real 1.80 toolchain.>&-) is still not detected. The Rust runtime reopens fds 0 to 2 as/dev/nullbeforemainruns. The catalogue page says so.| head -1) gives E-OUTPUT only when a write actually fails. Short output that fits in the pipe buffer still exits 0.Owner rulings this PR carries (by selector, 26 Nov)
RSR Quality Checklist
Required
just testor equivalent)just fmtor equivalent)unsafeblocks 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 here. The ADR 0007 note for ring comes in PR 4.docs/status/ROADMAP.adocupdated: not yet. I will update it when the stack is reviewed.docs/architecture/TOPOLOGY.adocupdated: not needed for this milestone.CHANGELOGor release notes updatedsrc/errors/errors.toml) reflected in the regenerated outputs. Exit code 25 is appended; no code changed.Testing
Run locally on Linux x86_64:
cargo fmt --check,cargo clippy --all-targets -- -D warnings: clean.cargo test: lib 1, cli 7, doctests 7 (6compile_fail, 1 passing). The/dev/fulltest is Linux only.scripts/gen-errors-rs.sh --check, and the runbook and issue-form generators in check mode: pass.scripts/proto/dx-golden.sh --checkthrough the prototype and throughIDRIS2X_BIN=target/debug/idris2x: 46 cases x 5 renderings, identical.explainruns, 0 differences.scripts/check-msg-negatives.sh: 6 negatives fail for their stated code. A mutant with a wrong code fails the check.check-mint-tokens,check-spdx-headers,check-mise-language,check-container-pins) pass locally.scripts/check-launcher-loc.sh: 409 of 1,000 lines.just testandjust quality: exit 0.Not run:
check-adoc-renders.sh: asciidoctor is not installed here, and the script fails closed.analyze (actions, none)) fails here and onmain: the repository has CodeQL default setup switched on and its own CodeQL workflow, and GitHub refuses the second. Switching the repository to Advanced setup is a settings change for the owner.Screenshots
Before this PR, the same command panicked and reported E-INTERNAL (exit 70). The plain form with
NO_COLOR=1is the same as the first block, because stderr is not a terminal here.idris2x specifics
docs/decisions/) for the provenance types; exit code 25 is new.src/errors/errors.tomledited (exit codes append-only), thenscripts/gen-runbooks.shandscripts/gen-issue-forms.shre-rundocs/wikis/(published on merge): the generated error table gains E-OUTPUTGenerated by Claude Code