Repository navigation
[anneal] Add Tarjan SCC .olean sharding and BinChunkTree proof bridge - #4234
Conversation
Verification Receipt (post-final-edit on
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4234 +/- ##
=======================================
Coverage 92.99% 92.99%
=======================================
Files 16 16
Lines 2469 2469
=======================================
Hits 2296 2296
Misses 173 173 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c1ec9d7be
ℹ️ 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
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — FINDINGS (tier2_tcb, Round 1)
- Identity:
one:128cb1c4514c2fdebb68712a5bcfdf5ea9a40ac0:de7dd14ee1020006a88e5d9fb9926ac726e424bb:197c299738a201b4a731b7a3cf1fe71b6794d14fc8f42b9e994e339efcb30841(base=e86eb0281380,head=3c1ec9d7bef1,tree=de7dd14ee102) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 32 inspected, 0 inapplicable, 0 blocked (of 32 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
8 | 734s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
4 | 980s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 895s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R1-01 |
P1 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/olean_cache.rs:368 |
--no-rebuild-bundled fails open for TrustedBoundary (CacheKind::Inspector), silently recompiling the inspector on cache miss instead of failing closed. |
G2-R1-02 |
P1 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:411 |
Disk .olean caching for untrusted Proof.Shard_* modules lacks sandbox isolation, allowing a tainted --allow-unsandboxed-elaboration run to populate cache entries silently reused by subsequent untainted sandboxed runs. |
G2-R1-03 |
P1 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:447 |
Target-shard OleanCache keys hash only direct imports (edge_list) instead of the transitive import closure, causing stale .olean cache hits and false kernel-replay failures when a two-hop upstream module changes without altering the intermediate .olean. |
G2-R1-04 |
P2 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/olean_cache.rs:12 |
The olean cache docs still say only the inspector and bundled Trusted./Anneal. modules are cached, but this PR also caches target Captured.Shard_/Proof.Shard_/Proof.IdTree outputs, and the Human review surface reports no policy relaxation. |
G2-R1-05 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/cli.rs:71 |
The PR adds user-visible behavior (default-on sharding above 20 bodies that reorders DefIds, a shard-plan subcommand, --shard-/--verify-shard-plan flags, Captured/Shard_.lean and capture_shards.json artifacts, reserved Proof.IdTree/Captured./Expected. modules, shards/capture_shards_sha256 receipt fields) without updating the bundled cargo-anneal SKILL user doc. |
G2-R1-06 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/rustc-capture/src/extract.rs:744 |
New trusted callee extraction works with rustc structures (ty::FnDef, Instance::try_resolve, TerminatorKind::Call func/args, Rvalue operands) but quotes no pinned rust-lang/rust source and silently skips other operand positions, so the documented call-edge DAG is only partial. |
G2-R1-07 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/olean_cache.rs:206 |
Caching target shard modules adds new per-edit entries to the per-user disk cache, which has no eviction, so the cache grows without bound during proof iteration. |
G2-R1-08 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/shard.rs:420 |
ByteDecisionTree, ShardPlan/CaptureShardsManifest schemas, schema versions and default budgets are hand-duplicated in two trusted crates, kept in sync only by the id_tree_sha256 digest check and serde schemas. |
G2-R1-09 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/rustc-capture/src/ir.rs:879 |
Body::try_new is now only called from tests but stays in production trusted code behind #[cfg_attr(not(test), allow(dead_code))]. |
G2-R1-10 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/rustc-capture/src/lean.rs:406 |
Sharded capture permutes Program.bodies (the theorem subject's DefIds) into callee-first SCC order, but the trusted code does not explain why that leaves the theorem's meaning unchanged, and the ENTRY_DEF_ID comment's 'first captured body' now depends on shard CLI flags that the request does not record. |
G2-R1-11 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/rustc-capture/src/shard.rs:131 |
The new anneal-shards.json is a generated numeric-shard topology lockfile, which conflicts with the existing design doc's anneal-shards.json (a human-authored map from shard names to DefPath sets with Expected/Shard_* obligations), and the doc was not reconciled. |
G2-R1-01 [P1] (anneal/trusted/cargo-anneal/src/olean_cache.rs:368, Pass 2 §3 (trusted/cargo-anneal), static_verified): --no-rebuild-bundled fails open for TrustedBoundary (CacheKind::Inspector), silently recompiling the inspector on cache miss instead of failing closed.
- Invariant:
VerifyArgs::no_rebuild_bundled(anneal/trusted/cargo-anneal/src/verify.rs:247-249) contracts to fail closed rather than compilingTrusted.*,Anneal.*, orTrustedBoundarywhen absent from prebuilt or local.oleancaches. - Evidence:
stage.rs:3034-3036looks up the inspector withOleanCacheKeyInput { kind: CacheKind::Inspector, module: "TrustedBoundary".to_owned(), ... }.olean_cache.rs:368narrows the failure guard toif self.no_rebuild_bundled && is_cacheable_bundled_module(&input.module), whereis_cacheable_bundled_module(olean_cache.rs:197-201) checks onlymatches!(module, "Trusted" | "Anneal") || module.starts_with("Trusted.") || module.starts_with("Anneal.")and therefore returnsfalsefor"TrustedBoundary". On an inspector cache miss under--no-rebuild-bundled,lookup_bytesreturnsOk(None)andstage.rssilently compilesTrustedBoundary.lean. Guard withinput.kind == CacheKind::Inspector || is_cacheable_bundled_module(&input.module)and add a regression test forCacheKind::Inspector.
G2-R1-02 [P1] (anneal/trusted/cargo-anneal/src/stage.rs:411, Pass 2 §3 (trusted/cargo-anneal), static_verified): Disk .olean caching for untrusted Proof.Shard_* modules lacks sandbox isolation, allowing a tainted --allow-unsandboxed-elaboration run to populate cache entries silently reused by subsequent untainted sandboxed runs.
- Invariant:
THREAT_MODEL.md§2.1 and Receipt v3's Uniform Flag-Driven Taint Law require untainted sandboxed verification runs (taint_reasons: [],elaboration_sandbox: "linux_bwrap"/"linux_landlock_seccomp") never to silently accept untrustedTargetRole::Proofartifacts elaborated only outside the OS sandbox. - Evidence:
verify.rs:2243-2249setsSandboxMode::Unsandboxedunder--allow-unsandboxed-elaborationwhile keepingchecker.set_use_olean_cache(!args.no_cache).stage.rs:411-414andolean_cache.rs:206-210enable disk caching for authoredProof.Shard_*modules (TargetRole::Proof, exempt from syntactic preflight and allowed to executeby_elab/run_cmd).prepare_module_cache(stage.rs:439-448) buildsOleanCacheKeyInput(olean_cache.rs:66-75) without sandbox state, andfinish_module_artifacts(stage.rs:477-483, called fromstage.rs:2720-2730) unconditionally callsolean_cache.store_compiledeven whenruntime.backend == ActiveSandbox::Unsandboxed. A subsequent untainted run computes the identical key, skips sandboxed Lean elaboration via cache hit, and emits an untainted sandboxed receipt for aProof.Shard_*module that can depend on unsandboxed host access and fail underbwrap/Landlock. Disable target-shard disk cache reads/writes wheneversandbox_mode == SandboxMode::Unsandboxed(orActiveSandbox::Unsandboxed).
G2-R1-03 [P1] (anneal/trusted/cargo-anneal/src/stage.rs:447, Pass 2 §3 (trusted/cargo-anneal), static_verified): Target-shard OleanCache keys hash only direct imports (edge_list) instead of the transitive import closure, causing stale .olean cache hits and false kernel-replay failures when a two-hop upstream module changes without altering the intermediate .olean.
- Invariant: Content-addressed
.oleancaching for classic (is_lean_module: false) Lean modules must invalidate whenever any transitively imported.oleanin the module's elaboration environment changes. - Evidence:
write_setup_json_to_path(stage.rs:178) suppliestransitive_import_closure(&adm.graph, imports)tolean --setup, whereasprepare_module_cache(stage.rs:447) constructsOleanCacheKeyInput.importsviabuild_import_bindings(edge_list, &adm.artifacts, path_sha_cache)(olean_cache.rs:907-940), hashing only direct imports. In Lean 4.34.1 classic.oleanserialization (Lean/Environment.lean:109-128ModuleData,Lean/Setup.lean:25-34Import),.oleanfiles record import names/flags andConstantInfoterms without hashing imported.oleans. When an upstream moduleAchanges a definition body (e.g.,SpecHelper -> Spec -> Proof.Shard_000, orCaptured.Shard_000 -> Proof.Shard_000 -> Proof.Shard_001) while intermediateBonly referencesAsymbolically or re-exports it,B.oleanstays byte-identical,C(Proof.Shard_*) gets a stale cache hit skipping re-elaboration, andtarget-auditfalsely rejects valid proof source during fresh kernel replay until--no-cacheor cache eviction. Bind all transitive import artifact digests inOleanCacheKeyInput.imports.
G2-R1-04 [P2] (anneal/trusted/cargo-anneal/src/olean_cache.rs:12, Pass 2 §3 (trusted/cargo-anneal), static_verified): The olean cache docs still say only the inspector and bundled Trusted./Anneal. modules are cached, but this PR also caches target Captured.Shard_/Proof.Shard_/Proof.IdTree outputs, and the Human review surface reports no policy relaxation.
- Invariant: AGENTS.md Commenting in trusted/: trusted code must state accurate rationale, invariants and contracts; Code Review Rules: the Human review surface and commit body must disclose every intentional policy relaxation.
- Evidence: olean_cache.rs:12-17 still reads 'Only the static inspector (
TrustedBoundary.lean) and static bundledTrusted.*/Anneal.*runtime modules are cached', and line 63 describes OleanCacheKeyInput as 'for an inspector or bundled module'. Meanwhile olean_cache.rs:206-210 adds is_cacheable_target_shard_module and stage.rs is_cacheable_module enables it for target_rejection compiles, so outputs of untrusted proof modules now persist in the per-user disk cache across runs and crates. The cache keeps no record of how an entry was produced (e.g. sandbox mode). The PR's Human review surface block says 'Policy relaxations: none'. Integrity rests on content keys plus target-audit replay, which looks sufficient, but the documented cache-scope invariant was widened without updating the trusted doc or disclosing the change.
G2-R1-05 [P2] (anneal/trusted/cargo-anneal/src/cli.rs:71, General / Documentation, static_verified): The PR adds user-visible behavior (default-on sharding above 20 bodies that reorders DefIds, a shard-plan subcommand, --shard-/--verify-shard-plan flags, Captured/Shard_.lean and capture_shards.json artifacts, reserved Proof.IdTree/Captured./Expected. modules, shards/capture_shards_sha256 receipt fields) without updating the bundled cargo-anneal SKILL user doc.
- Invariant: AGENTS.md Standing rules > Documentation: add or update affected docs, examples and links in the same PR; docs-reviewer: flag stale text and missing guidance.
- Evidence: cli.rs:71 adds ShardPlan; verify.rs adds ShardArgs, verify_shard_plan and receipt fields; rustc-capture shard.rs DEFAULT_SHARD_MIN_BODIES=20 makes sharding the default and permutes Program.bodies. trusted/cargo-anneal/skills/cargo-anneal/SKILL.md (printed by
cargo anneal skill) is not in the diff: its proof_failed triage step still says to comparecapture/Captured.lean(where body definitions no longer live in sharded mode), it never mentions shard-plan or the flags, and the Receipt v3 section omits the new fields and reserved module names. Existing >20-body proofs that refer to Captured.body_N or body indices will see different bodies, with no migration guidance.
G2-R1-06 [P2] (anneal/trusted/rustc-capture/src/extract.rs:744, Pass 2 §2 (trusted/rustc-capture), static_verified): New trusted callee extraction works with rustc structures (ty::FnDef, Instance::try_resolve, TerminatorKind::Call func/args, Rvalue operands) but quotes no pinned rust-lang/rust source and silently skips other operand positions, so the documented call-edge DAG is only partial.
- Invariant: AGENTS.md: trusted/ code modeling Rust semantics or rustc structures must explain the correspondence and quote and cite rust-lang/rust at a pinned commit; trust-review Pass 2 §2 upstream citations.
- Evidence: extract.rs:741-819 (resolve_local_callee_identity, collect_operand_callee, collect_block_callees) carry only short docs with no pinned quote for Instance::try_resolve or the Call/Rvalue field semantics. collect_block_callees scans only Use/UnaryOp/Cast/BinaryOp and Call/SwitchInt, with
_ => {}at lines 801 and 816, so fn items in Aggregate, Repeat or other positions are dropped without a stated rationale. ir.rs:870-875 describes callees as 'extracted from MIR call terminators and function-item operands', and the commit presents callee_shards and the anneal-shards.json drift check as authenticated call topology. Body order and the theorem's meaning are unaffected, but the plan check can miss topology changes, and the trusted code lacks the required correspondence comments.
G2-R1-07 [P3] (anneal/trusted/cargo-anneal/src/olean_cache.rs:206, Pass 2 §3 (trusted/cargo-anneal), static_verified): Caching target shard modules adds new per-edit entries to the per-user disk cache, which has no eviction, so the cache grows without bound during proof iteration.
- Invariant: Robust, operationally bounded orchestrator behavior; base cache scope was a bounded set of bundled modules per toolchain.
- Evidence: olean_cache.rs contains no eviction/prune/LRU logic. sharded_capture_and_cache.rs:505-511 shows that each 1-body edit adds 2 new entries while keeping all old ones. Repeated edits to Proof.Shard_* and Captured.Shard_* therefore accumulate entries in XDG_CACHE_HOME/anneal/olean-cache indefinitely.
G2-R1-08 [P3] (anneal/trusted/cargo-anneal/src/shard.rs:420, Pass 2 §2/§3 (trusted/rustc-capture, trusted/cargo-anneal), static_verified): ByteDecisionTree, ShardPlan/CaptureShardsManifest schemas, schema versions and default budgets are hand-duplicated in two trusted crates, kept in sync only by the id_tree_sha256 digest check and serde schemas.
- Invariant: AGENTS.md trusted/ parsimony: limit bespoke TCB code; robust-code single source of truth.
- Evidence: cargo-anneal/src/shard.rs:390-512 and rustc-capture/src/shard.rs:372-516 implement the same decision-tree builder (with different initial best_thr/best_score values that happen not to matter), and both files define DEFAULT_SHARD_* and *_SCHEMA_VERSION. Divergence fails closed through the digest compare in verify.rs, but it doubles the human audit surface and creates a latent drift risk for the defaults (capture defaults are bypassed only because cargo-anneal passes explicit flags).
G2-R1-09 [P3] (anneal/trusted/rustc-capture/src/ir.rs:879, Pass 2 §2 (trusted/rustc-capture), static_verified): Body::try_new is now only called from tests but stays in production trusted code behind #[cfg_attr(not(test), allow(dead_code))].
- Invariant: trusted/ parsimony / zero dead code in the TCB.
- Evidence: ir.rs:879 adds
#[cfg_attr(not(test), allow(dead_code))]to try_new after extract.rs switched to try_new_with_callees. The wrapper could be #[cfg(test)] or removed instead of carrying a dead-code allowance in the capture TCB.
G2-R1-10 [P3] (anneal/trusted/rustc-capture/src/lean.rs:406, Pass 2 §2 (trusted/rustc-capture), static_verified): Sharded capture permutes Program.bodies (the theorem subject's DefIds) into callee-first SCC order, but the trusted code does not explain why that leaves the theorem's meaning unchanged, and the ENTRY_DEF_ID comment's 'first captured body' now depends on shard CLI flags that the request does not record.
- Invariant: AGENTS.md Commenting in trusted/: document rationale and invariants of capture-to-theorem-subject transformations.
- Evidence: rustc-capture shard.rs:667-677 builds a permutation and calls Manifest::reorder_bodies (ir.rs:1292-1332). lean.rs:398-408 still says 'a specification that reads the program's own entry sees the first captured body', which is now the topologically first body when N > --shard-min-bodies, and those flags are not part of request_sha256. The change is benign under ProgramVerified (every body is checked via entryProgForBody, specs are identity-keyed), but no trusted comment states this argument.
G2-R1-11 [P3] (anneal/trusted/rustc-capture/src/shard.rs:131, General / Documentation, static_verified): The new anneal-shards.json is a generated numeric-shard topology lockfile, which conflicts with the existing design doc's anneal-shards.json (a human-authored map from shard names to DefPath sets with Expected/Shard_* obligations), and the doc was not reconciled.
- Invariant: Documentation review: flag stale text and conflicting guidance in affected docs.
- Evidence: docs/build-systems-and-receipts.md:286-301 (§5) specifies
nominalmode consuming a checked-inanneal-shards.jsonmapping stable human-readable shard names to Rust DefPath sets, plus Expected/Shard_.lean obligations and Proof/Link.lean. The PR ships ShardPlan (rustc-capture shard.rs:131-146, cargo-anneal shard.rs:142-157) under the same filename with incompatible semantics (generated numeric shards, IdTree, BinChunkTree assembly) and leaves that doc untouched.
Executed Sandbox Probes
seat3pass1_hygiene_and_diff_scan: outcome=passed(rc=0)seat3rust_sharding_differential_and_scc_probe: outcome=passed(rc=0)seat3zerocopy_05_sharded_tryfrombytes_consistency: outcome=passed(rc=0)seat3lean_lock_and_trusted_boundary_syntax_scan: outcome=passed(rc=0)seat3lean_j1_standalone_kernel_probe: outcome=env_limited(rc=1)seat3rust_coarsening_stress_and_axiom_scan: outcome=passed(rc=0)seat3root_manifest_and_bundle_parity: outcome=passed(rc=0)
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — FINDINGS (tier2_tcb, Round 2)
- Identity:
one:128cb1c4514c2fdebb68712a5bcfdf5ea9a40ac0:de7dd14ee1020006a88e5d9fb9926ac726e424bb:197c299738a201b4a731b7a3cf1fe71b6794d14fc8f42b9e994e339efcb30841(base=e86eb0281380,head=3c1ec9d7bef1,tree=de7dd14ee102) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 32 inspected, 0 inapplicable, 0 blocked (of 32 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
5 | 985s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
2 | 1391s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1413s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R2-01 |
P2 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/olean_cache.rs:12 |
The TCB module invariant 'Only the static inspector and static bundled Trusted./Anneal. runtime modules are cached' is now false: the cache also stores compiled outputs of authored target proof modules and generated capture/IdTree modules. |
G2-R2-02 |
P2 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/olean_cache.rs:368 |
--no-rebuild-bundled fails open for TrustedBoundary (CacheKind::Inspector) because is_cacheable_bundled_module("TrustedBoundary") returns false. |
G2-R2-03 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/rustc-capture/src/extract.rs:741 |
New trusted MIR traversal (resolve_local_callee_identity / collect_operand_callee / collect_block_callees) has none of the required pinned rust-lang/rust quotes or citations and no rationale for its selective operand/terminator coverage, and the ir.rs callees doc overstates what is collected. |
G2-R2-04 |
P3 | 1 (seat1) | static_verified |
anneal/theory/Anneal/SccSharding/InterprocCallModel.lean:28 |
Bundled theory defines its own call semantics (evalInterprocStep / InterprocReturns), but nothing links it to Trusted.MirSemantics (which faults on any reachable call), and the module docs do not disclose this gap. |
G2-R2-05 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/cli.rs:71 |
User-facing cargo-anneal guidance is not updated for the new shard-plan subcommand, the --shard-*/--verify-shard-plan flags, the default sharded Captured/Shard_k layout with body reordering above 20 bodies, or the new receipt fields. |
G2-R2-06 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/rustc-capture/src/lean.rs:492 |
render_sharded_root is documented as a 'thin O(K) root' but emits one alias definition per body (O(N)). |
G2-R2-01 [P2] (anneal/trusted/cargo-anneal/src/olean_cache.rs:12, Pass 2 §3 (trusted/cargo-anneal), static_verified): The TCB module invariant 'Only the static inspector and static bundled Trusted./Anneal. runtime modules are cached' is now false: the cache also stores compiled outputs of authored target proof modules and generated capture/IdTree modules.
- Invariant: AGENTS.md 'Commenting in trusted/' (explicit, accurate invariants and contracts for human TCB review); trust-review Pass 2 §3/§5 cache policy must be accurately documented and justified.
- Evidence: olean_cache.rs:206 is_cacheable_target_shard_module admits 'Proof.IdTree' and any module name with prefix 'Captured.Shard_' or 'Proof.Shard_' (so any authored module named Proof.Shard_ qualifies); stage.rs:411-414 enables it when target_rejection is set, and :483-489 stores authored-module .oleans in the per-user disk cache for reuse across runs. The module doc at :12-13 still says only the inspector and bundled modules are cached, and the commit body says only 'enable incremental shard compilation caching' without stating that untrusted authored proof outputs now persist and are reused. Safety still rests on source/import-digest keying and target-audit replay (doc lines 14-17), but the stated invariant no longer matches the code.
G2-R2-02 [P2] (anneal/trusted/cargo-anneal/src/olean_cache.rs:368, Pass 2 §3 (trusted/cargo-anneal), static_verified): --no-rebuild-bundled fails open for TrustedBoundary (CacheKind::Inspector) because is_cacheable_bundled_module("TrustedBoundary") returns false.
- Invariant: VerifyArgs::no_rebuild_bundled (anneal/trusted/cargo-anneal/src/verify.rs:246-248) requires failing closed rather than compiling Trusted., Anneal., or TrustedBoundary when absent from prebuilt or local .olean caches.
- Evidence: anneal/trusted/cargo-anneal/src/stage.rs:3034-3065 calls self.olean_cache.lookup_bytes with OleanCacheKeyInput { kind: CacheKind::Inspector, module: "TrustedBoundary", ... }. At anneal/trusted/cargo-anneal/src/olean_cache.rs:368, the diff narrows
if self.no_rebuild_bundledtoif self.no_rebuild_bundled && is_cacheable_bundled_module(&input.module). Because is_cacheable_bundled_module (olean_cache.rs:197-201) matches only "Trusted", "Anneal", "Trusted.", and "Anneal.", "TrustedBoundary" evaluates to false; on a cache miss, lookup_bytes returns Ok(None) and stage.rs silently recompiles TrustedBoundary.lean instead of failing closed. The new unit test target_shard_cache_policy_allows_shards_while_no_rebuild_bundled_stays_strict (olean_cache.rs:1329-1388) only exercises CacheKind::Module ("Anneal.SccSharding"), missing CacheKind::Inspector. Gate oninput.kind == CacheKind::Inspector || is_cacheable_bundled_module(&input.module)and add a CacheKind::Inspector miss test under --no-rebuild-bundled.
G2-R2-03 [P2] (anneal/trusted/rustc-capture/src/extract.rs:741, Pass 2 §2 (trusted/rustc-capture), static_verified): New trusted MIR traversal (resolve_local_callee_identity / collect_operand_callee / collect_block_callees) has none of the required pinned rust-lang/rust quotes or citations and no rationale for its selective operand/terminator coverage, and the ir.rs callees doc overstates what is collected.
- Invariant: AGENTS.md 'Commenting in trusted/': code in trusted/ modeling rustc structures must explain the correspondence and quote and cite rust-lang/rust at a pinned commit; trust-review Pass 2 §2 upstream citations.
- Evidence: extract.rs:741-820 interprets ty::FnDef operand types, Instance::try_resolve, Rvalue::{Use,UnaryOp,Cast,BinaryOp} and TerminatorKind::{Call,SwitchInt} with a two-line doc and no upstream links, while the base file carries 82 pinned f8a08b68 citations (e.g. check_call_source at extract.rs:609-619, terminator() at :635-651). The traversal silently skips Aggregate/Repeat/Ref operands and TailCall/Drop terminators without rationale, yet ir.rs:870 says the edges are 'extracted from MIR call terminators and function-item operands'. Because returning calls are refused at capture time (extract.rs:646-647), the edges come only from diverging calls and fn-item operands and drive shard packing, callee_shards and anneal-shards.json drift detection, not the claim, so the impact is reviewability and accuracy of plan metadata rather than soundness.
G2-R2-04 [P3] (anneal/theory/Anneal/SccSharding/InterprocCallModel.lean:28, Pass 1 / General, static_verified): Bundled theory defines its own call semantics (evalInterprocStep / InterprocReturns), but nothing links it to Trusted.MirSemantics (which faults on any reachable call), and the module docs do not disclose this gap.
- Invariant: trust-review Pass 1 §4 seam integrity (no vacuous or disconnected intermediate predicates presented as verification capability); docs-reviewer accuracy.
- Evidence: Module doc (lines 26-34) says it 'Mechanizes multi-frame TerminatorKind.call push/return execution' and the PR body calls these 'zero-TCB theory models of direct, cyclic, and mutually recursive call verification', but Trusted.MirSemantics/Step.lean:744 maps .call to .fault .unsupported (Boundary.lean:174). No lemma relates InterprocReturns/InterprocExecutes to WellFormed/BodyVerified, so proofs about this model cannot discharge any CrateTheorem/UnitTheorem obligation. The module ships to all users via bundled_theory.json and the Anneal umbrella. Not unsound (the kernel checks Expected.claim), but it can mislead proof authors about what is supported.
G2-R2-05 [P3] (anneal/trusted/cargo-anneal/src/cli.rs:71, General (documentation), static_verified): User-facing cargo-anneal guidance is not updated for the new shard-plan subcommand, the --shard-*/--verify-shard-plan flags, the default sharded Captured/Shard_k layout with body reordering above 20 bodies, or the new receipt fields.
- Invariant: AGENTS.md Standing rules: Documentation (add or update affected docs in the same PR); docs-reviewer stale-text check.
- Evidence: cli.rs:71 adds Command::ShardPlan and verify gains global shard flags (verify.rs ShardArgs flatten). The bundled skill printed by
cargo anneal skill(trusted/cargo-anneal/skills/cargo-anneal/SKILL.md, unchanged) mentions none of these, and its step-0 triage at line 95 still says to compare 'capture/Captured.lean', which in sharded mode holds only aliases while the bodies are in capture/Captured/Shard_.lean. Sharding is on by default (DEFAULT_SHARD_MIN_BODIES=20) and reorders bodies into callee-first order, which changes body indices and Captured.body_N meaning for existing proofs over larger captures; this is undocumented outside code comments.
G2-R2-06 [P3] (anneal/trusted/rustc-capture/src/lean.rs:492, Pass 2 §2 (trusted/rustc-capture), static_verified): render_sharded_root is documented as a 'thin O(K) root' but emits one alias definition per body (O(N)).
- Invariant: AGENTS.md 'Commenting in trusted/' accuracy of trusted code comments.
- Evidence: lean.rs:492 doc says 'Render the thin
O(K)rootCaptured.leanmodule', while the loop over shards and 0..num_bodies emits adef body_{global_idx}alias for every body, so the root size grows with N, not K.
Executed Sandbox Probes
seat3Pass 1 repo hygiene, modes, TODOs, headers, root-manifest.sha256, and bundle-manifest parity: outcome=Exit 0: 32 changed regular 100644 UTF-8 files, 0 symlinks in changed set, 0 case/NFC collisions, 0 TODO markers, 0 private leaks, Fuchsia 2026 headers present on all new files, root-manifest.sha256 4/4 match, bundle-manifest 22/22 SHA-256 match.seat3Lean TrustedBoundary static rules, markdown links/wrapping, and bundled_theory.json byte-exactness: outcome=Exit 0: all 9 changed .lean files satisfy prelude/module/import-all/forbidden-token checks and Init imports are in foundation-lock.json/library-lock.json; bundled_theory.json matches render_bundled_theory byte-for-byte (777022 bytes); zero broken relative links/anchors.seat305_sharded_tryfrombytes index, Spec, and verify_zerocopy.discover_units validation: outcome=Exit 0: verify_zerocopy.discover_units discovers 5 units incl. 05_sharded_tryfrombytes; all 25 roots verified against Spec.lean, Shard_000 (0..19), Shard_001 (20..24), and Proof.lean; Spec04 predicates preserved.seat3Compiled Rust differential fuzzing of candidate rustc-capture/src/shard.rs and cargo-anneal/src/shard.rs: outcome=Exit 0: ByteDecisionTree UTF-8/prefix/empty/duplicate edge cases and rustc<->cargo render_id_tree_module parity passed; 50 randomized Tarjan SCC permutation-invariance, coarsening, ShardPlan parity, and cargo-anneal validation trials passed.seat3anneal/ci Python stdlib unit test suites: outcome=Exit 0 across the 11 stdlib suites (1 skipped: test_real_usr_bin_time_isolates_small_child_rss). Earlier unfiltered run failed in test_check_todo (missing rg) and test_check_job_dependencies (missing yq).seat3Standalone Lean 4.34.1 ByteDecisionTree UTF-8/prefix kernel check under prlimit --nproc=64: outcome=Exit 1 before parsing/elaboration: Lean C++ worker initialization failed with 'failed to create thread: Resource temporarily unavailable' under RLIMIT_NPROC=64 (--threads=0 panics in IO.Promise.new).
3c1ec9d to
64cc25e
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Dispositions & Verification Receipt
Finding Dispositions (Codex R0, Gate 2 Round 1, Gate 2 Round 2)
Local Verification Executed on
|
|
Authored by an AI agent acting on joshlf's behalf. Rebase onto
|
64cc25e to
a7a63e9
Compare
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 3)
- Identity:
one:82c0cdf282466f67d0ad6ab42a4a113aed5b44f5:d43fc1a90264a3700a6c0abd41395a1ea3a23c06:552a896a27dd37b94606e67df52992c21e665fce517e0676324b9090f37e7013(base=dfdc3ee94993,head=a7a63e92ef45,tree=d43fc1a90264) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 37 inspected, 0 inapplicable, 0 blocked (of 37 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 2200s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 2011s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1233s |
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/docs/testing-architecture.md:136): File-tree listings for cargo-anneal/src and rustc-capture/src omit the new shard.rs modules (file not touched by this PR).G2-R3-A02[P3] (anneal/trusted/cargo-anneal/skills/cargo-anneal/SKILL.md:91): Says sharding is 'transparent for Proof' while later stating that positional proofs over more than 20 bodies must change.G2-R3-A03[P3] (anneal/trusted/cargo-anneal/src/stage.rs:2481): Pass literalfalseinstead oftarget_rejectionforallow_target_shard_cachein the unsandboxed branch.G2-R3-A04[P3] (anneal/trusted/cargo-anneal/src/verify.rs:964): The reserved-module tightening (any Captured.* / Expected.* first segment) is not mentioned in the commit body.G2-R3-A05[P3] (anneal/trusted/rustc-capture/src/ir.rs:1312): reorder_bodies remaps only selected[].body_index; it would silently mis-target call callees once capture emits DefId-bearing call terminators.G2-R3-A06[P3] (anneal/trusted/rustc-capture/src/lean.rs:409): In sharded runs, body order and entryDefId := 0 depend on --shard-* flags that are recorded in neither request_sha256 nor the receipt.
Executed Sandbox Probes
seat3Pass 1 hygiene, headers, Lean excluded-token scan, and trusted/root-manifest.sha256 check in bwrap: outcome=passedseat3Static parity, bundle/skill consistency, doc link/wrap audit, and zerocopy/05 cross-check in bwrap: outcome=passedseat3Extracted Rust Tarjan SCC, bucket packing, and ByteDecisionTree compilation + adversarial fuzzing via rustc --test in bwrap: outcome=passedseat3Theory Init.* import lock and tactic allowlist scan in bwrap: outcome=passedseat3CI Python unittest suite execution in bwrap: outcome=passed_with_skipseat3Standalone Lean 4.34.1 UTF-8 encoding probe in bwrap: outcome=errored_env_limitseat3Mandatory workflow permissions/auth/secret-containment checklist (.github/workflows/*.yml): outcome=inapplicable
a7a63e9 to
d3b0627
Compare
|
Authored by an AI agent acting on joshlf's behalf. Rebase onto
|
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — FINDINGS (tier2a_core_tcb, Round 4)
- Identity:
multi:9be5762cf8b1c31cae6ba72b4e99fdb01a7a60a1:d3b06271e0e37201c5786456a506d696bb27fc2a(base=9be5762cf8b1,head=d3b06271e0e3,tree=0c13b72bdf90) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 37 inspected, 0 inapplicable, 0 blocked (of 37 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 2930s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 3061s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
1 | 3004s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R4-01 |
P1 | 1 (seat3) | probe_confirmed |
anneal/trusted/rustc-capture/src/lean.rs:480 |
Default Tarjan SCC sharding (N > 20 bodies) emits non-module Captured/Captured.Shard_*/Proof.IdTree files (is_lean_module: false), forcing Expected.lean to drop module (verify.rs:2554) and causing Lean 4.34.1 to reject any module-mode Proof.lean (including fresh cargo anneal init / skill --example scaffolds and 01..04-style proofs) with error: cannot import non-'module' Expected from 'module', contradicting SKILL.md:102 ('Sharding is transparent for Proof unless Proof/Shard_.lean is authored'). |
G2-R4-01 [P1] (anneal/trusted/rustc-capture/src/lean.rs:480, anneal/trusted/rustc-capture/src/lean.rs:480,513; anneal/trusted/cargo-anneal/src/shard.rs:30,233; anneal/trusted/cargo-anneal/src/verify.rs:2554; anneal/trusted/cargo-anneal/skills/cargo-anneal/SKILL.md:75-115, probe_confirmed): Default Tarjan SCC sharding (N > 20 bodies) emits non-module Captured/Captured.Shard_*/Proof.IdTree files (is_lean_module: false), forcing Expected.lean to drop module (verify.rs:2554) and causing Lean 4.34.1 to reject any module-mode Proof.lean (including fresh cargo anneal init / skill --example scaffolds and 01..04-style proofs) with error: cannot import non-'module' Expected from 'module', contradicting SKILL.md:102 ('Sharding is transparent for Proof unless Proof/Shard_.lean is authored').
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/skills/proof-scaling/SKILL.md:64): The pass1-bundled-modules list omits Anneal.SccSharding.InterprocCallModel even though it is registered in theory/bundle-manifest.json.G2-R4-A02[P3] (anneal/trusted/cargo-anneal/src/olean_cache.rs:25): The stated rationale that cached target shard .oleans are 'replayed by target-audit (0 new TCB assumptions)' is overstated for Capture-role Captured.Shard_* modules.G2-R4-A03[P3] (anneal/trusted/cargo-anneal/src/stage.rs:2605): The unsandboxed cache-skip test does not fail if either guard alone is removed, and the guard for SandboxMode::Auto falling back to no sandbox (ActiveSandbox::None) is untested.G2-R4-A04[P3] (anneal/trusted/cargo-anneal/src/stage.rs:5298): Unit test target_shard_disk_cache_skips_reads_and_writes_when_unsandboxed does not seed a pre-existing disk cache entry to dynamically exercise the unsandboxed read-skip path.G2-R4-A05[P3] (anneal/trusted/rustc-capture/src/extract.rs:830): Comment says InlineAsm terminators contain no static ty::FnDef targets, but InlineAsmOperand::SymFn exists at the pinned rustc commit.G2-R4-A06[P3] (anneal/trusted/rustc-capture/src/lean.rs:161): Sharding turns on by default above 20 bodies and renumbers program.bodies and the Captured.body_N aliases, so an unchanged spec or proof that refers to bodies by position silently changes subject after upgrading.G2-R4-A07[P3] (anneal/trusted/rustc-capture/src/shard.rs:949): verify_shard_plan_file prints the staged plan_path in its drift remediation hint when invoked via cargo anneal verify --verify-shard-plan.
Executed Sandbox Probes
seat2ci/check_skills.py in isolated bwrap (--unshare-all --clearenv --ro-bind): outcome=Passed with zero errors.(rc=0)seat2CI Python unittest suite (test_perf_tracking, test_perf_workflow, test_render_perf_dashboard, test_verify_zerocopy, test_prebuild_bundled_oleans) in isolated bwrap: outcome=Ran 58 tests in 16.937s: OK (57 passed, 1 skipped for unavailable /usr/bin/time).(rc=0)seat2verify_zerocopy.discover_units on candidate zerocopy/proofs in isolated bwrap: outcome=Discovered all 5 proof units cleanly (01 through 05_sharded_tryfrombytes).(rc=0)seat3repo_hygiene_static: outcome=passedseat3workflow_permissions_auth_secret_containment_checklist: outcome=not_applicableseat3bwrap_root_manifest_sha256: outcome=passedseat3bwrap_parity_and_ci_python_unittests: outcome=passedseat3bwrap_rust_tarjan_decision_tree_and_tamper_fuzz: outcome=passedseat3bwrap_lean4_seam_equivalence_and_module_import_check: outcome=failed
d3b0627 to
29f4c95
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (Post-
|
29f4c95 to
e6f6d65
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (Post-
|
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — FINDINGS (tier2a_core_tcb, Round 5)
- Identity:
multi:cf81f0e51aeff036a58ccf0b42d4f52adeaf255e:e6f6d653451f60bef1227be9a2c12e0f33219c2d(base=cf81f0e51aef,head=e6f6d653451f,tree=06d35ccebadd) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 36 inspected, 0 inapplicable, 0 blocked (of 36 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
1 | 2012s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1660s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1445s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R5-01 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:5839 |
The regression test for the unsandboxed target-shard cache gate passes even if the gate at stage.rs:2706 is deleted, because its module order contains no bundled module, so the disk cache context is never created. |
G2-R5-01 [P2] (anneal/trusted/cargo-anneal/src/stage.rs:5839, Pass 2 §3 (trusted/cargo-anneal) / General test adequacy, static_verified): The regression test for the unsandboxed target-shard cache gate passes even if the gate at stage.rs:2706 is deleted, because its module order contains no bundled module, so the disk cache context is never created.
- Invariant: Security-relevant guards must have regression tests that fail when the guard is disabled (Code Review Rules: test adequacy and negative-test sensitivity). The claimed invariant (olean_cache.rs module docs; stage.rs:2704-2708) is that unsandboxed runs never read or write target-shard disk cache entries shared with sandboxed runs.
- Evidence: In compile_lean_modules_parallel, cache_ctx is Some only if has_cacheable, which is computed with allow_target_cache_context = target_rejection && sandbox_mode != Unsandboxed (stage.rs:2530-2546). The test's order is [Proof.IdTree, Captured.Shard_000, Proof.Shard_000] (stage.rs:5903) with SandboxMode::Unsandboxed, so has_cacheable is false, cache_ctx is None, and prepare_module_cache returns CompileNeeded(None) before ever consulting allow_target_shard_cache (stage.rs:2706-2708). Replacing that guard with plain
target_rejectionstill yields 3 compiles and no disk cache, so the test passes. In production the guard is load-bearing: target.rs:1195 compiles demand-driven bundled Anneal.* modules in the same batch, and the generated Proof.IdTree always imports Anneal.SccSharding.BinChunkTree when sharding is active, so cache_ctx is Some and only stage.rs:2706 keeps unsandboxed shard oleans out of the shared cache. Fix: add a bundled module (e.g. Trusted.MirAst or Anneal.SccSharding.BinChunkTree) to the test's order/sources/imports so cache_ctx is created, and keep asserting no target-shard entries are written or read.
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/tests/cargo-anneal/tests/cli.rs:2495): The CLI --verify-shard-plan drift test uses a fake-capture stub that ignores --verify-shard-plan, exercising verify.rs's post-capture compare_shard_plan fallback rather than anneal-rustc-capture's pre-publication check.G2-R5-A02[P3] (anneal/theory/Anneal/SccSharding/BinChunkTree.lean:39): Doc comment wraps an inline-code span across two lines (same check warning in InterprocCallCanary.lean:298,399 and rustc-capture/src/extract.rs:1354).G2-R5-A03[P3] (anneal/trusted/cargo-anneal/src/cli.rs:302): Exit codes differ betweenverify --verify-shard-plandrift (exit 2) andshard-plan --checkdrift (exit 1), though both fail closed.G2-R5-A04[P3] (anneal/trusted/cargo-anneal/src/verify.rs:2075): Passing the private staged copy work/expected-shard-plan.json to anneal-rustc-capture --verify-shard-plan causes capture's drift hint to cite the temporary staging path instead of the operator-supplied plan path.G2-R5-A05[P3] (anneal/trusted/cargo-anneal/src/verify.rs:2478): The Human review surface block could not be checked: no Review Receipt or branch handoff was supplied, only the commit/PR body, which does disclose the wider target-shard olean cache scope.G2-R5-A06[P3] (anneal/trusted/rustc-capture/src/lean.rs:568): Body order and the body that entryDefId := 0 names now depend on --shard-* flags, which are not recorded in request_sha256 or in the receipt's shards manifest; replaying a receipt requires knowing those flags.G2-R5-A07[P3] (anneal/trusted/rustc-capture/src/shard.rs:758): Hygiene script flags missing upstream SHA citation note and a wrapped inline-code comment span, plus cross-crate ByteDecisionTree rendering duplication with cargo-anneal.
Executed Sandbox Probes
seat3repo_hygiene_and_unicode_audit: outcome=passedseat3lean_template_hygiene_and_token_scan: outcome=passedseat3manifest_bundle_and_merge_tree: outcome=passedseat3zerocopy_unit_discovery_and_callgraph_check: outcome=passedseat3python_ci_unittests_bwrap: outcome=passedseat3probe_a_tarjan_and_decision_tree_rustc_bwrap: outcome=passedseat3probe_b_lean_olean_shards_and_utf8_bwrap: outcome=passedseat3probe_c_manifest_validation_and_ast_nodes_rustc_bwrap: outcome=passedseat3workflow_checklist_item_1_permissions_least_privilege: outcome=naseat3workflow_checklist_item_2_untrusted_triggers: outcome=naseat3workflow_checklist_item_3_secret_containment: outcome=naseat3workflow_checklist_item_4_release_environments: outcome=naseat3workflow_checklist_item_5_checkout_and_pinned_shas: outcome=naseat3workflow_checklist_item_6_script_injection: outcome=naseat3workflow_checklist_item_7_cache_artifact_trust: outcome=naseat3workflow_checklist_item_8_no_guard_relaxation: outcome=na
e6f6d65 to
9ffed1c
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (Post-
|
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — FINDINGS (tier2a_core_tcb, Round 6)
- Identity:
multi:d5c1f12b6d2a6804ccb6b41f4ec3641875cd20ea:9ffed1c23604c6002f680bc41763e596a78d0ca9(base=d5c1f12b6d2a,head=9ffed1c23604,tree=77dd5339f78f) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 36 inspected, 0 inapplicable, 0 blocked (of 36 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 701s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1992s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
1 | 1403s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R6-01 |
P2 | 1 (seat3) | probe_confirmed |
anneal/trusted/rustc-capture/src/extract.rs:1307 |
resolve_local_callee_identity formats local lifetime-generic method callees using instance_identity (erased '_) while body_inner assigns Body.identity using item_identity (named 'a), silently dropping call edges and splitting Tarjan SCCs. |
G2-R6-01 [P2] (anneal/trusted/rustc-capture/src/extract.rs:1307, Pass 2 §2 (trusted/rustc-capture), probe_confirmed): resolve_local_callee_identity formats local lifetime-generic method callees using instance_identity (erased '_) while body_inner assigns Body.identity using item_identity (named 'a), silently dropping call edges and splitting Tarjan SCCs.
- Invariant: All intra-crate call edges returned by
extract::bodyfor captured local bodies must match the canonicalBody.identitystrings of those target bodies socompute_tarjan_sccspreserves strongly connected components and callee-first topological order. - Evidence:
body_inner(extract.rs:1758-1801) captures uninstantiated defs whose generics are purelyGenericParamDefKind::Lifetimeunderitem_identity(tcx, def.to_def_id()), producing e.g.rust-path-v1::Wrap::<'a>::step_bandrust-path-v1::<Wrap<'a> as MyMarker>::mark. Inresolve_local_callee_identity(extract.rs:1307-1331),ty::Instance::try_resolve(tcx, typing_env, def_id, args)succeeds when!args.has_non_region_param()and erases regions toReErased; because!inst.args.is_empty()(e.g.raw_args_len=1), it returnsinstance_identity(tcx, inst)(rust-path-v1::Wrap::<'_>::step_b,rust-path-v1::<Wrap<'_> as MyMarker>::mark). Exact lookupnode_to_idx.get(callee.as_str())inanneal/trusted/rustc-capture/src/shard.rs:236then drops those edges. Confirmed viarustc_privateprobe (CALLEE_EXIT=0). Lean soundness (ProgramVerified) is unaffected.
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/perf_budgets.json:103): The verified_units_count floor of 5 is below the 7 proof units present after this PR, so it would not catch the loss of up to two units.G2-R6-A02[P3] (anneal/docs/architecture.md:556): The architecture theory-module list and directory tree were not updated for theory/Anneal/SccSharding*.G2-R6-A03[P3] (anneal/tests/cargo-anneal/tests/suite/anti_vacuity_and_e2e.rs:130): The large-list balancing test now passes whether or not sharding is active, so the unsharded chunked-list path is no longer exercised end to end for captures over 20 bodies.G2-R6-A04[P3] (anneal/trusted/cargo-anneal/src/olean_cache.rs:21): Disk-cache reuse now covers Capture-role Captured.Shard_* .olean files, whose definitions are imported directly into the verdict environment, while the module doc still implies target-audit replay covers them.G2-R6-A05[P3] (anneal/trusted/rustc-capture/src/lean.rs:564): Sharded body order, and therefore what entryDefId := 0 and positional indices denote, depends on --shard-* flags that are not part of request_sha256, and the spec vacuity lint does not flag specs that use entryDefId or positions.
Executed Sandbox Probes
seat3ci_unittest_targeted: outcome=passedseat3bundle_manifest_and_hygiene: outcome=passedseat3lean_syntax_and_trust_tier_scan: outcome=passedseat3bdt_and_tarjan_differential_probe: outcome=passedseat3ast_nodes_and_tag_probe: outcome=passedseat3rustc_private_callee_identity_probe: outcome=finding_confirmedseat3lean_bwrap_compile_boundary_probe: outcome=blocked_by_sandbox_limit
9ffed1c to
277b86a
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (Post-
|
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 7)
- Identity:
one:4e27f9228880629176b58ab281734f449f7a8a5e:717c4441497b55088574f5441ac9c98430b99d5b:dc3964d133e91e0ac6470cf583ad69cfb097becb974ad320ee240fac83c73d22(base=63388fa55d05,head=277b86ac30d9,tree=717c4441497b) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 35 inspected, 0 inapplicable, 0 blocked (of 35 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 603s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1883s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 423s |
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-R7-A01[P3] (anneal/trusted/cargo-anneal/src/shard.rs:453): ByteDecisionTree construction and Lean rendering (~275 lines) are duplicated between rustc-capture/src/shard.rs and cargo-anneal/src/shard.rs.G2-R7-A02[P3] (anneal/trusted/cargo-anneal/src/verify.rs:1): No Review Receipt / Human review surface block was present in the supplied PR metadata, so its completeness could not be verified (the commit body does disclose the cache-policy expansion and body reordering).G2-R7-A03[P3] (anneal/trusted/cargo-anneal/src/verify.rs:907): CaptureProgram deserializes bodies as Vecserde::de::IgnoredAny rather than cross-checking capture.json body identities against capture_shards.json shards[*].identities.G2-R7-A04[P3] (anneal/trusted/rustc-capture/src/ir.rs:1368): Body.callees doc says callees are 'projected into capture_shards.json', but only per-shard callee_shards indices are emitted; raw callee identities are not.G2-R7-A05[P3] (anneal/trusted/rustc-capture/src/lean.rs:564): Body order, and so what entryDefId := 0 and positional Specs.property terms refer to, depends on --shard-* flags that are not in request_sha256, and the shard config values are not recorded in the receipt.G2-R7-A06[P3] (anneal/trusted/rustc-capture/src/lean.rs:635): render_shard_module doc places shard_bodies 'inside Proof/Shard_.lean with list literals <= MAX_LIST_CHUNK_LEN', but it is emitted in Captured/Shard_.lean as a balanced append over singleton [body_i] leaves.
Executed Sandbox Probes
seat3Pass 1 repo-wide hygiene scan (modes, symlinks, submodules, Unicode/bidi, caches, TODO, Fuchsia headers, banned Lean tokens): outcome=passedseat3bwrap sha256sum --check --strict trusted/root-manifest.sha256: outcome=passedseat3bwrap python3 -B -s -m unittest discover -s ci -p 'test_perf_*.py': outcome=passedseat3bwrap python3 -B -s ci/test_check_pr_hygiene.py: outcome=passedseat3bwrap verify_zerocopy.discover_units + expected_unit_profile: outcome=passedseat3bundle-manifest.json SHA-256 verification: outcome=passedseat3Differential byte_list_tag vs Lean Trusted.MirSemantics.byteListTag: outcome=passedseat3bwrap rustc --edition 2024 adversarial ByteDecisionTree::build/eval probe: outcome=passedseat3bwrap lean 4.34.1 non-module file importing module-mode artifact: outcome=passedseat3Mandatory workflow permissions/auth/secret-containment checklist: outcome=not_applicableseat3Full Cargo test suite / lake build / live cargo anneal verify on 05_sharded_tryfrombytes: outcome=skipped_light_mode
277b86a to
b5623d1
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (Post-
|
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — FINDINGS (tier2a_core_tcb, Round 8)
- Identity:
one:1c54a9f3bafed7632aa265eb3b2d228955201f31:b616ea58010453c6d6caf61035eaf6b72dcce6e8:824bb061d480965db51262d32dbed66959fb72b5a0b5854a509bd925d7fa5638(base=9fe014fb974e,head=b5623d139954,tree=b616ea580104) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 35 inspected, 0 inapplicable, 0 blocked (of 35 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
2 | 1440s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
3 | 1337s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
2 | 1366s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R8-01 |
P1 | 3 (seat1, seat2, seat3) | probe_confirmed |
anneal/trusted/cargo-anneal/src/verify.rs:2521 |
Generated Proof.IdTree is staged at generated/Proof/IdTree.lean with role proof, but inspect --verify-artifacts resolves non-Anneal proof-role sources under authored/, so retained evidence for every sharded run fails artifact verification. |
G2-R8-02 |
P1 | 3 (seat1, seat2, seat3) | probe_confirmed |
anneal/trusted/cargo-anneal/src/verify.rs:2958 |
Sharded verification adds root Receipt v3 fields capture_shards_sha256 and shards that the unchanged inspect schema treats as unrecognized, so default cargo anneal inspect rejects every sharded success receipt. |
G2-R8-01 [P1] (anneal/trusted/cargo-anneal/src/verify.rs:2521, Pass 2 §3 (trusted/cargo-anneal), probe_confirmed): Generated Proof.IdTree is staged at generated/Proof/IdTree.lean with role proof, but inspect --verify-artifacts resolves non-Anneal proof-role sources under authored/, so retained evidence for every sharded run fails artifact verification.
- Invariant: Cross-file contract inside trusted/cargo-anneal: every audit.sources entry in a success receipt must resolve to its retained source under the role-to-directory mapping used by
inspect --verify-artifacts. - Evidence: Trigger:
cargo anneal verify --artifacts <DIR>followed bycargo anneal inspect <receipt.json> --verify-artifacts <DIR>on any sharded verification run (> 20 bodies).verify.rs:2520-2528writesProof.IdTreetowork.join('generated/Proof/IdTree.lean')withrole: TargetRole::Proof;target.rs:1010-1021,1220-1230retains non-bundled modules inaudit.sourceswithrole = 'proof';retain_stagecopies<DIR>/generated/Proof/IdTree.lean. Yetverify_retained_artifacts(inspect.rs:872-878) maps everyrole == 'proof'entry other thanAnneal/Anneal.*strictly toauthored/{mod_path}.lean(authored/Proof/IdTree.lean->ENOENT), forcingexact_match = falseand exit1even under--passive(inspect.rs:366-370). In addition,inspect.rs:818-828hashesrequest.jsonandcapture/capture.jsonbut never hashescapture/capture_shards.jsonagainstcapture_shards_sha256. Confirmed viabwrapcross-module contract check.
G2-R8-02 [P1] (anneal/trusted/cargo-anneal/src/verify.rs:2958, Pass 2 §3 (trusted/cargo-anneal), probe_confirmed): Sharded verification adds root Receipt v3 fields capture_shards_sha256 and shards that the unchanged inspect schema treats as unrecognized, so default cargo anneal inspect rejects every sharded success receipt.
- Invariant: Cross-file contract inside trusted/cargo-anneal: receipts emitted by
verifymust validate under the same binary's defaultinspectpolicy, which fails closed on unrecognized root fields unless --passive is given. - Evidence: Trigger: verifying any crate/unit with >
--shard-min-bodies(20) bodies, such aszerocopy/proofs/05_sharded_tryfrombytes/request.json(25 roots).verify.rs:2956-2960insertscapture_shards_sha256andshardsinto Receipt v3 (andtestkit/src/assertions.rsadded both fields). Incore/inspect/schema.rs:688-1194,parse_success_receiptnever visits either field, soroot.collect_unrecognized(&mut unknown)(schema.rs:597) populates['/capture_shards_sha256', '/shards']. Because defaultcargo anneal inspectruns--check(!args.passive,inspect.rs:357) with--unknown-fields=warn(inspect.rs:160-161) andevaluate_policy(schema.rs:456-469) rejects unrecognized fields in warn+check mode, defaultinspectexits1,--unknown-fields=denyexits2(inspect.rs:327-332), andinspect --diffexits1or2(inspect.rs:270-282,302-315). Confirmed viabwrapcontract extraction (UNRECOGNIZED_IN_SCHEMA: ['capture_shards_sha256', 'shards']) andgrepreturning 0 matches ininspect.rsandcore/inspect/.
Non-blocking advisories (P3, not Gate 2 findings)
These notes do not block merge and do not require another Gate 2 round.
G2-R8-A01[P3] (anneal/ci/perf_budgets.json:103): Untouched docs still describe the verified-units floor as >= 4 after the budget was raised to 5.G2-R8-A02[P3] (anneal/trusted/cargo-anneal/src/olean_cache.rs:226): The head-bound Review Receipt lists touched surfaces but has no policy-relaxation line.G2-R8-A03[P3] (anneal/trusted/cargo-anneal/src/shard.rs:215): Several new fail-closed guards have no negative test.G2-R8-A04[P3] (anneal/trusted/cargo-anneal/src/verify.rs:1015): reserved_proof_module does not reserve Proof.IdTree when sharding is inactive, allowing authored Proof.IdTree modules that later collide once body count crosses shard_min_bodiesG2-R8-A05[P3] (anneal/trusted/rustc-capture/src/lean.rs:626): Shard budget flags change body order and which body entryDefId 0 names, but are not part of request_sha256 and are not recorded for unsharded runs.
Executed Sandbox Probes
seat3static_hygiene_pass1: outcome=passedseat3git_diff_check_and_pr_hygiene: outcome=passedseat3ci_python_unittests: outcome=passedseat3verify_zerocopy_sharded_receipt_v3: outcome=passedseat3lean_module_vs_non_module_compat: outcome=passedseat3markdown_relative_links: outcome=passedseat3inspect_schema_and_artifacts_contract: outcome=failedseat3zerocopy_05_sharded_consistency: outcome=passedseat3rustc_shard_algorithm_probes: outcome=passedseat3lean_id_tree_splitlex_syntax: outcome=passedseat3workflow_permissions_checklist: outcome=inapplicable
b5623d1 to
edf9845
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (
|
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (
|
edf9845 to
d1f4529
Compare
Partition large MIR captures (`N > shard_min_bodies`, default budget:
20 min / 20 max bodies, 2500 max AST nodes) into an acyclic
condensation DAG of Lean 4 `module`-mode `Captured.Shard_<k>` `.olean`
modules and prove whole-crate soundness compositionally at `O(log N)`
root proof depth in pure zero-TCB Lean theory, leaving
`anneal/trusted/lean/` and `anneal/trusted/audit/` untouched.
Capture sharding (`anneal/trusted/rustc-capture`):
- Exhaustively extract static intra-crate `ty::FnDef` call edges from
MIR assign rvalues and call/tail-call/branch/assert/yield
terminators (including diverging `target: None` calls) with pinned
`rust-lang/rust` citations (`extract.rs`, `ir.rs`), and include
Profile v2 IR variants plus rendered `Body.identity`
`_root_.String.ofList` / `_root_.Char.ofNat` nodes in
`Body::ast_nodes`.
- Compute permutation-invariant Tarjan strongly connected components in
deterministic callee-first topological order, pack adjacent components
up to `--shard-max-bodies` and `--shard-max-ast-nodes` while keeping
multi-body recursive cycles together and marking single oversized
cyclic/large SCCs (`shard.rs`). When sharding is active,
`Captured.program.bodies` is reordered into canonical callee-first
order (remapping intra-crate `Terminator::Call` callee indices) and
`entryDefId := 0` names canonical body `0`, so sharded specs must
identify targets by `Body.identity`.
- Emit Lean 4 `module`-mode `Captured/Shard_<k>.lean` per-shard modules,
a `module`-mode balanced binary `Captured.lean` assembly (preserving
`mir_profile_version` and `overflow_checks`), and
`capture_shards.json` (`is_lean_module: true`) with SHA-256 digests,
`callee_shards` DAG edges, `global_def_id_range`, and
`id_tree_sha256` (`lean.rs`, `publication.rs`, `lib.rs`, `shard.rs`),
so sharding stays transparent to `module`-mode proofs.
Zero-TCB theory bridge (`anneal/theory/Anneal/SccSharding*`):
- Add `Anneal.SccSharding.BinChunkTree` (re-exported by
`Anneal.SccSharding` and registered in `bundle-manifest.json`):
balanced `BinChunkTree` container, guaranteed `O(log N)`-depth
`ByteDecisionTree` (`splitByte`, `splitTag`, `splitLex`) identity
uniqueness checker (`allIdx`, `checkBodyIdentityAt`),
`LocalBodyVerified`, `TreeLocalVerified`, non-unfolding root builders
(`toList_branch`, `size_branch`, `wf_branch`, `allIdx_branch`), and
`programVerified_of_shardedTree` / `crateTheorem_of_shardedTree`.
- Add `Anneal.SccSharding.InterprocCallModel` and
`InterprocCallCanary` as standalone zero-TCB operational models of
direct, cyclic, and mutually recursive `BinChunkTree` call dispatch
(not yet bridged to `CrateTheorem` or `UnitTheorem` obligations), plus
`splitTag`/`splitLex` `rfl` evaluation canaries.
Orchestration, receipt inspection, and first-customer coverage:
- Add `cargo anneal shard-plan` (`--write` / `--check`) and
`--verify-shard-plan` drift checks across `cargo-anneal` and
`anneal-rustc-capture` (`cli.rs`, `shard.rs`, `verify.rs`) and
document the sharding workflow, Receipt v3 shard fields, and numeric
`ShardPlan` v1 vs planned `nominal` mode in
`trusted/cargo-anneal/skills/cargo-anneal/SKILL.md` and
`docs/build-systems-and-receipts.md`.
- Validate `capture_shards.json` structural, `is_lean_module: true`,
DAG, `total_sccs`, `cyclic_sccs`, `scc_ids` partition, and
`oversized_scc` singleton invariants (`shard.rs`), generate
`module`-mode `Proof.IdTree` identically across capture and
verification, and record `capture_shards_sha256` and `shards` in
Schema v3 receipts.
- Extend pure `cargo anneal inspect` (`core/inspect/{schema,diff,
render}.rs`) to parse, validate, diff, and render
`capture_shards_sha256` and `shards` (binding `Proof.IdTree` and
`Captured.Shard_*` hashes against `audit.sources`), and update
`inspect --verify-artifacts` (`inspect.rs`) to hash
`capture/capture_shards.json` (with manifest parity) and resolve
sharded `Proof.IdTree` under `generated/Proof/IdTree.lean`.
- Extend `OleanCache` (`olean_cache.rs`, `stage.rs`, `verify.rs`) beyond
`TrustedBoundary` (`CacheKind::Inspector`) and bundled libraries to
cache sandboxed target shard outputs (`Proof.IdTree`,
`Captured.Shard_*`, `Proof.Shard_*`) with `v2` transitive import
Merkle keys, skipping target shard reads/writes under unsandboxed
elaboration (`SandboxMode::Unsandboxed` / `ActiveSandbox::None`) and
keeping `--no-rebuild-bundled` fail-closed on inspector and bundled
misses.
- Add regression tests in `tests/rustc-capture/tests/typed_capture.rs`,
`tests/cargo-anneal/tests/{cli,inspect}.rs`,
`tests/cargo-anneal/tests/suite/{anti_vacuity_and_e2e,
sharded_capture_and_cache}.rs`, ratchet `anneal/ci/perf_budgets.json`
`verified_units_count` from `4` to `5` (and update
`test_perf_{tracking,workflow}.py` fixtures), plus add the verbatim
25-item `module`-mode `zerocopy/proofs/05_sharded_tryfrombytes` unit
and `anneal/skills/proof-scaling/SKILL.md` guidance.
Agent-authored-by: AI agent acting on joshlf's behalf
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt (
|
d1f4529 to
7494a33
Compare
joshlf
left a comment
There was a problem hiding this comment.
Authored by an AI agent acting on joshlf's behalf.
Gate 2 Independent Cross-Family Review — CLEAN (tier2a_core_tcb, Round 9)
- Identity:
multi:f43546b35cb0b0a90ead160bc2c1fc0c750fed69:7494a33fe5882cc378dc123c592df34125e230b0(base=f43546b35cb0,head=7494a33fe588,tree=d6965bb384e5) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 41 inspected, 0 inapplicable, 0 blocked (of 41 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 2309s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1302s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 2027s |
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-R9-A01[P3] (anneal/tests/cargo-anneal/tests/suite/anti_vacuity_and_e2e.rs:129): balances_large_captured_lists_through_lean_and_target_audit now runs the sharded path by default, so the unsharded balanced bodies_chunk_* path no longer has target-audit e2e coverage.G2-R9-A02[P3] (anneal/trusted/cargo-anneal/src/shard.rs:1): ByteDecisionTree and render_id_tree_module are duplicated across rustc-capture and cargo-anneal and must stay byte-identical; drift fails closed but adds maintenance risk.G2-R9-A03[P3] (anneal/trusted/cargo-anneal/src/verify.rs:1043): reserved_proof_module now reserves the Captured.* and Expected.* prefixes (a trusted rule tightening), but the commit/PR body does not mention it.G2-R9-A04[P3] (anneal/trusted/rustc-capture/src/lean.rs:628): Body order (and which body entryDefId := 0 names) depends on --shard-* flags that are not recorded in request_sha256 or the receipt, so positional or entryDefId-based specs and capture reproduction depend on unrecorded flags.G2-R9-A05[P3] (zerocopy/proofs/README.md:65): New unit 05_sharded_tryfrombytes reuses the 05_ prefix of the existing 05_layout_add_scaled_metadata.
Executed Sandbox Probes
seat3Pass 1 root-manifest & bundle-manifest SHA-256 verification (bwrap): outcome=passedseat3Pass 1 git diff --check, check_pr_hygiene.py, and TODO/symlink/unicode scan (bwrap): outcome=passedseat3verify_zerocopy.discover_units & zerocopy/src target correspondence (bwrap): outcome=passedseat3CI Python unit tests: test_perf_tracking.py, test_perf_workflow.py, test_verify_zerocopy.py (bwrap): outcome=passedseat3ByteDecisionTree & render_id_tree_module parity and standalone rustc edge-case probe (bwrap): outcome=passedseat3TrustedBoundary import/tactic/attribute static check on SccSharding* & 05_sharded_tryfrombytes (bwrap): outcome=passedseat3Lean 4 module vs non-module cross-import probe under prlimit --nproc=64 (bwrap): outcome=inconclusive_envseat3Workflow permissions/auth/secret-containment checklist: outcome=not_applicable
Partition large MIR captures (
N > shard_min_bodies, default budget: 20 min / 20 max bodies, 2500 max AST nodes) into an acyclic condensation DAG of Lean 4module-modeCaptured.Shard_<k>.oleanmodules and prove whole-crate soundness compositionally atO(log N)root proof depth in pure zero-TCB Lean theory, leavinganneal/trusted/lean/andanneal/trusted/audit/untouched.Capture sharding (
anneal/trusted/rustc-capture):ty::FnDefcall edges from MIR assign rvalues and call/tail-call/branch/assert/yield terminators (including divergingtarget: Nonecalls) with pinnedrust-lang/rustcitations (extract.rs,ir.rs), and include Profile v2 IR variants plus renderedBody.identity_root_.String.ofList/_root_.Char.ofNatnodes inBody::ast_nodes.--shard-max-bodiesand--shard-max-ast-nodeswhile keeping multi-body recursive cycles together and marking single oversized cyclic/large SCCs (shard.rs). When sharding is active,Captured.program.bodiesis reordered into canonical callee-first order (remapping intra-crateTerminator::Callcallee indices) andentryDefId := 0names canonical body0, so sharded specs must identify targets byBody.identity.module-modeCaptured/Shard_<k>.leanper-shard modules, amodule-mode balanced binaryCaptured.leanassembly (preservingmir_profile_versionandoverflow_checks), andcapture_shards.json(is_lean_module: true) with SHA-256 digests,callee_shardsDAG edges,global_def_id_range, andid_tree_sha256(lean.rs,publication.rs,lib.rs,shard.rs), so sharding stays transparent tomodule-mode proofs.Zero-TCB theory bridge (
anneal/theory/Anneal/SccSharding*):Anneal.SccSharding.BinChunkTree(re-exported byAnneal.SccShardingand registered inbundle-manifest.json): balancedBinChunkTreecontainer, guaranteedO(log N)-depthByteDecisionTree(splitByte,splitTag,splitLex) identity uniqueness checker (allIdx,checkBodyIdentityAt),LocalBodyVerified,TreeLocalVerified, non-unfolding root builders (toList_branch,size_branch,wf_branch,allIdx_branch), andprogramVerified_of_shardedTree/crateTheorem_of_shardedTree.Anneal.SccSharding.InterprocCallModelandInterprocCallCanaryas standalone zero-TCB operational models of direct, cyclic, and mutually recursiveBinChunkTreecall dispatch (not yet bridged toCrateTheoremorUnitTheoremobligations), plussplitTag/splitLexrflevaluation canaries.Orchestration, receipt inspection, and first-customer coverage:
cargo anneal shard-plan(--write/--check) and--verify-shard-plandrift checks acrosscargo-annealandanneal-rustc-capture(cli.rs,shard.rs,verify.rs) and document the sharding workflow, Receipt v3 shard fields, and numericShardPlanv1 vs plannednominalmode intrusted/cargo-anneal/skills/cargo-anneal/SKILL.mdanddocs/build-systems-and-receipts.md.capture_shards.jsonstructural,is_lean_module: true, DAG,total_sccs,cyclic_sccs,scc_idspartition, andoversized_sccsingleton invariants (shard.rs), generatemodule-modeProof.IdTreeidentically across capture and verification, and recordcapture_shards_sha256andshardsin Schema v3 receipts.cargo anneal inspect(core/inspect/{schema,diff, render}.rs) to parse, validate, diff, and rendercapture_shards_sha256andshards(bindingProof.IdTreeandCaptured.Shard_*hashes againstaudit.sources), and updateinspect --verify-artifacts(inspect.rs) to hashcapture/capture_shards.json(with manifest parity) and resolve shardedProof.IdTreeundergenerated/Proof/IdTree.lean.OleanCache(olean_cache.rs,stage.rs,verify.rs) beyondTrustedBoundary(CacheKind::Inspector) and bundled libraries to cache sandboxed target shard outputs (Proof.IdTree,Captured.Shard_*,Proof.Shard_*) withv2transitive import Merkle keys, skipping target shard reads/writes under unsandboxed elaboration (SandboxMode::Unsandboxed/ActiveSandbox::None) and keeping--no-rebuild-bundledfail-closed on inspector and bundled misses.tests/rustc-capture/tests/typed_capture.rs,tests/cargo-anneal/tests/{cli,inspect}.rs,tests/cargo-anneal/tests/suite/{anti_vacuity_and_e2e, sharded_capture_and_cache}.rs, ratchetanneal/ci/perf_budgets.jsonverified_units_countfrom4to5(and updatetest_perf_{tracking,workflow}.pyfixtures), plus add the verbatim 25-itemmodule-modezerocopy/proofs/05_sharded_tryfrombytesunit andanneal/skills/proof-scaling/SKILL.mdguidance.Authored by an AI agent acting on joshlf's behalf.