Skip to content

Launcher milestone 1 of 4: messages, byte for byte with the catalogue - #6

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/phase1-launcher-m1
Nov 26, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
claude/phase1-launcher-m1

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Milestone 1 of 4 of the Phase 1 Rust launcher: messages. The launcher now renders every message in src/errors/errors.toml byte 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, help and version.

Changes

  • scripts/gen-errors-rs.sh generates src/errors_gen.rs from errors.toml. There is one Fail variant 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 the explain text.
  • src/msg.rs types context text by where it came from (ADR 0012). A private module holds the policy table. Six compile_fail doctests show the refused flows. scripts/check-msg-negatives.sh checks that each one fails with its stated error code, because stable rustdoc passes a compile_fail test on any error.
  • src/main.rs: explain, help, version, and the hidden __render hook that dx-golden.sh drives. A panic is reported as E-INTERNAL (exit 70).
  • New error E-OUTPUT (exit 25, the next free code), case 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.jq fills 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.sh takes IDRIS2X_BIN. The wiki-sync.yml check 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 to check_digest, check_version, the template fill and shq. Neither was run.
  • CI fix (second review round): src/msg.rs has no expect() 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 to missing(), which only the __render hook calls, because a Fail variant always carries every value its case uses. The JSON renderer no longer writes {{{cx}}}, which check-mint-tokens.sh read as an unfilled template token.

Departures to note

  • The checks are wired into wiki-sync.yml, not rust-ci.yml, because rust-ci.yml is managed by the actions lock.
  • help lists only the commands this build has. Each milestone adds its own.
  • No rust-toolchain.toml. MSRV stays 1.80, checked with a real 1.80 toolchain.
  • A closed stdout (>&-) is still not detected. The Rust runtime reopens fds 0 to 2 as /dev/null before main runs. The catalogue page says so.
  • A reader that stops early (| 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)

  • Keep E-OUTPUT, exit 25.
  • 8 templates put a lock or channel value into a sentence, which ADR 0012 does not allow. They will be reworded so the value appears only on its fact line (option A). That change is the first commit of PR 2, where those values first appear.

RSR Quality Checklist

Required

  • Tests pass (just test or equivalent)
  • Code is formatted (just fmt or equivalent)
  • Linter is clean (no new warnings or errors)
  • No banned language patterns (no Python, Go, TypeScript or ReScript; JavaScript runs Bun > Deno > pnpm > npm)
  • No unsafe blocks without // SAFETY: comments (the binary has #[forbid(unsafe_code)])
  • No banned functions (believe_me, unsafeCoerce, Obj.magic, Admitted, sorry)
  • SPDX license headers present on all new/modified source files (new files carry them; existing headers are unchanged)
  • No secrets, credentials, or .env files included

As Applicable

  • Repo deed (*_chora.deed) (status) / (maturity) updated: not changed. The phase is still incubating and nothing is shipped.
  • Repo deed (ecosystem) updated: no integration changed.
  • Repo deed (meta) and/or docs/decisions/ updated: no ADR changed here. The ADR 0007 note for ring comes in PR 4.
  • docs/status/ROADMAP.adoc updated: not yet. I will update it when the stack is reviewed.
  • Documentation updated for user-facing changes (catalogue pages, runbook, wiki table)
  • docs/architecture/TOPOLOGY.adoc updated: not needed for this milestone.
  • CHANGELOG or release notes updated
  • New dependencies reviewed for license compatibility: none added.
  • Interface contract changes (src/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 (6 compile_fail, 1 passing). The /dev/full test 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 --check through the prototype and through IDRIS2X_BIN=target/debug/idris2x: 46 cases x 5 renderings, identical.
  • A differential run outside CI: 2,520 more renders and 80 explain runs, 0 differences.
  • scripts/check-msg-negatives.sh: 6 negatives fail for their stated code. A mutant with a wrong code fails the check.
  • After the CI fix: 552 more renders (both launchers, styles A and B, widths 40 to 80), 0 differences. The four mint gates (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 test and just quality: exit 0.

Not run:

  • check-adoc-renders.sh: asciidoctor is not installed here, and the script fails closed.
  • CodeQL (analyze (actions, none)) fails here and on main: 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.
  • Creusot and Verus: not installed or run. No proof is claimed.
  • The panic hook has no test yet.
  • The chaos suite runs from PR 4.

Screenshots

$ idris2x explain >/dev/full
idris2x: error[E-OUTPUT]: cannot write the output: No space left on device (os error 28)
    reason: No space left on device (os error 28)
  state: The output is incomplete. Anything the command did before it tried to write is kept.
  why: The disk or file that the output goes to is full, or the program reading it stopped before the end, as head does.
  fix: Send the output to a file on a disk with free space, or to a program that reads all of it, then run the same command again.
  see: idris2x explain E-OUTPUT
  see: https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-OUTPUT.adoc
exit 25

$ IDRIS2X_JSON=1 idris2x explain >/dev/full
{"schema":1,"tool":"idris2x","level":"error","id":"E-OUTPUT","case":"write-failed","exit":25,"title":"the output could not be written","summary":"cannot write the output: No space left on device (os error 28)","context":{"detail":"No space left on device (os error 28)"},"state":"The output is incomplete. Anything the command did before it tried to write is kept.","why":"The disk or file that the output goes to is full, or the program reading it stopped before the end, as head does.","fix":{"command":"","note":"Send the output to a file on a disk with free space, or to a program that reads all of it, then run the same command again.","auto":"none"},"explain":"idris2x explain E-OUTPUT","docs":"https://github.com/metadatastician/idris2x/blob/main/docs/runbooks/E-OUTPUT.adoc"}
exit 25

Before this PR, the same command panicked and reported E-INTERNAL (exit 70). The plain form with NO_COLOR=1 is the same as the first block, because stderr is not a terminal here.

idris2x specifics

  • Risk class: [x] C (launcher, exit codes): ADR 0012 (docs/decisions/) for the provenance types; exit code 25 is new.
  • Error taxonomy changed: src/errors/errors.toml edited (exit codes append-only), then scripts/gen-runbooks.sh and scripts/gen-issue-forms.sh re-run
  • Launcher still under 1,000 lines of our own code (409); no new crates
  • User-facing output changed: transcript above (plain and JSON)
  • Wiki source changed in docs/wikis/ (published on merge): the generated error table gains E-OUTPUT

Generated by Claude Code

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.
@gitnotebooks

gitnotebooks Bot commented Nov 26, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/metadatastician/idris2x/pull/6

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The 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.

Share

Comment thread src/msg.rs Fixed
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Hypatia grid green

🟢 clean · commit 1d53cb3e9546 · run 45767110285 · scope: this change (19 file(s))

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.
Raw Hypatia alert-derived observations: 36 (code-scanning, Dependabot and secret-scanning; some may also be in SARIF; not an extra total).

Reporter Gate Status Critical High Medium Minor Since previous revision
Hypatia scan gating 🟢 clean 0 0 0 0 — same commit (no revision comparison)
panic-attack assail advisory 🟡 medium 0 0 2 0 — same commit (no revision comparison)
pons asinorum advisory 🟢 clean 0 0 0 0 — same commit (no revision comparison)
echidnabot advisory ⚪ not applicable 0 0 0 0 — same commit (no revision comparison)
rhodibot (RSR compliance) advisory 🟢 clean 0 0 0 0 — same commit (no revision comparison)
panicbot advisory ⚪ not applicable 0 0 0 0 — same commit (no revision comparison)
sustainabot advisory ⚪ not applicable 0 0 0 0 — same commit (no revision comparison)
glambot (presentation quality) advisory 🔵 minor 0 0 0 6 — same commit (no revision comparison)
seambot advisory ⚪ not applicable 0 0 0 0 — same commit (no revision comparison)
finishingbot (release readiness) advisory 🔵 minor 0 0 0 1 — same commit (no revision comparison)
cipherbot advisory ⚪ not applicable 0 0 0 0 — same commit (no revision comparison)
accessibilitybot advisory ⚪ not applicable 0 0 0 0 — same commit (no revision comparison)
Hypatia scan: 5 finding(s)
  • 5 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
panic-attack assail: 24 finding(s)
  • medium CommandInjection — scripts/proto/dx-golden.sh — 25 potentially unquoted variable expansions in scripts/proto/dx-golden.sh
  • medium CommandInjection — scripts/gen-errors-rs.sh — 40 potentially unquoted variable expansions in scripts/gen-errors-rs.sh
  • 22 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
pons asinorum: 9 finding(s)
  • 9 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
echidnabot: not_applicable — template default: enrol once the repository carries proofs and an ECHIDNA engine is configured
  • ⚪ not applicable: template default: enrol once the repository carries proofs and an ECHIDNA engine is configured
rhodibot (RSR compliance): 13 finding(s)
  • 13 further finding(s) in files this change does not touch: reported, not graded (0 critical, 12 high).
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
  • ⚪ 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)
  • ⚪ not applicable: reserved fleet slot; no adapter exists (gitbot-fleet bots/sustainabot/README.adoc)
glambot (presentation quality): 151 finding(s)
  • info VIS-005 — docs/dx/ERROR-CATALOGUE-RENDERED.adoc:3 — Line 112 characters exceeds max length of 80.
  • info VIS-005 — docs/dx/ERROR-CATALOGUE.adoc:8 — Line 107 characters exceeds max length of 80.
  • info VIS-005 — docs/status/PROOF-STATUS.adoc:8 — Line 82 characters exceeds max length of 80.
  • info VIS-005 — docs/runbooks/E-OUTPUT.adoc:2 — Line 101 characters exceeds max length of 80.
  • info VIS-005 — docs/wikis/Error-Reference.adoc:3 — Line 94 characters exceeds max length of 80.
  • info VIS-005 — CHANGELOG.adoc:13 — Line 120 characters exceeds max length of 80.
  • 145 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
seambot: not_applicable — template default: enrol once a seam register exists at spec/seams/seam-register.json
  • ⚪ not applicable: template default: enrol once a seam register exists at spec/seams/seam-register.json
finishingbot (release readiness): 149 finding(s)
  • info REL-003 — src/msg.rs — Found 1 occurrence(s) of 'println!' in source
  • 148 further finding(s) in files this change does not touch: reported, not graded (0 critical, 4 high).
cipherbot: not_applicable — template default: enrol once the repository implements cryptography
  • ⚪ not applicable: template default: enrol once the repository implements cryptography
accessibilitybot: not_applicable — template default: enrol once the repository serves HTML
  • ⚪ 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.
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 26, 2026 09:59
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T09:59:56.297386Z
We couldn’t complete this review. Comment @codex review to try again.
1d53cb3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hyperpolymath
hyperpolymath merged commit f23fe03 into main Nov 26, 2026
52 of 54 checks passed
@hyperpolymath
hyperpolymath deleted the claude/phase1-launcher-m1 branch November 26, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants