Repository navigation
Conversation
|
Authored by an AI agent acting on joshlf's behalf. Human review surface
Gate-1 Trust Review (
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
5711804 to
e8c9b27
Compare
|
Authored by an AI agent acting on joshlf's behalf. Human review surface
Rebase & Gate-1 Security Invariant Check (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4147 +/- ##
=======================================
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:
|
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:
multi:e8dcb7f08edbc19485c9e7980333607ebbff5f48:e8c9b27a98875d2c32051beba99e3193abbb7560(base=e8dcb7f08edb,head=e8c9b27a9887,tree=f66c02b46015) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 19 inspected, 0 inapplicable, 0 blocked (of 19 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
12 | 1946s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
9 | 1089s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
4 | 920s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R1-01 |
P0 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:433 |
Security-relevant name lookups go through a dot-joined string map that later names overwrite, so distinct Lean names that render identically are conflated and an untrusted export can redirect the lookups. |
G2-R1-02 |
P0 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2345 |
The comparator admits the three permitted axioms by name only and never pins their statements to the clean sysroot, so an untrusted proof export can redeclare Classical.choice or Quot.sound with an arbitrary type. |
G2-R1-03 |
P1 | 3 (seat1, seat2, seat3) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2194 |
The specification-constant scan attributes declarations to Specification modules by dotted-name prefix and checks only direct dependencies, so it is weaker than the legacy check it claims to mirror. |
G2-R1-04 |
P1 | 2 (seat2, seat3) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2480 |
build_closure_entries drops all Init/Std sysroot modules (and non-namespaced or _private.* declarations), stripping sysroot moduleIdentities from Receipt v3 and making target.rs's post-run unpinned sysroot TOCTOU verification unreachable dead code. |
G2-R1-05 |
P1 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/toolchain.rs:312 |
discover_ndjson_comparator_tools activates unpinned leanexport/nanoda_bin/con-ron binaries even in pinned (!allow_unpinned_lean) mode without SHA-256 lock verification, and Receipt v3 omits all comparator/kernel binary digests from toolchain_identity and assumptions. |
G2-R1-06 |
P2 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:740 |
NDJSON records with repeated JSON keys are silently accepted with last-value-wins semantics and export metadata is never cross-checked, leaving a parser-differential question against the external kernels. |
G2-R1-07 |
P2 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:2974 |
SpecPreflight routing is not gated on the toolchain, so on the pinned v4.34.1 toolchain headers, spec-preflight, and resolve-imports now run through SpecPreflight.lean, contrary to the commit message, in-tree docs, and Review Receipt. |
G2-R1-08 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/audit/SpecPreflight.lean:270 |
SpecPreflight.lean duplicates TrustedBoundary.lean's header and specification admission guards without guard-mutation catalog entries, new negative tests, or a lockstep check, so the guards cargo-anneal verify now runs are no longer protected by the mutation gate. |
G2-R1-09 |
P2 | 1 (seat3) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2154 |
is_forbidden_expected_const fails to strip _private.<mod>.<idx> prefixes, letting _private.<SpecOrCapture>.0.{Anneal,Proof}.* bypass expected-cone isolation. |
G2-R1-10 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:1847 |
Pinned-mode toolchain admission adopts leanexport, nanoda_bin, and con-ron from the sysroot bin directory as verdict-producing kernels with no locked digest, taint, warning, or receipt binding. |
G2-R1-11 |
P2 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:3602 |
run_sandboxed_leanexport misclassifies clean-sysroot 5-init failures as policy proof_failed (exit 1), and stage.rs hardlinks writable 0o600 proof_full.ndjson into runs//in/. |
G2-R1-12 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/verify.rs:223 |
The change ships a default verdict path, a new --paranoid-quorum flag, and new report fields without updating any documentation, leaving several docs stale or contradicted by the code. |
G2-R1-13 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/tests/ndjson_comparator_e2e.rs:218 |
All three end-to-end tests return early and pass when no Lean v4.35.0 toolchain is discoverable, so in CI the new default verdict path and its adversarial cases execute zero assertions. |
G2-R1-14 |
P3 | 3 (seat1, seat2, seat3) | static_verified |
anneal/trusted/audit/SpecPreflight.lean:88 |
Doc comments copied into SpecPreflight.lean describe inspector modes the file does not implement, and load-bearing upstream claims in the comparator lack pinned citations. |
G2-R1-15 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1651 |
The new legacy verdict validator duplicates checks the legacy audit already performs and the comparator verdict validator checks constants it was just handed, adding trusted code whose doc comments misstate what it does. |
G2-R1-16 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2324 |
The comparator rejects every opaque declaration including Init opaques that spec-preflight explicitly admits, so specifications reaching System.Platform.numBits verify on the legacy path but cannot verify on the comparator path. |
G2-R1-01 [P0] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:433, Pass 2 §3 (trusted/cargo-anneal), static_verified): Security-relevant name lookups go through a dot-joined string map that later names overwrite, so distinct Lean names that render identically are conflated and an untrusted export can redirect the lookups.
- Invariant: Canonical name identity must be injective; allowlist, theorem, and primitive lookups must resolve to the exact structural Lean name regardless of what an untrusted stream interns.
- Evidence: intern_name inserts every newly interned structural name into string_to_name under its dot-joined rendering, overwriting earlier entries (ndjson_comparator.rs:419-434); parse_record accepts any string component (1013-1017) or numeric component (1018-1022). A single-component name whose string is 'Classical.choice' renders identically to the two-component Classical.choice, and a numeric component 0 renders identically to the string component '0'. intern_dotted_name returns the map hit first (439-442), and the untrusted proof stream is parsed last (target.rs:1357-1358), so lookups for the axiom allowlist (2272-2275), theorem (2224), Quot.sound (2063), and the 39 primitives (1963-1965) resolve to whichever colliding name was interned last. Concretely, an export containing the single-component name gets an axiom of arbitrary type under that name admitted and reported as Classical.choice (2344-2358) while the genuine axiom would be rejected; lookups against init_primitives and expected_cone fail closed. The unit test at 2969-2992 already builds a private name with string component '0' where Lean emits a numeric component. End-to-end impact depends on how the external kernels match permitted axiom names, which was not verifiable here.
G2-R1-02 [P0] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2345, Pass 2 §3 (trusted/cargo-anneal), static_verified): The comparator admits the three permitted axioms by name only and never pins their statements to the clean sysroot, so an untrusted proof export can redeclare Classical.choice or Quot.sound with an arbitrary type.
- Invariant: Action 5c must enforce a strict 3-axiom ceiling against a hostile proof_full stream; the legacy path binds each permitted axiom to its defining Init module and forbids target declarations under the Classical and Quot roots.
- Evidence: Trigger: a hostile proof_full.ndjson (the stream this module is specified to distrust) contains an axiom record named Classical.choice or Quot.sound whose type is, for example, False. Mechanism: PINNED_INIT_PRIMITIVES (ndjson_comparator.rs:90-130) omits the three axioms and step 1 (1963-1971) never requires them in init_primitives; step 3 (2000-2020) compares only names present in expected_cone; step 4 (2027-2040) pins only names present in init_primitives; step 7 (2272-2275, 2344-2356) admits any axiom whose name id is in the allowlist; build_nanoda_config_json (2526-2544) likewise passes names only. Read-only probe on the pinned Lean 4.34.1 sysroot: '#print axioms' over all 39 pinned primitives reports only propext (via Nat.land, Nat.lor, Nat.xor), so the 'leanexport Init -- <39 names>' cone (stage.rs:3648-3650) contains neither Classical.choice nor Quot.sound, and trusted/lean has no textual reference to either. Legacy binding: toolchain.rs:46-50 (FOUNDATION_AXIOMS name-to-module pairs), TrustedBoundary.lean:5749-5752 (axiom policy check), TrustedBoundary.lean:2282-2289 (reservedKernelRoots includes Classical and Quot). No unit test forges an axiom type. Remaining uncertainty: whether 'con-ron --verified' independently pins axiom statements, and whether the v4.35.0 cone differs from 4.34.1. Resolving check: add the three axioms to the pinned init targets, require their presence and DAG identity, and add a negative unit test with a forged axiom type.
G2-R1-03 [P1] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2194, Pass 2 §3 (trusted/cargo-anneal), static_verified): The specification-constant scan attributes declarations to Specification modules by dotted-name prefix and checks only direct dependencies, so it is weaker than the legacy check it claims to mirror.
- Invariant: Checks described as mirroring the legacy specification constant ban should cover the same declarations: those defined by Specification modules, including the transitive ban.
- Evidence: At ndjson_comparator.rs:2193-2220, is_spec_const checks arena.belongs_to_module(cid, m) (string prefix match on
<SpecModule>.*or_private.<SpecModule>.<idx>.*). SpecPreflight.lean permits Spec.lean to declare constants outside namespace Spec (e.g. top-leveldef helperornamespace Helper), for which belongs_to_module returns false, bypassing the direct Lean.Syntax*/panic* ban. Additionally, verify_ndjson_structure completely omits TrustedBoundary.lean's isForbiddenSpecTransitiveConst traversal (allowing Spec.lean to call an admitted Init/Std helper that transitively reaches IO, dbgTrace, System.Platform.isWindows, or Lean.version), stage.rs:660-664 exports only Expected.claim's cone rather than all Specification declarations, and no check forbids Spec.lean from declaring constants in Trusted.* or Init./Std..
G2-R1-04 [P1] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2480, Pass 2 §3 (trusted/cargo-anneal), static_verified): build_closure_entries drops all Init/Std sysroot modules (and non-namespaced or _private.* declarations), stripping sysroot moduleIdentities from Receipt v3 and making target.rs's post-run unpinned sysroot TOCTOU verification unreachable dead code.
- Invariant: PRINCIPLES.md / THREAT_MODEL.md §1 TCB audit log completeness and target.rs:1160-1220 post-audit sysroot provenance and TOCTOU invariant.
- Evidence: Because
leanexportNDJSON records omit module origins,ndjson_comparator.rs:2194andbuild_closure_entries(:2480-2519) match constants solely by string name prefix againstmodel_modules(["Trusted.MirSemantics", ...]) andspecification_modules.SpecPreflight.lean:360and:823permitnamespace TrustedinSpecificationfiles, andverify_ndjson_structureomits both non-ModelTrusted.*ownership checks andreservedKernelRootschecks outside the 39PINNED_INIT_PRIMITIVES. Consequently,def Trusted.MirSemantics.CustominsideSpec.leanpasses preflight and Action5cwhile appearing insidemodelClosureinstead ofspecificationClosure, helpers in custom namespaces (namespace Helper) are missed by:2194and:2495, andProofmodules can declare arbitraryTrusted.*/Std.*/Lean.*/System.*constants.
G2-R1-05 [P1] (anneal/trusted/cargo-anneal/src/toolchain.rs:312, Pass 2 §3 (trusted/cargo-anneal), static_verified): discover_ndjson_comparator_tools activates unpinned leanexport/nanoda_bin/con-ron binaries even in pinned (!allow_unpinned_lean) mode without SHA-256 lock verification, and Receipt v3 omits all comparator/kernel binary digests from toolchain_identity and assumptions.
- Invariant: PRINCIPLES.md / THREAT_MODEL.md §1 and trust-review Pass 2 §3: pinned untainted runs must never silently execute unpinned toolchain verdict binaries, and Receipt v3 must accurately record every trusted tool's digest and assumption.
- Evidence: stage.rs:1847 calls discover_ndjson_comparator_tools(&prefix)? unconditionally during pinned tool_admission(), and target.rs:1117 switches auditing to audit_target_ndjson whenever ndjson_tools.is_some(). toolchain.rs:312-378 checks only .is_file() and computes runtime hashes for pre/post TOCTOU without verifying any pinned SHA-256 lock. Thus placing leanexport, nanoda_bin, and con-ron in a pinned sysroot's bin/ silently replaces TrustedBoundary.lean with unpinned binaries while issuing an untainted Receipt v3. Furthermore, even under --allow-unpinned-lean, target.rs:1426-1460 and verify.rs:1912-1977 never emit leanexport_sha256, nanoda_bin_sha256, con_ron_sha256, con_leche_sha256, or lean4lean_sha256 into NdjsonAuditVerdict, toolchain_identity, or assumptions.
G2-R1-06 [P2] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:740, Pass 2 §3 (trusted/cargo-anneal), static_verified): NDJSON records with repeated JSON keys are silently accepted with last-value-wins semantics and export metadata is never cross-checked, leaving a parser-differential question against the external kernels.
- Invariant: The comparator and the independent kernels must interpret each exported record identically; ambiguous encodings should be rejected.
- Evidence: Each line is parsed with serde_json::from_str into a generic Value (ndjson_comparator.rs:740); map deserialization keeps the last value for a repeated key, and the key-count checks (998, 1035, 1128, 1262) run after that collapse, so a declaration object with two 'type' members is accepted using the last one. If a kernel resolves duplicates differently, the comparator and that kernel check different declarations. ExportMeta fields are parsed (839-845) but never compared across the three streams or with the admitted toolchain. Open question: duplicate-key behavior of nanoda_bin and con-ron is not verifiable here. Resolving check: reject duplicate keys during parsing and add a negative test.
G2-R1-07 [P2] (anneal/trusted/cargo-anneal/src/stage.rs:2974, Pass 1 (Human review surface accuracy) / Pass 2 §3, static_verified): SpecPreflight routing is not gated on the toolchain, so on the pinned v4.34.1 toolchain headers, spec-preflight, and resolve-imports now run through SpecPreflight.lean, contrary to the commit message, in-tree docs, and Review Receipt.
- Invariant: Commit bodies, trusted/ documentation, and the Human review surface must accurately describe what changed; mischaracterization of a trusted surface blocks ready-for-review.
- Evidence: uses_spec_preflight returns true for the three modes whenever SpecPreflight.lean was staged (stage.rs:2974-2977), and tool_admission stages it whenever the bundled file exists (stage.rs:1497-1521; bundle.rs:39) with no version or ndjson_tools condition. TrustedBoundary.lean's copies of those modes therefore become unreachable from cargo-anneal verify on every toolchain. This contradicts the commit message ('Target preflight on v4.35.0+ drops to SpecPreflight.lean'), the new TrustedBoundary.lean header (17-39: v4.35.0+ runtime verification does not execute this file; legacy v4.34.1 cargo-anneal verify invokes it across ten modes), SpecPreflight.lean:15-19, and target.rs:1111-1116. The Review Receipt's Human review surface additionally describes SpecPreflight's three modes with 'loadExts := false', but spec-preflight imports with extensions := true and enableInitializersExecution (SpecPreflight.lean:110-117, 1109-1113). Functional behavior is equivalent today because the copied code is identical.
G2-R1-08 [P2] (anneal/trusted/audit/SpecPreflight.lean:270, Pass 2 §3 (trusted/audit) and §5 (ci guard mutation), static_verified): SpecPreflight.lean duplicates TrustedBoundary.lean's header and specification admission guards without guard-mutation catalog entries, new negative tests, or a lockstep check, so the guards cargo-anneal verify now runs are no longer protected by the mutation gate.
- Invariant: Every added or modified admission or syntax guard needs negative tests verified to fail when the guard is disabled; cataloged header guards must be live and exercised by guard-mutation CI.
- Evidence: validateTargetImports (SpecPreflight.lean:270-283), inspectHeader (289-302), and 50 of the file's 55 declarations are byte-identical copies of TrustedBoundary.lean declarations (mechanical declaration-level comparison); after the routing change they are the guards executed at run time. ci/check_guard_mutation.py:1031-1058 (AUDIT_HEADER_GUARDS) still mutates trusted/audit/TrustedBoundary.lean and runs TrustedBoundary in 'headers' mode (1232-1255), so disabling the Lean or Lake import ban in SpecPreflight.lean survives the 100% kill-rate gate. The change adds no catalog entry, no file under trusted/audit/tests, and no check that keeps the two copies identical, so a future fix applied to one copy can silently diverge.
G2-R1-09 [P2] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2154, Pass 2 §3 (trusted/cargo-anneal statement-origin isolation), static_verified): is_forbidden_expected_const fails to strip _private.<mod>.<idx> prefixes, letting _private.<SpecOrCapture>.0.{Anneal,Proof}.* bypass expected-cone isolation.
- Invariant: Statement-origin isolation requires that no declaration in
Anneal.*orProof.*(public or private) appears inexpected_cone, matchingTrustedBoundary.privateToUserNamesemantics. - Evidence:
ndjson_comparator.rs:2154-2162checksreq.forbidden_expected_roots.contains(arena.name_root(cid))({"Anneal", "Proof"}) andarena.belongs_to_module(cid, m)overforbidden_expected_modules(TargetRole::Proofmodules only), without stripping_private.<mod>.<idx>.viaarena.strip_private_and_root(cid)(ndjson_comparator.rs:457-495, already used at line 2201). BecauseSpecPreflight.lean:360and:823do not forbidAnnealorProofnamespaces inTargetRole::Specificationmodules,private def Anneal.fooinSpec.leancompiles as_private.Spec.0.Anneal.foo(name_root == "_private"), passingverify_ndjson_structure. Unit testndjson_comparator.rs:2967-2991only checks_private.Proof.0.Proof.helper, which hitsforbidden_expected_modules.
G2-R1-10 [P2] (anneal/trusted/cargo-anneal/src/stage.rs:1847, Pass 2 §3 and §4 (trusted/cargo-anneal, toolchain provenance), static_verified): Pinned-mode toolchain admission adopts leanexport, nanoda_bin, and con-ron from the sysroot bin directory as verdict-producing kernels with no locked digest, taint, warning, or receipt binding.
- Invariant: cargo-anneal must not let ambient state silently substitute unverified toolchain components; in pinned mode, executed and loaded sysroot code is digest-verified, and the comparator design specifies a digest-locked init primitive cone.
- Evidence: Pinned tool_admission calls discover_ndjson_comparator_tools (stage.rs:1847; the same struct sets unpinned: false), which only records self-computed SHA-256 digests (toolchain.rs:312-378); run_target switches the verdict path on presence alone (target.rs:1117). No LOCKED_* constant, taint reason, or warning covers these executables; NdjsonAuditVerdict (ndjson_comparator.rs:1601-1626) records no kernel-binary digests; the init cone is regenerated at run time by the same unlocked leanexport (stage.rs:3622-3656) although docs/auditing-and-comparator.md:119-120 specifies a cone locked by digest in the toolchain manifest. Pinned sysroot verification allowlists runtime libraries and rejects dynamic libraries in bin/ but accepts extra executables (toolchain.rs:1805-1828), and default lean discovery follows ambient XDG_CACHE_HOME and HOME (toolchain.rs:896-900). Trigger: three executables with those names beside a digest-matching lean binary. Result: an untainted pinned result whose verdict was produced by unlocked, unrecorded binaries. Exploitation requires control of the toolchain directory or environment, which THREAT_MODEL.md assumes away, so this is rated as a trust-policy regression rather than a break of the stated threat model.
G2-R1-11 [P2] (anneal/trusted/cargo-anneal/src/stage.rs:3602, Pass 2 §3 (trusted/cargo-anneal), static_verified): run_sandboxed_leanexport misclassifies clean-sysroot 5-init failures as policy proof_failed (exit 1), and stage.rs hardlinks writable 0o600 proof_full.ndjson into runs//in/.
- Invariant: docs/elaborator-containment-design.md §3.2 (in/ receives 0o444 physical copies, never hardlinks) and §4 (exit 1 is reserved for policy/proof failures while toolchain/sysroot failures must return exit 2 tool_failed).
- Evidence: At stage.rs:3602-3612, run_sandboxed_leanexport returns Failure::policy (exit code 1) on any non-zero leanexport exit, including when called from export_ndjson_init_primitives (line 3650) over only the clean sysroot Init module (and verify.rs:2285 treats err.code == 1 as proof_failed, triggering partial --export-lean-lib export). Separately, sandbox.rs:1972 creates NDJSON stdout sinks with mode 0o600, and stage.rs:3760 and 3857 hardlink proof_full.ndjson directly into in_dir rather than copying as 0o444 (and stage.rs:3687 hardlinks stage/lib/*.olean into expected_lib). In addition, init_primitives_cache (stage.rs:60-75, 3622-3645) keys only on (prefix, leanexport_sha256) without the sysroot manifest digest.
G2-R1-12 [P2] (anneal/trusted/cargo-anneal/src/verify.rs:223, General (documentation review), static_verified): The change ships a default verdict path, a new --paranoid-quorum flag, and new report fields without updating any documentation, leaving several docs stale or contradicted by the code.
- Invariant: Standing documentation rule: affected docs, examples, and links must be added or updated in the same PR; undisclosed deviations from documented contracts must be stated.
- Evidence: No documentation path is in the diff. docs/auditing-and-comparator.md:11-28 still labels the comparator an unshipped target architecture, and the code deviates from its contract without updating it: the init cone is not digest-locked (119-120 versus stage.rs:3622-3656); con-ron and con-leche are skipped when sorryAx is admitted (151-155 'Both checkers must exit 0' versus target.rs:1396-1406 and 1421-1425); every opaque is banned rather than non-Init opaque (143-144); paranoid mode runs two extra kernels directly rather than the described multi-kernel comparator set (165-175). docs/elaborator-containment-design.md:105 still attributes header and specification admission to TrustedBoundary.lean, docs/alpha.md:138-154 omits --paranoid-quorum, and the Review Receipt lists intentional policy relaxations as none.
G2-R1-13 [P2] (anneal/trusted/cargo-anneal/tests/ndjson_comparator_e2e.rs:218, Pass 2 §3 (test sensitivity) / General, static_verified): All three end-to-end tests return early and pass when no Lean v4.35.0 toolchain is discoverable, so in CI the new default verdict path and its adversarial cases execute zero assertions.
- Invariant: Negative security tests must fail if their target guard is disabled; new trust-critical paths need non-vacuous executed coverage.
- Evidence: Each test begins with 'let Some(lean) = discover_v435_lean() else { eprintln!(...); return; }' (ndjson_comparator_e2e.rs:218-221, 296-299, 378-381); discover_v435_lean (47-62) consults only the ANNEAL_LEAN_V435 variable and a fixed elan toolchain directory under HOME. No workflow, flake input, or CI script provides either, and the repository pin is v4.34.1, so the export, comparator-driver, and kernel-invocation code (stage.rs:3506-4016; target.rs:1279-1484) has no CI-executed integration coverage and these tests would still pass with every comparator guard removed. The unit tests in ndjson_comparator.rs cover only synthetic structural cases.
G2-R1-14 [P3] (anneal/trusted/audit/SpecPreflight.lean:88, Pass 2 §3 (trusted/ comment accuracy), static_verified): Doc comments copied into SpecPreflight.lean describe inspector modes the file does not implement, and load-bearing upstream claims in the comparator lack pinned citations.
- Invariant: trusted/ comments must give accurate rationale and contracts; upstream behavior relied on for soundness should be cited at a pinned source.
- Evidence: importEnv's comment documents preflight, audit, and target-audit modes (SpecPreflight.lean:88-109); importCorrEnv's comment documents the correspondence modes although its only caller here is resolve-imports (119-137, 1153-1161); validateGraph (146-147) and initHermeticSearchPath (153-155, bootstrap of the precompiled TrustedBoundary.olean) are likewise stale. In ndjson_comparator.rs the claims about the upstream primitive target lists (82-89), Expr.eqv semantics (186-194), the axiom-collection traversal (38-41), and the export parser's handling of isUnsafe (1340-1341) carry no repository, commit, or line citation, unlike the pinned-commit URLs used in TrustedBoundary.lean, and refer to Lean v4.35.0 sources outside the repository's v4.34.1 pin. Minor: seven comment lines in ndjson_comparator.rs exceed 80 columns.
G2-R1-15 [P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1651, General (maintainability, comment accuracy), static_verified): The new legacy verdict validator duplicates checks the legacy audit already performs and the comparator verdict validator checks constants it was just handed, adding trusted code whose doc comments misstate what it does.
- Invariant: trusted/ code should stay minimal and its comments should accurately state rationale and contracts.
- Evidence: inspect_target already deserializes into the deny_unknown_fields TargetAuditReport and runs validate_target_audit_report (target.rs:388-566, 640-652); run_target then re-parses the re-serialized value into the near-identical LegacyTargetAuditVerdict and repeats the same checks (target.rs:1128-1139; ndjson_comparator.rs:1651-1764), so the comment about replacing untyped map inspection (1646-1648) is inaccurate. validate_ndjson_verdict (1768) is documented as validating a verdict round-tripped through JSON but is called on the struct built immediately above it with replay and exact_type hard-coded to true (target.rs:1437-1478). NdjsonComparatorTools.lake (toolchain.rs:303) is populated but never read.
G2-R1-16 [P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2324, General (cross-file contract), static_verified): The comparator rejects every opaque declaration including Init opaques that spec-preflight explicitly admits, so specifications reaching System.Platform.numBits verify on the legacy path but cannot verify on the comparator path.
- Invariant: Admission layers should agree: constructs explicitly allowed by spec-preflight and by the documented non-Init opaque ban should not be unconditionally rejected downstream.
- Evidence: The scans reject any CanonConstInfo::Opaque with no Init exemption (ndjson_comparator.rs:2282-2291, 2324-2333), while docs/auditing-and-comparator.md:143-144 scopes the ban to non-Init opaque declarations and SpecPreflight.lean:369-373 admits System.Platform numBits, getNumBits, and numBits_eq in specifications. Read-only probe on the pinned 4.34.1 sysroot: '#print System.Platform.getNumBits' prints an opaque declaration. The failure is fail-closed (false rejection), not unsound.
Executed Sandbox Probes
seat1axioms-of-pinned-primitives: outcome=Only propext appears (Nat.land, Nat.lor, Nat.xor); Classical.choice and Quot.sound appear for none of the 39 names; exit 0seat1getnumbits-is-opaque: outcome=Printed as an opaque declaration; exit 0seat3test_prebuild_bundled_oleans.py, test_alpha_release.py, test_check_bundle_tree.py in bwrap: outcome=passseat3test_ci_workflow.py in bwrap (split run): outcome=partial_timeoutseat3sha256sum --check --strict trusted/root-manifest.sha256 paired probe in bwrap: outcome=passseat3check_bundle_tree.py SpecPreflight sensitivity & prebuild missing-SpecPreflight probe in bwrap: outcome=passseat3bundled_resources.rs TRUSTED_BUNDLE_SOURCES parity & PR diff TODO check in bwrap: outcome=passseat3Lean elaboration & cargo test execution check: outcome=skipped_light_or_env_limit
e8c9b27 to
bdd3341
Compare
|
Addressed all 16 Gate-2 Round-1 review findings ( Gate-2 Round-1 Finding Dispositions
Review & Verification Receipt (on
|
bdd3341 to
c9f43a0
Compare
|
Authored by an AI agent acting on joshlf's behalf. Fixed the CI Fix (
|
c9f43a0 to
8b4844d
Compare
|
Authored by an AI agent acting on joshlf's behalf. Rebased onto Verification Receipt (
|
|
Authored by an AI agent acting on joshlf's behalf. Rebased cleanly onto Rebase Verification Receipt (
|
8b4844d to
b6fc48c
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 — FINDINGS (tier2_tcb, Round 2)
- Identity:
one:b56d8040df1d2d0cfe3f43b804ba6548d31189df:3ebda64311970d5e9db1694f62d30255cffbd475:8e612dd5c3e8e8acdb15f007c22257d78dd6445f4f18f715c807f719c599b2b7(base=706acd8761d7,head=b6fc48c1b85d,tree=3ebda6431197) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 25 inspected, 0 inapplicable, 0 blocked (of 25 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
13 | 3705s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
5 | 2815s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
2 | 1242s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R2-01 |
P1 | 3 (seat1, seat2, seat3) | static_verified |
anneal/trusted/audit/SpecPreflight.lean:1213 |
collectDeclaredSpecConsts emits only names the user wrote, omitting auto-generated spec constants (anonymous instances, deriving instances, constructors/projections, where/let-rec auxiliaries). Such constants escape the comparator's direct spec-dependency checks unless they carry the module prefix. |
G2-R2-02 |
P1 | 2 (seat1, seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2977 |
Closedness of the expected cone is never checked: bfs_cone silently skips dependencies absent from the trusted export, so an export omission (5a runs leanexport --ignore-missing) would let proof_full supply that dependency with arbitrary content. |
G2-R2-03 |
P1 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2597 |
Open trust question: the reserved-root and kernel-accelerated-name exemptions trust a constant's sysroot status by name alone, so a proof export may redeclare existing sysroot names whose content is never pinned. It is unverified whether any kernel evaluates such a name natively. |
G2-R2-04 |
P1 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2622 |
check_namespace_ownership makes Trusted.* namespace isolation vacuous on proof_full whenever Trusted is a model module and skips non-model Trusted.* and canonical-input origin enforcement on expected_cone. |
G2-R2-05 |
P2 | 2 (seat1, seat2) | static_verified |
anneal/trusted/audit/TrustedBoundary.lean:1888 |
rejectForbiddenSpecDeclNamespace replaces isForbiddenPureNamespace for the spec namespace 'enter' and 'declare in' checks, dropping root stripping and the Init.System / Std.Internal.UV / Internal.UV / Dynlib prefix rejections. The weakening is not disclosed, and the doc comment falsely claims the list includes the reservedKernelRoots entries (Init/Std are omitted). |
G2-R2-06 |
P2 | 1 (seat1) | static_verified |
anneal/tests/audit/tests/target_audit.rs:451 |
The modified spec namespace guards lack negative tests: only the 'Trusted' declaration case is asserted, and boundary_audit.rs is unchanged. |
G2-R2-07 |
P3 | 1 (seat1) | static_verified |
anneal/ci/test_check_guard_mutation.py:415 |
The SpecPreflight/TrustedBoundary parity test compares only 12 header/namespace definitions, omitting the spec allowlists, validators and namespace guard functions, so drift there goes undetected. |
G2-R2-08 |
P3 | 1 (seat1) | static_verified |
anneal/docs/auditing-and-comparator.md:18 |
Docs say the NDJSON comparator runs whenever the v4.35 binaries exist under /bin/, omitting that it activates only under --allow-unpinned-lean; trusted comments say 'by default everywhere'. |
G2-R2-09 |
P3 | 1 (seat1) | static_verified |
anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:312 |
Every test that needs real Lean v4.35 returns as passing when the toolchain is absent (unless ANNEAL_REQUIRE_V435=1), and the only always-on test uses exit 0 kernel stubs, so CI exercises no real comparator negative cases end to end. |
G2-R2-10 |
P3 | 1 (seat3) | probe_confirmed |
anneal/trusted/audit/SpecPreflight.lean:435 |
forbiddenSpecDeclRootNamespaces in SpecPreflight.lean and TrustedBoundary.lean omits Init and Std despite its docstring claiming to include all reservedKernelRoots, allowing namespace Init / namespace Std and Init.* / Std.* declarations past preflight. |
G2-R2-11 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:38 |
Module and function docs claim every .opaqueInfo is banned, but the code admits any non-unsafe opaque whose name is in the sysroot inventory. |
G2-R2-12 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:4038 |
Kernels receive a fresh copy of proof_full.ndjson that is not re-hashed against the digest the Rust comparator verified. |
G2-R2-13 |
P3 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:4167 |
run_ndjson_standalone_kernel omits check_lean_stderr_panic when invoking lean4lean, inconsistent with run_sandboxed_leanexport. |
G2-R2-14 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/target.rs:1098 |
A missing declaredConsts key in the spec-preflight response is silently treated as an empty list rather than failing closed on the NDJSON route. |
G2-R2-15 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/target.rs:1604 |
The NDJSON route skips validate_target_audit_report (closure/import-graph cross-checks and the specWarnings anti-vacuity lint), so receipts show an empty spec_warnings list that is indistinguishable from 'lint ran clean'. |
G2-R2-16 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/target.rs:1661 |
verify_export_meta_matches_toolchain returns Ok without checking anything when the admitted version string is not in the expected 'Lean (version ...' / 40-hex-commit format. |
G2-R2-01 [P1] (anneal/trusted/audit/SpecPreflight.lean:1213, Pass 2 §3 (trusted/audit), static_verified): collectDeclaredSpecConsts emits only names the user wrote, omitting auto-generated spec constants (anonymous instances, deriving instances, constructors/projections, where/let-rec auxiliaries). Such constants escape the comparator's direct spec-dependency checks unless they carry the module prefix.
- Invariant: declaredConsts must cover every constant a specification module introduces so that per-declaration spec restrictions apply.
- Evidence: SpecPreflight.lean:405 admits Parser.Command.instance and line 381 admits Parser.Command.deriving, yet declarationIdent? (SpecPreflight.lean:244-249) returns none for anonymous instances and collectDeclaredSpecConsts (SpecPreflight.lean:1213-1231) returns #[] for none and Parser.Command.deriving while also omitting compiler-generated constructors/projections/defaults/matchers under custom namespaces. Action 5a (stage.rs:3963) exports only Expected.claim plus spec_declared_lean_names via leanexport --ignore-missing, and Action 5c (ndjson_comparator.rs:2687-2723) checks only constants present in expected_cone matching spec_decl_modules or specification_modules. Thus: (1) an unreferenced anonymous instance in Spec calling runST (fun _ => pure 0) (which passes SpecPreflight, per ndjson_comparator_e2e.rs:515-531) is never exported into expected_cone.ndjson and evades Action 5c's transitive ST ban; (2) because SpecPreflight.lean:460-462 does not ban the identifier sorryAx, an anonymous instance in Spec using sorryAx passes if unreferenced, and if used by Proof under --allow-sorry-in-proof, it is absent from expected_cone_set (ndjson_comparator.rs:2575) so ndjson_comparator.rs:2888 permits sorryAx inside a specification declaration; (3) custom-namespace anonymous instances and generated helpers fail is_spec_const (ndjson_comparator.rs:2688-2692), skipping direct is_lean_syntax_const/is_panic_spec_const checks and dropping out of specification_closure.
G2-R2-02 [P1] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2977, Pass 2 §3 (trusted/cargo-anneal), static_verified): Closedness of the expected cone is never checked: bfs_cone silently skips dependencies absent from the trusted export, so an export omission (5a runs leanexport --ignore-missing) would let proof_full supply that dependency with arbitrary content.
- Invariant: Every constant transitively reachable from Expected.claim must come from the trusted 5a export and be DAG-identical in proof_full.
- Evidence: bfs_cone (ndjson_comparator.rs:2962-2984, line 2977) guards
if env.constants.contains_key(&dep)and silently ignores dependencies absent from env.constants. Action 5a invokes leanexport --ignore-missing (stage.rs:3963), and verify_ndjson_structure (ndjson_comparator.rs:2408-2443) never checks that every dependency returned by collect_const_deps for expected_bfs.visited or spec_bfs.visited exists in expected_cone.constants, nor that the four canonical inputs exist in expected_cone.constants (line 2684 silently guardsif expected_cone.constants.contains_key(&spec_id), and build_closure_entries at 3037-3042 synthesizes missing root entries). If any transitive dependency D of Expected.claim (including Spec.specs) is missing from expected_cone.ndjson, Step 3 skips comparing D against proof_full, allowing a compromised 5b export to supply an arbitrary definition of D in proof_full.ndjson and pass both verify_ndjson_structure and the external kernels.
G2-R2-03 [P1] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2597, Pass 2 §3 (trusted/cargo-anneal), static_verified): Open trust question: the reserved-root and kernel-accelerated-name exemptions trust a constant's sysroot status by name alone, so a proof export may redeclare existing sysroot names whose content is never pinned. It is unverified whether any kernel evaluates such a name natively.
- Invariant: Non-sysroot modules must not declare constants beneath reserved kernel/sysroot roots or under names the kernels special-case (doc comments at lines 160-164 and 174-175 claim this); every name a kernel evaluates natively must be content-pinned to the clean sysroot.
- Evidence: check_namespace_ownership computes is_sysroot = sysroot_const_to_module.contains_key(encoded) (line 2597) and skips the KERNEL_ACCELERATED_NAMES (2599) and RESERVED_KERNEL_ROOTS (2608) checks when it is true. Content is pinned only for names in init_primitives (step 4, lines 2450-2463) or in expected_cone (lines 2410-2443). A prelude-only proof module that does not import the sysroot module defining e.g. Nat.log2 can declare its own Nat.log2 with arbitrary content. PINNED_INIT_PRIMITIVES (lines 107-147) and KERNEL_ACCELERATED_NAMES omit Nat.log2. If nanoda_bin, con-ron, con-leche or lean4lean evaluates Nat.log2 (or another unlisted name) natively, the mismatch between native reduction and the attacker's definition can yield False, and with it any claim. Resolving check: compare each kernel's native-evaluation name set against the pinned set, or require every proof_full constant whose name is in the sysroot inventory to equal a clean sysroot export.
G2-R2-04 [P1] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2622, Pass 2 §3 (trusted/cargo-anneal), static_verified): check_namespace_ownership makes Trusted.* namespace isolation vacuous on proof_full whenever Trusted is a model module and skips non-model Trusted.* and canonical-input origin enforcement on expected_cone.
- Invariant: Non-model target modules (Proof, Expected, Capture, Specification) must not declare constants in the Trusted.* namespace (except compiler-generated helpers on authenticated Model parents), and canonical inputs (canonical_root, Crate.mk, subject_declaration, specification_declaration, expected_declaration, theorem_name) must originate from their designated TargetRole modules (TrustedBoundary.lean:6223-6226, 6273-6277, 6326-6354).
- Evidence: At ndjson_comparator.rs:2620-2632, in_expected_or_model evaluates req.model_modules.iter().any(|m| arena.belongs_to_module(cid, m)) (likewise is_model_parts at 2580-2588). Because trusted/lean/Trusted.lean (bundle.rs:36-45, ndjson_comparator_e2e.rs:81-95) registers 'Trusted' in req.model_modules, belongs_to_module(cid, 'Trusted') (675-698) matches every Trusted.* constant (and 'Trusted.MirSemantics' matches every Trusted.MirSemantics.* constant), making the Trusted namespace rejection on proof_full vacuous so Proof can declare arbitrary new constants in Trusted.. Furthermore, line 2654 passes allow_trusted_outside_model = true for expected_cone without checking per-role declaration origins, so a non-model module such as Expected or Captured declaring Trusted.MirSemantics.Crate (explicitly rejected in tests/audit/tests/target_audit.rs:286-302) or Spec.specs passes verify_ndjson_structure. Additionally, belongs_to_module_parts (675-698) does not strip root, so is_forbidden_expected_const (2635-2643) would not match root.. against forbidden_expected_modules.
G2-R2-05 [P2] (anneal/trusted/audit/TrustedBoundary.lean:1888, Pass 2 §3 (trusted/audit), static_verified): rejectForbiddenSpecDeclNamespace replaces isForbiddenPureNamespace for the spec namespace 'enter' and 'declare in' checks, dropping root stripping and the Init.System / Std.Internal.UV / Internal.UV / Dynlib prefix rejections. The weakening is not disclosed, and the doc comment falsely claims the list includes the reservedKernelRoots entries (Init/Std are omitted).
- Invariant: Preserve TrustedBoundary.lean admission checks (pushSpecScopes / checkSpecDeclNamespace); any weakening must be disclosed and justified in the commit body.
- Evidence: TrustedBoundary.reservedKernelRoots (TrustedBoundary.lean:2557-2561) and RESERVED_KERNEL_ROOTS (ndjson_comparator.rs:169) include Init and Std, but forbiddenSpecDeclRootNamespaces (TrustedBoundary.lean:1547-1557, duplicated at SpecPreflight.lean:435-443) omits both Init and Std despite its doc comment claiming inclusion of reservedKernelRoots. In addition, pushSpecScopes (TrustedBoundary.lean:2046, SpecPreflight.lean:941) and checkSpecDeclNamespace (TrustedBoundary.lean:2070, 2075, SpecPreflight.lean:965, 970) switched from rejectForbiddenSpecNamespace (isForbiddenPureNamespace) to rejectForbiddenSpecDeclNamespace (TrustedBoundary.lean:1888-1890, SpecPreflight.lean:783-785), which checks only forbiddenSpecDeclRootNamespaces.contains ns.getRoot. Consequently, namespace Init / namespace Std (activating scoped parser extensions via Parser.parserExtension.activateScoped at TrustedBoundary.lean:2050 and SpecPreflight.lean:945) and declarations under Init.* / Std.* pass spec-preflight, and pushSpecScopes/checkSpecDeclNamespace no longer enforce forbiddenSysUvPrefixes directly.
G2-R2-06 [P2] (anneal/tests/audit/tests/target_audit.rs:451, Pass 2 §3 (trusted/audit negative tests), static_verified): The modified spec namespace guards lack negative tests: only the 'Trusted' declaration case is asserted, and boundary_audit.rs is unchanged.
- Invariant: Every added or modified admission guard requires negative tests asserting exit 1 and the target diagnostic, verified to fail if the guard is disabled.
- Evidence: The only new assertion (lines 451-460) checks 'cannot declare in reserved namespace Trusted in specification'. There are no tests for entering namespace Nat/Anneal/Proof, for a bare
def Nat(new .str .anonymous branch, TrustedBoundary.lean lines 2074-2076), or regression tests that Init.System / Std.Internal.UV / Dynlib / root.IO namespaces are still rejected after the guard change. tests/audit/tests/boundary_audit.rs is unchanged.
G2-R2-07 [P3] (anneal/ci/test_check_guard_mutation.py:415, Pass 2 §5 (ci/), static_verified): The SpecPreflight/TrustedBoundary parity test compares only 12 header/namespace definitions, omitting the spec allowlists, validators and namespace guard functions, so drift there goes undetected.
- Invariant: Duplicated trusted admission logic needs a mechanical drift check covering every security-relevant definition.
- Evidence: Lines 431-444 list allowedHeaderKinds ... forbiddenSpecDeclRootNamespaces only. Missing: allowedSpecCommandKinds, allowedSpecDeclModifierKinds, forbiddenSpecModifierKinds, allowedSpecTacticKinds, forbiddenSpecTermKinds, validateSpec*, rejectForbiddenSpec*Namespace, pushSpecScopes, checkSpecDeclNamespace, inspectSpecSyntax. extract_def_block uses text.index(f"def {name}") (line 422), which can match a longer definition name that starts with the same prefix.
G2-R2-08 [P3] (anneal/docs/auditing-and-comparator.md:18, General (documentation), static_verified): Docs say the NDJSON comparator runs whenever the v4.35 binaries exist under /bin/, omitting that it activates only under --allow-unpinned-lean; trusted comments say 'by default everywhere'.
- Invariant: Docs and trusted comments must match the code's gating.
- Evidence: Pinned admission hard-codes ndjson_tools: None (stage.rs line 1979); only tool_admission_unpinned calls discover_ndjson_comparator_tools (stage.rs line 2070). docs line 18, toolchain.rs line 374 and target.rs line 1253 describe default activation without the opt-in. alpha.md and the commit body state the requirement correctly.
G2-R2-09 [P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:312, General (test adequacy), static_verified): Every test that needs real Lean v4.35 returns as passing when the toolchain is absent (unless ANNEAL_REQUIRE_V435=1), and the only always-on test uses exit 0 kernel stubs, so CI exercises no real comparator negative cases end to end.
- Invariant: Negative security tests must be non-vacuous in CI.
- Evidence: Lines 223-226, 312-315, 394-397 and 458-461 return early on discover_v435_lean() == None. The synthetic test (550-791) writes nanoda_bin and con-ron as
#!/bin/sh exit 0(733-737) and only checks plumbing. None of the tests simulates a hand-crafted proof_full NDJSON that redefines sysroot or pinned names.
G2-R2-10 [P3] (anneal/trusted/audit/SpecPreflight.lean:435, Pass 2 (anneal/trusted/audit/SpecPreflight.lean / TrustedBoundary.lean), probe_confirmed): forbiddenSpecDeclRootNamespaces in SpecPreflight.lean and TrustedBoundary.lean omits Init and Std despite its docstring claiming to include all reservedKernelRoots, allowing namespace Init / namespace Std and Init.* / Std.* declarations past preflight.
- Invariant: forbiddenSpecDeclRootNamespaces must forbid entering
namespace <Root>or declaring constants beneath every root inreservedKernelRoots, as stated at SpecPreflight.lean:430-434 and TrustedBoundary.lean:1542-1546. - Evidence: A bwrap cross-check comparing TrustedBoundary.reservedKernelRoots against SpecPreflight.forbiddenSpecDeclRootNamespaces (SpecPreflight.lean:435-443) union forbiddenSpecRootNamespaces (SpecPreflight.lean:427-428) reported
['Init', 'Std']missing (likewise in TrustedBoundary.lean:1547-1555). While namedInit.*/Std.*declarations are caught later by TrustedBoundary.reservedKernelRoots and ndjson_comparator.rs:165-172 (RESERVED_KERNEL_ROOTS), spec-preflight fails to reject them early, and an unreferenced anonymousinstanceinsidenamespace Initnever reaches 5a.
G2-R2-11 [P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:38, General (trusted/ comment accuracy), static_verified): Module and function docs claim every .opaqueInfo is banned, but the code admits any non-unsafe opaque whose name is in the sysroot inventory.
- Invariant: Trusted-code comments must accurately state invariants for human auditors.
- Evidence: Lines 38-41 ('banning every
.opaqueInfo') and 2305-2306 ('zero.opaqueInfodeclarations') contradict lines 2792-2796, which permit non-unsafe opaques whose names are in the sysroot inventory (and the proof_full counterpart, ~2840-2846). The comment at 2783-2784 is accurate. The design looks sound because axioms are scanned across the whole export, but the stated invariant is false.
G2-R2-12 [P3] (anneal/trusted/cargo-anneal/src/stage.rs:4038, Pass 2 §3 (trusted/cargo-anneal), static_verified): Kernels receive a fresh copy of proof_full.ndjson that is not re-hashed against the digest the Rust comparator verified.
- Invariant: The structural comparator and the kernels should provably check the same bytes.
- Evidence: copy_readonly_file(proof_ndjson_host, &in_ndjson, phase) at line 4038 (nanoda) and line 4133 (standalone kernels) re-reads the host file after target.rs lines 1499-1506 verified proof_ndjson_sha256; the copy is never compared with that digest. The stage directory is 0o700, so only a same-uid process could swap the file; hardening only.
G2-R2-13 [P3] (anneal/trusted/cargo-anneal/src/stage.rs:4167, Pass 2 §3 (trusted/cargo-anneal), static_verified): run_ndjson_standalone_kernel omits check_lean_stderr_panic when invoking lean4lean, inconsistent with run_sandboxed_leanexport.
- Invariant: Lean 4 binaries executed inside ExecSeal should check stderr for Lean runtime panic/internal-exception markers (check_lean_stderr_panic) in addition to setting LEAN_ABORT_ON_PANIC=1 (stage.rs:195-211, 3749).
- Evidence: run_sandboxed_leanexport (stage.rs:3748-3749) sets LEAN_ABORT_ON_PANIC=1 and calls check_lean_stderr_panic(phase, &output)?, whereas run_ndjson_standalone_kernel (stage.rs:4113-4195, invoked by run_ndjson_lean4lean for the Lean 4-compiled lean4lean kernel under --paranoid-quorum) sets LEAN_ABORT_ON_PANIC=1 (stage.rs:4151) but does not call check_lean_stderr_panic after
let output = output?;(stage.rs:4167).
G2-R2-14 [P3] (anneal/trusted/cargo-anneal/src/target.rs:1098, Pass 2 §3 (trusted/cargo-anneal), static_verified): A missing declaredConsts key in the spec-preflight response is silently treated as an empty list rather than failing closed on the NDJSON route.
- Invariant: Inspector outputs that feed security checks must be required when the consuming path is active.
- Evidence: Line 1098
if let Some(arr) = spec_pf.get("declaredConsts").and_then(Json::as_array)has no else branch. declaredConsts feeds the spec roots in ndjson_comparator.rs lines 2677-2709 and the extra 5a export roots. SpecPreflight emits the key today, so this matters only if the inspector regresses. stage.rs line 1642 also tolerates a missing SpecPreflight.lean; that case currently still fails closed via the unknown sysroot-consts mode.
G2-R2-15 [P3] (anneal/trusted/cargo-anneal/src/target.rs:1604, General (receipt fidelity), static_verified): The NDJSON route skips validate_target_audit_report (closure/import-graph cross-checks and the specWarnings anti-vacuity lint), so receipts show an empty spec_warnings list that is indistinguishable from 'lint ran clean'.
- Invariant: Receipts should honestly represent which checks ran; switching audit engines should not silently drop advisory checks.
- Evidence: NdjsonAuditVerdict (constructed at 1604-1642, validated by validate_ndjson_verdict) has no specWarnings field. verify.rs lines 2109-2114 call extract_spec_warnings, which returns [] when the key is absent (2265). The legacy path validates spec_warnings and closures against expected_graph (target.rs ~565-581).
G2-R2-16 [P3] (anneal/trusted/cargo-anneal/src/target.rs:1661, Pass 2 §3 (trusted/cargo-anneal), static_verified): verify_export_meta_matches_toolchain returns Ok without checking anything when the admitted version string is not in the expected 'Lean (version ...' / 40-hex-commit format.
- Invariant: Toolchain cross-checks should fail closed on unrecognised input.
- Evidence: Line 1661
if let Some(after) = toolchain_version.strip_prefix("Lean (version ")with no else branch. An empty reported version is skipped (1663), and a commit that isn't 40 hex characters is skipped (1674-1676). In unpinned mode the version string comes from the operator's binary. Defense in depth only: expected and proof metas are still compared against the init meta (ndjson_comparator.rs lines 2322-2333).
Executed Sandbox Probes
seat3pass1_hygiene_and_bundled_resources: outcome=passedseat3root_manifest_sha256: outcome=passedseat3python_ci_unit_tests: outcome=passedseat3guard_mutation_catalog_list: outcome=passedseat3spec_preflight_and_comparator_parity_probe: outcome=finding
b6fc48c to
32c0a5f
Compare
|
Authored by an AI agent acting on joshlf's behalf. Fixed all 16 Gate-2 Round 2 findings and rebased onto Gate 2 Round 2 dispositions (
|
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 3)
- Identity:
one:e29a7c66c216a55091e0b2314ea2adcfb175c788:a0df0bcad2f47ff57c3c48f213af1de34a0d215e:9e846fa782e32b58553cef50c406f0f5e5c60e54fc60465f3d66a6df54b1efd8(base=a3bdc4f43ce3,head=32c0a5f40bd3,tree=a0df0bcad2f4) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 25 inspected, 0 inapplicable, 0 blocked (of 25 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
3 | 1092s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
4 | 2994s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
1 | 1385s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R3-01 |
P1 | 2 (seat1, seat2) | static_verified |
anneal/trusted/audit/SpecPreflight.lean:1382 |
The new SpecPreflight admission guard (reject unsafe constants in target modules) and the target-consts/sysroot-consts modes have no negative or functional test that actually runs in CI. |
G2-R3-02 |
P2 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2875 |
verify_ndjson_structure omits compiled declaration-edge TargetRole::allows enforcement required by target.rs's two-point authority contract. |
G2-R3-03 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/target.rs:1217 |
The NDJSON comparator route replaces old target-audit but silently drops its compiler-override rejection and pre-import .olean validation; only the anti-vacuity lint omission is disclosed. |
G2-R3-04 |
P3 | 2 (seat2, seat3) | probe_confirmed |
anneal/docs/testing-architecture.md:911 |
Renaming the paranoid-mode heading in auditing-and-comparator.md broke two relative anchor links in testing-architecture.md. |
G2-R3-05 |
P3 | 1 (seat2) | static_verified |
anneal/trusted/audit/SpecPreflight.lean:206 |
inspectHeaderSyntax's requirePrelude branch checks args[1]!.isOfKind ``Parser.Module.prelude directly instead of unwrapping the optional nullKind node, so it always fails if requirePrelude is enabled. |
G2-R3-06 |
P3 | 1 (seat1) | static_verified |
anneal/trusted/audit/TrustedBoundary.lean:35 |
Trusted module header calls SpecPreflight a minimal parser-only inspector and lists only headers/spec-preflight/resolve-imports, but it also serves sysroot-consts and target-consts, which import compiled sysroot and target .olean files. |
G2-R3-01 [P1] (anneal/trusted/audit/SpecPreflight.lean:1382, Pass 2 §3 (trusted/audit) / General test adequacy, static_verified): The new SpecPreflight admission guard (reject unsafe constants in target modules) and the target-consts/sysroot-consts modes have no negative or functional test that actually runs in CI.
- Invariant: Code Review Rules Pass 2: every added admission guard needs a negative test asserting exit 1 and the diagnostic, verified to fail if the guard is disabled. Core invariant: do not present skipped or stubbed tests as real coverage.
- Evidence: In Lean 4's finalizeImport (Lean/Environment.lean), when two independent modules declare a .thmInfo with identical (name, type, levelParams, all) (subsumesInfo), importModules succeeds without error, overwrites privateConstantMap with the later module's ConstantInfo, and retains the earlier module in const2ModIdx via insertIfNew. Because collectTargetConsts (SpecPreflight.lean:1373-1388) imports (foundation ++ libraries ++ targets) and only loops over env.constants checking env.getModuleIdxFor? constName against targets: (1) a Specification module declaring a theorem colliding with an imported Init/Std theorem under an unreserved root (e.g., Function, WellFounded, Add, Vector—absent from forbiddenSpecDeclRootNamespaces) whose proof invokes runST (which passes SpecPreflight, see ndjson_comparator_e2e.rs:558-595) maps to the sysroot module index and is silently omitted from targetConsts, 5a, and 5c; (2) between two independent Specification modules SpecA (invoking runST) and SpecB (clean), SpecB overwrites privateConstantMap so both collectTargetConsts and 5a export only SpecB's clean proof, erasing SpecA's banned ST dependency. Unlike TrustedBoundary.lean:6167-6182, collectTargetConsts also never inspects env.header.moduleData for data.constNames == data.constants.map ConstantInfo.name, intra-module duplicates, or data.isModule.
G2-R3-02 [P2] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2875, Pass 2 §3 (trusted/cargo-anneal), static_verified): verify_ndjson_structure omits compiled declaration-edge TargetRole::allows enforcement required by target.rs's two-point authority contract.
- Invariant: TargetRole::allows (anneal/trusted/cargo-anneal/src/target.rs:79-85) requires checking authority directionality (Model -> {Model}, Capture -> {Model, Capture}, Specification -> {Model, Specification}, Expected -> !Proof) both before elaboration and again over actual compiled declaration edges, matching TrustedBoundary.lean:450-466 and 6434-6443.
- Evidence: In verify_ndjson_structure (ndjson_comparator.rs:2577-3251), req.target_const_origins carries each non-Proof constant's TargetOriginRole, yet no check iterates declaration edges in expected_cone or proof_full to verify src_role.allows(dst_role). Cross-role edges such as Specification -> Capture, Capture -> Specification, or Model -> Specification/Capture in expected_cone (where Action 5a mounts all non-Proof roles together in one leanexport invocation) or in standalone calls to public verify_ndjson_structure are accepted without error, dropping the second enforcement layer documented at target.rs:79-83.
G2-R3-03 [P2] (anneal/trusted/cargo-anneal/src/target.rs:1217, Pass 2 §3 (trusted/cargo-anneal, trusted/audit), static_verified): The NDJSON comparator route replaces old target-audit but silently drops its compiler-override rejection and pre-import .olean validation; only the anti-vacuity lint omission is disclosed.
- Invariant: Code Review Rules: any undisclosed weakening blocks merge; Human review surface and commit body must list every intentional policy relaxation. Pass 2 section 3 asks reviewers to preserve the auditor's checks.
- Evidence: Trigger: --allow-unpinned-lean with leanexport/nanoda_bin/con-ron under /bin sets use_ndjson_comparator (target.rs:1217), which calls audit_target_ndjson (target.rs:1374) instead of inspect_target. Old target-audit rejects @[implemented_by]/@[extern]/@[csimp] on reached declarations authored by target modules (TrustedBoundary.lean:6521-6531) and runs validateTargetArtifactPreImport before loading non-Proof target .olean files (TrustedBoundary.lean:5125, 6122). The new route has no equivalent: NDJSON carries no attribute data (ndjson_comparator.rs parse_record), SpecPreflight collectTargetConsts calls importEnv on target modules without pre-import validation (SpecPreflight.lean:1373), and 5a leanexport loads the same files unvalidated (stage.rs export_ndjson_expected). The receipt's deferred list adds only the anti-vacuity lint (verify.rs:2332) and the commit body mentions only that lint. Kernel soundness is unaffected (compiler attributes do not change kernel reduction; the loads run sandboxed), hence P2, but it is a behavioral relaxation versus base unpinned verification that must be disclosed or restored.
G2-R3-04 [P3] (anneal/docs/testing-architecture.md:911, General (Documentation), probe_confirmed): Renaming the paranoid-mode heading in auditing-and-comparator.md broke two relative anchor links in testing-architecture.md.
- Invariant: Documentation changes must keep relative Markdown links and heading anchors valid across affected docs (anneal/AGENTS.md Standing rules and Documentation review).
- Evidence: anneal/docs/testing-architecture.md:911 links to auditing-and-comparator.md#optional-paranoid-multi-kernel-ci-mode, which matched base auditing-and-comparator.md:165 (
### Optional paranoid multi-kernel CI mode) but was broken when this change renamed the heading at auditing-and-comparator.md:210 to### Optional--paranoid-quorummulti-kernel mode; confirmed by bwrap doc-link probe.
G2-R3-05 [P3] (anneal/trusted/audit/SpecPreflight.lean:206, Pass 2 §3 (trusted/audit), static_verified): inspectHeaderSyntax's requirePrelude branch checks args[1]!.isOfKind ``Parser.Module.prelude directly instead of unwrapping the optional nullKind node, so it always fails if requirePrelude is enabled.
- Invariant: Header syntax inspection must match Lean 4's Parser.Module.header AST layout (
$[module]? $[prelude]? $imports*, Lean/Parser/Module.lean:84), as implemented in TrustedBoundary.lean:946. - Evidence: In SpecPreflight.lean:205-208,
if requirePrelude && k == ``Parser.Module.header then unless args.size >= 2 && args[1]!.isOfKind ``Parser.Module.preludetestsargs[1]!directly, whereas Lean 4 wraps optionalpreludein anullKindnode whose child isParser.Module.prelude(compare TrustedBoundary.lean:946:!(args[1]?.map Syntax.getArgs |>.getD #[]).isEmpty). Latent because current callers passrequirePrelude := false, but any future caller enablingrequirePrelude := truewill unconditionally reject validpreludeheaders.
G2-R3-06 [P3] (anneal/trusted/audit/TrustedBoundary.lean:35, Pass 2 §3 (trusted/audit) / General documentation, static_verified): Trusted module header calls SpecPreflight a minimal parser-only inspector and lists only headers/spec-preflight/resolve-imports, but it also serves sysroot-consts and target-consts, which import compiled sysroot and target .olean files.
- Invariant: AGENTS.md 'Commenting in trusted/': trusted comments must give reviewers accurate rationale and contracts; trusted/ comment edits are never inapplicable.
- Evidence: TrustedBoundary.lean:33-41 says v4.35.0+ verification 'uses the minimal parser-only trusted/audit/SpecPreflight.lean ("headers", "spec-preflight", "resolve-imports")'. SpecPreflight.lean:42-54 and 1312-1392 add sysroot-consts and target-consts, which importModules the admitted sysroot plus the Model/Capture/Specification/Expected .olean files; stage.rs routes all five modes to SpecPreflight (uses_spec_preflight). The routing also applies only with --allow-unpinned-lean plus bundled binaries, not to every v4.35.0+ run. docs/auditing-and-comparator.md:229-233 still describes SpecPreflight as parser-only with zero .olean loading; docs/testing-architecture.md was updated to 'runtime preflight + module index'.
Executed Sandbox Probes
seat3bwrap root-manifest sha256sum --check --strict: outcome=passedseat3bwrap static hygiene and bundled_resources byte-parity check: outcome=passedseat3bwrap Python CI unittest suite (prebuild_bundled_oleans, check_guard_mutation, check_bundle_tree): outcome=passedseat3bwrap test_alpha_release.py + ARCHIVE_INPUTS path check: outcome=partialseat3bwrap Markdown relative link & heading anchor validator: outcome=failedseat3bwrap SpecPreflight vs TrustedBoundary decl parity & Rust/Lean constant table cross-check: outcome=passedseat3bwrap standalone rustc (--edition 2024 -O) CanonicalArena & BFS falsification probe: outcome=passed
265085f to
511f61c
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R3 fixes and rebase
Gate-2 R3 dispositions
VerificationRust and Lean suites ran on a head whose
On Mutation checks: removing the unsafe guard, the collision guard, the stored/owner equality check, or override extraction each makes its test fail. Not exercised: real Human review surfaceHuman review surface (base=9be5762cf8b1c31cae6ba72b4e99fdb01a7a60a1, merge_base=9be5762cf8b1c31cae6ba72b4e99fdb01a7a60a1, head=511f61c0fb5ea45c3840f84ea1048d436f83c7ff):
|
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 4)
- Identity:
one:879a6280327263572adae4ab62f78c894906a7d3:136d3bbfe3e5d50860c2507c97f44fbcc20ae099:202854b3f475382bb8f3744c834d5ccc39fe3b0055bee2e6cfd21604ed36efc6(base=9be5762cf8b1,head=511f61c0fb5e,tree=136d3bbfe3e5) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 24 inspected, 0 inapplicable, 0 blocked (of 24 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 2113s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1660s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1488s |
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/trusted/cargo-anneal/src/stage.rs:3863): The unpinned init-primitives cache key falls back to lean_sha256 without hashing sysroot .olean content.G2-R4-A02[P3] (anneal/ci/test_check_guard_mutation.py:421): The parity test compares onlydefblocks, so structure/abbrev/instance definitions escape comparison.G2-R4-A03[P3] (anneal/docs/testing-architecture.md:119): Repository layout comment forcheck_guard_mutation.pystill says(48 guards)after adding 4SpecPreflight.leanguards.G2-R4-A04[P3] (anneal/docs/trust-model.md:230): The trust-model doc still describes unpinned runs as target-audit replay only.G2-R4-A05[P3] (anneal/tests/audit/tests/target_audit.rs:2197): No reserved-namespace vectors for instance/structure/mutual/open ... indeclaration forms.G2-R4-A06[P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:10): Docs say 'default-ON on v4.35.0+', but the route needs --allow-unpinned-lean; live tests self-skip and CI installs no v4.35.G2-R4-A07[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1071): The parser silently skips empty lines, widening comparator-versus-kernel parse divergence surface.G2-R4-A08[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1809): Inductive records are flattened, so mutual-block grouping and order are never compared; the inductive parser branch has no unit test.G2-R4-A09[P3] (anneal/trusted/cargo-anneal/src/stage.rs:4168): Kernels are accepted on exit status alone; replayedDeclarations is comparator-derived.G2-R4-A10[P3] (anneal/trusted/cargo-anneal/src/verify.rs:2319): The unpinned receipt's unhashed list omits the comparator and kernel binaries' shared libraries.
Executed Sandbox Probes
seat3repo_hygiene_and_diff_scan: outcome=passedseat3workflow_permissions_auth_secret_containment_checklist: outcome=inapplicableseat3bwrap_root_manifest_sha256: outcome=passedseat3bwrap_python_ci_unittests: outcome=passedseat3bwrap_guard_mutation_catalog_and_bundle_check: outcome=passedseat3bwrap_lean_v4_34_1_spec_preflight_compile: outcome=passedseat3bwrap_spec_preflight_adversarial_vectors: outcome=passedseat3bwrap_module_header_and_target_consts_equations: outcome=passedseat3bwrap_specwf_unsafe_rec_and_sysroot_semantics: outcome=passedseat3rust_tests_and_live_v4_35_comparator: outcome=not_run
511f61c to
8e3f09c
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: rebase onto main after #4237
Changes since the reviewed head
VerificationRun on
On this head: Gate-1 (cross-family, read-only) on the delta: PASS, 0 P0/P1/P2, 2 P3. Both P3s are fixed in this head: the stale Not exercised: real Human review surface
|
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:d94f400cdfaa0ec820522d30ed7647af5b4ca509:8e3f09c4fc64439944b75b58d3b926bba3048599(base=d94f400cdfaa,head=8e3f09c4fc64,tree=a9ddc8c4af91) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 24 inspected, 0 inapplicable, 0 blocked (of 24 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
2 | 672s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
3 | 1514s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1678s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R5-01 |
P1 | 1 (seat2) | static_verified |
anneal/ci/check_guard_mutation.py:1584 |
Adding SpecPreflight.lean guard targets to check_guard_mutation.py without adding anneal/trusted/audit/SpecPreflight.lean to anneal-guard-mutation inputs in ci/checks.toml breaks the hermetic ci-core check and omits SpecPreflight.lean from its cache key. |
G2-R5-02 |
P1 | 1 (seat2) | static_verified |
anneal/flake.nix:338 |
Adding targetSpecPreflight = ./trusted/audit/SpecPreflight.lean to anneal/flake.nix without seeding it in ci/docker/anneal-tc.Dockerfile breaks anneal-tc image builds during nix eval. |
G2-R5-03 |
P2 | 1 (seat1) | static_verified |
anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:333 |
No test shows that any external kernel (nanoda_bin, con-ron, con-leche, lean4lean) rejects an ill-typed proof export in its configured invocation, although these kernels are the sole type checkers on the comparator route. |
G2-R5-04 |
P2 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/stage.rs:3961 |
Unpinned-mode process-global caches init_primitives_cache and sysroot_consts_cache omit sysroot .olean part_hashes from their cache keys, allowing stale trusted sysroot pins and inventories across multi-run callers in one process. |
G2-R5-05 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/verify.rs:2454 |
The Review Receipt's Human review surface reports 'Policy relaxations: none', but on Lean v4.35+ with --allow-unpinned-lean the comparator route drops the legacy fail-closed rejection of compiler overrides on reached Proof-module declarations and the anti-vacuity specification lint. |
G2-R5-01 [P1] (anneal/ci/check_guard_mutation.py:1584, Pass 2 §5 (CI scripts and ci-core input/cache manifest), static_verified): Adding SpecPreflight.lean guard targets to check_guard_mutation.py without adding anneal/trusted/audit/SpecPreflight.lean to anneal-guard-mutation inputs in ci/checks.toml breaks the hermetic ci-core check and omits SpecPreflight.lean from its cache key.
- Invariant: ci/checks.toml inputs must mount and hash every file read by a check so ci-core neither fails on missing mounted files nor serves stale cached passes for unmonitored TCB edits.
- Evidence: anneal/ci/check_guard_mutation.py:1584-1627 adds four AuditHeaderGuard entries with target_file='trusted/audit/SpecPreflight.lean', and run_guard_mutation_suite (anneal/ci/check_guard_mutation.py:2317-2332) compiles trusted/audit/SpecPreflight.lean. However, ci/checks.toml:1052-1077 ([[checks]] id = 'anneal-guard-mutation') lists 'anneal/trusted/audit/TrustedBoundary.lean' at line 1068 and omits 'anneal/trusted/audit/SpecPreflight.lean'. Because ci-core mounts only declared inputs and keys caching on inputs, anneal-guard-mutation cannot access SpecPreflight.lean at runtime and future SpecPreflight.lean-only edits would not invalidate its cache.
G2-R5-02 [P1] (anneal/flake.nix:338, Pass 2 §4/§5 (flake.nix and ci-core image build), static_verified): Adding targetSpecPreflight = ./trusted/audit/SpecPreflight.lean to anneal/flake.nix without seeding it in ci/docker/anneal-tc.Dockerfile breaks anneal-tc image builds during nix eval.
- Invariant: Every ./ path literal referenced by anneal/flake.nix derivations evaluated by nix eval must exist in ci/docker/anneal-tc.Dockerfile's synthetic /tmp/anneal-seed/anneal/ seed tree.
- Evidence: anneal/flake.nix:338 adds targetSpecPreflight = ./trusted/audit/SpecPreflight.lean inside packages.${system}.omnibus-archive. Because anneal/flake.nix is listed in [images.anneal-tc].context (ci/checks.toml:141), this PR triggers rebuilding ci/docker/anneal-tc.Dockerfile, which touches synthetic seed files at ci/docker/anneal-tc.Dockerfile:88-104 (including trusted/audit/TrustedBoundary.lean at line 90) without SpecPreflight.lean, and then evaluates all packages and devShells via nix eval --apply 'builtins.mapAttrs (: builtins.mapAttrs (: pkg: pkg.drvPath))' (ci/docker/anneal-tc.Dockerfile:129-132). Static scan confirmed ./trusted/audit/SpecPreflight.lean is the only flake.nix seed literal absent from ci/docker/anneal-tc.Dockerfile, causing nix eval to fail on the missing path.
G2-R5-03 [P2] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:333, Pass 2 §3 (trusted/cargo-anneal) test sensitivity, static_verified): No test shows that any external kernel (nanoda_bin, con-ron, con-leche, lean4lean) rejects an ill-typed proof export in its configured invocation, although these kernels are the sole type checkers on the comparator route.
- Invariant: trust-review Pass 2 §3 mandatory negative tests and anti-vacuity: every negative security test must fail if its target guard is disabled; the comparator route must not record a kernel as passed without evidence that it checks the export.
- Evidence: verify_ndjson_structure (target.rs:1541) checks only structure and identity. Type-correctness of proof_full rests on run_ndjson_nanoda, run_ndjson_con_ron and the quorum kernels (target.rs:1557-1595; invocation flags stage.rs:4396 '--verified', stage.rs:4476 '--import'). Every adversarial case in scalar_ndjson_comparator_rejects_adversarial_proofs (wrong statement, custom axiom, opaque, partial, sorry, Trusted.*) is rejected by the Rust comparator before any kernel runs. The synthetic test writes '#!/bin/sh\nexit 0' for nanoda_bin and con-ron (lines 843-845) and asserts kernelsPassed == [nanoda_bin, con-ron] (line 897). Replacing any kernel with /bin/true, or misconfiguring its CLI so it checks nothing, would pass the whole suite while receipts claim dual- or four-kernel coverage. Fix: add a negative test with a hand-crafted ill-typed but structurally valid proof_full fed to each kernel, expecting rejection.
G2-R5-04 [P2] (anneal/trusted/cargo-anneal/src/stage.rs:3961, Pass 2 §3 (trusted/cargo-anneal caching & sysroot integrity), static_verified): Unpinned-mode process-global caches init_primitives_cache and sysroot_consts_cache omit sysroot .olean part_hashes from their cache keys, allowing stale trusted sysroot pins and inventories across multi-run callers in one process.
- Invariant: Cached trusted sysroot NDJSON exports (init_primitives_cone.ndjson) and sysroot constant-to-module inventories (sysrootConsts) must bind their cache key to the cryptographic digests of the actual .olean* artifacts imported by leanexport and SpecPreflight.
- Evidence: Both caches execute in unpinned mode (adm.sysroot_manifest_sha256 is None because ndjson_tools is only populated under --allow-unpinned-lean). In export_ndjson_init_primitives (anneal/trusted/cargo-anneal/src/stage.rs:3961-3965), sysroot_key falls back to adm.lean_sha256 alone and ignores adm.unpinned_records completely. In collect_sysroot_consts_cached (anneal/trusted/cargo-anneal/src/stage.rs:4005-4016), sysroot_fp hashes only rec.source_sha256 (an Option that is None when src/lean is absent and is never read by SpecPreflight's 'sysroot-consts' .olean import) while omitting rec.part_hashes (which unpinned_sysroot_modules_sha256 in anneal/trusted/cargo-anneal/src/target.rs:1881-1906 already hashes). If sysroot .olean* files are modified under the same prefix and lean binary between Checker runs in the same process, both static caches return stale sysroot data.
G2-R5-05 [P2] (anneal/trusted/cargo-anneal/src/verify.rs:2454, Pass 1 / Human review surface; Pass 2 §3 (trusted/cargo-anneal), static_verified): The Review Receipt's Human review surface reports 'Policy relaxations: none', but on Lean v4.35+ with --allow-unpinned-lean the comparator route drops the legacy fail-closed rejection of compiler overrides on reached Proof-module declarations and the anti-vacuity specification lint.
- Invariant: AGENTS.md Code Review Rules: every PR's Review Receipt Human review surface must list every intentional policy relaxation (or none); any omission or mischaracterization blocks merge or ready-for-review.
- Evidence: Legacy target-audit rejects @[implemented_by]/@[extern]/@[csimp] on any logically reached declaration, including those authored by Proof modules via proofExport.overrides (TrustedBoundary.lean:6630-6640, 'Reject authored changes nevertheless'). The comparator only rejects overrides on retained non-Proof target modules (ndjson_comparator.rs:3297-3312; target-consts never loads Proof oleans). verify.rs:2450-2460 defers both the anti-vacuity lint and Proof-module override inspection and omits spec_warnings on this route. The same unpinned flag previously ran both checks via TrustedBoundary. The commit body discloses this, but every Human review surface block in the PR's Review Receipt comments (including the R4 receipt the latest delta receipt defers to) says 'Policy relaxations: none'.
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/ndjson_comparator_e2e.rs:48): The live v4.35 comparator e2e tests skip silently unless a v4.35 toolchain is found, and no CI script or workflow sets ANNEAL_REQUIRE_V435 or installs v4.35, so CI never exercises the live leanexport, kernel or SpecPreflight path.G2-R5-A02[P3] (anneal/trusted/audit/SpecPreflight.lean:1551): Post-import collectTargetConsts does not re-check validateTargetModuleIsModuleConsistency against deserialized data.isModule.G2-R5-A03[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1086): The NDJSON parser accepts empty lines, CRLF and unknown keys inside declaration records, none of which leanexport emits, which leaves room for the Rust comparator and the kernels to read the same bytes differently under a compromised 5b exporter.G2-R5-A04[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1446): NDJSON record parser rejects duplicate keys and unknown top-level keys but allows unexpected extra keys inside nested JSON objects.G2-R5-A05[P3] (anneal/trusted/cargo-anneal/src/stage.rs:3885): run_sandboxed_leanexport joins mapped paths with ':' in LEAN_PATH, which splits host paths containing ':' under non-bwrap execution tiers.
Executed Sandbox Probes
seat3Pass 1 static hygiene across candidate tree and diff_raw.txt (bwrap --unshare-all): outcome=passedseat3Root manifest & version/action checks (bwrap --unshare-all): outcome=passedseat3Mandatory CI workflow permissions/auth/secret-containment checklist: outcome=inapplicableseat3Python CI unittest suites in bwrap (test_check_bundle_tree, test_check_guard_mutation, test_prebuild_bundled_oleans, test_update_root_manifest, test_workflow_yaml, test_run_anneal_check, test_flake_lock, test_check_non_stable_version, test_ci_workflow, test_perf_tracking): outcome=passedseat3SpecPreflight vs TrustedBoundary compilation, parity, and adversarial target-consts probes on Lean v4.34.1 in bwrap: outcome=passedseat3Offline Rust Cargo test check in bwrap: outcome=skipped_missing_prereqs
8e3f09c to
f44bab7
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R5 fixes and rebase
Gate-2 R5 dispositions
VerificationRun on
Also on Gate-1 (cross-family, read-only) on the delta: PASS, 0 P0/P1/P2/P3. Not exercised: real Human review surface
|
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 6)
- Identity:
multi:120fe613cd50a89a3956ca90a2ae43fa47ae5ee0:f44bab78c3bd3072e0cc0ab2c70a2da74f52d872(base=120fe613cd50,head=f44bab78c3bd,tree=bf9c7bc08be2) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 26 inspected, 0 inapplicable, 0 blocked (of 26 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 2073s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1252s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 2778s |
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/docs/auditing-and-comparator.md:73): Doc cites crate-inner#![forbid(unsafe_code)], whereas enforcement is module-scoped#[forbid(unsafe_code)]onpub mod ndjson_comparator.G2-R6-A02[P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:237): Comparator e2e and kernel-rejection tests return early (pass) when no v4.35.0 toolchain is found, and no CI check sets ANNEAL_REQUIRE_V435, so kernel-level negative tests never run in CI.G2-R6-A03[P3] (anneal/trusted/audit/SpecPreflight.lean:1573): Identical realized equation theorems declared by two sibling non-Proof modules of incompatible roles are attributed solely to the earlier-loaded module.G2-R6-A04[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2419): render_leanexport_name emits unquoted ASCII words that could collide with Lean reserved keywords if a module declared a keyword-named constant.G2-R6-A05[P3] (anneal/trusted/cargo-anneal/src/sandbox.rs:1780): If the stdout-sink drain thread disconnects without sending (for example, it panics), stdout is treated as an empty success while the NDJSON sink file may be partial.G2-R6-A06[P3] (anneal/trusted/cargo-anneal/src/stage.rs:3394): Process-wide compiled_inspector_cache omits inspector stem from its key tuple.
Executed Sandbox Probes
seat3Verified 0 symlinks (120000), 0 submodules (160000), 0 hardlinks, 0 bidi/control characters, 0 TODO tokens, valid Fuchsi: outcome=passedseat3sha256sum --check --strict trusted/root-manifest.sha256 inside bwrap passed 4/4 entries (Cargo.toml, Cargo.lock, flake.n: outcome=passedseat3Inside bwrap: ci/check_skills.py exited 0; discover ci/test_*.py passed 32/32; test_check_guard_mutation.py passed 10/10: outcome=passedseat3Inside bwrap: SpecPreflight.lean and TrustedBoundary.lean matched identically across 70/70 non-divergent shared defs plu: outcome=passedseat3Inside bwrap: 0 broken relative Markdown links or missing anchors across the 4 changed docs; documented CLI flags, JSON: outcome=passedseat3Cargo workspace compilation/tests (ndjson_comparator, stage, target, verify, target_audit, ndjson_comparator_e2e), lake: outcome=not_runseat3No .github/workflows/*.yml files were modified in the 26-file diff.: outcome=inapplicableseat3No .github/workflows/*.yml files were modified in the 26-file diff.: outcome=inapplicableseat3No .github/workflows/*.yml files were modified; ci/checks.toml and ci/docker/anneal-tc.Dockerfile introduce no secrets o: outcome=inapplicableseat3No .github/workflows/*.yml files or release jobs were modified.: outcome=inapplicableseat3No .github/workflows/*.yml files or third-party Actions references were added or modified.: outcome=inapplicableseat3No .github/workflows/*.yml files were modified.: outcome=inapplicableseat3No .github/workflows/*.yml files or workflow caches/artifacts were modified.: outcome=inapplicableseat3No .github/workflows/*.yml files were modified; ci/checks.toml adds SpecPreflight.lean to anneal-guard-mutation.inputs a: outcome=inapplicableseat3seat1-spec-preflight-parity: outcome=confirmed
e7c9532 to
564bdbd
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: rebase onto main after #4156
Gate-2 R5 dispositions
VerificationRun on this head [real measurement]: The heavy suites ran on
Not exercised: real Human review surface
|
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 7)
- Identity:
one:e4296c20d0f485f9b3ff89ee503c6c1e61d66234:4662c12bf5d7474e4719a41c61dc9b956d41e98a:860053d7da41cd8ab539f2a42d0f8f076f79cc48b22008803ebd5b139df1f184(base=5ef98a084341,head=564bdbd25c85,tree=4662c12bf5d7) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 26 inspected, 0 inapplicable, 0 blocked (of 26 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 520s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
2 | 2145s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
1 | 1091s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R7-01 |
P1 | 2 (seat2, seat3) | static_verified |
anneal/trusted/cargo-anneal/src/target.rs:1244 |
NDJSON comparator audit reports omit audit.graph, causing every cargo anneal verify run on the NDJSON route to fail unconditionally with tool_failed (missing or malformed audit.graph metadata). |
G2-R7-02 |
P2 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:3456 |
build_closure_entries appends synthetic entries for every unreached retained Model module into modelClosure, causing verify.rs to over-report unreached candidate:* features and mark vetted-only or partial-feature receipts as experimental: true. |
G2-R7-01 [P1] (anneal/trusted/cargo-anneal/src/target.rs:1244, Pass 2 §4 (trusted/cargo-anneal), static_verified): NDJSON comparator audit reports omit audit.graph, causing every cargo anneal verify run on the NDJSON route to fail unconditionally with tool_failed (missing or malformed audit.graph metadata).
- Invariant: Every
Checker::run_targetreport consumed byverify.rsmust provideaudit.graphsovalidate_and_extract_candidate_features(verify.rs:2306-2308, 2601-2657) can enforce thevetted -/-> candidate:*bundled-model import boundary and emit a receipt, matchingTrustedBoundary.lean:6660. - Evidence: verify::run calls checker.run_target(&audit_request) at anneal/trusted/cargo-anneal/src/verify.rs:2244 and immediately calls validate_and_extract_candidate_features(&audit, &model_tiers, &model_modules) at lines 2306-2308. At lines 2606-2608, validate_and_extract_candidate_features returns Err(error("tool_failed", "audit", "missing or malformed audit.graph metadata")) unless audit.get("graph") is a JSON object. When self.admitted()?.ndjson_tools.is_some() (target.rs:1242-1244), audit_target_ndjson serializes NdjsonAuditVerdict (ndjson_comparator.rs:2034-2072, target.rs:1628-1680), which omits graph, and run_target (target.rs:1267-1371) only inserts moduleIdentities, bindings, sources, toolchain, and unpinnedLean. Although verify.rs:2464 detects auditMode == "ndjson_comparator" to skip extract_spec_warnings at lines 2538-2542, it does not guard line 2307 or populate audit.graph in target.rs. In anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs, every test invokes Checker::run_target directly without calling verify::run.
G2-R7-02 [P2] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:3456, Pass 2 §4 (trusted/cargo-anneal), static_verified): build_closure_entries appends synthetic entries for every unreached retained Model module into modelClosure, causing verify.rs to over-report unreached candidate:* features and mark vetted-only or partial-feature receipts as experimental: true.
- Invariant:
audit.modelClosuremust contain only declarations logically reached from the claim's model roots (TrustedBoundary.lean:6642-6654), becauseverify.rs:2599-2600, 2658-2679(tested atverify.rs:4878-4921) computes receiptcandidate_features,experimental, andassumptions(verify.rs:2444-2446) directly from modules appearing inaudit.modelClosurewhile excluding unreached candidate modules. - Evidence:
anneal/trusted/cargo-anneal/src/verify.rs:2050-2065registers every bundledtrusted/lean/*.leanmodule withTargetRole::Model, andanneal/trusted/cargo-anneal/src/target.rs:220(reachable_target_modules) retains all non-Proofmodules as seeds, sotarget.rs:1414-1415puts all bundledModelmodules (bothvettedand allcandidate:*modules, including unreached modules such asTrusted.MirSemantics.CanaryFixturesand any futurecandidate:<feature>modules) intoreq.model_modules.anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:3325-3331passesreq.model_modulesintobuild_closure_entries, whose loop at lines3456-3460unconditionally insertsClosureEntry { name: m.clone(), module: m.clone() }for everymnot incovered_modules. This pollutesaudit.modelClosurewith synthetic non-declaration entries for unreached modules, drags those modules intomoduleIdentities(target.rs:1275-1334), and causesvalidate_and_extract_candidate_features(verify.rs:2658-2679) to report every bundledcandidate:*tier as reached.
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/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:373): The only test that each external kernel, as invoked, rejects an ill-typed proof export (plus all other live-kernel e2e tests) returns early unless a v4.35 toolchain exists, and no CI job sets ANNEAL_REQUIRE_V435.G2-R7-A02[P3] (anneal/trusted/audit/TrustedBoundary.lean:2091): The new specification namespace guard now also rejects root-level declarations and namespace entry under Nat/List/Option/etc. on the pinned v4.34.1 path; specs that opened those namespaces will now be rejected.G2-R7-A03[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2412): render_leanexport_name writes numeric components as bare digits (e.g. _private.Spec.0.helper); if leanexport does not decode them back to Name.num, honest specs usingprivate deffail closed on the comparator route.
Executed Sandbox Probes
seat3git_mode_unicode_todo_fuchsia_header_scan: outcome=passedseat3root_manifest_sha256_check_bwrap: outcome=passedseat3anneal_ci_python_unittests_bwrap: outcome=passedseat3spec_preflight_compile_v434_and_v435_bwrap: outcome=passedseat3check_guard_mutation_spec_preflight_mutants_bwrap: outcome=passedseat3spec_preflight_reserved_namespace_and_target_consts_bwrap: outcome=passedseat3ndjson_four_kernel_valid_and_ill_typed_probe_bwrap: outcome=passedseat3check_pr_hygiene_bwrap: outcome=passedseat3check_bundle_tree_lean_only_source_tree_probe: outcome=inapplicableseat3github_workflows_security_checklist: outcome=inapplicableseat3verify_run_audit_graph_static_falsification: outcome=failed
564bdbd to
42f989d
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R7 fixes, rebased onto main after #4184
Gate-2 R7 dispositions
VerificationAll of the following are [real measurement].
Not exercised: real Human review surface
|
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:
multi:98ef27b42cdd4faa428daceff6a0a777d5b0f30d:42f989d4b9dee814e4bd3b84f5f93c289cdb3d74(base=98ef27b42cdd,head=42f989d4b9de,tree=77b467a35b9e) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 26 inspected, 0 inapplicable, 0 blocked (of 26 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 562s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1839s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
findings |
1 | 762s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R8-01 |
P1 | 1 (seat3) | probe_confirmed |
anneal/trusted/cargo-anneal/src/stage.rs:4454 |
run_ndjson_con_leche omits --jobs=<n>, causing --paranoid-quorum to abort with thread-creation EAGAIN under address-space limits on high-core-count hosts. |
G2-R8-01 [P1] (anneal/trusted/cargo-anneal/src/stage.rs:4454, Pass 2 §3 (trusted/cargo-anneal), probe_confirmed): run_ndjson_con_leche omits --jobs=<n>, causing --paranoid-quorum to abort with thread-creation EAGAIN under address-space limits on high-core-count hosts.
- Invariant:
--paranoid-quorummust reliably runcon-lecheinsideExecSealacross supported host environments, bounding worker virtual-memory reservations consistently withrun_ndjson_con_ronandcon-leche's documented--jobs=<n>guidance. - Evidence: In
anneal/trusted/cargo-anneal/src/stage.rs,run_ndjson_con_ron(lines 4424-4431) caps workers viadefault_compile_workers(2).min(4)and passesvec!["--verified".to_string(), format!("--jobs={jobs}")], whereasrun_ndjson_con_leche(lines 4449-4456) passesVec::new().con-leche --helpdocuments that--jobsdefaults to hardware thread count and each worker reserves ~1 GiB of virtual address space (failed to create threadunderulimit -v). In isolatedbwrapprobes on a 96-core host: (1)ndjson_kernels_reject_ill_typed_proof_export(livev4.35.0,prlimit --as=68719476736) passednanoda_binandcon-ron, then failed inrun_ndjson_con_lechewithexit Some(139): libc++abi: terminating due to uncaught exception of type lean::exception: failed to create thread: Resource temporarily unavailable; (2) a two-sidedbwrapprobe on a 267-declarationInit.CoreNDJSON export under both16 GiBand64 GiBRLIMIT_ASfailed with[](rc=-6) and succeeded with['--verified', '--jobs=4'](rc=0,con-leche: accepted 267 declarations (--verified)).
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/test_check_guard_mutation.py:448): The parity test exempts preflightSpecs and inspectHeader without checking that they differ only in the header-syntax call, so a later SpecPreflight edit could drop a check from those entry points without failing CI.G2-R8-A02[P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:403): The real-kernel e2e tests (including the ill-typed-export rejection test the commit body cites) return early unless a v4.35 toolchain is installed, and no CI lane sets ANNEAL_REQUIRE_V435=1, so kernel rejection behaviour is never exercised in CI.G2-R8-A03[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:3278): Checkis_sysroot_id(arena, cid)alongsideexpected_cone_set.contains(&cid)when admittingsorryAxreferences underallow_sorry_in_prooffor strict parity withTrustedBoundary.lean.G2-R8-A04[P3] (anneal/trusted/cargo-anneal/src/stage.rs:3881): On the unpinned comparator route, leanexport and kernel binaries are hashed before and after execution but run by path, so a swap during execution followed by a restore would not be detected.G2-R8-A05[P3] (anneal/trusted/cargo-anneal/src/stage.rs:4383): run_ndjson_standalone_kernel classifieslibc++abi: terminating due to uncaught exceptionaborts asFailure::policy(code: 1) instead of an operational error (code: 2).
Executed Sandbox Probes
seat3pass1_static_hygiene_and_root_manifest: outcome=passedseat3workflow_permissions_checklist: outcome=inapplicableseat3bwrap_python_ci_unit_tests: outcome=passedseat3bwrap_spec_preflight_v434_v435: outcome=passedseat3bwrap_rust_ndjson_comparator_unit_and_synthetic_e2e: outcome=passedseat3bwrap_target_audit_spec_preflight_v434: outcome=partial_timeoutseat3bwrap_live_v435_ndjson_kernels_and_con_leche_two_sided: outcome=failed_confirmed_finding
42f989d to
aa06e34
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R8 fix, rebased onto main after #4341
Gate-2 R8 dispositions
VerificationAll results below are [real measurement].
Not exercised: real Human review surface
|
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 9)
- Identity:
multi:b6eae9a57aaccf9f35b23e629162026ffb405f0f:aa06e34365877e5b95bfdcafcf2156cec4a7b6b9(base=b6eae9a57aac,head=aa06e3436587,tree=211fb5fb5c8a) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 26 inspected, 0 inapplicable, 0 blocked (of 26 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
1 | 526s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1271s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 2778s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R9-01 |
P2 | 1 (seat1) | static_verified |
anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2570 |
Open trust question: the NDJSON comparator checks that exports include every constant they depend on, but not that declarations only reference earlier ones, and it drops inductive-record grouping, so soundness against injected cyclic theorems or malformed inductive records rests on unverified external kernel loader behaviour. |
G2-R9-01 [P2] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:2570, Pass 2 §3 (trusted/cargo-anneal), static_verified): Open trust question: the NDJSON comparator checks that exports include every constant they depend on, but not that declarations only reference earlier ones, and it drops inductive-record grouping, so soundness against injected cyclic theorems or malformed inductive records rests on unverified external kernel loader behaviour.
- Invariant: On the comparator route the Rust comparator plus external kernels replace TrustedBoundary's in-order kernel replay. A proof export must be well-founded (each constant references only earlier declarations or its own mutual block), and the inductive blocks the kernels load must be exactly those the comparator vetted.
- Evidence: check_export_closed (L2570-2593) only tests env.constants.contains_key(dep) and never compares positions in const_order; insert_const appends to const_order (L1413) with no order check elsewhere. The inductive parser (L1824 onward) splits types/ctors/recs into separate Induct/Ctor/Rec constants without checking that the record's types match each type's all list, that every ctor is listed in some type's ctors with a matching induct, or that recursors belong to the record. Trigger: Proof modules are untrusted Lean and may add environment declarations without kernel checking (e.g. in-source set_option debug.skipKernelTC or a metaprogram calling addDeclWithoutChecking), so the sandboxed leanexport can emit
theorem T : Expected.claim := Aandtheorem A : Expected.claim := T. The step-7 type check (L3118-3165) passes because T's declared type is Expected.claim, and the comparator does not unfold values. Whether nanoda_bin (multi-threaded, stage.rs config) and con-ron --verified reject forward or cyclic references and orphan constructors is undocumented and not exercised by the ill-typed-export kernel test. The route is reachable only under --allow-unpinned-lean (tainted receipts). Resolving check: add a const_order precedence check plus an inductive record consistency check in 5c, or cite the pinned kernels' loader semantics and add two-theorem-cycle and orphan-constructor negative tests.
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/ci/test_check_guard_mutation.py:416): Parity test regex compares only column-0defblocks; future shared structure/abbrev/instance or one-line@[attr] defguards would drift silently (ParseScope is currently uncompared).G2-R9-A02[P3] (anneal/tests/audit/tests/target_audit.rs:2195): The ns-root-trusted vector cannot fail if the root stripping in rejectForbiddenSpecDeclNamespace is removed, because isValidSourceIdent rejects root first with a message containing the same substring; the Internal.UV/Dynlib vectors similarly pin the older guard.G2-R9-A03[P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:10): Module doc says the comparator is 'default-ON on Lean v4.35.0+', but it is gated on --allow-unpinned-lean.G2-R9-A04[P3] (anneal/trusted/audit/TrustedBoundary.lean:160): Review Receipt Human review surface says pinned v4.34.1 runs are unaffected, but the stricter spec-namespace guard also applies to pinned runs (a tightening, disclosed in the commit body).G2-R9-A05[P3] (anneal/trusted/audit/TrustedBoundary.lean:1909): The modified spec admission guard is tested in target_audit.rs rather than boundary_audit.rs as base AGENTS.md literally requires; coverage exists and follows existing spec-preflight test precedent, but only about 6 of about 60 reserved roots are pinned by tests.G2-R9-A06[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1086): parse_ndjson_reader silently skips internal blank lines rather than failing closed on non-JSON empty lines.G2-R9-A07[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1701): Unknown keys inside declaration payload objects are silently ignored, unlike the strictness applied to top-level records; a kernel honouring an extra field could diverge from what the comparator vetted.G2-R9-A08[P3] (anneal/trusted/cargo-anneal/src/stage.rs:60): In-memory InspectorCacheKey omits the inspector module stem (TrustedBoundary vs SpecPreflight) that OleanCacheKeyInput includes.G2-R9-A09[P3] (anneal/trusted/cargo-anneal/src/stage.rs:3919): check_pr_hygiene.py emitted 7 non-blocking inline-code-span line-wrap warnings across 5 touched files.G2-R9-A10[P3] (anneal/trusted/cargo-anneal/src/verify.rs:2415): Receipt v3 lean_assumption lists only (nanoda_bin / con-ron) even when --paranoid-quorum runs con-leche and lean4lean.
Executed Sandbox Probes
seat3root-manifest.sha256 integrity (sha256sum --check --strict trusted/root-manifest.sha256inside bwrap): outcome=passseat3Shell syntax check (bash -n /work/anneal/ci/run_anneal_check.shinside bwrap): outcome=passseat3PR-relevant Python CI unit test suites (8 modules inside bwrap --unshare-all --clearenv): outcome=passseat3Basecheck_pr_hygiene.py(b6eae9a..aa06e34inside bwrap against non-bare/tmp/probe/repobacked by/pr.git+ alternates): outcome=passseat3Adversarialcheck_bundle_tree.verify_bundle_treeSpecPreflight enforcement inside bwrap: outcome=passseat3Adversarialtest_spec_preflight_parity_with_trusted_boundarysensitivity + guard mutation anchor check inside bwrap: outcome=passseat3Cross-file Lean/Rust TCB parity andspec_warningsconsumer scan inside bwrap: outcome=passseat3Minimalrustccompile + run probe inside bwrap (rustc 1.98.0-nightly 2026-05-31): outcome=passseat3``test_ci_workflow.pysubset inside bwrap (excludingtest_root_override_paths_and_symlinks_fail_closed`)`: outcome=`partial_timeout`seat3Host Lean v4.34.1 runtime check inside bwrap (--versionandlean -j1 --stdin): outcome=blocked_by_host_limitsseat3Workflow Permissions Checklist #1: Top-level and per-jobpermissions:least-privilege across touched.github/workflows/*.yml``: outcome=not_applicableseat3Workflow Permissions Checklist #2: Nopull_request_target/workflow_run/issue_commentexecuting untrusted code with secrets/write tokens: outcome=not_applicableseat3Workflow Permissions Checklist #3:secrets.*/GITHUB_TOKENexposure and no echo/$GITHUB_ENV/$GITHUB_OUTPUT/artifact leaks: outcome=not_applicableseat3Workflow Permissions Checklist #4: Release/publish jobs gated by protectedenvironment:``: outcome=not_applicableseat3Workflow Permissions Checklist #5:actions/checkoutpersist-credentials: falseand full commit-SHA third-party action pinning: outcome=not_applicableseat3Workflow Permissions Checklist #6: No${{ github.event.* }}/${{ inputs.* }}shell script injection inrun:``: outcome=not_applicableseat3Workflow Permissions Checklist #7: Cache key/restore-key trust isolation and artifact verification: outcome=not_applicableseat3Workflow Permissions Checklist #8: No relaxation of existing workflow/CI guards (permissions,environment,cache,if:): outcome=pass
aa06e34 to
c32ecde
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R9 fix, rebased onto main after #4215
Gate-2 R9 dispositions
Additional fix:
|
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 10)
- Identity:
one:59c578a6bca721334f4865d3509b807b7648ac56:0f0d62607ccc8e3205dc3b8ddfeb956b22ddeb9f:e1f8f136556c50f4af0f53a8706ebb266444b5070dc65df4fe5967089327e0af(base=c69454f044c7,head=c32ecde0755f,tree=0f0d62607ccc) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 28 inspected, 0 inapplicable, 0 blocked (of 28 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
2 | 1459s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1579s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1304s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R10-01 |
P2 | 1 (seat1) | static_verified |
anneal/ci/test_check_guard_mutation.py:448 |
The parity test exempts preflightSpecs and no CI-executed test runs SpecPreflight's spec-preflight mode, so SpecPreflight's specification-admission entry point can stop calling parseAndInspectSpecCommands without any CI failure. |
G2-R10-02 |
P2 | 1 (seat1) | static_verified |
anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:404 |
Every test that runs a real or rejecting kernel on the comparator route returns early unless a Lean v4.35.0 toolchain is present, which CI neither provisions nor requires, and the only CI-executed pipeline test stubs nanoda_bin and con-ron as exit 0, so the kernel-rejection guards have no CI-executed negative test. |
G2-R10-01 [P2] (anneal/ci/test_check_guard_mutation.py:448, Pass 2 §3 (trusted/audit) / Pass 2 §5 (ci/), static_verified): The parity test exempts preflightSpecs and no CI-executed test runs SpecPreflight's spec-preflight mode, so SpecPreflight's specification-admission entry point can stop calling parseAndInspectSpecCommands without any CI failure.
- Invariant: Every added or modified admission or syntax guard needs a negative test asserting exit code 1 and the diagnostic that fails if the guard is disabled (AGENTS.md Pass 2 trusted/audit; trust-review section 3).
- Evidence: The divergent set {inspectHeader, preflightSpecs, run, main} only asserts that each name exists in TrustedBoundary.lean. anneal/trusted/cargo-anneal/src/stage.rs:3381 routes headers, spec-preflight and resolve-imports to SpecPreflight only when ndjson_tools is present, which never holds on the pinned CI toolchain, so the spec-preflight negative vectors in anneal/tests/audit/tests/target_audit.rs (line 1676) exercise TrustedBoundary only. The only SpecPreflight spec-preflight negatives (ndjson_comparator_e2e.rs line 547) are v4.35-gated, and the guard-mutation suite covers only SpecPreflight headers mode. Guard removal: deleting the call at anneal/trusted/audit/SpecPreflight.lean:1317-1318 passes the parity test (exempt), the required-definition list (the def still exists), the mutation suite and target_audit. Independent comparison shows the two preflightSpecs bodies differ only in the header-inspection call, so the exemption is wider than the actual divergence.
G2-R10-02 [P2] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:404, Pass 2 §3 (trusted/cargo-anneal orchestrator) / General (test adequacy), static_verified): Every test that runs a real or rejecting kernel on the comparator route returns early unless a Lean v4.35.0 toolchain is present, which CI neither provisions nor requires, and the only CI-executed pipeline test stubs nanoda_bin and con-ron as exit 0, so the kernel-rejection guards have no CI-executed negative test.
- Invariant: Negative security tests must fail when their target guard is disabled (trust-review section 3 anti-vacuity; change-review non-vacuous tests); the commit message states that a test requires each kernel to reject an ill-typed export.
- Evidence: discover_v435_lean (lines 48-66) returns None unless ANNEAL_LEAN_V435 or a home elan v4.35.0 toolchain exists; ANNEAL_REQUIRE_V435 and ANNEAL_LEAN_V435 occur nowhere else in the tree and no file under ci/, .github/, anneal/ci/, flake.nix or the tc Dockerfile references a 4.35 toolchain. Skip sites: 236-239, 404-407, 446-449, 548-551, 626-629. The CI-run synthetic test (line 760) writes both kernels as 'exit 0' shell stubs (956-959) and asserts acceptance only. Guard removal: deleting the non-zero-exit rejection blocks in anneal/trusted/cargo-anneal/src/stage.rs (4352-4363 and 4441-4452), the copy_verified_kernel_input digest check (stage.rs 216-231), or the incomplete-tool fail-closed branch in toolchain.rs discover_ndjson_comparator_tools leaves every CI-executed test green. The con-ron/con-leche invocation with --verified --jobs=N differs from the flagless bundledKernels invocation in upstream Lake/CLI/Check.lean at the cited pinned commit, so its effect is validated only by the skipped tests. The author's receipt reports a manual ANNEAL_REQUIRE_V435=1 run, which is not a merge gate.
Non-blocking advisories (P3, not Gate 2 findings)
These notes do not block merge and do not require another Gate 2 round.
G2-R10-A01[P3] (anneal/docs/auditing-and-comparator.md:73): Documentation spells the safety attribute as crate-level #![forbid(unsafe_code)] while lib.rs applies module-level #[forbid(unsafe_code)] to ndjson_comparator.G2-R10-A02[P3] (anneal/docs/testing-architecture.md:119): Overview tree comment still says84 guardsforcheck_guard_mutation.pyafter adding 4spec_preflight_*guards.G2-R10-A03[P3] (anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1726): parse_ndjson_comparator_audit validates digest formats without cross-checking paranoidQuorum against quorum kernel digests/kernelsPassed or traversing timingMs subkeys.G2-R10-A04[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:109): Two pinned upstream citations in the trusted module docs do not match the cited commit: CollectAxioms does traverse opaque bodies, and Expr equality does compare let nondep and mdata.G2-R10-A05[P3] (anneal/trusted/cargo-anneal/src/sandbox.rs:2553): Tier 1 bwrap and Tier 2 Landlock reuse PT_INTERP and /nix/store settings probed solely from exec_lean rather than resolving policy.exec_bin.G2-R10-A06[P3] (anneal/trusted/cargo-anneal/src/stage.rs:4352): A kernel process that dies from a signal or resource limit is reported as a policy rejection (code 1) instead of an operational failure (code 2).
Executed Sandbox Probes
seat3repo_hygiene_and_root_manifest: outcome=passedseat3ci_python_targeted_suites: outcome=passedseat3audit_headers_guard_mutation: outcome=passedseat3spec_preflight_lean_v4_34_1_adversarial_probes: outcome=passedseat3name_render_round_trip_rustc_and_lean: outcome=passedseat3check_bundle_tree_and_run_anneal_check_shell_guards: outcome=passedseat3workflow_checklist_1_permissions: outcome=inapplicableseat3workflow_checklist_2_triggers: outcome=inapplicableseat3workflow_checklist_3_secrets: outcome=inapplicableseat3workflow_checklist_4_release_environments: outcome=inapplicableseat3workflow_checklist_5_checkout_and_action_pinning: outcome=inapplicableseat3workflow_checklist_6_script_injection: outcome=inapplicableseat3workflow_checklist_7_cache_and_artifact_trust: outcome=inapplicableseat3workflow_checklist_8_guard_relaxation: outcome=inapplicable
c32ecde to
3e9f125
Compare
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R10 fixes, rebased onto main after #4234
Gate-2 R10 dispositions
VerificationRun on tree
Gate-1: a cross-family read-only reviewer returned PASS with P0=P1=P2=P3=0 on the same patch at Not exercised: real Human review surface
|
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 11)
- Identity:
one:4c934b3e9a6a9654e5014f9491469d6d675d6098:2eab4971f7f11dbe7ce6adae9ce708ad8d1275c8:4fe6f26367c4d0f9c972bb9899c2166edd0e174b421ba30da7db4610ee94436c(base=85efba8b01ff,head=3e9f125f1a53,tree=2eab4971f7f1) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 28 inspected, 0 inapplicable, 0 blocked (of 28 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 3054s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
1 | 1484s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1257s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R11-01 |
P2 | 1 (seat2) | static_verified |
anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1870 |
parse_ndjson_comparator_audit bypasses UnknownFieldsPolicy::Deny on audit.timingMs and omits ndjson_comparator quorum, digest, and primitive-count cross-checks. |
G2-R11-01 [P2] (anneal/trusted/cargo-anneal/src/core/inspect/schema.rs:1870, Pass 2 §3 (trusted/cargo-anneal/src/core/inspect/schema.rs), static_verified): parse_ndjson_comparator_audit bypasses UnknownFieldsPolicy::Deny on audit.timingMs and omits ndjson_comparator quorum, digest, and primitive-count cross-checks.
- Invariant: Receipt v3 schema validation (core/inspect/schema.rs) must reject unrecognized keys under UnknownFieldsPolicy::Deny on fixed-schema nested objects (matching /timing_ms at schema.rs:889-896) and enforce internal cross-field invariants matching validate_ndjson_verdict (ndjson_comparator.rs:2224-2296).
- Evidence: 1) At schema.rs:1898,
audit.req_obj("timingMs")?;never creates anObjectCursor::nested("/audit/timingMs", ...)or callscollect_unrecognized(unknown), so arbitrary unrecognized keys and non-u64 values inside/audit/timingMspass even underUnknownFieldsPolicy::Deny(andsample_ndjson_success_jsonat schema.rs:3068 only populates{"total": 1}instead ofNdjsonTimingMs's 10 fields). 2) At schema.rs:1108-1131 and 1870-1900,parse_ndjson_comparator_auditacceptsauditMode: "ndjson_comparator"receipts withpinnedPrimitivesCount: 0,expectedConeDeclarations: 0,paranoidQuorum: truewith omittedconLecheSha256/lean4leanSha256and onlykernelsPassed: ["nanoda_bin"], or a kernel listed in bothkernelsPassedandkernelsSkipped, with zeroinvariant_violationsand passing defaultevaluate_policy. The PR's own test at schema.rs:3091-3100 assertsinvariant_violations.is_empty()on a contradictory receipt that hasparanoidQuorum: falsewith quorum digests andcon-ronsimultaneously inkernelsPassedandkernelsSkipped(citingsorryAxdespite nosorryAxinaxioms).
Non-blocking advisories (P3, not Gate 2 findings)
These notes do not block merge and do not require another Gate 2 round.
G2-R11-A01[P3] (anneal/README.md:264): The acknowledgments do not credit the external kernels and exporter the new route depends on.G2-R11-A02[P3] (anneal/ci/test_check_guard_mutation.py:448): The parity test exempts inspectHeader entirely although it differs from the TrustedBoundary version by the same single substitution already modelled for preflightSpecs.G2-R11-A03[P3] (anneal/docs/trust-model.md:381): The trust model still says the target checker under --allow-unpinned-lean runs two-phase target-audit kernel replay, which is no longer true when the sysroot bundles the comparator binaries.G2-R11-A04[P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:236): Five of the seven end-to-end tests return early and report success when no v4.35.0 toolchain is installed, so CI green does not mean they ran.G2-R11-A05[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:86): The MAX_NDJSON_LINES comment says the bound prevents host memory exhaustion, which the quadratic name rendering does not deliver.G2-R11-A06[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:518): intern_name stores a full dotted rendering for every interned name, so memory grows quadratically with name nesting depth in an adversarial proof export.G2-R11-A07[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1101): The comparator silently skips empty lines that the exporter never emits, which is an unverified point of possible divergence from the external kernels' parsers.G2-R11-A08[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:3441): Step 8 sorryAx admission under allow_sorry_in_proof checks expected_cone_set.contains(&cid) but does not also reject is_sysroot_id(arena, cid).G2-R11-A09[P3] (anneal/trusted/cargo-anneal/src/verify.rs:3430): Receipt assumptions string unconditionally lists(nanoda_bin / con-ron)for NDJSON comparator runs regardless of sorry-induced con-ron skip or --paranoid-quorum.G2-R11-A10[P3] (ci/checks.toml:1097): The Review Receipt's prose Human review surface list omits the two repository-root CI files, which appear only in its machine-readable footer and the commit body.
Executed Sandbox Probes
seat3repo_hygiene_and_root_manifest: outcome=passedseat3spec_preflight_parity_and_guard_list: outcome=passedseat3ci_python_unit_tests_core_and_release: outcome=passedseat3ci_python_unit_tests_pr_hygiene_and_ci_lib: outcome=passedseat3ci_python_unit_tests_ci_workflow: outcome=partialseat3ci_python_unit_tests_host_tool_limited: outcome=inconclusiveseat3shell_syntax_and_env_edge_probes: outcome=passedseat3rustc_canon_name_and_eq_helper_probes: outcome=passedseat3lean_v434_spec_preflight_compile_probe: outcome=inconclusiveseat3workflow_checklist_1_permissions_least_privilege: outcome=passedseat3workflow_checklist_2_triggers: outcome=passedseat3workflow_checklist_3_secrets_exposure: outcome=passedseat3workflow_checklist_4_protected_environments: outcome=passedseat3workflow_checklist_5_checkout_and_sha_pinning: outcome=passedseat3workflow_checklist_6_script_injection: outcome=passedseat3workflow_checklist_7_cache_and_artifact_boundaries: outcome=passedseat3workflow_checklist_8_no_guard_relaxation: outcome=passedseat3blank-line-kernel-differential: outcome=inconclusive
Verify target theorems on Lean `v4.35.0+` (when `--allow-unpinned-lean`
is enabled and `<sysroot>/bin/` provides `leanexport`, `nanoda_bin`, and
`con-ron`) without any Lean process producing the verdict and without
loading `Proof` `.olean` files outside the sandboxed exporter.
`cargo-anneal` routes those runs through the pure-Rust Universal NDJSON
Comparator (`trusted/cargo-anneal/src/ndjson_comparator.rs`) backed by
dual independent kernels (`nanoda_bin` and `con-ron`), plus optional
4-kernel `--paranoid-quorum` (`con-leche`, `lean4lean --import`). Pinned
admission sets `ndjson_tools: None` until `v4.35.0+` comparator tool
digests are pinned, so the repository's pinned Lean `v4.34.1` toolchain
keeps using `TrustedBoundary.lean` for every mode.
The comparator route runs these actions:
- `5-init`: clean-sysroot export of the 39 kernel-accelerated and
elaborator `Init` primitives, the 3 standard axioms, and the admitted
`System.Platform` declarations.
- `target-consts`: `SpecPreflight` validates the compiled `Model`,
`Capture`, `Specification`, and `Expected` `.olean`s with the same
pre-import header, companion, and `isModule` checks as the legacy
`"target-audit"`, imports them with the admitted sysroot (never a
`Proof` `.olean`; `loadExts := false`), and reports each module's
exact constant inventory from its `ModuleData`. Compiler-generated
constants (anonymous and `deriving` instances, constructors and
projections, `where`/`let rec` auxiliaries) are thus attributed to
their defining module instead of being reconstructed from source
syntax. Lean's import keeps the later of two equal-header theorems
under the earlier module's index, so each target constant must equal
the stored constant, and a constant another loaded module also
declares is rejected unless it is a realized equation-style theorem
equal to the owner's. It also rejects any `unsafe` target constant and
reports the targets' `@[implemented_by]`, `@[extern]`, and `@[csimp]`
subjects.
- `5b`: sandboxed export of `proof_full.ndjson`.
- `5a`: export from the trusted modules alone of the expected
declaration, every `Specification` constant (except the `partial`
`_unsafe_rec` auxiliaries Lean pairs with well-founded definitions),
and every target-module constant `proof_full` contains.
`--ignore-missing` is no longer passed, so an absent root or
dependency aborts the export.
- `5-pin`: clean-sysroot re-export, with zero target `.olean`s mounted,
of every sysroot-named constant either export contains.
- `5c`: the pure-Rust checks, then the kernels.
`5c` requires every export to declare each constant's dependencies
before the constant (other than the names-only mutual-block peers
`leanexport` records for definitions, and references within one
inductive record), so a missing, forward, or cyclic reference fails
closed. Each inductive record must be one consistent mutual block whose
types, constructors, and recursors agree on its membership. It requires
each sysroot-named constant to equal its clean `5-init`/`5-pin`
definition, so sysroot status is never granted by name alone; a proof
module that redeclares a sysroot name (or a kernel-accelerated one) with
different content is rejected. Each target-module constant in
`proof_full` must appear identically in the trusted export, and each
trusted-export constant must have a sysroot or target-module origin.
Proof-origin constants may not use the `Trusted` root, a reserved kernel
root, or a kernel-accelerated name (generated equation and splitter
helpers of a pinned parent excepted); this replaces the name-prefix
check that let a registered `Trusted` model module admit any `Trusted.*`
constant. Compiled declaration edges between target modules must satisfy
`TargetRole::allows`, and sysroot constants in either export may not
reference target constants. Canonical inputs must come from their
designated roles, the canonical root must be `CrateTheorem` or
`UnitTheorem` applied to `Crate.mk` or a Profile v2 counterpart applied
to `CrateV2.mk`, the target theorem must be proof-origin, no reached
target declaration may carry a compiler override, and the direct and
transitive specification bans apply to every module-indexed
`Specification` constant. `.opaqueInfo` is admitted only for non-unsafe,
content-pinned sysroot constants such as `System.Platform.getNumBits`.
The comparator also interns names structurally, rejects duplicate NDJSON
keys, and requires export metadata to match the admitted toolchain's
exact version and commit. Kernels re-hash their private copy of
`proof_full.ndjson` against the digest the comparator verified, and
every kernel's stderr is checked for Lean panic markers. `con-ron` and
`con-leche` run in `--verified` mode with a capped `--jobs`; by default
each starts a worker per hardware thread and exhausts address-space
limits on many-core hosts. A test feeds every kernel, in its configured
invocation, an export whose target theorem is ill-typed but structurally
intact, and requires each to reject it while accepting the well-typed
original; that test needs a `v4.35.0` install, so a CI test also runs
the comparator route with stub kernels and requires it to fail closed
when either kernel exits nonzero or panics. The process-wide caches of
the clean sysroot export and the sysroot constant index are keyed by the
pinned manifest digest or, unpinned, by every admitted sysroot module's
artifact digests.
`SpecPreflight.lean` duplicates `TrustedBoundary.lean`'s header and
specification admission guards (including module-mode specifications)
and its pre-import `.olean` validation;
`ci/test_check_guard_mutation.py` requires every shared definition, and
`preflightSpecs` apart from its header check, to stay identical, and
`tests/audit/tests/target_audit.rs` exercises `"sysroot-consts"`,
`"target-consts"`, and (through a test hook that routes it to
`SpecPreflight`) `"spec-preflight"` on the pinned toolchain. In
both files the specification namespace guard keeps the
`isForbiddenPureNamespace` checks (`_root_` stripping and the
`Init.System`/`Internal.UV`/`Dynlib` sub-scopes) and additionally
reserves `Trusted`, `Anneal`, `Proof`, and every `reservedKernelRoots`
root, including `Init` and `Std`.
As in `TrustedBoundary.lean`'s `"target-audit"`, the comparator verdict
carries the admitted module import graph, which `verify` needs to check
bundled-model trust tiers, and its subject, model, and specification
closures list only reached declarations, each with its defining module,
so `candidate:*` features come only from reached `Model` modules.
Receipts record `sysrootPinsSha256` and the comparator and kernel binary
digests. `cargo anneal inspect` validates those digests, the fixed
`timingMs` schema, and the kernel and quorum invariants the comparator
enforces, reads skipped kernels recorded as `{kernel, reason}`, does not
require `checkedAlternateProofs` from the comparator route, and ranks a
change from the comparator to the default audit as a regression. The
comparator route does not run the anti-vacuity specification lint, and
it does not inspect compiler-override attributes on `Proof` declarations
(their `.olean`s never load outside the sandboxed exporter, and the
attributes cannot change kernel reduction). Its receipts therefore omit
`spec_warnings` and list both under `deferred`. `stage.rs`,
`sandbox.rs`, and `verify.rs` reserve `SpecPreflight`, copy NDJSON sinks
read-only into `ExecSeal` inputs, and precompile and cache
`SpecPreflight.olean` (`ci/prebuild_bundled_oleans.py`, `flake.nix`,
`ci/run_anneal_check.sh`, `ci/check_bundle_tree.py`,
`trusted/root-manifest.sha256`). The `anneal-guard-mutation` ci-core
check takes `SpecPreflight.lean` as an input, and the `anneal-tc` image
seeds it for the flake evaluation.
Part of #4016
Part of #4109
Agent-authored-by: AI agent acting on joshlf's behalf
|
Authored by an AI agent acting on joshlf's behalf. Review Receipt: Gate-2 R11 fix, rebased onto main after #4374
Gate-2 R11 dispositions
VerificationOn the simulated base (head
On the final head
Gate-1 (cross-family, read-only reviewer):
Not exercised: real Human review surface
|
3e9f125 to
fe86e6e
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 12)
- Identity:
one:ecbb2d90b35aa47f1e1c1937ac2ccd6904790f1c:7e02bb24a488816a3529a243c4ddc804fa4a1a5e:ed104564356bd0e8437718ae67e66b7d610eca8d130d5b07940c02afa25a9930(base=24e6e7250c69,head=fe86e6e2e7e0,tree=7e02bb24a488) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 29 inspected, 0 inapplicable, 0 blocked (of 29 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 386s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 1474s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 1043s |
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-R12-A01[P3] (anneal/ci/test_check_guard_mutation.py:430): The parity test's boundary_re ends a def body at any column-0 '--' comment, so drift after such a comment inside a shared def would not be compared.G2-R12-A02[P3] (anneal/tests/audit/tests/target_audit.rs:2152): Negative tests for the modified TrustedBoundary spec namespace guard are in target_audit.rs and the e2e test rather than boundary_audit.rs as the base rule names.G2-R12-A03[P3] (anneal/tests/cargo-anneal/tests/ndjson_comparator_e2e.rs:237): v4.35 kernel e2e tests silently early-return when no v4.35 toolchain is installed unless ANNEAL_REQUIRE_V435=1 is set.G2-R12-A04[P3] (anneal/trusted/cargo-anneal/src/ndjson_comparator.rs:1467): Inner NDJSON record sub-objects accept unrecognized extra JSON keys instead of enforcing strict per-variant key counts or allowlists.G2-R12-A05[P3] (anneal/trusted/cargo-anneal/src/sandbox.rs:1835): drain_to_bounded_file aborts on ErrorKind::Interrupted rather than retrying transient EINTR reads.G2-R12-A06[P3] (anneal/trusted/cargo-anneal/src/target.rs:1286): --paranoid-quorum only verifies con-leche and lean4lean binary availability at quorum execution after earlier export and dual-kernel phases complete.G2-R12-A07[P3] (anneal/trusted/cargo-anneal/src/verify.rs:3711): Omitting spec_warnings on ndjson_route causes output.rs classify_success_badge to mark receipts Tainted, which is harmless under --allow-unpinned-lean today but will need updating when v4.35.0+ is pinned.
Executed Sandbox Probes
seat3root_manifest_sha256: outcome=pass(rc=0)seat3hygiene_static_and_nonascii: outcome=pass(rc=0)seat3anneal_ci_python_unit_suites: outcome=pass(rc=0)seat3anneal_ci_long_suites_timeout_and_workflow_checklist: outcome=timeout(rc=124)seat3repo_ci_skills_and_unit_tests: outcome=pass_with_skips(rc=0)seat3cross_file_parity_and_cli_fail_closed: outcome=pass(rc=0)seat3shell_syntax_and_env_edge_cases: outcome=pass(rc=0)seat3rustc_name_encoding_and_lean_nproc_probe: outcome=partial(rc=1)
Verify target theorems on Lean
v4.35.0+(when--allow-unpinned-leanis enabled and<sysroot>/bin/providesleanexport,nanoda_bin, andcon-ron) without any Lean process producing the verdict and without loadingProof.oleanfiles outside the sandboxed exporter.cargo-annealroutes those runs through the pure-Rust Universal NDJSON Comparator (trusted/cargo-anneal/src/ndjson_comparator.rs) backed by dual independent kernels (nanoda_binandcon-ron), plus optional 4-kernel--paranoid-quorum(con-leche,lean4lean --import). Pinned admission setsndjson_tools: Noneuntilv4.35.0+comparator tool digests are pinned, so the repository's pinned Leanv4.34.1toolchain keeps usingTrustedBoundary.leanfor every mode.The comparator route runs these actions:
5-init: clean-sysroot export of the 39 kernel-accelerated and elaboratorInitprimitives, the 3 standard axioms, and the admittedSystem.Platformdeclarations.target-consts:SpecPreflightvalidates the compiledModel,Capture,Specification, andExpected.oleans with the same pre-import header, companion, andisModulechecks as the legacy"target-audit", imports them with the admitted sysroot (never aProof.olean;loadExts := false), and reports each module's exact constant inventory from itsModuleData. Compiler-generated constants (anonymous andderivinginstances, constructors and projections,where/let recauxiliaries) are thus attributed to their defining module instead of being reconstructed from source syntax. Lean's import keeps the later of two equal-header theorems under the earlier module's index, so each target constant must equal the stored constant, and a constant another loaded module also declares is rejected unless it is a realized equation-style theorem equal to the owner's. It also rejects anyunsafetarget constant and reports the targets'@[implemented_by],@[extern], and@[csimp]subjects.5b: sandboxed export ofproof_full.ndjson.5a: export from the trusted modules alone of the expected declaration, everySpecificationconstant (except thepartial_unsafe_recauxiliaries Lean pairs with well-founded definitions), and every target-module constantproof_fullcontains.--ignore-missingis no longer passed, so an absent root or dependency aborts the export.5-pin: clean-sysroot re-export, with zero target.oleans mounted, of every sysroot-named constant either export contains.5c: the pure-Rust checks, then the kernels.5crequires every export to declare each constant's dependencies before the constant (other than the names-only mutual-block peersleanexportrecords for definitions, and references within one inductive record), so a missing, forward, or cyclic reference fails closed. Each inductive record must be one consistent mutual block whose types, constructors, and recursors agree on its membership. It requires each sysroot-named constant to equal its clean5-init/5-pindefinition, so sysroot status is never granted by name alone; a proof module that redeclares a sysroot name (or a kernel-accelerated one) with different content is rejected. Each target-module constant inproof_fullmust appear identically in the trusted export, and each trusted-export constant must have a sysroot or target-module origin. Proof-origin constants may not use theTrustedroot, a reserved kernel root, or a kernel-accelerated name (generated equation and splitter helpers of a pinned parent excepted); this replaces the name-prefix check that let a registeredTrustedmodel module admit anyTrusted.*constant. Compiled declaration edges between target modules must satisfyTargetRole::allows, and sysroot constants in either export may not reference target constants. Canonical inputs must come from their designated roles, the canonical root must beCrateTheoremorUnitTheoremapplied toCrate.mkor a Profile v2 counterpart applied toCrateV2.mk, the target theorem must be proof-origin, no reached target declaration may carry a compiler override, and the direct and transitive specification bans apply to every module-indexedSpecificationconstant..opaqueInfois admitted only for non-unsafe, content-pinned sysroot constants such asSystem.Platform.getNumBits. The comparator also interns names structurally, rejects duplicate NDJSON keys, and requires export metadata to match the admitted toolchain's exact version and commit. Kernels re-hash their private copy ofproof_full.ndjsonagainst the digest the comparator verified, and every kernel's stderr is checked for Lean panic markers.con-ronandcon-lecherun in--verifiedmode with a capped--jobs; by default each starts a worker per hardware thread and exhausts address-space limits on many-core hosts. A test feeds every kernel, in its configured invocation, an export whose target theorem is ill-typed but structurally intact, and requires each to reject it while accepting the well-typed original; that test needs av4.35.0install, so a CI test also runs the comparator route with stub kernels and requires it to fail closed when either kernel exits nonzero or panics. The process-wide caches of the clean sysroot export and the sysroot constant index are keyed by the pinned manifest digest or, unpinned, by every admitted sysroot module's artifact digests.SpecPreflight.leanduplicatesTrustedBoundary.lean's header and specification admission guards (including module-mode specifications) and its pre-import.oleanvalidation;ci/test_check_guard_mutation.pyrequires every shared definition, andpreflightSpecsapart from its header check, to stay identical, andtests/audit/tests/target_audit.rsexercises"sysroot-consts","target-consts", and (through a test hook that routes it toSpecPreflight)"spec-preflight"on the pinned toolchain. In both files the specification namespace guard keeps theisForbiddenPureNamespacechecks (_root_stripping and theInit.System/Internal.UV/Dynlibsub-scopes) and additionally reservesTrusted,Anneal,Proof, and everyreservedKernelRootsroot, includingInitandStd.As in
TrustedBoundary.lean's"target-audit", the comparator verdict carries the admitted module import graph, whichverifyneeds to check bundled-model trust tiers, and its subject, model, and specification closures list only reached declarations, each with its defining module, socandidate:*features come only from reachedModelmodules. Receipts recordsysrootPinsSha256and the comparator and kernel binary digests.cargo anneal inspectvalidates those digests, the fixedtimingMsschema, and the kernel and quorum invariants the comparator enforces, reads skipped kernels recorded as{kernel, reason}, does not requirecheckedAlternateProofsfrom the comparator route, and ranks a change from the comparator to the default audit as a regression. The comparator route does not run the anti-vacuity specification lint, and it does not inspect compiler-override attributes onProofdeclarations (their.oleans never load outside the sandboxed exporter, and the attributes cannot change kernel reduction). Its receipts therefore omitspec_warningsand list both underdeferred.stage.rs,sandbox.rs, andverify.rsreserveSpecPreflight, copy NDJSON sinks read-only intoExecSealinputs, and precompile and cacheSpecPreflight.olean(ci/prebuild_bundled_oleans.py,flake.nix,ci/run_anneal_check.sh,ci/check_bundle_tree.py,trusted/root-manifest.sha256). Theanneal-guard-mutationci-core check takesSpecPreflight.leanas an input, and theanneal-tcimage seeds it for the flake evaluation.Part of #4016
Part of #4109
Authored by an AI agent acting on joshlf's behalf.