Repository navigation
Conversation
Add two standalone, zero-TCB developer and pre-review checks under `ci/` so downstream proof regressions and recurring MIR/rustc defects fail fast before full Cargo/CI runs: - `ci/check_fixtures_lean.py` + `ci/test_check_fixtures_lean.py`: discovers downstream `Proof.lean` (and named companion `*Proof.lean`) fixtures under `tests/cargo-anneal/tests/fixtures/`, reuses a provided `--prebuilt-dir` or invokes `ci/prebuild_bundled_oleans.py`, stages `Captured.lean` (+ shards), `Spec.lean`, `Expected.lean`, and proof modules, and elaborates every fixture DAG in parallel across `--jobs N` under pinned Lean 4.35 (`-DwarningAsError=true -DElab.async=false -Ddebug.skipKernelTC=false`). Supports optional `--capture-cache-dir` and `--no-capture` for fast Lean-only retries. - `ci/mir_preflight_checks.py` + `ci/test_mir_preflight_checks.py`: fast (<30s) pre-review linter checking newly added `CoreCallOp` variants for `ci/stdlib_intrinsics.toml` classification, dead/gated Lean arms, and `ci/guard_mutation/*.toml` coverage; CLI-rejected `--exclude-trait=core::ops::Drop` or reasonless `"unsupported"` assertions in added Rust negative tests; `RUSTC-WORKAROUND(#NNNN)` anchors near added `LocalExpnId::fresh` calls; the 5 fast lockstep scripts; and Option-C non-test `trusted/` LOC and `trusted/audit/` awareness warnings. - `ci/pr_preflight.py`: update stale docstring repo slug example from `google/zerocopy` to `google/anneal`. No existing workflow, build, or trusted files are modified. Agent-authored-by: AI agent acting on joshlf's behalf
|
🤖 Review Receipt
Human review surface
Verification Summary
Authored by an AI agent acting on joshlf's behalf. |
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 (tier2b_cli_policy, Round 1)
- Identity:
multi:8b73d98158e8fe0863777855ca01f4c4721d0364:9517ffcc9a4018fcc99fd022d01c6fe6767484cd(base=8b73d98158e8,head=9517ffcc9a40,tree=a124cef423f1) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 5 inspected, 0 inapplicable, 0 blocked (of 5 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
policy_and_cli_critic |
completed |
findings |
2 | 562s |
seat2 |
gemini-frontier-thinking |
policy_and_spec_critic |
completed |
findings |
2 | 766s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 483s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R1-01 |
P1 | 2 (seat1, seat2) | probe_confirmed |
ci/mir_preflight_checks.py:1388 |
The 'pre-Gate-1/Gate-2' linter runs the target head's own ci/*.py lockstep scripts, extracted via git archive, outside any sandbox and with the full inherited environment whenever --head differs from the checked-out commit. Nothing in the docstring or help discloses this. |
G2-R1-02 |
P2 | 1 (seat2) | probe_confirmed |
ci/check_fixtures_lean.py:1140 |
--prebuilt-dir accepts any directory containing manifest.json and lib/ without verifying bundled source or Lean toolchain digests, allowing stale .olean files to silently shadow local trusted/lean/ and theory/ edits. |
G2-R1-03 |
P2 | 1 (seat1) | static_verified |
ci/test_check_fixtures_lean.py:30 |
The commit/PR body describes the change as 'standalone, zero-TCB' checks. Under base rules, ci/.py is a declared TCB executable and human-review surface, and both new ci/test_.py modules are automatically executed by the required anneal-ci-tests check, so the PR adds code to required CI. |
G2-R1-01 [P1] (ci/mir_preflight_checks.py:1388, Pass 2 §5 (ci & workflows), probe_confirmed): The 'pre-Gate-1/Gate-2' linter runs the target head's own ci/*.py lockstep scripts, extracted via git archive, outside any sandbox and with the full inherited environment whenever --head differs from the checked-out commit. Nothing in the docstring or help discloses this.
- Invariant: AGENTS.md Standing rules / Code Review Rules (Execution, isolation, and probes): reviewers and coordinators must run untrusted reviewed-candidate, worker, or third-party code only inside an OS-level sandbox without credentials. Sibling ci/pr_preflight.py (whose helpers this module imports) documents that it never checks out or executes candidate code.
- Evidence: At ci/mir_preflight_checks.py:1393-1468, check_lockstep_suite exports head_sha to scan_dir via git archive (or uses repo_dir) and builds all 5 subprocess commands from scan_dir / 'ci/<script>.py' (lines 1404, 1420, 1434, 1450, 1463), then executes them at line 1490 with env = dict(os.environ) (line 1472) without stripping ACTIONS_CACHE_URL, ACTIONS_RESULTS_URL, ACTIONS_RUNTIME_TOKEN, or OIDC tokens. Contrast with ci/pr_preflight.py:806-808, which invokes Path(file).resolve().parent / 'check_pr_hygiene.py'. Running the trusted base copy of mir_preflight_checks.py --head <untrusted_candidate> executes arbitrary unreviewed Python from <untrusted_candidate> outside any sandbox with full ambient credentials and lets a candidate PR bypass all 5 lockstep checks by modifying those scripts to exit 0. All 5 base lockstep scripts already take --repo-root/--root/--repo as pure data arguments (verified on base), so invoking _CI_DIR / '<script>.py' against scan_dir with strip_actions_env(os.environ, include_oidc=True) avoids executing candidate code entirely (tests can inject a ci_dir override).
G2-R1-02 [P2] (ci/check_fixtures_lean.py:1140, Pass 2 §5 (ci & workflows), probe_confirmed): --prebuilt-dir accepts any directory containing manifest.json and lib/ without verifying bundled source or Lean toolchain digests, allowing stale .olean files to silently shadow local trusted/lean/ and theory/ edits.
- Invariant: Pass 2 §5 (AGENTS.md / trust-review): caches in ci/ scripts must not shadow source changes; reused bundled .olean directories must match current trusted/lean/ and theory/ source hashes and pinned Lean toolchain identity (as enforced by ci/prebuild_bundled_oleans.py --cache-dir).
- Evidence: At ci/check_fixtures_lean.py:1140-1150, when prebuilt_dir is provided, run_fixtures checks only (pb_dir / 'manifest.json').is_file() and (pb_dir / 'lib').is_dir() (and omits symlink checks), then adds pb_dir / 'lib' directly to LEAN_PATH at line 999 without parsing manifest.json or verifying lean_sha256, sysroot_manifest_sha256, or bundled Trusted./Anneal. source_sha256 entries against repo_root. ci/test_check_fixtures_lean.py:173 confirms this by passing with an empty '{}' manifest.json. If a developer or CI step modifies trusted/lean/ or theory/ in a way that breaks downstream proofs and passes an earlier --prebuilt-dir, Lean elaborates against stale .olean artifacts and reports false-positive PASS.
G2-R1-03 [P2] (ci/test_check_fixtures_lean.py:30, Pass 2 §5 (ci & workflows), static_verified): The commit/PR body describes the change as 'standalone, zero-TCB' checks. Under base rules, ci/.py is a declared TCB executable and human-review surface, and both new ci/test_.py modules are automatically executed by the required anneal-ci-tests check, so the PR adds code to required CI.
- Invariant: AGENTS.md Code Review Rules (Human review surface): relevant commit bodies must explain what changed and why, and any omission or mischaracterization of a changed surface blocks merge or ready-for-review. ci/ is listed in the Human review surface and triggers Pass 2.
- Evidence: Commit 9517ffc body: 'Add two standalone, zero-TCB developer and pre-review checks under
ci/'. Base ci/checks.toml [tcb] extra_executable_paths = ["ci/.py", ...] makes ci/.py TCB executables for ci-core. Base ci/run_anneal_check.sh ci-tests mode runs"$PY_BIN" -I -B -m unittest discover -s ci -p 'test_*.py' -vunder ANNEAL_CI_STRICT=1, and checks.toml id=anneal-ci-tests (gated by ci-core / gate) runs it. TestCheckFixturesLean (L30) and TestMirPreflightChecks (test_mir_preflight_checks.py L116), including the live-repo test_discover_fixtures_on_live_repo, therefore become part of required CI. The body should disclose this and drop the 'zero-TCB' label.
Non-blocking advisories (P3, not Gate 2 findings)
These notes do not block merge and do not require another Gate 2 round.
G2-R1-A01[P3] (ci/check_fixtures_lean.py:23): The tool reports PASS / 'verify cleanly' after only Lean-compiling the module DAG. It never checks that the proof declares Proof.verify : Expected.claim and never runs anneal-audit or an axiom check, so anaxiomor a theorem-less Proof.lean reports PASS.G2-R1-A02[P3] (ci/check_fixtures_lean.py:148): _FIXTURE_OVERRIDES copies per-fixture compile metadata from tests/cargo-anneal/tests/*.rs and ci/verify_starnix_e2e.py with no lockstep check, so future drift silently desyncs the checker. --allow-unpinned-lean (L1082) also emits no user-visible warning in the human output.G2-R1-A03[P3] (ci/check_fixtures_lean.py:548): Under --no-capture without an explicit --capture/--sysroot, cache entries from any capture-tool build are accepted. --prebuilt-dir is accepted if manifest.json and lib/ merely exist. Both allow stale captures or .oleans to produce misleading PASS/FAIL.G2-R1-A04[P3] (ci/check_fixtures_lean.py:1082): Lean version pinning check uses unanchored substring containment (pinned_tag not in lean_ver), which would accept prerelease or longer version strings containing4.35.0.G2-R1-A05[P3] (ci/mir_preflight_checks.py:29): The warnings assert an 'Option-C auto-merge' policy (1,500 non-test trusted/ LOC cap, trusted/audit excluded) that no governing doc in the repo defines.G2-R1-A06[P3] (ci/mir_preflight_checks.py:520): extract_lean_match_arms rejects qualified CoreCallOp. patterns due to (?<![A-Za-z0-9]). (unlike _ctor_has_guard_mutation at line 700), and TEST_ATTR_RE at line 103 is unused.G2-R1-A07[P3] (ci/test_check_fixtures_lean.py:432): test_run_fixtures_prebuilt_cache_and_failures is not hermetic. It fails when ANNEAL_ZEROCOPY_ROOT points at a zerocopy checkout or /opt/zerocopy-dogfood/zerocopy exists (anneal-tc/anneal-rust images, dev shells). The anneal-lean-lite CI image is unaffected.
Executed Sandbox Probes
seat3bwrap_unit_test_check_fixtures_lean: Ran python3 -I -B /work/ci/test_check_fixtures_lean.py -v in unshared bwrap: 8/8 tests passed in 3.801s. (rc=0)seat3bwrap_unit_test_mir_preflight_checks: Ran python3 -I -B /work/ci/test_mir_preflight_checks.py -v in unshared bwrap: 13/13 tests passed in 7.934s. (rc=0)seat3bwrap_unit_test_pr_preflight: Ran python3 -I -B /work/ci/test_pr_preflight.py -v in unshared bwrap: 11/11 tests passed in 15.889s. (rc=0)seat3bwrap_discover_fixtures_live_repo: Verified check_fixtures_lean.discover_fixtures on candidate tree: 32 fixtures discovered, 0 missing proof/spec/helper/local-source files. (rc=0)seat3bwrap_core_call_op_real_repo_parse: Verified mir_preflight_checks Lean/Rust parsers on real candidate Terminators.lean, terminators.rs, MirSemantics/*.lean, CallsTermV2.lean: 65/65 variants parsed (rc=0)seat3bwrap_run_mir_preflight_lockstep_live: Ran run_mir_preflight(..., skip_lockstep_suite=False) on a sandboxed git repo initialized from candidate tree: rc=0, all 5 lockstep scripts passed, 0 errors/war (rc=0)seat3bwrap_cli_entrypoints_fail_closed: Verified --help and fail-closed JSON rc=2 exits for check_fixtures_lean.py (--no-capture missing Lean) and mir_preflight_checks.py (--repo /nonexistent). (rc=0)seat3bwrap_unittest_discover_all_ci: Full unittest discover -s /work/ci -p 'test_*.py' timed out at 30s inside unrelated redteam/alpha_release suites (unrelated LiveToolIntegrationTests skipped due (rc=124)seat3seat1-probe-1-test-hermeticity: outcome=confirmedseat3seat1-probe-2-mir-preflight-head-exec: outcome=confirmed
| status_res = _run_git(repo_dir, ["status", "--porcelain=v1", "-z"]) | ||
| dirty_tree = status_res.returncode == 0 and bool(status_res.stdout) | ||
|
|
||
| need_export = (not working_tree) and ( |
There was a problem hiding this comment.
G2-R1-01 [P1] (probe_confirmed): The 'pre-Gate-1/Gate-2' linter runs the target head's own ci/*.py lockstep scripts, extracted via git archive, outside any sandbox and with the full inherited environment whenever --head differs from the checked-out commit. Nothing in the docstring or help discloses this.
At ci/mir_preflight_checks.py:1393-1468, check_lockstep_suite exports head_sha to scan_dir via git archive (or uses repo_dir) and builds all 5 subprocess commands from scan_dir / 'ci/<script>.py' (lines 1404, 1420, 1434, 1450, 1463), then executes them at line 1490 with env = dict(os.environ) (line 1472) without stripping ACTIONS_CACHE_URL, ACTIONS_RESULTS_URL, ACTIONS_RUNTIME_TOKEN, or OIDC tokens. Contrast with ci/pr_preflight.py:806-808, which invokes Path(file).resolve().parent / 'check_pr_hygiene.py'. Running the trusted base copy of mir_preflight_checks.py --head <untrusted_candidate> executes arbitrary unreviewed Python from <untrusted_candidate> outside any sandbox with full ambient credentials and lets a candidate PR bypass all 5 lockstep checks by modifying those scripts to exit 0. All 5 base lockstep scripts already take --repo-root/--root/--repo as pure data arguments (verified on base), so invoking _CI_DIR / '<script>.py' against scan_dir with strip_actions_env(os.environ, include_oidc=True) avoids executing candidate code entirely (tests can inject a ci_dir override).
|
|
||
| with tempfile.TemporaryDirectory(prefix="anneal-fixtures-prebuilt-") as td: | ||
| t_pre = time.monotonic() | ||
| if prebuilt_dir is not None: |
There was a problem hiding this comment.
G2-R1-02 [P2] (probe_confirmed): --prebuilt-dir accepts any directory containing manifest.json and lib/ without verifying bundled source or Lean toolchain digests, allowing stale .olean files to silently shadow local trusted/lean/ and theory/ edits.
At ci/check_fixtures_lean.py:1140-1150, when prebuilt_dir is provided, run_fixtures checks only (pb_dir / 'manifest.json').is_file() and (pb_dir / 'lib').is_dir() (and omits symlink checks), then adds pb_dir / 'lib' directly to LEAN_PATH at line 999 without parsing manifest.json or verifying lean_sha256, sysroot_manifest_sha256, or bundled Trusted./Anneal. source_sha256 entries against repo_root. ci/test_check_fixtures_lean.py:173 confirms this by passing with an empty '{}' manifest.json. If a developer or CI step modifies trusted/lean/ or theory/ in a way that breaks downstream proofs and passes an earlier --prebuilt-dir, Lean elaborates against stale .olean artifacts and reports false-positive PASS.
| import check_fixtures_lean as cfl # noqa: E402 | ||
|
|
||
|
|
||
| class TestCheckFixturesLean(unittest.TestCase): |
There was a problem hiding this comment.
G2-R1-03 [P2] (static_verified): The commit/PR body describes the change as 'standalone, zero-TCB' checks. Under base rules, ci/.py is a declared TCB executable and human-review surface, and both new ci/test_.py modules are automatically executed by the required anneal-ci-tests check, so the PR adds code to required CI.
Commit 9517ffc body: 'Add two standalone, zero-TCB developer and pre-review checks under ci/'. Base ci/checks.toml [tcb] extra_executable_paths = ["ci/.py", ...] makes ci/.py TCB executables for ci-core. Base ci/run_anneal_check.sh ci-tests mode runs "$PY_BIN" -I -B -m unittest discover -s ci -p 'test_*.py' -v under ANNEAL_CI_STRICT=1, and checks.toml id=anneal-ci-tests (gated by ci-core / gate) runs it. TestCheckFixturesLean (L30) and TestMirPreflightChecks (test_mir_preflight_checks.py L116), including the live-repo test_discover_fixtures_on_live_repo, therefore become part of required CI. The body should disclose this and drop the 'zero-TCB' label.
Add two standalone, zero-TCB developer and pre-review checks under
ci/so downstream proof regressions and recurring MIR/rustc defects fail fast before full Cargo/CI runs:ci/check_fixtures_lean.py+ci/test_check_fixtures_lean.py: discovers downstreamProof.lean(and named companion*Proof.lean) fixtures undertests/cargo-anneal/tests/fixtures/, reuses a provided--prebuilt-diror invokesci/prebuild_bundled_oleans.py, stagesCaptured.lean(+ shards),Spec.lean,Expected.lean, and proof modules, and elaborates every fixture DAG in parallel across--jobs Nunder pinned Lean 4.35 (-DwarningAsError=true -DElab.async=false -Ddebug.skipKernelTC=false). Supports optional--capture-cache-dirand--no-capturefor fast Lean-only retries.ci/mir_preflight_checks.py+ci/test_mir_preflight_checks.py: fast (<30s) pre-review linter checking newly addedCoreCallOpvariants forci/stdlib_intrinsics.tomlclassification, dead/gated Lean arms, andci/guard_mutation/*.tomlcoverage; CLI-rejected--exclude-trait=core::ops::Dropor reasonless"unsupported"assertions in added Rust negative tests;RUSTC-WORKAROUND(#NNNN)anchors near addedLocalExpnId::freshcalls; the 5 fast lockstep scripts; and Option-C non-testtrusted/LOC andtrusted/audit/awareness warnings.ci/pr_preflight.py: update stale docstring repo slug example fromgoogle/zerocopytogoogle/anneal.No existing workflow, build, or trusted files are modified.
Authored by an AI agent acting on joshlf's behalf.