Skip to content

[correspondence] Add MiniRust operational correspondence - #4318

Open
mdittmer wants to merge 1 commit into
mainfrom
tl-minirust/minirust-correspondence-v1
Open

mdittmer wants to merge 1 commit into
mainfrom
tl-minirust/minirust-correspondence-v1

Conversation

@mdittmer

@mdittmer mdittmer commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Anchor a second, independent operational correspondence witness to Trusted.MirAst and Trusted.MirSemantics against a SHA-256-pinned snapshot of upstream MiniRust (minirust/minirust@d821c6e3a3d3), kept in correspondence/ so trusted/lean/ stays unchanged and neither correspondence/ nor vendor/minirust/ is shipped in the user toolchain archive.

Unlike Trusted.Correspondence's locked claim constants, these witness statements (MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim), admission predicates (MiniRustAdmitted, MiniRustExactAdmitted), and the transcribed MiniRust machine reside in unlocked correspondence/, with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies. Both admission predicates validate and execute the call-free entry body p.bodies[p.entryDefId] (call, sysrootCall, and coreCall terminators excluded, so any additional unreferenced bodies in p.bodies are uninvoked). Every MiniRustAdmitted input satisfies the structural Program::check_wf subset for start and the entry function (minirust_admitted_prog_wellFormed, with a 0-arg 1-ZST start function, initMrMachine constructing the post-Call two-frame state whose return slot exitWith observes, ValueExpr::Variant payload and discriminant typing, no StorageDead on return or argument locals, and unique Switch keys), never faults .unsupported in Anneal, and never reaches StepOutcome.illFormed in MiniRust (minirust_admitted_never_illFormed).

Because Anneal deinitializes non-ZST Operand.move sources and checks char's Unicode scalar niche while upstream MiniRust evaluates ValueExpr::Load non-destructively and lacks Type::Char (so char lowers to u32), OracleCert.lean separates two constructive claims: minirust_forward_sim_holds over MiniRustAdmitted (forward return and divergence simulation plus contrapositive UB soundness, with strictness witnesses for move and char) and minirust_bi_fault_equiv_holds over MiniRustExactAdmitted (bidirectional return, UB, and divergence equivalence over call-free entry-body copy-only, char-free, Assert-free, projection-free scalar, overflow-pair, and fieldless-enum MIR, with monotone allocation in MrMemory.allocate).

  • Pin 30 upstream MiniRust files (27 spec/**/*.md files plus LICENSE-APACHE, LICENSE-MIT, and README.md) in anneal/vendor/minirust/UPSTREAM_PIN.json. Exempt pinned vendor/minirust/ files from Fuchsia headers in anneal/AGENTS.md and exclude **/vendor/** from committed-tree git grep in anneal/ci/check_todo.sh via :(exclude,glob)**/vendor/**, with committed vendor and clean-tree non-vendor regression tests in test_check_todo.py.
  • Add 10 constructive Lean 4 correspondence modules: 9 modules under anneal/correspondence/Anneal/MiniRust/ (Syntax, Memory, Machine, Anchors, Translate, Relation, OpSim, StepSim, OracleCert) plus Anneal/MiniRustProof.lean (58 SpecAnchor records, 23 fuel-checked witnesses, and zero imports of Miri, Trusted.Correspondence, Anneal.MirCorrespondence*, or Anneal.MirWp).
  • Add anneal/ci/check_minirust_pin.py and test_check_minirust_pin.py, include vendor/minirust/ inputs in ci/checks.toml (anneal-ci-tests, anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke), and register /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json in .github/CODEOWNERS. Tier-0 CI enforces UPSTREAM_PIN.json SHA-256 parity against locked commit, tarball, and manifest constants, Lean hygiene (<= 3,500 lines, forbidden imports/tokens, required theorem declarations), and all 58 SpecAnchor symbol and excerpt checks. The anneal-audit correspondence stage sandbox-compiles and kernel-replays all declarations of the 10 Anneal.MiniRust* modules (where correspondence/ permits Classical.choice because vendor/lean-miri uses it), while --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity across all 39 exported theorems.
  • Register the 10 correspondence/Anneal/MiniRust* modules and vendor/minirust/UPSTREAM_PIN.json in trusted_bundle.rs (CORRESPONDENCE_PROOF_PATHS and PROVENANCE_SOURCES), bind and validate minirust_upstream provenance across trusted_bundle.rs, core/inspect/schema.rs, verify_zerocopy.py, test_verify_zerocopy.py, render_correspondence_provenance.py, flake.nix (root-manifest.sha256), run_anneal_check.sh, and anneal-tc.Dockerfile, and update README.md, architecture.md, mir-correspondence-design.md, testing-architecture.md, and trust-model.md.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust (anneal/trusted/cargo-anneal/src/trusted_bundle.rs, anneal/trusted/cargo-anneal/src/verify.rs): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules in ASCII-sorted order within the correspondence/ block in CORRESPONDENCE_PROOF_PATHS and PROVENANCE_SOURCES (19 -> 29 correspondence proof entries) and updates the unit-test count assertion in verify.rs. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, anneal/trusted/root-manifest.sha256, and user toolchain archives are untouched.
  • Repository ci-core & owner governance (ci/checks.toml, .github/CODEOWNERS): Adds "anneal/vendor/minirust/**" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-ci-tests (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged) so test_check_minirust_pin.py can read the pinned snapshot inside ci-core's sandbox, and adds /anneal/vendor/minirust/UPSTREAM_PIN.json @joshlf @jswrenn @mdittmer in .github/CODEOWNERS (plain path rule, zero backslashes/negations/character classes).
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,365 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), guarded by ci/check_minirust_pin.py and per-PR human review (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub), and MIR-to-MiniRust lowering (Translate.lean, where start satisfies structural 0-arg 1-ZST well-formedness while initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines (spec/lang/representation.md:35, spec/lang/step/locks.md:22, spec/lang/syntax.md:99-103, spec/lang/types.md:81,96,115, spec/mem/basic.md:67, spec/mem/tree_borrows/reborrow_settings.md:92, spec/mem/tree_borrows/state_machine_unprotected.md:49,54, spec/mem/tree_borrows/tree.md:26,204), upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/check_minirust_pin.py, anneal/ci/test_check_minirust_pin.py, anneal/ci/check_todo.sh, anneal/ci/test_check_todo.py, anneal/ci/test_render_correspondence_provenance.py): Tier-0 unittest discovery runs check_minirust_pin.py --check-lean --check-anchors against the live checkout (30 pinned files, 10 Lean modules, 58 anchors, required exported theorems, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, and credential-stripped subprocess execution).
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • CI workflows (.github/workflows/*.yml), pinned root manifests (trusted/root-manifest.sha256), and editor/agent configs (AGENTS.md, .claude/, .codex/): none.
  • Intentional policy relaxations: anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure). No other policy relaxations.

Review Receipt

  1. Comparison tuple:

    • target_base: bdcef280ab45a0f91334f5c5883b4aa02659d580 (main, parent tree e20a66876998e64c4480002e8246cdba5bdca7f6)
    • merge_base: bdcef280ab45a0f91334f5c5883b4aa02659d580
    • head: 43eb1f396fcca109ceebfd84ecb321c92c47f446 (tree: dd1d00acf41d993004b4c645f1e9f24f2a3479a3, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{trusted_bundle.rs,verify.rs}, anneal/ci/*, ci/checks.toml, .github/CODEOWNERS), governing documentation (anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude across semantic, Gate-1/Pass-2, and ci-core rebase reviews) because the change introduces a new mechanized operational semantics witness, CI pin/hygiene verifier, and check_todo.sh vendor pathspec fix.
  3. Grouped coverage (56 changed paths across bdcef280ab45..43eb1f396fcc):

    • anneal/trusted/cargo-anneal/src/trusted_bundle.rs, anneal/trusted/cargo-anneal/src/verify.rs (2 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS and PROVENANCE_SOURCES registration (19 -> 29, ASCII-sorted within the correspondence/ block), zero user-bundle or TCB Lean impact, unit test parity (verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, .github/CODEOWNERS (2 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits) and registers /anneal/vendor/minirust/UPSTREAM_PIN.json @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/check_minirust_pin.py, anneal/ci/test_check_minirust_pin.py, anneal/ci/check_todo.sh, anneal/ci/test_check_todo.py, anneal/ci/test_render_correspondence_provenance.py (5 paths) — inspected (Pass 1 & Pass 2): SHA-256 manifest/commit locks, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing (including whitespace and nested comments after s!/m!/f!), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping (ACTIONS_*, GITHUB_TOKEN, GH_TOKEN), tomllib ci/checks.toml + CODEOWNERS parity test, and :(exclude,glob)**/vendor/** pathspec parity with clean-tree positive/negative tests.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, .illFormed vs. .ub separation across all operator/statement/terminator sites including evalTransmute .ub and dead-return-local .illFormed, 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate), non-vacuity of 23 fuel-checked positive/strictness/UB witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): correspondence_proofs count assertion (19 -> 29).
    • anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (5 paths) — inspected (Pass 1 & docs review): accurate module/file counts, unlocked correspondence/ placement, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Gate-1/Pass-2, and ci-core rebase reviewers, converging to 0 blocking and 0 substantive findings on 43eb1f396fcca109ceebfd84ecb321c92c47f446).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
    • anneal-audit --require-correspondence (PASS: 5112 replayed correspondence declarations across all 29 correspondence modules; 22879 reachable declarations), check_minirust_pin.py --check-lean --check-anchors --check-axioms (39/39 exported theorems ⊆ {propext, Quot.sound}), and receipt_and_bindings::verifies_real_source_and_rejects_boundary_mutations (1 passed; 0 failed) were executed on pre-rebase revisions whose 10 Anneal/MiniRust* Lean blobs, vendor/minirust/*, check_minirust_pin.py, and trusted_bundle.rs are 100% hunk-identical (git range-diff across the rebase adds only ci/checks.toml, .github/CODEOWNERS, and test_ci_core_checks_toml_and_codeowners_cover_minirust_pin in test_check_minirust_pin.py, while rebased-over trusted/audit/ commits performed only orthogonal SafeFs refactoring), and 57 boundary_audit tests (covering all bundle, correspondence, workspace, pin, and sandbox invariants; 3 orthogonal MirWp/cache canary tests deferred to CI), bundled_correspondence_provenance_is_well_formed, and all 65 Python unit tests (anneal/ci + root ci/) ran directly on 43eb1f396fcca109ceebfd84ecb321c92c47f446.
  5. Checks and probes (executed on 43eb1f396fcca109ceebfd84ecb321c92c47f446):

    • cargo test --locked -p anneal-audit-tests --test boundary_audit (57 passed; 0 failed, including enforces_bundled_resources_parity_and_regular_files, enforces_correspondence_non_backsliding, rejects_correspondence_audit_violations_and_sysroot_mismatch, rejects_cargo_workspace_members_and_path_deps_outside_trusted, and verifies_upstream_pin_and_rejects_tampering) & cargo test --locked -p cargo-anneal --lib bundled_correspondence_provenance_is_well_formed (1 passed; 0 failed) -> PASS.
    • python3 -I -B -m unittest discover -s anneal/ci -p 'test_check_minirust_pin.py' -v -> Ran 21 tests in 7.146s — OK (includes tomllib ci/checks.toml + CODEOWNERS coverage check and negative sensitivity probes for tampered commit/manifest SHAs, ⟨...⟩/where/.mk anchor bypasses, unresolved leanSymbol, s! whitespace/newline/comment sorry injection, bare/missing --lean, and forbidden imports/vendor dotfiles).
    • PYTHONPATH=anneal/ci python3 -B -m unittest -v test_check_todo test_render_correspondence_provenance (Ran 12 tests in 3.454s — OK) and python3 -B -m unittest discover -s ci -p 'test_*.py' -v (Ran 32 tests in 1.524s — OK).
    • ./ci/check_todo.sh, (cd anneal && ./ci/check_todo.sh && sha256sum --check --strict trusted/root-manifest.sha256) (4/4 OK), and git diff --check bdcef280ab45..43eb1f396fcc -- . ':(exclude)anneal/vendor/minirust' -> all rc=0.
    • Reused from hunk-identical pre-rebase runs: cargo run --locked -p anneal-audit -- --require-correspondence (PASS: 19 Trusted modules; 86 Theory modules; 1760 Trusted kernel declarations; 14982 total replayed declarations; Correspondence: 5112 replayed declarations; 22879 reachable declarations) and check_minirust_pin.py --check-lean --check-anchors --check-axioms (39/39 ⊆ {propext, Quot.sound}).
  6. Findings and blockers:

    • All local cross-family findings across Rounds 1–3 and the ci-core rebase (StorageDead on argument locals, .illFormed vs. .ub separation, 0-arg 1-ZST start + post-Call initMrMachine disclosure, upstream char-as-u32 lowering, check_todo.sh :(exclude,glob)**/vendor/** pathspec + regression tests, locked commit/manifest/anchor/theorem constants, s!/m!/f! whitespace & comment lexing, PATH-aware --lean resolution, anneal-ci-tests ci/checks.toml input glob + .github/CODEOWNERS entry, and honest CI vs. anneal-audit vs. --check-axioms documentation) are fixed and verified on 43eb1f396fcca109ceebfd84ecb321c92c47f446.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T02:44:58.449845Z 011fc1c Manual request
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43eb1f396f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread anneal/vendor/minirust/README.md Resolved
@joshlf joshlf added the anneal Primary scope: Anneal verification stack (`anneal/` and `exocrate/`) label Nov 25, 2026
@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 43eb1f3 to eb3ab3f Compare November 25, 2026 04:51
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and adds /anneal/vendor/minirust/UPSTREAM_PIN.json @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,365 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), guarded by ci/check_minirust_pin.py and per-PR human review (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] while start satisfies structural 0-arg 1-ZST well-formedness and initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 unittest discovery verifies check_minirust_pin.py --check-lean --check-anchors against the live checkout (30 pinned files, 10 Lean modules, 58 anchors, required exported theorems, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, and credential-stripped subprocess execution) and verifies minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, call-free entry-body admission scope, minirust_upstream provenance binding, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 5f003db450e7c5253fe3606f2ebbd3058a34b1b1 (main, parent tree f5e443b33016cc299e74032b222282ddb094673b)
    • merge_base: 5f003db450e7c5253fe3606f2ebbd3058a34b1b1
    • head: eb3ab3f69b60f2e363ae912346343d68ce56f990 (tree: b761180cfadc88e38c2cbc434139047d14d8af99, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication and Round-1 delta trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude), resolving all three external automated review findings (AGENTS.md vendor header exemption, minirust_upstream provenance binding across Rust/Python/Nix/CI, and call-free entry-body admission wording).
  3. Grouped coverage (64 changed paths across 5f003db450e7..eb3ab3f69b60):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (6 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit test parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in anneal-tc.Dockerfile, and registers /anneal/vendor/minirust/UPSTREAM_PIN.json @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): SHA-256 manifest/commit locks, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, tomllib ci/checks.toml (5 checks) + CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, .illFormed vs. .ub separation, call-free entry-body validation + 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope, minirust_upstream provenance binding, unlocked correspondence/ placement, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Gate-1/Pass-2, ci-core, and Round-1 range-diff delta reviewers, converging to 0 blocking and 0 substantive code findings on eb3ab3f69b60f2e363ae912346343d68ce56f990).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
    • Delta-rebase & Round-1 scope (43eb1f396fcc -> eb3ab3f69b60): zero .lean paths changed (git diff --name-only 43eb1f396fcc eb3ab3f69b60 has 0 .lean files; all 10 Anneal/MiniRust* .lean blobs are byte-identical), while minirust_upstream provenance binding, AGENTS.md vendor header exemption, call-free entry-body documentation, and rebase onto 5f003db450e7 were verified directly on eb3ab3f69b60f2e363ae912346343d68ce56f990; full anneal-audit --require-correspondence (5112 replayed correspondence declarations across all 29 correspondence modules) and --check-axioms (39/39 ⊆ {propext, Quot.sound}) were executed on byte-identical Lean blobs, and all 200/200 non-skipped GitHub CI checks (19 skipped, 0 failures) passed on 43eb1f396fcca109ceebfd84ecb321c92c47f446.
  5. Checks and probes (executed on eb3ab3f69b60f2e363ae912346343d68ce56f990, plus unit/clippy checks on db5581b4f356 which differs solely by a 2-line comment wrap in anneal/ci/test_render_correspondence_provenance.py):

    • cargo test --locked -p cargo-anneal-tests --test suite -- verifies_real_source_and_rejects_boundary_mutations (1 passed; 0 failed directly on eb3ab3f69b60f2e363ae912346343d68ce56f990), plus cargo test --locked -p cargo-anneal --lib (192 passed; 0 failed), cargo test --locked -p cargo-anneal --example regenerate_bundle (6 passed; 0 failed), cargo test --locked -p anneal-audit-tests --test boundary_audit -- --exact enforces_bundled_resources_parity_and_regular_files (1 passed; 0 failed), and cargo clippy --locked --workspace --all-targets -- -D warnings (0 warnings) -> PASS.
    • PYTHONPATH=anneal/ci python3 -B -m unittest -v test_render_correspondence_provenance test_check_minirust_pin test_check_todo (Ran 34 tests in 10.990s — OK) and python3 -B -m unittest discover -s ci -p 'test_*.py' -v (Ran 32 tests in 1.633s — OK, including test_check_skills on anneal/AGENTS.md and test_check_toolchains_sync on ci/checks.toml + anneal-tc.Dockerfile) directly on eb3ab3f69b60f2e363ae912346343d68ce56f990.
    • ./ci/check_todo.sh, (cd anneal && ./ci/check_todo.sh && sha256sum --check --strict trusted/root-manifest.sha256) (4/4 OK), and git diff --check 5f003db450e7..eb3ab3f69b60 -- . ':(exclude)anneal/vendor/minirust' directly on eb3ab3f69b60f2e363ae912346343d68ce56f990 -> all rc=0.
    • Reused from byte-identical Lean blobs & 43eb1f396fcc: cargo run --locked -p anneal-audit -- --require-correspondence (PASS: 5112 replayed correspondence declarations; 22879 reachable declarations), check_minirust_pin.py --check-lean --check-anchors --check-axioms (39/39 ⊆ {propext, Quot.sound}), 57 local boundary_audit tests (0 failures), and 200 SUCCESS / 19 SKIPPED / 0 failures on GitHub CI (43eb1f396fcc).
  6. Findings and blockers:

    • All local cross-family findings and all 3 Round-1 automated review findings (anneal/AGENTS.md pinned vendor/minirust/ header exemption, minirust_upstream provenance binding across trusted_bundle.rs / render_correspondence_provenance.py / flake.nix / run_anneal_check.sh / anneal-tc.Dockerfile / ci/checks.toml, and "call-free entry-body" admission wording) are fixed and verified on eb3ab3f69b60f2e363ae912346343d68ce56f990.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb3ab3f69b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread anneal/ci/check_minirust_pin.py Resolved
@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from eb3ab3f to fef1d3c Compare November 25, 2026 05:11
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and adds /anneal/vendor/minirust/UPSTREAM_PIN.json @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,365 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), guarded by ci/check_minirust_pin.py and per-PR human review (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] while start satisfies structural 0-arg 1-ZST well-formedness and initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 unittest discovery verifies check_minirust_pin.py --check-lean --check-anchors against the live checkout (30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, required exported theorems, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, and credential-stripped subprocess execution) and verifies minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, call-free entry-body admission scope, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 5f003db450e7c5253fe3606f2ebbd3058a34b1b1 (main, parent tree f5e443b33016cc299e74032b222282ddb094673b)
    • merge_base: 5f003db450e7c5253fe3606f2ebbd3058a34b1b1
    • head: fef1d3c1c284503d27a515230c78c9fd1fb0b9e1 (tree: 7f67530b65940e172c686d67c2d97dcf77bacd10, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication and delta trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude), resolving all Round-1 and Round-2 external automated review findings (AGENTS.md vendor header exemption, minirust_upstream provenance binding across Rust/Python/Nix/CI, call-free entry-body admission wording, and locking tarball_sha256 / schema_version / duplicate JSON keys in check_minirust_pin.py).
  3. Grouped coverage (64 changed paths across 5f003db450e7..fef1d3c1c284):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (6 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit test parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in anneal-tc.Dockerfile, and registers /anneal/vendor/minirust/UPSTREAM_PIN.json @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, tomllib ci/checks.toml (5 checks) + CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, .illFormed vs. .ub separation, call-free entry-body validation + 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, unlocked correspondence/ placement, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Gate-1/Pass-2, ci-core, and Round-1/Round-2 range-diff delta reviewers, converging to 0 blocking and 0 substantive code findings on fef1d3c1c284503d27a515230c78c9fd1fb0b9e1).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
    • Round-2 delta scope (eb3ab3f69b60 -> fef1d3c1c284): touches only 3 paths (anneal/ci/check_minirust_pin.py, anneal/ci/test_check_minirust_pin.py, and anneal/docs/mir-correspondence-design.md), leaving all Rust, Nix, ci/checks.toml, UPSTREAM_PIN.json, and 10 Anneal/MiniRust* .lean blobs 100% byte-identical to eb3ab3f69b60f2e363ae912346343d68ce56f990 (where all 103 SUCCESS / 16 SKIPPED / 0 failed GitHub CI checks and verifies_real_source_and_rejects_boundary_mutations passed).
  5. Checks and probes (executed directly on fef1d3c1c284503d27a515230c78c9fd1fb0b9e1):

    • python3 -I -B -m unittest discover -s anneal/ci -p 'test_check_minirust_pin.py' -v (Ran 21 tests in 7.533s — OK, including negative sensitivity probes for tampered tarball_sha256, malformed tarball_sha256, bad schema_version, duplicate JSON keys, tampered commit / manifest_sha256, SpecAnchor constructor/symbol bypasses, and ci/checks.toml + CODEOWNERS coverage).
    • python3 -B -m unittest discover -s ci -p 'test_check_skills.py' -v (Ran 22 tests in 1.223s — OK), ./ci/check_todo.sh, (cd anneal && ./ci/check_todo.sh && sha256sum --check --strict trusted/root-manifest.sha256) (4/4 OK), and git diff --check 5f003db450e7..fef1d3c1c284 -- . ':(exclude)anneal/vendor/minirust' -> all rc=0.
    • Reused from byte-identical Rust/Lean/Nix blobs on eb3ab3f69b60 / db5581b4f356 / pre-rebase: 103 SUCCESS / 16 SKIPPED / 0 failures on GitHub CI (eb3ab3f69b60), cargo test --locked -p cargo-anneal-tests --test suite -- verifies_real_source_and_rejects_boundary_mutations (1 passed; 0 failed on eb3ab3f69b60), cargo test --locked -p cargo-anneal --lib (192 passed; 0 failed), cargo run --locked -p anneal-audit -- --require-correspondence (PASS: 5112 replayed correspondence declarations; 22879 reachable declarations), and check_minirust_pin.py --check-lean --check-anchors --check-axioms (39/39 ⊆ {propext, Quot.sound}).
  6. Findings and blockers:

    • All local cross-family findings and all Round-1 and Round-2 external automated review findings (anneal/AGENTS.md pinned vendor/minirust/ header exemption, minirust_upstream provenance binding across trusted_bundle.rs / render_correspondence_provenance.py / flake.nix / run_anneal_check.sh / anneal-tc.Dockerfile / ci/checks.toml, "call-free entry-body" admission wording, and LOCKED_MINIRUST_TARBALL_SHA256 + schema_version + duplicate-key locking in check_minirust_pin.py) are fixed and verified on fef1d3c1c284503d27a515230c78c9fd1fb0b9e1.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: fef1d3c1c2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — FINDINGS (tier2a_core_tcb, Round 1)

  • Identity: one:f5e443b33016cc299e74032b222282ddb094673b:7f67530b65940e172c686d67c2d97dcf77bacd10:7122767a4b1dd815d04874a5d6b61bc63325b938ac2ff18f4554802c024b2f2f (base=5f003db450e7, head=fef1d3c1c284, tree=7f67530b6594)
  • Separation: author_family=gemini vs. reviewer_family=claude
  • Coverage: 64 inspected, 0 inapplicable, 0 blocked (of 64 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking tcb_and_api_critic completed clean 0 3165s
seat2 gemini-frontier-thinking tcb_and_spec_critic completed findings 1 1966s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed findings 1 2836s

Deduplicated Findings

ID Sev Consensus Verification Location Summary
G2-R1-01 P2 1 (seat3) probe_confirmed anneal/ci/test_check_minirust_pin.py:63 populate_valid_repo preserves read-only source permissions via shutil.copytree, crashing 18 of 21 tests/subtests under read-only source trees.
G2-R1-02 P2 1 (seat2) static_verified anneal/correspondence/Anneal/MiniRust/Translate.lean:171 translateConst emits ValueExpr.variant payloads typed as unitTy (size 0) for Ordering and scalar-tagged Enum constants instead of their variant's emptySizedTy payload type, violating upstream MiniRust ValueExpr::check_wf.

G2-R1-01 [P2] (anneal/ci/test_check_minirust_pin.py:63, General / CI test suite (anneal/ci/test_check_minirust_pin.py), probe_confirmed): populate_valid_repo preserves read-only source permissions via shutil.copytree, crashing 18 of 21 tests/subtests under read-only source trees.

  • Invariant: CI unit tests in anneal/ci must execute cleanly when staged from read-only source trees, matching the contract enforced by sibling anneal/ci/test_render_correspondence_provenance.py::test_fixture_staging_succeeds_from_readonly_source_tree.
  • Evidence: At anneal/ci/test_check_minirust_pin.py:62-68, populate_valid_repo calls shutil.copytree(ANNEAL_ROOT / 'vendor/minirust', vendor_dir) without adding owner-write permissions (unlike _make_tree_writable in anneal/ci/test_render_correspondence_provenance.py:30-54). When ANNEAL_ROOT is mounted read-only (0o444 files / 0o555 dirs), tests modifying vendor_dir (lines 167, 238, 250, 260, 269, 314, 323, 348) raise PermissionError: [Errno 13] Permission denied: 18/21 errors on read-only /work/anneal vs 21/21 OK on a chmod u+rwX copy (while test_render_correspondence_provenance.py passed 6/6 and test_run_anneal_check.py passed 15/15 on the same read-only mount).

G2-R1-02 [P2] (anneal/correspondence/Anneal/MiniRust/Translate.lean:171, Pass 1 (correspondence/ specification & upstream MiniRust semantic fidelity), static_verified): translateConst emits ValueExpr.variant payloads typed as unitTy (size 0) for Ordering and scalar-tagged Enum constants instead of their variant's emptySizedTy payload type, violating upstream MiniRust ValueExpr::check_wf.

  • Invariant: Translated MiniRust programs produced by Translate.lean for MiniRustAdmitted inputs must satisfy upstream MiniRust well-formedness (anneal/vendor/minirust/spec/lang/well-formed.md:378-389), which requires ValueExpr::Variant.data to check at exact equality with variant.ty (and Type::Enum::check_wf at well-formed.md:230 requires variant.ty to match the enum size).
  • Evidence: Syntax.lean:311-319 defines every variant of orderingTy with payload type emptySizedTy 1 1 (MrType.tuple .nil <1> <1>), and Translate.lean:71-79 (buildEnumVariants) defines every variant of a scalar-tagged fieldless enum with payload type emptySizedTy tagW.byteSize tagW.byteSize. However, Translate.lean:171-173 (.ordering) emits .variant _ (.tuple .nil unitTy) orderingTy and Translate.lean:190 (.enum ety with .scalar tagW tagS) emits .variant dInt (.tuple .nil unitTy) (translateEnumTy ety), where unitTy = MrType.tuple .nil <0> <1> (Syntax.lean:293-294). Under anneal/vendor/minirust/spec/lang/well-formed.md:387-388 (ensure_wf(checked == variant.ty, "ValueExpr::Variant: invalid type")), every translated program containing a valid Ordering or scalar-tagged enum constant—including OracleCert.lean:2950-2962 (progEnumScalarDiscr)—is ill-formed in upstream MiniRust. The mismatch escapes internal validation because mrStmtWellFormed (Translate.lean:990-991) omits ValueExpr type checking and Machine.lean:482-485 discards data's evaluated type in evalValue (.variant ...). Fix: emit emptySizedTy 1 1 at Translate.lean:171-173 and emptySizedTy tagW.byteSize tagW.byteSize at Translate.lean:190.

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R1-A01 [P3] (anneal/AGENTS.md:43): Review policy gains the header exemption for vendor/minirust but no routing for MiniRust pin bumps or the LOCKED_MINIRUST_* constants.
  • G2-R1-A02 [P3] (anneal/ci/check_minirust_pin.py:1140): The constructive-axiom claim is enforced only by the manual --check-axioms mode, and the required-theorem check also accepts names listed in an export command.
  • G2-R1-A03 [P3] (anneal/docs/trust-model.md:71): The row says unlocked MiniRust claim statements are 'guarded by ci/check_minirust_pin.py', but that script checks theorem names only, and the claim modules have no CODEOWNERS rule.
  • G2-R1-A04 [P3] (anneal/trusted/cargo-anneal/src/trusted_bundle.rs:184): The receipt note says anneal-audit kernel-replays the MiniRust modules 'against vendor/minirust/UPSTREAM_PIN.json', but anneal-audit never reads that pin.
  • G2-R1-A05 [P3] (anneal/trusted/cargo-anneal/src/trusted_bundle.rs:267): The provenance JSON gains a new top-level minirust_upstream object while schema_version stays 1.
  • G2-R1-A06 [P3] (anneal/vendor/minirust/spec/lang/step/locks.md:22): Vendored upstream markdown contains one U+00A0 here and two U+02CB characters at spec/lang/syntax.md:102.

Executed Sandbox Probes

  • seat1 git pathspec exclusion semantics: outcome=From cwd=anneal, ':!**/vendor/**' reported both src/bad.rs and vendor/dep/lib.rs; ':(exclude,glob)**/vendor/**' reported only src/bad.rs. Nested x/vendor/y was excluded by both.
  • seat1 vendor pin provenance: outcome=30/30 files match the pin and upstream raw content at d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed; manifest digest recomputed and equal; tarball SHA-256 equal to the pinned value; commit is on upstream master.
  • seat1 SpecAnchor verification: outcome=58 records, 58 distinct ids, 0 excerpt or symbol failures, minimum excerpt length 25, 11 spec files anchored.
  • seat1 head-SHA CI evidence: outcome=116 check runs on fef1d3c1c284503d27a515230c78c9fd1fb0b9e1: 103 success, 13 skipped, 0 failing, including Repository boundary audit, Static checks, Workspace tests and Toolchain setup, packaging & smoke tests.
  • seat3 root_manifest_sha256: outcome=passed
  • seat3 check_minirust_pin_cli: outcome=passed
  • seat3 vendor_minirust_sha256_and_perms: outcome=passed
  • seat3 render_correspondence_provenance_cli_and_tests: outcome=passed
  • seat3 test_check_minirust_pin_paired_ro_vs_rw: outcome=failed
  • seat3 check_todo_git_grep_vendor_pathspec: outcome=passed
  • seat3 ci_shell_checks_subset: outcome=passed
  • seat3 lean_pure_init_compile_and_ast_preflight: outcome=passed
  • seat3 workflow_permissions_auth_secret_containment_checklist: outcome=passed

Comment thread anneal/ci/test_check_minirust_pin.py Resolved
@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from fef1d3c to d715e46 Compare November 25, 2026 07:25
@mdittmer

mdittmer commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, updates CORRESPONDENCE_PROVENANCE_NOTE to state that anneal-audit --require-correspondence kernel-replays correspondence/Anneal/MiniRust* (with vendor/minirust/UPSTREAM_PIN.json verified by Tier-0 CI and recorded in provenance), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,746 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 unittest discovery verifies check_minirust_pin.py --check-lean --check-anchors against the live checkout (30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations via include_exports=False, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, read-only source-tree fixture staging via _make_tree_writable, and credential-stripped subprocess execution) and verifies minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 82e9ffe0841864007183255ebca89707f238c4dc (main)
    • merge_base: 9c5cc713dfc7a2f2178187e5766d6d2114d2899f (parent tree f425035054bf2e51cfd4495840e109d8eff2b67d)
    • head: d715e467b2222efb24e0a9fd380567fb75ce9f74 (tree: be1ad659d4da972053d401e7f09faaa740840433, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication and delta trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude), resolving all prior automated review findings including read-only source-tree fixture staging (_make_tree_writable in test_check_minirust_pin.py), ValueExpr::Variant emptySizedTy payload parity across Translate.lean (translateConst, mrValueExprVariantWF) and Machine.lean (evalValue), real theorem declaration enforcement (include_exports=False), .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE wording, and rebase alignment with Profile v2 (#4237) and ci-core v0.1.5 (#4325).
  3. Grouped coverage (64 changed paths across 9c5cc713dfc7..d715e467b222):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (6 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, CORRESPONDENCE_PROVENANCE_NOTE accuracy, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit test parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, real theorem declaration extraction (include_exports=False in extract_exported_theorems), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, _make_tree_writable + read-only source-tree regression test, tomllib ci/checks.toml (5 checks) + 3-rule CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, ValueExpr::Variant discriminant and emptySizedTy payload-type checking statically in mrValueExprVariantWF and dynamically in evalValue, .illFormed vs. .ub separation, call-free entry-body validation + 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate, and Profile v2 constructor exhaustiveness), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope, CODEOWNERS-gated per-PR human review of statement bodies, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Pass-2, ci-core, and delta range-diff reviewers).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
  5. Checks and probes (executed directly on d715e467b2222efb24e0a9fd380567fb75ce9f74 / tree be1ad659d4da972053d401e7f09faaa740840433):

    • cargo run --locked -p anneal-audit -- --require-correspondence: PASS (19 Trusted modules, 86 Theory modules, 2191 Trusted kernel declarations, 15734 total Pass-1 replayed declarations; 160 Vendor Miri modules, 39088 kernel-replayed declarations; 5171 replayed correspondence declarations, 22968 reachable declarations).
    • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors --check-axioms --lean <lean-v4.34.1> --stage-dir <stage>: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors) | axioms: OK (39 exported theorems, subset of {propext, Quot.sound}).
    • cargo test --locked -p cargo-anneal --lib (192 passed; 0 failed) and cargo test --locked -p anneal-audit-tests --test boundary_audit -- --exact enforces_bundled_resources_parity_and_regular_files (1 passed; 0 failed).
    • PYTHONPATH=anneal/ci python3 -B -m unittest -v test_check_minirust_pin test_render_correspondence_provenance test_check_todo (Ran 35 tests — OK), 0o444/0o555 read-only staged ANNEAL_ROOT test_check_minirust_pin.py probe (Ran 22 tests — OK), and python3 -B -m unittest discover -s ci -p 'test_*.py' -v (Ran 32 tests — OK).
    • ./ci/check_todo.sh, (cd anneal && ./ci/check_todo.sh && sha256sum --check --strict trusted/root-manifest.sha256) (4/4 OK), and git diff --check origin/main..HEAD -- . ':(exclude)anneal/vendor/minirust' -> all rc=0.
  6. Findings and blockers:

    • All local cross-family findings and all external automated review findings (_make_tree_writable read-only fixture staging, ValueExpr::Variant emptySizedTy payload/discriminant checking in Translate.lean and Machine.lean, include_exports=False theorem declaration check, .github/CODEOWNERS + trust-model.md governance alignment, and CORRESPONDENCE_PROVENANCE_NOTE accuracy) are fixed and verified on d715e467b2222efb24e0a9fd380567fb75ce9f74.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: d715e467b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 2)

  • Identity: one:f425035054bf2e51cfd4495840e109d8eff2b67d:be1ad659d4da972053d401e7f09faaa740840433:cf394787334d04dd32423b2a18077eb61da6378898b06eb6b30091053a7c96c7 (base=9c5cc713dfc7, head=d715e467b222, tree=be1ad659d4da)
  • Separation: author_family=gemini vs. reviewer_family=claude
  • Coverage: 64 inspected, 0 inapplicable, 0 blocked (of 64 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking tcb_and_api_critic completed clean 0 481s
seat2 gemini-frontier-thinking tcb_and_spec_critic completed clean 0 1800s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed clean 0 1790s

No unresolved P0-P2 findings raised across completed seats.

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R2-A01 [P3] (anneal/AGENTS.md:43): Policy-file edit (Fuchsia-header exemption extended to vendor/minirust) and the PR's Human review surface block could not be cross-checked because no Review Receipt was in the supplied artifacts.
  • G2-R2-A02 [P3] (anneal/correspondence/Anneal/MiniRust/Machine.lean:709): Faithfulness of the transcribed MiniRust machine to the vendored spec is human-audited only; this review spot-checked the Return/StorageDead/BottomOfStack paths and found them faithful, but did not audit the full transcription.

Executed Sandbox Probes

  • seat3 root_manifest_sha256: outcome=passed
  • seat3 check_minirust_pin_lean_and_anchors: outcome=passed
  • seat3 render_correspondence_provenance: outcome=passed
  • seat3 python_ci_unit_tests: outcome=passed
  • seat3 ci_shell_checks_and_todo_git_sensitivity: outcome=passed
  • seat3 minirust_mutation_sensitivity_probes: outcome=passed
  • seat3 repo_hygiene_bidi_headers_links_leaks: outcome=passed
  • seat3 lean_4gb_rlimit_probe: outcome=blocked_by_resource_limit
  • seat3 check_actions_and_ci_workflow_timeout: outcome=blocked_in_offline_bounded_sandbox
  • seat3 workflow_checklist_1_permissions_least_privilege: outcome=passed
  • seat3 workflow_checklist_2_triggers_no_unsafe_pr_target: outcome=passed
  • seat3 workflow_checklist_3_secret_and_token_containment: outcome=passed
  • seat3 workflow_checklist_4_release_publish_protection: outcome=passed
  • seat3 workflow_checklist_5_checkout_credentials_and_sha_pinning: outcome=passed
  • seat3 workflow_checklist_6_script_injection_prevention: outcome=passed
  • seat3 workflow_checklist_7_cache_and_artifact_trust_boundaries: outcome=passed
  • seat3 workflow_checklist_8_no_guard_relaxations: outcome=passed

@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, updates CORRESPONDENCE_PROVENANCE_NOTE to state that anneal-audit --require-correspondence kernel-replays correspondence/Anneal/MiniRust* (with vendor/minirust/UPSTREAM_PIN.json verified by Tier-0 CI and recorded in provenance), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,746 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 unittest discovery verifies check_minirust_pin.py --check-lean --check-anchors against the live checkout (30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations via include_exports=False, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, read-only source-tree fixture staging via _make_tree_writable, and credential-stripped subprocess execution) and verifies minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 4b2791214e2f02de47397dc3f5bc98c8e78f88d6 (main)
    • merge_base: 4b2791214e2f02de47397dc3f5bc98c8e78f88d6 (parent tree 5a3b4a3941d9d0f68c284a9ba8ea0c3c25027f7d)
    • head: c4f51571b131a57a6b7f9144182abde1e66e6f39 (tree: 086d26b3ccd835b20fb6ffd056c67c11ce9a6959, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication and delta trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude), resolving all prior automated review findings including read-only source-tree fixture staging (_make_tree_writable in test_check_minirust_pin.py), ValueExpr::Variant emptySizedTy payload parity across Translate.lean (translateConst, mrValueExprVariantWF) and Machine.lean (evalValue), real theorem declaration enforcement (include_exports=False), .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE wording, and rebase alignment onto 4b2791214e2f (#4250, where git range-diff 9c5cc713dfc7..d715e467b222 4b2791214e2f..c4f51571b131 contains solely the 1-line flake.nix SHA-256 refresh in anneal/trusted/root-manifest.sha256).
  3. Grouped coverage (64 changed paths across 4b2791214e2f..c4f51571b131):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (6 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, CORRESPONDENCE_PROVENANCE_NOTE accuracy, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit test parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, real theorem declaration extraction (include_exports=False in extract_exported_theorems), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, _make_tree_writable + read-only source-tree regression test, tomllib ci/checks.toml (5 checks) + 3-rule CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, ValueExpr::Variant discriminant and emptySizedTy payload-type checking statically in mrValueExprVariantWF and dynamically in evalValue, .illFormed vs. .ub separation, call-free entry-body validation + 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate, and Profile v2 constructor exhaustiveness), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp/theory/ imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope, CODEOWNERS-gated per-PR human review of statement bodies, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Pass-2, ci-core, and delta range-diff reviewers).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
  5. Checks and probes:

    • Delta rebase checks executed directly on c4f51571b131a57a6b7f9144182abde1e66e6f39 (tree: 086d26b3ccd835b20fb6ffd056c67c11ce9a6959) (git range-diff 9c5cc713dfc7..d715e467b222 4b2791214e2f..c4f51571b131 verified to differ solely by the 1-line flake.nix SHA-256 refresh in anneal/trusted/root-manifest.sha256):
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256 && ./ci/check_todo.sh) (4/4 OK), repo-root ./ci/check_todo.sh, git diff --check origin/main..HEAD -- . ':(exclude)anneal/vendor/minirust', and python3 -B anneal/ci/check_pr_hygiene.py -> all rc=0.
      • cargo test --locked -p cargo-anneal --lib: 194 passed; 0 failed (including bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, and verify::tests::bundled_correspondence_provenance_is_well_formed).
      • PYTHONPATH=anneal/ci python3 -B -m unittest -v test_check_minirust_pin test_render_correspondence_provenance test_check_todo (Ran 35 tests — OK) and python3 -B -m unittest discover -s ci -p 'test_*.py' (Ran 48 tests — OK, skipped=7).
    • Full correspondence, audit, and CI checks executed on pre-rebase d715e467b2222efb24e0a9fd380567fb75ce9f74 (tree: be1ad659d4da972053d401e7f09faaa740840433, patch-identical per git range-diff across all 63 non-root-manifest.sha256 changed paths; file contents differ only in 7 auto-merged files via non-overlapping #4250 base hunks, while all 10 correspondence/Anneal/MiniRust* modules and vendor/minirust/** are byte-identical):
      • cargo run --locked -p anneal-audit -- --require-correspondence: PASS (19 Trusted modules, 86 Theory modules, 2191 Trusted kernel declarations, 15734 total Pass-1 replayed declarations; 160 Vendor Miri modules, 39088 kernel-replayed declarations; 5171 replayed correspondence declarations, 22968 reachable declarations).
      • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors --check-axioms --lean <lean-v4.34.1> --stage-dir <stage>: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors) | axioms: OK (39 exported theorems, subset of {propext, Quot.sound}).
      • cargo test --locked -p anneal-audit-tests --test boundary_audit -- --exact enforces_bundled_resources_parity_and_regular_files (1 passed; 0 failed), 0o444/0o555 read-only staged ANNEAL_ROOT test_check_minirust_pin.py probe (Ran 22 tests — OK), and full GitHub CI (117/117 completed checks green on d715e467b222).
  6. Findings and blockers:

    • All local cross-family findings and all external automated review findings (_make_tree_writable read-only fixture staging, ValueExpr::Variant emptySizedTy payload/discriminant checking in Translate.lean and Machine.lean, include_exports=False theorem declaration check, .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE accuracy, and #4250 root-manifest.sha256 rebase alignment) are fixed and verified on c4f51571b131a57a6b7f9144182abde1e66e6f39.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from d715e46 to c4f5157 Compare November 25, 2026 12:21
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c4f51571b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 3)

  • Identity: one:5a3b4a3941d9d0f68c284a9ba8ea0c3c25027f7d:086d26b3ccd835b20fb6ffd056c67c11ce9a6959:cf394787334d04dd32423b2a18077eb61da6378898b06eb6b30091053a7c96c7 (base=4b2791214e2f, head=c4f51571b131, tree=086d26b3ccd8)
  • Separation: author_family=gemini vs. reviewer_family=claude
  • Coverage: 64 inspected, 0 inapplicable, 0 blocked (of 64 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking tcb_and_api_critic completed clean 0 3044s
seat2 gemini-frontier-thinking tcb_and_spec_critic completed clean 0 1398s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed clean 0 1064s

No unresolved P0-P2 findings raised across completed seats.

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R3-A01 [P3] (anneal/ci/check_minirust_pin.py:324): The pin verifier ignores the informational fields tarball_url, commit_date and commit_subject.
  • G2-R3-A02 [P3] (anneal/ci/check_minirust_pin.py:1917): The manual axiom mode runs an ambient Lean binary unsandboxed with the caller's environment mostly intact.
  • G2-R3-A03 [P3] (anneal/correspondence/Anneal/MiniRust/Machine.lean:632): Dormant stepStatement .setDiscriminant reads and rewrites the full enum byte range rather than writing only tagger slices as in upstream spec/lang/step/statements.md.
  • G2-R3-A04 [P3] (anneal/correspondence/Anneal/MiniRustProof.lean:28): The module states every exported theorem is constructive, but no CI job enforces that.
  • G2-R3-A05 [P3] (anneal/docs/README.md:100): The docs index still describes the MIR correspondence design doc as anchoring only against vendor/lean-miri.
  • G2-R3-A06 [P3] (anneal/docs/trust-model.md:72): The rewritten vendored-model table row drops qualifiers that the base row stated for the lean-miri guarantee.
  • G2-R3-A07 [P3] (anneal/trusted/cargo-anneal/src/trusted_bundle.rs:592): Two clauses of the new MiniRust pin validation have no independent negative test in the Rust suite.

Executed Sandbox Probes

  • seat3 root-manifest.sha256 verification: outcome=pass (rc=0)
  • seat3 check_minirust_pin live verification: outcome=pass (rc=0)
  • seat3 check_minirust_pin unit tests: outcome=pass (rc=0)
  • seat3 anneal/ci Python test suites (9 suites): outcome=pass (rc=0)
  • seat3 check_pr_hygiene on PR commit range: outcome=pass (rc=0)
  • seat3 root ci/check_skills.py and ci unit tests: outcome=pass_with_env_skips (rc=0)
  • seat3 Pass 1 static hygiene, 30-file SHA-256 recomputation, Pass 2 Lean boundary scan, provenance parity, and git grep vendor exclusion: outcome=pass (rc=0)
  • seat3 Workflow Checklist 1 - Least-privilege permissions: outcome=pass (rc=0)
  • seat3 Workflow Checklist 2 - Safe triggers on PR code: outcome=pass (rc=0)
  • seat3 Workflow Checklist 3 - Secret and GITHUB_TOKEN containment: outcome=pass (rc=0)
  • seat3 Workflow Checklist 4 - Protected release environments: outcome=pass (rc=0)
  • seat3 Workflow Checklist 5 - persist-credentials and SHA-pinned actions: outcome=pass (rc=0)
  • seat3 Workflow Checklist 6 - Zero shell interpolation script injection: outcome=pass (rc=0)
  • seat3 Workflow Checklist 7 - Cache and artifact trust boundaries: outcome=pass (rc=0)
  • seat3 Workflow Checklist 8 - No guard relaxations: outcome=pass (rc=0)

@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, updates CORRESPONDENCE_PROVENANCE_NOTE to state that anneal-audit --require-correspondence kernel-replays correspondence/Anneal/MiniRust* (with vendor/minirust/UPSTREAM_PIN.json verified by Tier-0 CI and recorded in provenance), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,746 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 unittest discovery verifies check_minirust_pin.py --check-lean --check-anchors against the live checkout (30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations via include_exports=False, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, read-only source-tree fixture staging via _make_tree_writable, and credential-stripped subprocess execution) and verifies minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 5ef98a084341dee38441680298a53c27d4fb041e (main)
    • merge_base: 5ef98a084341dee38441680298a53c27d4fb041e (parent tree e4296c20d0f485f9b3ff89ee503c6c1e61d66234)
    • head: 0e77c99605e34c2eaae22b028fa59ec75d9333a3 (tree: 383534a0779e93c3a3616a0188fde4196de33576, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication and delta trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude), resolving all prior automated review findings including read-only source-tree fixture staging (_make_tree_writable in test_check_minirust_pin.py), ValueExpr::Variant emptySizedTy payload parity across Translate.lean (translateConst, mrValueExprVariantWF) and Machine.lean (evalValue), real theorem declaration enforcement (include_exports=False), .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE wording, and clean rebase alignment onto 5ef98a084341 (incorporating #4250, #4230, #4297, and #4156, where git range-diff 4b2791214e2f..c4f51571b131 5ef98a084341..0e77c99605e3 contains solely the 1-line flake.nix SHA-256 refresh in anneal/trusted/root-manifest.sha256).
  3. Grouped coverage (64 changed paths across 5ef98a084341..0e77c99605e3):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (6 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, CORRESPONDENCE_PROVENANCE_NOTE accuracy, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit test parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, real theorem declaration extraction (include_exports=False in extract_exported_theorems), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, _make_tree_writable + read-only source-tree regression test, tomllib ci/checks.toml (5 checks) + 3-rule CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, ValueExpr::Variant discriminant and emptySizedTy payload-type checking statically in mrValueExprVariantWF and dynamically in evalValue, .illFormed vs. .ub separation, call-free entry-body validation + 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate, and Profile v2 constructor exhaustiveness), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp/theory/ imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope, CODEOWNERS-gated per-PR human review of statement bodies, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Pass-2, ci-core, and delta range-diff reviewers).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
  5. Checks and probes:

    • Class-3 seam & rebase checks executed directly on 0e77c99605e34c2eaae22b028fa59ec75d9333a3 (tree: 383534a0779e93c3a3616a0188fde4196de33576) (git range-diff 4b2791214e2f..c4f51571b131 5ef98a084341..0e77c99605e3 verified to differ solely by the 1-line flake.nix SHA-256 refresh in anneal/trusted/root-manifest.sha256, with independent claude cross-family seam inspection across trusted_bundle.rs, verify.rs, receipt_and_bindings.rs, flake.nix, ci/checks.toml, docs/, trusted/audit/, and test_trusted_boundary_claim_sync.py / test_lean_template_hygiene.py):
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256 && ./ci/check_todo.sh) (4/4 OK), repo-root ./ci/check_todo.sh, git diff --check origin/main..HEAD -- . ':(exclude)anneal/vendor/minirust', and python3 -B anneal/ci/check_pr_hygiene.py -> all rc=0.
      • cargo test --locked -p cargo-anneal -p anneal-audit --lib: anneal-audit (13 passed; 0 failed) and cargo-anneal (196 passed; 0 failed, including bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed, and validate_and_extract_candidate_features_enforces_tier_policy_and_closure).
      • cargo test --locked -p cargo-anneal-tests --test suite -- receipt_and_bindings: 5 passed; 0 failed (end-to-end verification & minirust_upstream provenance assertions on the rebased #4156 sysroot/tier stack).
      • PYTHONPATH=anneal/ci python3 -B -m unittest -v test_check_minirust_pin test_render_correspondence_provenance test_check_todo test_trusted_boundary_claim_sync test_lean_template_hygiene test_check_pr_hygiene (Ran 156 tests — OK) and python3 -B -m unittest discover -s ci -p 'test_*.py' (Ran 68 tests — OK, skipped=7).
    • Full correspondence, audit, and CI checks executed on pre-rebase d715e467b2222efb24e0a9fd380567fb75ce9f74 / c4f51571b131a57a6b7f9144182abde1e66e6f39 (10 correspondence/Anneal/MiniRust* modules and 30 vendor/minirust/** files remain byte-identical on 0e77c99605e3):
      • cargo run --locked -p anneal-audit -- --require-correspondence: PASS on d715e467b222 (19 Trusted modules, 86 Theory modules, 2191 Trusted kernel declarations, 15734 total Pass-1 replayed declarations; 160 Vendor Miri modules, 39088 kernel-replayed declarations; 5171 replayed correspondence declarations, 22968 reachable declarations).
      • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors --check-axioms --lean <lean-v4.34.1> --stage-dir <stage>: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors) | axioms: OK (39 exported theorems, subset of {propext, Quot.sound}).
      • cargo test --locked -p anneal-audit-tests --test boundary_audit -- --exact enforces_bundled_resources_parity_and_regular_files (1 passed; 0 failed), 0o444/0o555 read-only staged ANNEAL_ROOT test_check_minirust_pin.py probe (Ran 22 tests — OK), and 116/116 GitHub CI + Codex Round 5 CLEAN + tier2a_core_tcb Gate-2 Round 3 CLEAN (64/64 files, 0 P0–P2 findings) on c4f51571b131.
  6. Findings and blockers:

    • All local cross-family findings and all external automated review findings (_make_tree_writable read-only fixture staging, ValueExpr::Variant emptySizedTy payload/discriminant checking in Translate.lean and Machine.lean, include_exports=False theorem declaration check, .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE accuracy, and #4250 + #4156 rebase alignment) are fixed and verified on 0e77c99605e34c2eaae22b028fa59ec75d9333a3.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from c4f5157 to 0e77c99 Compare November 25, 2026 14:28
@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e77c99605

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread anneal/ci/check_minirust_pin.py Resolved
@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 0e77c99 to 83553c1 Compare November 25, 2026 14:56
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, updates CORRESPONDENCE_PROVENANCE_NOTE to state that anneal-audit --require-correspondence kernel-replays correspondence/Anneal/MiniRust* (with vendor/minirust/UPSTREAM_PIN.json verified by Tier-0 CI and recorded in provenance), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,746 lines, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 run_anneal_check.sh ci-tests explicitly invokes python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors directly against the checkout before running unittest discovery (which also runs test_real_vendored_minirust_pin_passes and test_tier0_ci_script_invokes_check_minirust_pin_on_checkout), verifying 30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations via include_exports=False, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, read-only source-tree fixture staging via _make_tree_writable, and credential-stripped subprocess execution, while verifying minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 5ef98a084341dee38441680298a53c27d4fb041e (main)
    • merge_base: 5ef98a084341dee38441680298a53c27d4fb041e (parent tree e4296c20d0f485f9b3ff89ee503c6c1e61d66234)
    • head: 83553c14e900d651aa89b7ab807369ec3952f23e (tree: e7f8c4e0c9ed22c6bb247a217530128e440d6d95, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Executed multi-round pre-publication and delta trust-review + change-review across two distinct model families (author_family: gemini, critic_family: claude), resolving all prior automated review findings including explicit direct invocation of ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors in anneal/ci/run_anneal_check.sh (ci-tests) with test_tier0_ci_script_invokes_check_minirust_pin_on_checkout, read-only source-tree fixture staging (_make_tree_writable in test_check_minirust_pin.py), ValueExpr::Variant emptySizedTy payload parity across Translate.lean (translateConst, mrValueExprVariantWF) and Machine.lean (evalValue), real theorem declaration enforcement (include_exports=False), .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE wording, and clean rebase alignment onto 5ef98a084341 (incorporating #4250, #4230, #4297, and #4156).
  3. Grouped coverage (64 changed paths across 5ef98a084341..83553c14e900):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (6 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, CORRESPONDENCE_PROVENANCE_NOTE accuracy, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit test parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, verify::tests::bundled_correspondence_provenance_is_well_formed).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, real theorem declaration extraction (include_exports=False in extract_exported_theorems), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, _make_tree_writable + read-only source-tree regression test, tomllib ci/checks.toml (5 checks) + 3-rule CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, ValueExpr::Variant discriminant and emptySizedTy payload-type checking statically in mrValueExprVariantWF and dynamically in evalValue, .illFormed vs. .ub separation, call-free entry-body validation + 0-arg 1-ZST start function + post-Call initMrMachine, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate, and Profile v2 constructor exhaustiveness), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp/theory/ imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope, CODEOWNERS-gated per-PR human review of statement bodies, minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; critic_family: claude — reviewed across two distinct model families (gemini author + independent fresh-context claude semantic, Pass-2, ci-core, and delta range-diff reviewers).
    • holdout mode: none (post-push cold Gate 2 provides independent unprimed falsification).
  5. Checks and probes:

    • Targeted delta & read-only -I -B checks executed directly on 83553c14e900d651aa89b7ab807369ec3952f23e (tree: e7f8c4e0c9ed22c6bb247a217530128e440d6d95, adding only the explicit ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors call in run_anneal_check.sh ci-tests, test_tier0_ci_script_invokes_check_minirust_pin_on_checkout, and mir-correspondence-design.md note on top of 0e77c99605e3):
      • Isolated python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors on a 0o444/0o555 read-only staged anneal/ checkout (exit 0: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors)).
      • PYTHONPATH=anneal/ci python3 -B -m unittest -v test_check_minirust_pin test_run_anneal_check test_check_pr_hygiene (Ran 136 tests — OK), expanded 7-suite anneal/ci run including test_render_correspondence_provenance, test_check_todo, test_trusted_boundary_claim_sync, and test_lean_template_hygiene (Ran 172 tests — OK), ./ci/scripts/check_shell_and_hooks.sh (rc=0), and python3 -B anneal/ci/check_pr_hygiene.py (0 findings, 0 warnings).
    • Class-3 #4156 seam & Rust/integration checks executed on parent-identical 0e77c99605e3 (0 Rust/Nix/vendor/Lean diffs between 0e77c99605e3 and 83553c14e900):
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256 && ./ci/check_todo.sh) (4/4 OK), repo-root ./ci/check_todo.sh, git diff --check origin/main..HEAD -- . ':(exclude)anneal/vendor/minirust', and python3 -B -m unittest discover -s ci -p 'test_*.py' (Ran 68 tests — OK, skipped=7).
      • cargo test --locked -p cargo-anneal -p anneal-audit --lib (anneal-audit: 13 passed; 0 failed; cargo-anneal: 196 passed; 0 failed) and cargo test --locked -p cargo-anneal-tests --test suite -- receipt_and_bindings (5 passed; 0 failed), plus claude cross-family seam inspection (PASS).
    • Full correspondence, audit, and CI checks executed on pre-rebase d715e467b2222efb24e0a9fd380567fb75ce9f74 / c4f51571b131a57a6b7f9144182abde1e66e6f39 (10 correspondence/Anneal/MiniRust* modules and 30 vendor/minirust/** files remain byte-identical on 83553c14e900):
      • cargo run --locked -p anneal-audit -- --require-correspondence: PASS on d715e467b222 (19 Trusted modules, 86 Theory modules, 2191 Trusted kernel declarations, 15734 total Pass-1 replayed declarations; 160 Vendor Miri modules, 39088 kernel-replayed declarations; 5171 replayed correspondence declarations, 22968 reachable declarations).
      • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors --check-axioms --lean <lean-v4.34.1> --stage-dir <stage>: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors) | axioms: OK (39 exported theorems, subset of {propext, Quot.sound}).
      • cargo test --locked -p anneal-audit-tests --test boundary_audit -- --exact enforces_bundled_resources_parity_and_regular_files (1 passed; 0 failed), 0o444/0o555 read-only staged ANNEAL_ROOT test_check_minirust_pin.py probe (Ran 22 tests — OK), and 116/116 GitHub CI + Codex Round 5 CLEAN + tier2a_core_tcb Gate-2 Round 3 CLEAN (64/64 files, 0 P0–P2 findings) on c4f51571b131.
  6. Findings and blockers:

    • All local cross-family findings and all external automated review findings (_make_tree_writable read-only fixture staging, ValueExpr::Variant emptySizedTy payload/discriminant checking in Translate.lean and Machine.lean, include_exports=False theorem declaration check, .github/CODEOWNERS + trust-model.md governance alignment, CORRESPONDENCE_PROVENANCE_NOTE accuracy, explicit run_anneal_check.sh ci-tests invocation of check_minirust_pin.py --repo-root . --check-lean --check-anchors, and #4250 + #4156 rebase alignment) are fixed and verified on 83553c14e900d651aa89b7ab807369ec3952f23e.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 83553c14e9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 4)

  • Identity: multi:ffb97bcc0502ea03421d5cd97e3a9a55c2b5d8ca:83553c14e900d651aa89b7ab807369ec3952f23e (base=ffb97bcc0502, head=83553c14e900, tree=e7f8c4e0c9ed)
  • Separation: author_family=gemini vs. reviewer_family=claude
  • Coverage: 64 inspected, 0 inapplicable, 0 blocked (of 64 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking tcb_and_api_critic completed clean 0 3035s
seat2 gemini-frontier-thinking tcb_and_spec_critic completed clean 0 1241s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed clean 0 1429s

No unresolved P0-P2 findings raised across completed seats.

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R4-A01 [P3] (anneal/ci/check_minirust_pin.py:118): The required-theorem list locks 20 of the 39 theorem names, leaving out every UB-reachability witness and most return-value witnesses.
  • G2-R4-A02 [P3] (anneal/ci/check_minirust_pin.py:324): The pin checker locks commit, tarball digest, file count and manifest digest but not the pin file's own digest, and never inspects tarball_url, commit_date or commit_subject.
  • G2-R4-A03 [P3] (anneal/correspondence/Anneal/MiniRust/Machine.lean:620): stepStatement .setDiscriminant reads and writes the full enum byte range instead of writing only the tagger byte slices as in upstream spec/lang/step/statements.md.
  • G2-R4-A04 [P3] (anneal/docs/trust-model.md:695): The provenance-record description still lists only the lean-miri commit and pin digest, patched-file digests and correspondence proof digests, and omits the new minirust_upstream block.
  • G2-R4-A05 [P3] (anneal/trusted/cargo-anneal/src/trusted_bundle.rs:1011): The fail-closed test exercises a malformed tarball digest but not a malformed manifest digest, so the second operand of the validation guard is untested on the Rust side.

Executed Sandbox Probes

  • seat3 root_manifest_sha256_strict: outcome=pass
  • seat3 minirust_vendor_pin_sha256: outcome=pass
  • seat3 render_correspondence_provenance_determinism: outcome=pass
  • seat3 check_minirust_pin_and_tamper_probes: outcome=pass
  • seat3 python_ci_unit_suites_in_bwrap: outcome=partial
  • seat3 lean_static_hygiene_and_foundation_lock: outcome=pass
  • seat3 missing_host_tool_checks: outcome=not_run
  • seat3 workflow_checklist_1_checkout_head_vs_merge: outcome=na
  • seat3 workflow_checklist_2_least_privilege_permissions: outcome=na
  • seat3 workflow_checklist_3_persist_credentials_false: outcome=na
  • seat3 workflow_checklist_4_action_sha_pinning: outcome=na
  • seat3 workflow_checklist_5_untrusted_pr_input_containment: outcome=na
  • seat3 workflow_checklist_6_secret_env_containment: outcome=na
  • seat3 workflow_checklist_7_cache_poisoning_isolation: outcome=na
  • seat3 workflow_checklist_8_pr_target_safety: outcome=na

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 83553c1 to 49eb573 Compare November 25, 2026 23:18
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, parses and validates correspondence_provenance.minirust_upstream inside core/inspect/schema.rs (including nested files digests, file_count parity, trimmed non-empty keys/metadata, and RFC 6901 unrecognized-field tracking), updates CORRESPONDENCE_PROVENANCE_NOTE and verify::tests::bundled_correspondence_provenance_is_well_formed (29 correspondence proofs, 24 trusted_lean), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,837 lines total, max 3,473 lines in OracleCert.lean, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] with call/sysrootCall/coreCall excluded while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, SlotRel maps partialTuple slots to .unit, StateRel enforces frame.sysrootOp? = none, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 run_anneal_check.sh ci-tests explicitly invokes python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors directly against the checkout before running unittest discovery (which also runs test_real_vendored_minirust_pin_passes and test_tier0_ci_script_invokes_check_minirust_pin_on_checkout), verifying 30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations via include_exports=False, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, read-only source-tree fixture staging via _make_tree_writable, and credential-stripped subprocess execution, while verifying minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 11bfd2b07cf3646bf578484bbbdfbf427975a466 (main)
    • merge_base: 1790639c3d4a19bc7092dcac9cf7ea7741ff91b7 (parent tree 0d99211df82bc34e8d82acfc5be2e20e83e73f14)
    • head: 49eb573ffd499291efd8805b4546bd46c8881f95 (tree: bf9c06741b5e0939fb165802cfa1caece6b66dfe, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/inspect/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Rebased cleanly onto 1790639c3d4a (#4266 intra-crate calls/sysrootCall/partialTuple/FrameState.sysrootOp? + #4335 profile-parametric verification envelope spine + #4220 cargo anneal inspect strict schema validation) and added parse_minirust_upstream inside core/inspect/schema.rs so strict cargo anneal inspect --unknown-fields deny recognizes and validates correspondence_provenance.minirust_upstream across schema_version 1 and 3 receipts. Prior pre-rebase rounds also closed all automated Gate-2/Codex findings across author_family: gemini and critic_family: claude.
  3. Grouped coverage (65 changed paths across 1790639c3d4a..49eb573ffd49):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (7 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, strict receipt parsing + digest/file-count cross-checks + RFC 6901 unknown-field tracking in core/inspect/schema.rs, CORRESPONDENCE_PROVENANCE_NOTE accuracy, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit/E2E parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, core::inspect::schema::tests::minirust_upstream_provenance_validation_and_unknown_field_tracking, verify::tests::bundled_correspondence_provenance_is_well_formed expecting 29 proofs and 24 trusted_lean).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, real theorem declaration extraction (include_exports=False in extract_exported_theorems), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, _make_tree_writable + read-only source-tree regression test, tomllib ci/checks.toml (5 checks) + 3-rule CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity (29 proofs, 24 trusted_lean) and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, ValueExpr::Variant discriminant and emptySizedTy payload-type checking statically in mrValueExprVariantWF and dynamically in evalValue, .illFormed vs. .ub separation, call-free entry-body validation with call/sysrootCall/coreCall excluded + 0-arg 1-ZST start function + post-Call initMrMachine, SlotRel.partialTuple + frame.sysrootOp? = none adaptation, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate, and Profile v2 constructor exhaustiveness), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp/theory/ imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), CODEOWNERS-gated per-PR human review of statement bodies, minirust_upstream provenance binding across trusted_bundle.rs and core/inspect/schema.rs, locked commit/tarball/manifest pin constants, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; cold pre-push delta reviews passed on 49eb573ffd49 and b16d85d607cd (0 blocking findings; prior pre-rebase commits also passed multi-round cold claude reviews and Gate-2 R4 CLEAN).
    • holdout mode: none (post-push cold Gate 2 and CI provide independent unprimed falsification).
  5. Checks and probes (all executed after final edit on 49eb573ffd499291efd8805b4546bd46c8881f95):

    • Lean compilation, upstream pin, anchors, & axioms:
      • Compiled all 22 Trusted.* + 10 Anneal.MiniRust* modules (ALL_OK built=13 total=32, max 3,473 LOC <= 3,500).
      • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors --check-axioms --lean ~/.elan/bin/lean --stage-dir <stage>: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors) | axioms: OK (39 exported theorems, subset of {propext, Quot.sound}).
    • Live Pass-2 standalone Lean kernel audit:
      • cargo run --locked -p anneal-audit -- --require-correspondence: PASS: kernel dependency closure, module-origin separation, and Cargo DAG boundary (29 Trusted modules, 123 Theory modules, 2,761 Trusted kernel declarations, 22,716 total Pass-1 replayed declarations; 160 Vendor Miri modules, 39,088 kernel-replayed declarations, 14,213 reachable cone declarations; 6,256 replayed correspondence declarations, 24,671 reachable declarations).
    • Manifest, hygiene, formatting, clippy, & shell/todo checks:
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256): 4/4 OK.
      • python3 -I -B anneal/ci/check_pr_hygiene.py --base origin/main --head HEAD: PR hygiene checks passed. (0 findings).
      • ./anneal/ci/check_todo.sh, ./anneal/ci/check_non_stable_version.sh (0.0.0-dev), ./ci/scripts/check_shell_and_hooks.sh, and git diff --check origin/main HEAD -- ':(exclude)anneal/vendor/minirust/**': exit 0.
      • rustfmt +nightly-2026-05-31 --check --edition 2024 trusted/cargo-anneal/src/core/inspect/schema.rs and cargo clippy --locked -p cargo-anneal -p cargo-anneal-tests -p anneal-audit --all-targets -- -D warnings: exit 0.
    • Env-scrubbed Python CI:
      • anneal/ci (26 modules excluding test_check_job_dependencies, which requires yq not installed on this host): Ran 498 tests — OK (201.803s).
      • Root ci/: Ran 68 tests — OK (skipped=7, 7.421s).
    • Rust unit, bundle, audit boundary, inspect, & E2E integration suites:
      • cargo test --locked -p cargo-anneal --lib -- --test-threads=2: 218 passed; 0 failed (337.74s).
      • cargo test --locked -p cargo-anneal --example regenerate_bundle: 7 passed; 0 failed (0.03s).
      • cargo test --locked -p anneal-audit --lib: 13 passed; 0 failed (0.27s).
      • cargo test --locked -p anneal-audit-tests --test boundary_audit: 61 passed; 0 failed (1275.92s).
      • cargo test --locked -p cargo-anneal-tests --test inspect: 4 passed; 0 failed (0.36s).
      • cargo test --locked -p cargo-anneal-tests --test suite -- inspect_e2e inspect_profile_v2_e2e receipt_and_bindings: 7 passed; 0 failed (628.69s).
  6. Findings and blockers:

    • All local cold-critic findings (core/inspect/schema.rs recognition/validation of minirust_upstream, verify.rs / test_render_correspondence_provenance.py 21 -> 24 trusted_lean parity, and check_pr_hygiene.py wrap fixes) and prior external review findings are fixed and verified on 49eb573ffd499291efd8805b4546bd46c8881f95.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 49eb573ffd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — FINDINGS (tier2a_core_tcb, Round 5)

  • Identity: multi:11bfd2b07cf3646bf578484bbbdfbf427975a466:49eb573ffd499291efd8805b4546bd46c8881f95 (base=11bfd2b07cf3, head=49eb573ffd49, tree=bf9c06741b5e)
  • Separation: author_family=gemini vs. reviewer_family=claude
  • Coverage: 65 inspected, 0 inapplicable, 0 blocked (of 65 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking tcb_and_api_critic completed clean 0 460s
seat2 gemini-frontier-thinking tcb_and_spec_critic completed findings 1 1817s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed findings 1 730s

Deduplicated Findings

ID Sev Consensus Verification Location Summary
G2-R5-01 P2 3 (seat1, seat2, seat3) static_verified anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1495 Surviving mutant (replace || with && in the files-key trim check): no test exercises an empty or untrimmed minirust_upstream.files key.

G2-R5-01 [P2] (anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1495, Pass 2 §3 (trusted/cargo-anneal) test adequacy, static_verified): Surviving mutant (replace || with && in the files-key trim check): no test exercises an empty or untrimmed minirust_upstream.files key.

  • Invariant: New validation guards should have sensitivity tests that fail when the guard is disabled.
  • Evidence: Static inspection of parse_minirust_upstream (anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1493-1499) and minirust_upstream_provenance_validation_and_unknown_field_tracking (lines 2807-2883), corroborated by the diff mutation pre-pass surviving mutant (replace || with && in parse_minirust_upstream, line 1495 col 34).

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R5-A01 [P3] (anneal/trusted/cargo-anneal/src/trusted_bundle.rs:599): The MiniRust pin files-key validation differs across layers: the Rust renderer and Python renderer only reject empty keys, while inspect's schema flags untrimmed keys and check_minirust_pin.py enforces clean relative paths.
  • G2-R5-A02 [P3] (anneal/ci/check_minirust_pin.py:118): REQUIRED_EXPORTED_THEOREMS checks theorem names only, so a weakened MiniRust claim-statement body passes CI and relies solely on CODEOWNERS human review.
  • G2-R5-A03 [P3] (anneal/correspondence/Anneal/MiniRust/Machine.lean:632): stepStatement.setDiscriminant loads full ty.size bytes whereas upstream encode_discriminant accesses tag offsets only
  • G2-R5-A04 [P3] (anneal/correspondence/Anneal/MiniRustProof.lean:28): The module docstring asserts every exported theorem uses only {propext, Quot.sound}, but CI never enforces this; anneal-audit permits Classical.choice in correspondence/, and the check is the manual --check-axioms mode.

Executed Sandbox Probes

  • seat3 workflow-yaml-checklist: outcome=pass
  • seat3 bwrap-root-manifest-check: outcome=pass
  • seat3 bwrap-check-minirust-pin: outcome=pass
  • seat3 bwrap-render-correspondence-provenance: outcome=pass
  • seat3 bwrap-static-hygiene-and-lean-syntax: outcome=pass
  • seat3 bwrap-check-todo-pathspec-probe: outcome=pass
  • seat3 bwrap-schema-minirust-key-falsification: outcome=failed_guard_sensitivity
  • seat3 bwrap-ci-python-unittests-and-scripts: outcome=pass
  • seat3 offline-not-executed-heavy-gates: outcome=not_run
  • seat3 seat1-probe-1: outcome=confirmed

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 49eb573 to 686593f Compare November 26, 2026 01:05
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, parses and validates correspondence_provenance.minirust_upstream inside core/inspect/schema.rs (including nested files digests, file_count parity, trimmed non-empty keys/metadata, and RFC 6901 unrecognized-field tracking, with mutation-killing coverage in minirust_upstream_provenance_validation_and_unknown_field_tracking for empty/untrimmed files keys, zero file_count, untrimmed metadata, and invalid SHAs), updates CORRESPONDENCE_PROVENANCE_NOTE and verify::tests::bundled_correspondence_provenance_is_well_formed (29 correspondence proofs, 24 trusted_lean), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,837 lines total, max 3,473 lines in OracleCert.lean, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] with call/sysrootCall/coreCall excluded while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, SlotRel maps partialTuple slots to .unit, StateRel enforces frame.sysrootOp? = none, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py}): Tier-0 run_anneal_check.sh ci-tests explicitly invokes python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors directly against the checkout before running unittest discovery (which also runs test_real_vendored_minirust_pin_passes and test_tier0_ci_script_invokes_check_minirust_pin_on_checkout), verifying 30 pinned files, locked schema_version, upstream_repo, commit, tarball_sha256, file_count, and manifest_sha256, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations via include_exports=False, forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, read-only source-tree fixture staging via _make_tree_writable, and credential-stripped subprocess execution, while verifying minirust_upstream provenance rendering (render_correspondence_provenance.py + run_anneal_check.sh omnibus rendering) with duplicate-key, malformed-digest, and symlink rejection tests.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 06980c075893b447808807c218a61b5e3b69ee91 (main)
    • merge_base: 1790639c3d4a19bc7092dcac9cf7ea7741ff91b7 (parent tree 0d99211df82bc34e8d82acfc5be2e20e83e73f14)
    • head: 686593fca26dc77a4ea8f0658922cb884fd86a28 (tree: 83a9b5c61e4640139c831ecc614098a3badbdc7c, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Touches Pass 2 provenance/inspect/CI surfaces (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/flake.nix, anneal/trusted/root-manifest.sha256, anneal/ci/*, ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS), agent rules & governing documentation (anneal/AGENTS.md, anneal/docs/trust-model.md), pinned upstream specification markdown (anneal/vendor/minirust/), and 10 new untrusted correspondence modules (anneal/correspondence/Anneal/MiniRust*).
    • Closed Gate-2 Round 5 finding G2-R5-01 (anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1495) with +66 test-only lines in minirust_upstream_provenance_validation_and_unknown_field_tracking exercising empty "", whitespace-only " ", and non-empty untrimmed " README.md " files keys (independently exercising both arms of rel.trim().is_empty() || rel.trim() != rel), zero file_count on empty files, empty/untrimmed upstream_repository and upstream_commit, and invalid upstream_pin_sha256/tarball_sha256/manifest_sha256 digests. Verified clean against origin/main 06980c075893 (and rebased onto #4266 + #4335 + #4220).
  3. Grouped coverage (65 changed paths across 1790639c3d4a..686593fca26d):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (7 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29) and PROVENANCE_SOURCES (MINIRUST_UPSTREAM_PIN_PATH + 10 Anneal/MiniRust* modules) registration, duplicate-key-rejecting MiniRustPinInput validation and minirust_upstream provenance serialization, strict receipt parsing + digest/file-count cross-checks + RFC 6901 unknown-field tracking + mutation-killing unit test coverage in core/inspect/schema.rs, CORRESPONDENCE_PROVENANCE_NOTE accuracy, Nix minirustUpstreamPin wiring + root-manifest.sha256 flake.nix digest refresh, zero user-bundle or TCB Lean impact, unit/E2E parity (bundle::tests::provenance_sources_match_component_lists, trusted_bundle::tests::minirust_upstream_pin_validation_fails_closed, core::inspect::schema::tests::minirust_upstream_provenance_validation_and_unknown_field_tracking, verify::tests::bundled_correspondence_provenance_is_well_formed expecting 29 proofs and 24 trusted_lean).
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core): mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (sandbox = "nested_bwrap" preserved, zero engine SHA/workflow/permission edits), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py} (7 paths) — inspected (Pass 1 & Pass 2): LOCKED_MINIRUST_COMMIT, LOCKED_MINIRUST_TARBALL_SHA256, LOCKED_MINIRUST_FILE_COUNT, and LOCKED_MINIRUST_MANIFEST_SHA256 locks plus schema_version == 1 and duplicate-JSON-key rejection in verify_vendor_pin, symlink/traversal/confusable/bidi rejection, Lean comment/raw-string/interpolated-string lexing, real theorem declaration extraction (include_exports=False in extract_exported_theorems), SpecAnchor constructor and leanSymbol verification (58 anchors), PATH-aware _resolve_lean_command, child-env credential stripping, _make_tree_writable + read-only source-tree regression test, tomllib ci/checks.toml (5 checks) + 3-rule CODEOWNERS parity test, render_correspondence_provenance.py --minirust-upstream-pin + --anneal-root byte-parity (29 proofs, 24 trusted_lean) and negative tamper/duplicate-key/symlink tests, run_anneal_check.sh omnibus flag wiring, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/{Syntax,Memory,Machine,Anchors,Translate,Relation,OpSim,StepSim,OracleCert}.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): upstream MiniRust transcription fidelity (StorageDead argument-local rejection, ValueExpr::Variant discriminant and emptySizedTy payload-type checking statically in mrValueExprVariantWF and dynamically in evalValue, .illFormed vs. .ub separation, call-free entry-body validation with call/sysrootCall/coreCall excluded + 0-arg 1-ZST start function + post-Call initMrMachine, SlotRel.partialTuple + frame.sysrootOp? = none adaptation, char-as-u32 lowering, lazy tag-only GetDiscriminant, unique Switch keys, monotone MrMemory.allocate, and Profile v2 constructor exhaustiveness), non-vacuity of 23 fuel-checked witnesses, <= 3,500-line module cap, zero Miri/Trusted.Correspondence/Anneal.MirCorrespondence*/Anneal.MirWp/theory/ imports, and {propext, Quot.sound} axiom purity across all 39 exported theorems.
    • anneal/vendor/minirust/UPSTREAM_PIN.json, LICENSE-APACHE, LICENSE-MIT, README.md, spec/**/*.md (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed, regular 100644 file modes, zero executable/build/config files.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance schema/digest assertions and correspondence_proofs count assertion (19 -> 29).
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): pinned vendor/{lean-miri,minirust}/ header exemption, accurate module/file counts, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), CODEOWNERS-gated per-PR human review of statement bodies, minirust_upstream provenance binding across trusted_bundle.rs and core/inspect/schema.rs, locked commit/tarball/manifest pin constants, strictness boundary, and CI vs. anneal-audit vs. manual --check-axioms split.
  4. Realized capability and isolation:

    • author_family: gemini; cold pre-push delta audit passed directly on 686593fca26dc77a4ea8f0658922cb884fd86a28 (0 blocking findings, verifying all G2-R5-01 mutations are killed; prior 49eb573ffd49 and b16d85d607cd deltas also passed cold audits and Codex R8 CLEAN).
    • holdout mode: none (post-push cold Gate 2 and CI provide independent unprimed falsification).
  5. Checks and probes:

    • Direct post-final-edit checks on 686593fca26dc77a4ea8f0658922cb884fd86a28 (+66 test-only lines in core/inspect/schema.rs over 49eb573ffd49):
      • rustfmt +nightly-2026-05-31 --check --edition 2024 anneal/trusted/cargo-anneal/src/core/inspect/schema.rs: exit 0.
      • cargo clippy --locked -p cargo-anneal -p cargo-anneal-tests --all-targets -- -D warnings: exit 0.
      • cargo test --locked -p cargo-anneal --lib -- --test-threads=2: 218 passed; 0 failed (333.68s).
      • cargo test --locked -p cargo-anneal-tests --test inspect: 4 passed; 0 failed (0.38s).
      • cargo test --locked -p cargo-anneal-tests --test suite -- inspect_e2e inspect_profile_v2_e2e: 2 passed; 0 failed (92.06s).
      • python3 -I -B anneal/ci/check_pr_hygiene.py --base origin/main --head HEAD: PR hygiene checks passed. (0 findings).
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256): 4/4 OK.
      • ./anneal/ci/check_todo.sh, ./ci/scripts/check_shell_and_hooks.sh, git diff --check origin/main HEAD -- ':(exclude)anneal/vendor/minirust/**': exit 0.
      • Cold pre-push delta audit on 686593fca26d: VERDICT: PASS confirming mutant kill across parse_minirust_upstream (schema.rs:1471-1511).
    • Full Lean, live audit, Python, and integration suite checks on production-code-identical 49eb573ffd499291efd8805b4546bd46c8881f95 (zero non-test diffs vs. 686593fca26d):
      • Compiled all 22 Trusted.* + 10 Anneal.MiniRust* modules (ALL_OK built=13 total=32, max 3,473 LOC <= 3,500) and check_minirust_pin.py --check-lean --check-anchors --check-axioms: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors) | axioms: OK (39 exported theorems, subset of {propext, Quot.sound}).
      • Live cargo run --locked -p anneal-audit -- --require-correspondence: PASS (29 Trusted, 123 Theory, 2,761/22,716 Pass-1 decls; 160 Vendor Miri/39,088 decls; 6,256 replayed / 24,671 reachable correspondence decls).
      • Env-scrubbed Python CI: 498/498 anneal/ci (26 modules sans yq-only test_check_job_dependencies, which passed on GitHub Actions Anneal Tests 45720299581) + 68/68 root ci/ (skipped=7).
      • cargo test --locked -p cargo-anneal --example regenerate_bundle (7/7), cargo test --locked -p anneal-audit --lib (13/13), cargo test --locked -p anneal-audit-tests --test boundary_audit (61/61), cargo test --locked -p cargo-anneal-tests --test suite -- inspect_e2e inspect_profile_v2_e2e receipt_and_bindings (7/7), Codex Round 8 CLEAN (issuecomment-7177469874), and 6/6 GitHub workflows SUCCESS.
  6. Findings and blockers:

    • Closed Gate-2 Round 5 [P2] finding G2-R5-01 (PRRT_kwDOH9mcF868LE8Q / 4702677023) on 686593fca26dc77a4ea8f0658922cb884fd86a28.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 686593fca2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 686593f to 426ea49 Compare November 26, 2026 01:34
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, parses and validates correspondence_provenance.minirust_upstream inside core/inspect/schema.rs (including nested files digests, file_count parity, trimmed non-empty keys/metadata, and RFC 6901 unrecognized-field tracking, with mutation-killing coverage in minirust_upstream_provenance_validation_and_unknown_field_tracking), updates CORRESPONDENCE_PROVENANCE_NOTE and verify::tests::bundled_correspondence_provenance_is_well_formed (29 correspondence proofs, 24 trusted_lean), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,837 lines total, max 3,473 lines in OracleCert.lean, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] with call/sysrootCall/coreCall excluded while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, SlotRel maps partialTuple slots to .unit, StateRel enforces frame.sysrootOp? = none, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,verify_zerocopy.py,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py,test_verify_zerocopy.py}): Tier-0 run_anneal_check.sh ci-tests invokes python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors directly against the checkout before running unittest discovery (which also runs test_real_vendored_minirust_pin_passes and test_tier0_ci_script_invokes_check_minirust_pin_on_checkout), verifying 30 pinned files, locked constants, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations (include_exports=False), forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, and read-only fixture staging; render_correspondence_provenance.py + run_anneal_check.sh render/verify minirust_upstream; verify_zerocopy.py (PROVENANCE_V1_KEYS, _validate_minirust_upstream) validates optional minirust_upstream provenance on Profile v1/Schema 3 receipts (rejecting explicit null, unrecognized keys, blank/untrimmed strings, non-positive/bool/float file_count, count mismatches, empty/untrimmed files keys, and non-hex digests), with mutation-killed regression tests and live rendered provenance validation in test_verify_zerocopy.py; and check_todo.sh updates the committed-tree vendor exclusion to :(exclude,glob)**/vendor/**.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: f43546b35cb0b0a90ead160bc2c1fc0c750fed69 (main)
    • merge_base: f43546b35cb0b0a90ead160bc2c1fc0c750fed69 (parent tree ab85b864112e514cb1076b1fd90a170fa4fb56fd)
    • head: 426ea4941de8fea79fdf498ab36f79887c91ab4e (tree: 627c08620ab1fe325672e925a10e3ca7e82e4b17, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Rebased onto latest origin/main f43546b35cb0b0a90ead160bc2c1fc0c750fed69 (#4215, #4351, #4354, #4357, #4359) and resolved the #4354 Anneal Tests failure (test_validate_receipt_rejects_missing_or_corrupted_caveat_fields calling render_provenance_json(...) without minirust_upstream_pin, and verify_zerocopy.PROVENANCE_V1_KEYS rejecting live minirust_upstream keys). Added "minirust_upstream" + _validate_minirust_upstream to anneal/ci/verify_zerocopy.py (failing closed on explicit null, unrecognized keys, blank/untrimmed strings, non-positive/bool/float file_count, length mismatches, and malformed files keys/digests) and killed all targeted single-clause mutants in test_verify_zerocopy.py (all 7 omitted-field checks, null, file_count type/sign/count checks, files map/digest checks, live rendered provenance, and Schema 3 + minirust_upstream).
  3. Grouped coverage (67 changed paths across f43546b35cb0..426ea4941de8):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (7 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29), PROVENANCE_SOURCES, minirust_upstream provenance serialization and strict receipt parsing, root-manifest.sha256 flake.nix parity, zero user-bundle or TCB Lean impact.
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core & governance): vendor/minirust sandbox inputs (sandbox = "nested_bwrap" unchanged), toolchain seed, and CODEOWNERS rules.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,verify_zerocopy.py,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py,test_verify_zerocopy.py} (9 paths) — inspected (Pass 1 & Pass 2): locked pin checks, Lean hygiene & SpecAnchor checks (58 anchors), minirust_upstream provenance rendering, verify_zerocopy.py receipt validation + mutation-killed unit coverage, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): 17,837 lines (<= 3,500/file), 23 fuel-checked witnesses, zero forbidden imports, {propext, Quot.sound} purity across 39 exported theorems.
    • anneal/vendor/minirust/* (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d3.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance and 29-proof assertions.
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review).
  4. Realized capability and isolation:

    • author_family: gemini; cold pre-amend audit on 10da900428b4 identified 21 surviving test mutants in test_verify_zerocopy.py (P2) + explicit null minirust_upstream propagation (P3), all closed and mutation-tested on 426ea4941de8 (follow-up remote Gate 2 + Codex R9 run after push).
    • holdout mode: none.
  5. Checks and probes:

    • Direct post-amend checks on 426ea4941de8fea79fdf498ab36f79887c91ab4e (f43546b35cb0..426ea4941de8):
      • python3 -I -B anneal/ci/check_pr_hygiene.py --base origin/main --head HEAD: PR hygiene checks passed. (0 findings, 0 warnings).
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256): 4/4 OK.
      • python3 anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors).
      • ./anneal/ci/check_todo.sh, ./ci/scripts/check_shell_and_hooks.sh, git diff --check origin/main -- ':!anneal/vendor/minirust/': exit 0.
      • env -i ... python3 -B -m unittest test_verify_zerocopy test_render_correspondence_provenance test_perf_tracking test_check_minirust_pin test_check_todo: 83/83 OK (15.4s).
      • In-memory targeted mutation suite on _validate_minirust_upstream & _validate_profile_v1_provenance: 10/10 single-clause mutants killed.
      • cargo test --locked -p cargo-anneal --lib -- minirust_upstream bundled_correspondence provenance_sources_match: 4 passed; 0 failed (227 filtered out, 0.02s).
    • Rebased Rust/Clippy/Integration & Python checks on identical-Rust 10da900428b4056ca32531a566e199ad8694ea88 (on f43546b35cb0):
      • cargo clippy --locked -p cargo-anneal -p cargo-anneal-tests -p anneal-audit --all-targets -- -D warnings: exit 0.
      • cargo test --locked -p cargo-anneal --example regenerate_bundle (7/7), cargo test --locked -p anneal-audit --lib (20/20), cargo test --locked -p cargo-anneal-tests --test inspect (4/4), cargo test --locked -p cargo-anneal-tests --test suite -- inspect_e2e inspect_profile_v2_e2e receipt_and_bindings (8/8, 25 filtered out, 626.01s).
      • anneal/ci 26-module env-scrubbed unittest (499/499, run as 492/492 sans test_check_todo + 7/7 test_check_todo with rg, excluding yq-only test_check_job_dependencies) and root ci/ (68/68, skipped=14).
    • Full Lean & Pass-2 anneal-audit on unchanged Lean/vendor tree (49eb573ffd499291efd8805b4546bd46c8881f95):
      • build_minirust.py (ALL_OK built=13 total=32), check_minirust_pin.py --check-axioms (39 theorems ⊆ {propext, Quot.sound}), live cargo run --locked -p anneal-audit -- --require-correspondence (PASS: 29 Trusted, 123 Theory, 160 Vendor Miri, 6,256 replayed correspondence decls), and cargo test --locked -p anneal-audit-tests --test boundary_audit (61/61).
  6. Findings and blockers:

    • Closed #4354 Anneal Tests conflict (verify_zerocopy.py & test_verify_zerocopy.py) + all pre-push mutant findings on 426ea4941de8fea79fdf498ab36f79887c91ab4e.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 426ea4941d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, parses and validates correspondence_provenance.minirust_upstream inside core/inspect/schema.rs (including nested files digests, file_count parity, trimmed non-empty keys/metadata, and RFC 6901 unrecognized-field tracking, with mutation-killing coverage in minirust_upstream_provenance_validation_and_unknown_field_tracking), updates CORRESPONDENCE_PROVENANCE_NOTE and verify::tests::bundled_correspondence_provenance_is_well_formed (29 correspondence proofs, 24 trusted_lean), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,837 lines total, max 3,473 lines in OracleCert.lean, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] with call/sysrootCall/coreCall excluded while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, SlotRel maps partialTuple slots to .unit, StateRel enforces frame.sysrootOp? = none, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,verify_zerocopy.py,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py,test_verify_zerocopy.py}): Tier-0 run_anneal_check.sh ci-tests invokes python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors directly against the checkout before running unittest discovery (which also runs test_real_vendored_minirust_pin_passes and test_tier0_ci_script_invokes_check_minirust_pin_on_checkout), verifying 30 pinned files, locked constants, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations (include_exports=False), forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, and read-only fixture staging; render_correspondence_provenance.py + run_anneal_check.sh render/verify minirust_upstream; verify_zerocopy.py (PROVENANCE_V1_KEYS, _validate_minirust_upstream) validates optional minirust_upstream provenance on Profile v1/Schema 3 receipts (rejecting explicit null, unrecognized keys, blank/untrimmed strings, non-positive/bool/float file_count, count mismatches, empty/untrimmed files keys, and non-hex digests), with mutation-killed regression tests and live rendered provenance validation in test_verify_zerocopy.py; and check_todo.sh updates the committed-tree vendor exclusion to :(exclude,glob)**/vendor/**.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 80bfd5e1fb29b96566018e9a1d4c216907e9e078 (main)
    • merge_base: 80bfd5e1fb29b96566018e9a1d4c216907e9e078 (parent tree 8df2a8d0b1e2077fec0d24d0027ae56d5c633026)
    • head: 820010eca4aad922338c6141fe7e2166622275a8 (tree: 0739d0894396709c0c8cefdbb14f8b7b956dfd04, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Delta-proportional rebase onto latest origin/main 80bfd5e1fb29b96566018e9a1d4c216907e9e078 (#4249 SepAC + #4288 ITree differential fuzzer) from 426ea4941de8 (which cleared Codex Round 9 CLEAN issuecomment-7179975000 and 6/6 GitHub workflows SUCCESS). Reconciled only the three merge hunks (anneal/trusted/root-manifest.sha256 preserving #4288 Cargo.toml/Cargo.lock digests + MiniRust flake.nix digest, ci/docker/anneal-tc.Dockerfile preserving tests/itree_diff/ + vendor/minirust/UPSTREAM_PIN.json, and anneal/docs/trust-model.md preserving #4288's tests/itree_diff/ cell + MiniRust table updates), with zero code changes across Rust, Lean, or Python CI.
  3. Grouped coverage (67 changed paths across 80bfd5e1fb29..820010eca4aad):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (7 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29), PROVENANCE_SOURCES, minirust_upstream provenance serialization and strict receipt parsing, root-manifest.sha256 4/4 strict parity (Cargo.toml/Cargo.lock #4288 + flake.nix), zero user-bundle or TCB Lean impact.
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core & governance): vendor/minirust sandbox inputs (sandbox = "nested_bwrap" unchanged), tests/itree_diff + vendor/minirust/UPSTREAM_PIN.json toolchain seed parity, and CODEOWNERS rules.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,verify_zerocopy.py,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py,test_verify_zerocopy.py} (9 paths) — inspected (Pass 1 & Pass 2): locked pin checks, Lean hygiene & SpecAnchor checks (58 anchors), minirust_upstream provenance rendering, verify_zerocopy.py receipt validation + mutation-killed unit coverage, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): 17,837 lines (<= 3,500/file), 23 fuel-checked witnesses, zero forbidden imports, {propext, Quot.sound} purity across 39 exported theorems.
    • anneal/vendor/minirust/* (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d3.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance and 29-proof assertions.
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): clean integration alongside #4249 (Anneal.SepAC) and #4288 (tests/itree_diff/).
  4. Realized capability and isolation:

    • author_family: gemini; cold pre-push delta range-diff audit passed directly on 820010eca4aad922338c6141fe7e2166622275a8 (VERDICT: PASS, confirming 59/67 bit-identical blobs vs 426ea4941de8 and zero regressions across all 8 merged files).
    • holdout mode: none.
  5. Checks and probes:

    • Direct post-rebase delta checks on 820010eca4aad922338c6141fe7e2166622275a8 (80bfd5e1fb29..820010eca4aad):
      • python3 -I -B anneal/ci/check_pr_hygiene.py --base 80bfd5e1fb29 --head HEAD: PR hygiene checks passed. (0 findings, 0 warnings).
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256): 4/4 OK (Cargo.toml, Cargo.lock, flake.nix, flake.lock).
      • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors).
      • ./anneal/ci/check_todo.sh, ./ci/scripts/check_shell_and_hooks.sh, git diff --check 80bfd5e1fb29 -- ':!anneal/vendor/minirust/': exit 0.
      • cargo check --locked -p cargo-anneal -p anneal-audit -p cargo-anneal-tests: Finished in 4.92s.
      • Env-scrubbed delta Python CI: 6 anneal/ci modules (test_check_minirust_pin, test_update_root_manifest, test_ci_workflow, test_verify_zerocopy, test_render_correspondence_provenance, test_check_todo) 75/75 OK (95.028s) + root ci/ 68/68 OK (skipped=14, 6.941s).
      • Cold pre-push delta range-diff critic on 820010eca4aad: VERDICT: PASS (git range-diff, manifest/pin/hygiene, #4249/#4288 merge preservation, test_check_minirust_pin 23/23, test_render_correspondence_provenance 6/6, test_verify_zerocopy 21/21).
    • Code-identical CI, Codex, Rust, & Python checks on 426ea4941de8fea79fdf498ab36f79887c91ab4e / 10da900428b4056ca32531a566e199ad8694ea88 (0 code/test diffs vs 820010eca4aad):
      • 6/6 GitHub workflows SUCCESS (Anneal Tests, Build & Tests, CI (PR), Dependency Review, GitHub Actions Scan, Google GitHub Admin) + Codex Round 9 CLEAN (issuecomment-7179975000).
      • cargo clippy --locked -p cargo-anneal -p cargo-anneal-tests -p anneal-audit --all-targets -- -D warnings (0), regenerate_bundle (7/7), anneal-audit --lib (20/20), --test inspect (4/4), --test suite -- inspect_e2e inspect_profile_v2_e2e receipt_and_bindings (8/8, 626.01s), cargo-anneal --lib -- minirust_upstream bundled_correspondence provenance_sources_match (4/4, 227 filtered out), 83/83 Python + 10/10 _validate_minirust_upstream mutants killed, 499/499 anneal/ci (26 modules sans yq-only test_check_job_dependencies, which passed on GitHub Actions Anneal Tests).
    • Full Lean & Pass-2 anneal-audit on unchanged Lean/vendor tree (49eb573ffd499291efd8805b4546bd46c8881f95 / 686593fca26d):
      • build_minirust.py (ALL_OK built=13 total=32), check_minirust_pin.py --check-axioms (39 theorems ⊆ {propext, Quot.sound}), live cargo run --locked -p anneal-audit -- --require-correspondence (PASS: 29 Trusted, 123 Theory, 160 Vendor Miri, 6,256 replayed correspondence decls), boundary_audit (61/61), and cargo-anneal --lib (218/218).
  6. Findings and blockers:

    • Resolved all 3 #4288 merge hunks (root-manifest.sha256, ci/docker/anneal-tc.Dockerfile, anneal/docs/trust-model.md) cleanly at 820010eca4aad922338c6141fe7e2166622275a8.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 426ea49 to 820010e Compare November 26, 2026 02:05
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 820010eca4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Anchor a second, independent operational correspondence witness to
`Trusted.MirAst` and `Trusted.MirSemantics` against a SHA-256-pinned
snapshot of upstream MiniRust (`minirust/minirust@d821c6e3a3d3`), kept
in `correspondence/` so `trusted/lean/` stays unchanged and neither
`correspondence/` nor `vendor/minirust/` is shipped in the user
toolchain archive.

Unlike `Trusted.Correspondence`'s locked claim constants, these witness
statements (`MiniRustForwardSimClaim`, `MiniRustBiFaultEquivClaim`),
admission predicates (`MiniRustAdmitted`, `MiniRustExactAdmitted`), and
the transcribed MiniRust machine reside in unlocked `correspondence/`,
with theorem-name, hygiene, and `SpecAnchor` checks in
`ci/check_minirust_pin.py` and `CODEOWNERS`-gated per-PR human review of
statement bodies. Both admission predicates validate and execute the
call-free entry body `p.bodies[p.entryDefId]` (`call`, `sysrootCall`,
and `coreCall` terminators excluded, so any additional unreferenced
bodies in `p.bodies` are uninvoked). Every `MiniRustAdmitted` input
satisfies the structural `Program::check_wf` subset for `start` and
the entry function (`minirust_admitted_prog_wellFormed`, with a `0`-arg
`1`-ZST `start` function, `initMrMachine` constructing the post-`Call`
two-frame state whose return slot `exitWith` observes,
`ValueExpr::Variant` payload and discriminant typing, no `StorageDead`
on return or argument locals, and unique `Switch` keys), never faults
`.unsupported` in Anneal, and never reaches `StepOutcome.illFormed` in
MiniRust (`minirust_admitted_never_illFormed`).

Because Anneal deinitializes non-ZST `Operand.move` sources and checks
`char`'s Unicode scalar niche while upstream MiniRust evaluates
`ValueExpr::Load` non-destructively and lacks `Type::Char` (so `char`
lowers to `u32`), `OracleCert.lean` separates two constructive claims:
`minirust_forward_sim_holds` over `MiniRustAdmitted` (forward return and
divergence simulation plus contrapositive UB soundness, with strictness
witnesses for `move` and `char`) and `minirust_bi_fault_equiv_holds`
over `MiniRustExactAdmitted` (bidirectional return, UB, and divergence
equivalence over call-free entry-body copy-only, `char`-free,
`Assert`-free, projection-free scalar, overflow-pair, and fieldless-enum
MIR, with monotone allocation in `MrMemory.allocate`).

- Pin 30 upstream MiniRust files (27 `spec/**/*.md` files plus
  `LICENSE-APACHE`, `LICENSE-MIT`, and `README.md`) in
  `anneal/vendor/minirust/UPSTREAM_PIN.json`. Exempt pinned
  `vendor/minirust/` files from Fuchsia headers in `anneal/AGENTS.md`
  and exclude `**/vendor/**` from committed-tree `git grep` in
  `anneal/ci/check_todo.sh` via `:(exclude,glob)**/vendor/**`, with
  committed vendor and clean-tree non-vendor regression tests in
  `test_check_todo.py`.
- Add 10 constructive Lean 4 correspondence modules: 9 modules under
  `anneal/correspondence/Anneal/MiniRust/` (`Syntax`, `Memory`,
  `Machine`, `Anchors`, `Translate`, `Relation`, `OpSim`, `StepSim`,
  `OracleCert`) plus `Anneal/MiniRustProof.lean` (58 `SpecAnchor`
  records, 23 fuel-checked witnesses, and zero imports of `Miri`,
  `Trusted.Correspondence`, `Anneal.MirCorrespondence*`, or
  `Anneal.MirWp`).
- Add `anneal/ci/check_minirust_pin.py` and
  `test_check_minirust_pin.py`, include `vendor/minirust/` inputs in
  `ci/checks.toml` (`anneal-ci-tests`, `anneal-flake-eval`,
  `anneal-clippy`, `anneal-sandbox-aarch64`, and
  `anneal-installed-smoke`), and register
  `/anneal/correspondence/Anneal/MiniRust/`,
  `/anneal/correspondence/Anneal/MiniRustProof.lean`, and
  `/anneal/vendor/minirust/UPSTREAM_PIN.json` in `.github/CODEOWNERS`.
  Tier-0 CI enforces `UPSTREAM_PIN.json` SHA-256 parity against locked
  commit, tarball, and manifest constants, Lean hygiene (`<= 3,500`
  lines, forbidden imports/tokens, required theorem declarations), and
  all 58 `SpecAnchor` symbol and excerpt checks. The `anneal-audit`
  correspondence stage sandbox-compiles and kernel-replays all
  declarations of the 10 `Anneal.MiniRust*` modules (where
  `correspondence/` permits `Classical.choice` because
  `vendor/lean-miri` uses it), while `--check-axioms` is a local/manual
  mode confirming `{propext, Quot.sound}` purity across all 39 exported
  theorems.
- Register the 10 `correspondence/Anneal/MiniRust*` modules and
  `vendor/minirust/UPSTREAM_PIN.json` in `trusted_bundle.rs`
  (`CORRESPONDENCE_PROOF_PATHS` and `PROVENANCE_SOURCES`), bind and
  validate `minirust_upstream` provenance across `trusted_bundle.rs`,
  `core/inspect/schema.rs`, `verify_zerocopy.py`,
  `test_verify_zerocopy.py`, `render_correspondence_provenance.py`,
  `flake.nix` (`root-manifest.sha256`), `run_anneal_check.sh`, and
  `anneal-tc.Dockerfile`, and update `README.md`, `architecture.md`,
  `mir-correspondence-design.md`, `testing-architecture.md`, and
  `trust-model.md`.

Agent-authored-by: AI agent acting on mdittmer's behalf
@mdittmer

Copy link
Copy Markdown
Collaborator Author

Human review surface

  • Trusted Rust & Nix provenance binding (anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256): Registers the 10 new correspondence/Anneal/MiniRust* Lean modules (19 -> 29 correspondence proof entries) and MINIRUST_UPSTREAM_PIN_PATH = "vendor/minirust/UPSTREAM_PIN.json" in PROVENANCE_SOURCES, binds validated minirust_upstream metadata and file SHA-256 digests (rejecting duplicate JSON keys and malformed digests) into CORRESPONDENCE_PROVENANCE_JSON across trusted_bundle.rs and anneal/flake.nix, parses and validates correspondence_provenance.minirust_upstream inside core/inspect/schema.rs (including nested files digests, file_count parity, trimmed non-empty keys/metadata, and RFC 6901 unrecognized-field tracking, with mutation-killing coverage in minirust_upstream_provenance_validation_and_unknown_field_tracking), updates CORRESPONDENCE_PROVENANCE_NOTE and verify::tests::bundled_correspondence_provenance_is_well_formed (29 correspondence proofs, 24 trusted_lean), and updates the flake.nix SHA-256 entry in anneal/trusted/root-manifest.sha256. TRUSTED_BUNDLE_SOURCES, CORRESPONDENCE_ADAPTER_PATHS, anneal/trusted/lean/, anneal/trusted/correspondence/, anneal/trusted/rustc-capture/, anneal/trusted/audit/, and shipped user toolchain archive sources (correspondence/ and vendor/minirust/ remain CI-only) are untouched.
  • Repository ci-core, toolchain seed, & owner governance (ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS): Mounts "anneal/vendor/minirust/**" in anneal-ci-tests and "anneal/vendor/minirust/UPSTREAM_PIN.json" alongside "anneal/vendor/lean-miri/UPSTREAM_PIN.json" in anneal-flake-eval, anneal-clippy, anneal-sandbox-aarch64, and anneal-installed-smoke (ci/checks.toml, keeping sandbox = "nested_bwrap" and all engine SHAs/permissions unchanged), seeds /tmp/anneal-seed/anneal/vendor/minirust/UPSTREAM_PIN.json in ci/docker/anneal-tc.Dockerfile, and registers /anneal/correspondence/Anneal/MiniRust/, /anneal/correspondence/Anneal/MiniRustProof.lean, and /anneal/vendor/minirust/UPSTREAM_PIN.json for @joshlf @jswrenn @mdittmer in .github/CODEOWNERS.
  • Agent file-header rule (anneal/AGENTS.md): Extends line 43 from vendor/lean-miri/ to Pinned vendor/{lean-miri,minirust}/ files retain upstream headers and LICENSE-* files. so unmodified upstream MiniRust markdown and license files match documented header policy. .github/workflows/*.yml, .claude/, and .codex/ are untouched.
  • Correspondence specifications, machine model, and proofs (anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean): 10 new constructive Lean 4 modules (17,837 lines total, max 3,473 lines in OracleCert.lean, 58 SpecAnchor records, 39 exported theorems using ⊆ {propext, Quot.sound}).
    • Unlocked correspondence/ placement: Unlike Trusted.Correspondence, MiniRustForwardSimClaim, MiniRustBiFaultEquivClaim, MiniRustAdmitted, MiniRustExactAdmitted, and the transcribed MiniRust machine (Syntax, Memory, Machine, Translate) reside in unlocked correspondence/ (not locked in TrustedBoundary.lean), with theorem-name, hygiene, and SpecAnchor checks in ci/check_minirust_pin.py and CODEOWNERS-gated per-PR human review of statement bodies (anneal-audit --require-correspondence permits Classical.choice across correspondence/ because vendor/lean-miri uses it; --check-axioms is a local/manual mode confirming {propext, Quot.sound} purity).
    • Gate 5 semantic-faithfulness review: Human maintainer review covers the transcribed MiniRust syntax, byte-addressable memory (MrMemory.allocate is monotone without a 2^64 address cap so infinite StorageLive loops preserve divergence rather than introducing synthetic UB), small-step machine (Machine.lean, separating StepOutcome.illFormed from StepOutcome.ub and enforcing ValueExpr::Variant discriminant and payload-type equality in evalValue), and MIR-to-MiniRust lowering (Translate.lean, validating/executing the call-free entry body p.bodies[p.entryDefId] with call/sysrootCall/coreCall excluded while start satisfies structural 0-arg 1-ZST well-formedness, initMrMachine directly constructs the post-Call two-frame state whose return slot exitWith observes, SlotRel maps partialTuple slots to .unit, StateRel enforces frame.sysrootOp? = none, and translateConst + mrValueExprVariantWF enforce emptySizedTy variant payload parity with spec/lang/well-formed.md) against pinned anneal/vendor/minirust/spec/**, as well as the Operand.move deinitialization and char-as-u32 niche strictness boundary (MiniRustAdmitted forward simulation + strictness witnesses vs. MiniRustExactAdmitted call-free entry-body copy-only, char-free, Assert-free, projection-free bidirectional fault equivalence).
  • Vendored upstream snapshot (anneal/vendor/minirust/): 30 unmodified upstream files pinned to minirust/minirust@d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed (27 spec/**/*.md files plus upstream LICENSE-APACHE, LICENSE-MIT, and README.md, locked by SHA-256 in UPSTREAM_PIN.json and LOCKED_MINIRUST_* constants in ci/check_minirust_pin.py, including commit, tarball digest, file count, and manifest digest). Retains verbatim upstream bytes so SHA-256s match upstream d821c6e3a3d3 byte-for-byte, including upstream non-ASCII characters (U+00A0 in spec/lang/step/locks.md:22 and U+02CB in spec/lang/syntax.md:102), 16 upstream trailing-whitespace lines, upstream prose task markers, and upstream LICENSE-APACHE / LICENSE-MIT files.
  • CI scripts & tests (anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,verify_zerocopy.py,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py,test_verify_zerocopy.py}): Tier-0 run_anneal_check.sh ci-tests invokes python3 -I -B ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors directly against the checkout before running unittest discovery (which also runs test_real_vendored_minirust_pin_passes and test_tier0_ci_script_invokes_check_minirust_pin_on_checkout), verifying 30 pinned files, locked constants, duplicate-JSON-key rejection, 10 Lean modules, 58 anchors, real theorem declarations (include_exports=False), forbidden imports/tokens, ci/checks.toml + CODEOWNERS coverage, and read-only fixture staging; render_correspondence_provenance.py + run_anneal_check.sh render/verify minirust_upstream; verify_zerocopy.py (PROVENANCE_V1_KEYS, _validate_minirust_upstream) validates optional minirust_upstream provenance on Profile v1/Schema 3 receipts (rejecting explicit null, unrecognized keys, blank/untrimmed strings, non-positive/bool/float file_count, count mismatches, empty/untrimmed files keys, and non-hex digests), with mutation-killed regression tests and live rendered provenance validation in test_verify_zerocopy.py; and check_todo.sh updates the committed-tree vendor exclusion to :(exclude,glob)**/vendor/**.
  • Governing & design documentation (anneal/docs/trust-model.md, anneal/README.md, anneal/docs/architecture.md, anneal/docs/mir-correspondence-design.md, anneal/docs/testing-architecture.md): Updates governing documentation (docs/trust-model.md) and design/testing documentation to describe the unlocked MiniRust correspondence witness, CODEOWNERS-gated per-PR human review of statement bodies, call-free entry-body admission scope (call/sysrootCall/coreCall excluded), minirust_upstream provenance binding, locked commit/tarball/manifest pin constants, strictness boundaries, and the Tier-0 vs. anneal-audit vs. manual --check-axioms verification split.
  • Intentional policy relaxations:
    • anneal/AGENTS.md:43 extends the existing vendor/lean-miri/ file-header exemption to pinned vendor/{lean-miri,minirust}/ files so unmodified upstream MiniRust files retain their upstream headers and LICENSE-* files.
    • anneal/ci/check_todo.sh updates the committed-tree git grep vendor exclusion from :!**/vendor/** (which failed to match top-level anneal/vendor/** when run from anneal/) to :(exclude,glob)**/vendor/** on lines 149 and 151, aligning committed-tree scanning with the existing working-tree rg -g '!**/vendor/**' vendor exclusion so unmodified upstream task markers in anneal/vendor/minirust/spec/** do not fail check_todo.sh while non-vendor task markers remain fail-closed (test_check_todo.py covers both committed vendor pass and committed non-vendor failure).

Review Receipt

  1. Comparison tuple:

    • target_base: 85efba8b01ffb0cd3488f4324b9e8712173191fa (main)
    • merge_base: 85efba8b01ffb0cd3488f4324b9e8712173191fa (parent tree 4c934b3e9a6a9654e5014f9491469d6d675d6098)
    • head: 011fc1c93fd3915e7ab1d7efbdae5160b9f95fda (tree: 7775df787b5e9c5204126101e933e5db3bbc27bc, single commit, clean working tree)
  2. Risk and refinement rationale:

    • Delta-proportional rebase onto latest origin/main 85efba8b01ffb0cd3488f4324b9e8712173191fa (#4234 Tarjan SCC .olean sharding and BinChunkTree proof bridge) from 820010eca4aad922338c6141fe7e2166622275a8 (which cleared Codex Round 10 CLEAN issuecomment-7180495855 and 6/6 GitHub workflows SUCCESS). Only two paths overlapped with #4234: resolved the EOF test-append conflict in anneal/trusted/cargo-anneal/src/core/inspect/schema.rs (preserving both #4234's sample_sharded_success_json / validates_sharded_receipt_and_rejects_shard_invariants_and_unknown_keys and #4318's minirust_upstream_provenance_validation_and_unknown_field_tracking) and verified the orthogonal auto-merge in anneal/trusted/cargo-anneal/src/verify.rs. All Lean correspondence modules, vendored MiniRust files, provenance scripts, and CI specs had zero code changes vs 820010eca4aad.
  3. Grouped coverage (67 changed paths across 85efba8b01ff..011fc1c93fd3):

    • anneal/trusted/cargo-anneal/src/{bundle.rs,core/inspect/schema.rs,trusted_bundle.rs,verify.rs}, anneal/trusted/cargo-anneal/examples/regenerate_bundle.rs, anneal/flake.nix, anneal/trusted/root-manifest.sha256 (7 paths) — inspected (Pass 1 & Pass 2): CORRESPONDENCE_PROOF_PATHS (19 -> 29), PROVENANCE_SOURCES, minirust_upstream provenance serialization and strict receipt parsing, root-manifest.sha256 4/4 strict parity (Cargo.toml/Cargo.lock #4288 + flake.nix), clean coexistence with #4234 sharding fields (capture_shards_sha256, shards), zero user-bundle or TCB Lean impact.
    • ci/checks.toml, ci/docker/anneal-tc.Dockerfile, .github/CODEOWNERS (3 paths) — inspected (Pass 2 ci-core & governance): vendor/minirust sandbox inputs (sandbox = "nested_bwrap" unchanged), tests/itree_diff + vendor/minirust/UPSTREAM_PIN.json toolchain seed parity, and CODEOWNERS rules.
    • anneal/ci/{check_minirust_pin.py,check_todo.sh,render_correspondence_provenance.py,run_anneal_check.sh,verify_zerocopy.py,test_check_minirust_pin.py,test_check_todo.py,test_render_correspondence_provenance.py,test_verify_zerocopy.py} (9 paths) — inspected (Pass 1 & Pass 2): locked pin checks, Lean hygiene & SpecAnchor checks (58 anchors), minirust_upstream provenance rendering, verify_zerocopy.py receipt validation + mutation-killed unit coverage, and :(exclude,glob)**/vendor/** pathspec parity.
    • anneal/correspondence/Anneal/MiniRust/*.lean, anneal/correspondence/Anneal/MiniRustProof.lean (10 paths) — inspected (Pass 1 & semantic audit): 17,837 lines (<= 3,500/file), 23 fuel-checked witnesses, zero forbidden imports, {propext, Quot.sound} purity across 39 exported theorems.
    • anneal/vendor/minirust/* (31 paths: 30 pinned upstream files + UPSTREAM_PIN.json) — inspected (Pass 1): byte-for-byte SHA-256 parity against upstream minirust/minirust@d821c6e3a3d3.
    • anneal/tests/cargo-anneal/tests/suite/receipt_and_bindings.rs (1 path) — inspected (Pass 1): minirust_upstream provenance and 29-proof assertions.
    • anneal/AGENTS.md, anneal/README.md, anneal/docs/{architecture,mir-correspondence-design,testing-architecture,trust-model}.md (6 paths) — inspected (Pass 1 & docs review): clean integration alongside #4249 (Anneal.SepAC), #4288 (tests/itree_diff/), and #4234 (Anneal.SccSharding).
  4. Realized capability and isolation:

    • author_family: gemini; cold pre-push delta range-diff audit passed directly on 011fc1c93fd3915e7ab1d7efbdae5160b9f95fda (VERDICT: PASS across schema.rs merge, verify.rs merge, git range-diff, manifest/pin/hygiene, provenance parity, and 50/50 targeted Python tests; cold cargo test skipped on capsule without pre-warmed target/, verified locally below).
    • holdout mode: none.
  5. Checks and probes:

    • Direct post-rebase delta checks on 011fc1c93fd3915e7ab1d7efbdae5160b9f95fda (85efba8b01ff..011fc1c93fd3):
      • python3 -I -B anneal/ci/check_pr_hygiene.py --base 85efba8b01ffb0cd3488f4324b9e8712173191fa --head HEAD: PR hygiene checks passed. (0 findings, 0 warnings).
      • (cd anneal && sha256sum --check --strict trusted/root-manifest.sha256): 4/4 OK (Cargo.toml, Cargo.lock, flake.nix, flake.lock).
      • python3 -B anneal/ci/check_minirust_pin.py --repo-root anneal --check-lean --check-anchors: vendor-pin: OK (30 files at d821c6e3a3d3) | lean-hygiene: OK (10 modules) | spec-anchors: OK (58 anchors).
      • ./anneal/ci/check_todo.sh, ./ci/scripts/check_shell_and_hooks.sh, git diff --check 85efba8b01ffb0cd3488f4324b9e8712173191fa -- ':!anneal/vendor/minirust/': exit 0.
      • cargo clippy --locked -p cargo-anneal -p anneal-audit -p cargo-anneal-tests --all-targets -- -D warnings: Finished (0 warnings).
      • cargo test --locked -p cargo-anneal --lib -- minirust_upstream bundled_correspondence provenance_sources_match core::inspect::schema::tests: 11/11 OK (228 filtered out, including both validates_sharded_receipt_and_rejects_shard_invariants_and_unknown_keys and minirust_upstream_provenance_validation_and_unknown_field_tracking). Direct setup::tests re-run: 26/26 OK (full concurrent cargo-anneal --lib earlier saw 238/239 due to a transient concurrent subprocess flock contention flake in setup::tests::install_at_with_prune_holds_shared_lease_on_current_root_throughout_pruning, passing 1/1 and 26/26 on direct setup::tests re-run).
      • cargo test --locked -p anneal-audit --lib: 20/20 OK; cargo test --locked -p cargo-anneal-tests --test inspect: 5/5 OK; cargo test --locked -p cargo-anneal-tests --test cli: 34/34 OK.
      • Targeted Python CI on 011fc1c93fd3: test_verify_zerocopy (21/21), test_check_minirust_pin (23/23), test_render_correspondence_provenance (6/6), and root ci/ (68/68 OK, 7 skipped).
      • Cold pre-push delta range-diff critic on 011fc1c93fd3: VERDICT: PASS.
    • Code-identical CI, Codex, Rust, & Python checks on 820010eca4aad / 426ea4941de8 / 10da900428b4 (0 MiniRust/provenance logic diffs vs 011fc1c93fd3):
      • 820010eca4aad: 6/6 GitHub workflows SUCCESS + Codex Round 10 CLEAN (issuecomment-7180495855), 75/75 env-scrubbed anneal/ci (6 modules).
      • 426ea4941de8 / 10da900428b4: 6/6 GitHub workflows SUCCESS + Codex Round 9 CLEAN (issuecomment-7179975000), regenerate_bundle (7/7), --test suite -- inspect_e2e inspect_profile_v2_e2e receipt_and_bindings (8/8, 626.01s), 83/83 Python + 10/10 _validate_minirust_upstream mutants killed, 499/499 anneal/ci (26 modules sans yq-only test_check_job_dependencies, which passed in GitHub Actions Anneal Tests).
    • Full Lean & Pass-2 anneal-audit on unchanged Lean/vendor tree (49eb573ffd49 / 686593fca26d):
      • build_minirust.py (ALL_OK built=13 total=32), check_minirust_pin.py --check-axioms (39 theorems ⊆ {propext, Quot.sound}), live cargo run --locked -p anneal-audit -- --require-correspondence (PASS: 29 Trusted, 123 Theory, 160 Vendor Miri, 6,256 replayed correspondence decls), boundary_audit (61/61), and cargo-anneal --lib (218/218).
  6. Findings and blockers:

    • Reconciled #4234 EOF test-append conflict in anneal/trusted/cargo-anneal/src/core/inspect/schema.rs cleanly at 011fc1c93fd3915e7ab1d7efbdae5160b9f95fda.
    • Open trust questions: none.
    • Pending human approval (Gate 5): maintainer review of the Human review surface above.

Authored by an AI agent acting on mdittmer's behalf.

@mdittmer

Copy link
Copy Markdown
Collaborator Author

@codex review

@mdittmer
mdittmer force-pushed the tl-minirust/minirust-correspondence-v1 branch from 820010e to 011fc1c Compare November 26, 2026 02:40
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 011fc1c93f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 6)

  • Identity: one:4c934b3e9a6a9654e5014f9491469d6d675d6098:7775df787b5e9c5204126101e933e5db3bbc27bc:bd308758add3e223cbab0bc21fabee668863a75f4c03238c4047db9f50da401e (base=85efba8b01ff, head=011fc1c93fd3, tree=7775df787b5e)
  • Separation: author_family=gemini vs. reviewer_family=claude
  • Coverage: 67 inspected, 0 inapplicable, 0 blocked (of 67 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking tcb_and_api_critic completed clean 0 2046s
seat2 gemini-frontier-thinking tcb_and_spec_critic completed clean 0 1230s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed clean 0 2522s

No unresolved P0-P2 findings raised across completed seats.

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R6-A01 [P3] (anneal/ci/check_todo.sh:149): The glob-magic exclusion now also removes vendor/lean-miri from committed-tree TODO scanning; the base pathspec failed to exclude anneal/vendor/** when run from anneal/. The scope change is disclosed and matches the dirty-tree behavior.
  • G2-R6-A02 [P3] (anneal/ci/verify_zerocopy.py:2365): minirust_upstream is optional in v1 receipt validation, so the end-to-end receipt check would not catch a cargo-anneal regression that drops the field (the Rust unit tests still assert it).
  • G2-R6-A03 [P3] (anneal/correspondence/Anneal/MiniRust/Machine.lean:620): Unused stepStatement .setDiscriminant performs a full-enum mem.load and mem.store instead of writing only tag offsets as in upstream MiniRust.
  • G2-R6-A04 [P3] (anneal/correspondence/Anneal/MiniRustProof.lean:27): The module docstring states every exported theorem is constructive (axioms within propext and Quot.sound), but CI does not enforce it; --check-axioms is local/manual and anneal-audit permits Classical.choice in correspondence/.
  • G2-R6-A05 [P3] (anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1574): Receipt inspect parser accepts explicit JSON null for correspondence_provenance.minirust_upstream whereas CI receipt validator rejects it.
  • G2-R6-A06 [P3] (anneal/trusted/cargo-anneal/src/trusted_bundle.rs:590): The Rust renderer checks MiniRust pin metadata only for emptiness, while schema.rs and verify_zerocopy.py require trimmed strings and lowercase hex; this is unreachable in CI only because the pin is SHA-locked.

Executed Sandbox Probes

  • seat1 bwrap --unshare-all python3 -I -B ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors: outcome=exit 0: vendor-pin OK (30 files at d821c6e3a3d3) | lean-hygiene OK (10 modules) | spec-anchors OK (58 anchors)
  • seat1 bwrap python3 -B -m unittest discover -s ci -p test_check_minirust_pin.py / test_render_correspondence_provenance.py / test_check_todo.py / test_verify_zerocopy.py: outcome=23 / 6 / 7 / 21 tests OK
  • seat1 SHA-256 of 30 vendored files vs pin and vs GitHub raw contents at d821c6e3a3d358fa8a556774dc12b4aa5d0d65ed: outcome=0 mismatches; 0 unpinned files
  • seat1 sha256sum --check --strict trusted/root-manifest.sha256 (candidate): outcome=Cargo.toml, Cargo.lock, flake.nix and flake.lock OK
  • seat3 check_minirust_pin_tier0: outcome=passed
  • seat3 root_tcb_manifest_sha256: outcome=passed
  • seat3 ci_python_unittests: outcome=passed
  • seat3 check_todo_unittest_and_git_grep_exclusion: outcome=partial
  • seat3 vendor_pin_and_provenance_parity: outcome=passed
  • seat3 lean_token_hygiene_and_trustedboundary_parity: outcome=passed
  • seat3 vendor_minirust_encoding_and_modes: outcome=passed
  • seat3 checks_toml_and_dockerfile_parity: outcome=passed
  • seat3 lean_compilation_and_axiom_replay: outcome=blocked
  • seat3 workflow_checklist_1_permissions: outcome=inapplicable
  • seat3 workflow_checklist_2_triggers: outcome=inapplicable
  • seat3 workflow_checklist_3_secrets: outcome=inapplicable
  • seat3 workflow_checklist_4_environment: outcome=inapplicable
  • seat3 workflow_checklist_5_checkout_and_pins: outcome=inapplicable
  • seat3 workflow_checklist_6_script_injection: outcome=inapplicable
  • seat3 workflow_checklist_7_cache_trust: outcome=inapplicable
  • seat3 workflow_checklist_8_guard_relaxation: outcome=inapplicable

@mdittmer
mdittmer requested a review from joshlf November 26, 2026 04:38
@mdittmer

Copy link
Copy Markdown
Collaborator Author

@joshlf Ready for Gate-5 review and merge at 011fc1c93fd3:

  • Gate 1: Local receipt posted (#issuecomment-7181023457), PR hygiene clean (0/0), pinned root manifest + MiniRust pin & anchor checks pass.
  • Gate 2: Round 6 CLEAN (#pullrequestreview-6068556024, 0 P0–P2 across all seats).
  • Codex: Round 11 CLEAN (#issuecomment-7181083397).
  • CI & Mergeability: All 6/6 workflows green (116 checks), MERGEABLE, 0/8 unresolved review threads.

Authored by an AI agent acting on mdittmer's behalf.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anneal Primary scope: Anneal verification stack (`anneal/` and `exocrate/`)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants