Skip to content

verify: every part names its toolchain by address (UOR-native, piece 1) - #498

Merged
humuhumu33 merged 8 commits into
release/v0.4from
uor/toolchain-addresses
Nov 14, 2026
Merged

humuhumu33 merged 8 commits into
release/v0.4from
uor/toolchain-addresses

Conversation

@humuhumu33

@humuhumu33 humuhumu33 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Every part of a verification now names its toolchain by address, and a part that reads another refuses it unless all five addresses equal its own.

What changed

  • A shard writes toolchain.json (lexlean/verify-toolchain/1) beside its output. It holds the SHA-256 of the lean, lake and leanchecker its preflight hashed, the SHA-256 of the running lexlean, and the address of the rustc that compiled that lexlean.
  • The rustc address is computed by crates/lexlean/build.rs. It is the SHA-256 of one line <sha256> <sysroot-relative path> per file of the compiler's rustc executable and rustc_driver library, in path order. Both files are hashed because rustc itself is only a launcher; the compiler is the driver library. rustc -vV is embedded beside it (lexlean::build_identity).
  • partition::check_toolchain compares every part's addresses with the reader's own before it reads any record. A mismatch is refused with LLI9001, naming the part, the tool and both addresses; so is a missing toolchain.json.
  • The bootstrap export's custody record (ci: export the bootstrap project once per run (SPEC.md §9.4) #476) becomes lexlean/ci-bootstrap-export/2. Besides the version banners it already had, it now names the SHA-256 of the pinned lake, lean and leanchecker, and the rustc address of the binary that made the export. A leg whose own differ refuses the export. A version banner reads the same for a rebuilt or patched binary; the bytes do not.
  • The gap this closes: a process record names only lean or leanchecker, so before this a shard that ran a different lake, lexlean or rustc was accepted by the join.

What the tests show

  • partition unit test: a part whose lake, lexlean or rustc address differs is refused, naming the tool. A part without toolchain.json is refused. A record of another lean is still refused as before.
  • VR-23, file plant: another lake address is written into a real shard's output; the join refuses it with LLI9001.
  • RP-14 custody plants: a record naming another leanchecker, or another rustc, is refused, and the refusal names executables alone.
  • VR-23, real binary (unix): the join's own toolchain is a symlinked copy of the pinned one whose lake has one appended byte. Its preflight hashes the changed file, and it refuses the shards that ran the pinned lake, naming both addresses.

What does not change

  • Published verified directories, attestations, attestation IDs and expected/verify are unchanged, so nothing is regenerated.
  • The compiler-semantics ID is unchanged: no file under language/ or schemas/ moved.
  • VR-23's statement adds "or a part that ran a toolchain other than its own". It is updated in model/ids.toml, the §31 row, CONFORMANCE.md and the scenario.
  • SPEC.md §9.4 and §22.11 now define toolchain.json and the rustc address.

Not in this PR, and why

  • rustc inside the attestation itself. schemas/ is part of the compiler-semantics ID (§21.2). Adding a field to attestation.schema.json would move that ID and regenerate every lock, export, golden and record, Atlas included. The lexlean digest the attestation already records fixes the rustc output it came from. This is the maintainer's call.

Gates run locally

All run in WSL on the tree merged with release/v0.4 26e5e0a, which includes #483:

  • cargo fmt --check
  • workspace clippy -D warnings
  • lexlean lib tests partition and toolchain (7 passed)
  • validate-model, validate-spec-links
  • the 17 RP cases (57 s)
  • --test bdd
  • both Python suites (25 tests)
  • conformance_vr_23 (17 s, with the real changed lake)

Full gate: dispatch run 43324805389 on 041b7ab (which includes the CL-13 fix) passed every job.

🤖 Generated with Claude Code

humuhumu33 and others added 4 commits November 12, 2026 14:59
A shard writes toolchain.json (lexlean/verify-toolchain/1) beside its
output: the SHA-256 of the lean, lake and leanchecker its preflight
hashed, of the running lexlean, and the address of the rustc that
compiled it (its executable and rustc_driver library, hashed by the
build script). A part that reads another refuses it (LLI9001, naming the
part, the tool and both addresses) unless all five equal its own. A
process record names only lean or leanchecker, so a part that ran
another lake, lexlean or rustc was accepted before.

VR-23 plants another lake address in a shard's output and, on unix, runs
a join whose own lake differs from the pinned one by one byte; both are
refused. Published directories, attestations and expected/verify do not
change, and neither does the compiler-semantics ID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The custody record becomes lexlean/ci-bootstrap-export/2. Beside what
`rustc -vV` and `lean --version` report, it names the SHA-256 of the
pinned toolchain's lake, lean and leanchecker and the address of the
rustc that compiled the exporting binary (SPEC.md §22.11). A leg whose
own executables differ refuses the export. A version banner is the same
for a rebuilt or patched binary; the bytes are not. RP-14 plants another
leanchecker and another rustc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

Bounded source review at34c3ccd3:

  1. P2 — Do not silently emit a launcher-only compiler address. In build.rs around116, failed bin/lib read_dir calls are continued and filter_map(Result::ok) drops entry errors; the only final assertion requires bin/rustc. No condition requires a rustc_driver library. A missing/unreadable/unrecognized driver inventory can therefore compare equal on both sides while omitting the component SPEC§22.11 says is essential. Fail closed for the required inventory, or explicitly define and validate a supported alternative layout rather than silently downgrading the identity.

  2. P2 — Bind the selected compiler. Around100, RUSTC supplies -vV and --print=sysroot, but the hashed executable is sysroot/bin/rustc, not necessarily the selected RUSTC executable. A different compiler or wrapper reporting the same sysroot can retain the same recorded address. Bind the resolved selected executable with an explicit wrapper/driver scope, or reject unsupported selections and narrow the public claim accordingly. This is about the stated compiler identity, not a demand for unrelated full environment provenance.

Ordering observation: verify/mod.rs1348–1352 calls partition::import before check_toolchain; import already copies oleans and parses process records. This conflicts with the new 'before reading any record' claim. The inspected path still refuses before subsequent Lean consumption, so no proof-acceptance bypass was demonstrated. Put the address comparison before that work if early refusal is required, or accurately state the boundary.

The bounded review credits closed five-address parsing, all-five comparisons, and shared custody-v2 producer/consumer checks retaining existing run/tree/pin/bundle checks. No replay or axiom-policy deletion was found. Owner-reported local tests were not repeated; draft/full qualification remains pending. These addresses may supply a narrow #468 custody input, but do not complete its source/environment controls or authorize rebuilding/refreezing #316/#468 tools. Existing contributor retains implementation; no competing patch or gate was started.

@afflom afflom mentioned this pull request Nov 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@humuhumu33

Copy link
Copy Markdown
Contributor Author

Full gate: dispatch run 43472785457 on 68061c8 (merged with release/v0.4 b8b6e86, after RB-24) is running.

Earlier full gate 43324805389 on 041b7ab (before RB-24 merged) passed every job.

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

Bounded review credits actual6a02 integration: ordered parents68061 +6a02, treec8578593, and no language/schema/generated-product delta. This resolves the old base-composition gap without indicating an identity writer.

The three prior source dispositions in5880517426 remain unchanged: rustc_identity still silently skips required inventory read failures and only asserts bin/rustc; selected RUSTC supplies metadata but its executable is not itself bound; partition import still precedes check_toolchain while the prose promises comparison before reading any record. No proof-acceptance bypass is asserted. Resolve the required inventory, selected-executable scope and ordering-or-claim accuracy in one owner correction, preserving existing custody/axiom checks.

The historical manual43472785457 is cancelled, not running or accepted; old successful gates do not qualify this combination. Current CI43525392869/repro43525392855 are queued. Existing owner retains implementation and qualification; no logs, checks, producers or CI controls were repeated.

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

The c5ef→65b delta fixes the missing VR-23 toolchain clause in CONFORMANCE.md: one generated projection line, with build/verify implementation unchanged. This is useful projection credit, not resolution of the three source findings in5880517426/5899385408. Required driver inventory, selected-RUSTC executable binding and import-before-check/prose accuracy still need owner disposition. Existing custody and axiom checks remain preserved; no proof bypass is asserted.

Current CI43538556422/repro43538556389 are pending on65b. Preserve earlier results with their original heads; no identity writer, duplicate build or replacement gate is requested by this review. Independent receipt pr498-65b-projection-delta-review/receipt.json.

@humuhumu33
humuhumu33 marked this pull request as ready for review November 14, 2026 03:31
@humuhumu33
humuhumu33 merged commit 11f16b8 into release/v0.4 Nov 14, 2026
19 checks passed
@humuhumu33
humuhumu33 deleted the uor/toolchain-addresses branch November 14, 2026 03:31
humuhumu33 added a commit that referenced this pull request Nov 14, 2026
Brings the combined batch current with release after #459 and #498 landed,
before its regeneration runs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
humuhumu33 added a commit that referenced this pull request Nov 14, 2026
…s branch

Only CHANGELOG.md conflicted: the arrays entry stays first, #498's follows.
#498 changes no language data, schema, or lock, so the language-1.2 identity
and the regenerated files stand; the register is still 497.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
afflom pushed a commit that referenced this pull request Nov 14, 2026
…urity-patch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX

afflom commented Nov 14, 2026

Copy link
Copy Markdown
Member

Postlanding readback: #498 was externally merged as11f16b88db582d1a024aff8153d07d0beabf3b44, ordered parents[f8854bf,65bfb484]. Actual tree d386b58f differs from head tree b1d0443d; the incoming difference is VERIFICATION.md plus rust_package.rs from #459. This does not change the three source findings in5880517426/5900325073: required driver inventory, selected-RUSTC executable binding, and import-before-check versus its claim still need the implementing owner's follow-up.

PR run43538556422 completed only3 successful jobs with15 skipped; full manual43552089060 on65b remains active. Landing run43552094663 was cancelled. None is full acceptance of the actual landed tree, and canceled jobs are not combined. The following actual69de release gate43555579969 is pending with its own repro43555579964; preserve evidence at each exact tree.

Please carry the existing three dispositions in one bounded corrective follow-up and keep #468's broader custody/tooling work open. Root did not perform this merge or approve it retrospectively; no duplicate checks or producer were started.

humuhumu33 added a commit that referenced this pull request Nov 14, 2026
…ng fix

Only CHANGELOG.md conflicted: the nesting entry stays first, #498's follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants