Repository navigation
[audit][ci] Shard anneal-audit across Pass 1, Pass 2, and canaries - #740
Conversation
Verification receipt
Checks run (
|
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 1)
- Identity:
multi:c469ae0d9d724d6148fe8b53ae077d2e4e324a83:b7627f25c2f327a6c71d5bcfdad2720451ca98f6(base=c469ae0d9d72,head=b7627f25c2f3,tree=d892672f61f0) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 11 inspected, 0 inapplicable, 0 blocked (of 11 changed file(s))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
findings |
1 | 586s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
findings |
2 | 1218s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 936s |
Deduplicated Findings
| ID | Sev | Consensus | Verification | Location | Summary |
|---|---|---|---|---|---|
G2-R1-01 |
P2 | 3 (seat1, seat2, seat3) | static_verified |
trusted/audit/src/repo_audit.rs:251 |
The sharded CI audit no longer loads all theory/ modules into one Lean environment, so cross-family constant-name collisions are no longer rejected before merge, yet the commit body says nothing is relaxed. |
G2-R1-02 |
P2 | 1 (seat2) | static_verified |
trusted/audit/src/repo_audit.rs:1230 |
Unconditionally adding compiledTheoryModules, totalTheoryModules, and auditScope to anneal-audit --json breaks anneal_testkit::AuditReport strict deserialization and Workspace::run_audit. |
G2-R1-01 [P2] (trusted/audit/src/repo_audit.rs:251, Pass 2 §3 (trusted/audit), static_verified): The sharded CI audit no longer loads all theory/ modules into one Lean environment, so cross-family constant-name collisions are no longer rejected before merge, yet the commit body says nothing is relaxed.
- Invariant: AGENTS.md Code Review Rules: commit bodies must explain any rule relaxation; any omission or mischaracterization blocks merge or ready-for-review.
- Evidence: Before: ci/run_anneal_check.sh audit ran one full anneal-audit whose Pass 1 audit request listed every theory/ module, so loading them together rejected duplicate constant names across modules. After: ci/checks.toml line 733 replaces it with correspondence, pass1-1/4..4/4, and pass2-canaries shards. Each shard's audit list (repo_audit.rs lines 1096-1214) holds only the import closure of its assigned families plus Anneal.MirWp. The doc note at repo_audit.rs lines 251-255 admits cross-family collisions are 'only jointly imported under AuditScope::Full', and no CI job runs Full now (AUDIT_SHARD=all is local-only). The commit body says 'No trust-boundary checks, preflight allowlists, kernel replay gates, or sandbox requirements are relaxed.' Impact is integrity and importability, not soundness: collisions fail closed and claims are Trusted.*-only. Fix: disclose in the commit body and Human review surface, or restore a cheap all-theory constant-name uniqueness check somewhere in CI.
G2-R1-02 [P2] (trusted/audit/src/repo_audit.rs:1230, Pass 2 §3 (trusted/audit), static_verified): Unconditionally adding compiledTheoryModules, totalTheoryModules, and auditScope to anneal-audit --json breaks anneal_testkit::AuditReport strict deserialization and Workspace::run_audit.
- Invariant: anneal-audit --json output must remain compatible with the strict #[serde(deny_unknown_fields)] schema in tests/testkit/src/assertions.rs::AuditReport (and the commit claims default AuditScope::Full behavior is unchanged).
- Evidence: trusted/audit/src/repo_audit.rs:1230-1246 unconditionally inserts compiledTheoryModules, totalTheoryModules, and auditScope into the JSON report object for all AuditScope variants including AuditScope::Full. tests/testkit/src/assertions.rs:216-269 defines pub struct AuditReport with #[serde(deny_unknown_fields)] without those three fields, and tests/testkit/src/workspace.rs:414-437 (Workspace::run_audit) parses real anneal-audit --json stdout through AuditReport::from_json_slice, which will now unconditionally fail with unknown field 'compiledTheoryModules'. Existing tests missed this because tests/testkit/src/assertions.rs:530-545 tests only a synthetic JSON literal and tests/cargo-anneal/tests/installed_smoke.rs:599 parses into untyped serde_json::Value.
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_pass2_canaries.py:1215): No generic static guard requires the pass1-i/T shards to form a complete set (all of 1..T present) or the correspondence shard to stay in the matrix; only the exact-list assertion in ci/ci_workflow_tests/ci_core_workflows.py catches dropping one.G2-R1-A02[P3] (ci/check_pass2_canaries.py:1319): _check_ci_wiring uses a flat elif/else/fi lookahead regex when slicing case branches in ci/run_anneal_check.sh.G2-R1-A03[P3] (ci/checks.toml:733): The claim that ci-core's winning_cache_updaters picks the lexicographically first shard to publish miri-v1 can't be verified from this repo (ci-core is external, at pinned SHAs); the unit test only checks min(shards)=='correspondence'.G2-R1-A04[P3] (ci/run_anneal_check.sh:428): Bash arithmetic comparison (( idx > total )) wraps 64-bit signed values on oversized shard specs such as pass1-18446744073709551617/2 before Rust parse_theory_shard_spec rejects usize overflow.G2-R1-A05[P3] (ci/run_anneal_check.sh:684): The pass2-canaries shard now compiles untrusted correspondence/ and theory/ dependencies (Anneal.MirCorrespondence.*, Anneal.MirWp) inside check_pass2_canaries.py's bwrap --unshare-all jail without anneal-audit preflight having run first in the same job; before, canaries only ran after anneal-audit passed.G2-R1-A06[P3] (tests/audit/tests/boundary_audit/audit_sharding.rs:15): Synthetic integration tests verify CLI rejection and Pass1TheoryShard guards but lack a positive end-to-end AuditScope::CorrespondenceOnly compilation and audit test.G2-R1-A07[P3] (tests/audit/tests/boundary_audit/audit_sharding.rs:44): Conflicting CLI flag test checks exit status 2 without asserting clap's conflict diagnostic on stderr.G2-R1-A08[P3] (tests/audit/tests/boundary_audit/audit_sharding.rs:120): No Rust test exercises the success path of AuditScope::CorrespondenceOnly (narrowed theory set through correspondence-preflight, compile, and correspondence-audit); only the CI correspondence shard covers it.G2-R1-A09[P3] (trusted/audit/src/repo_audit.rs:395): Over-sharding error message reports the requested shard as empty even when index <= families.len() < total.
Executed Sandbox Probes
seat3repo_wide_hygiene_and_diff_unicode_check: outcome=passed(rc=0)seat3theory_shard_partition_completeness: outcome=passed(rc=0)seat3root_manifest_sha256_strict: outcome=passed(rc=0)seat3test_run_anneal_check_unittest: outcome=passed_with_skips(rc=0)seat3test_ci_workflow_unittest: outcome=passed(rc=0)seat3test_check_minirust_pin_unittest: outcome=passed(rc=0)seat3test_check_experimental_isolation_unittest: outcome=passed(rc=0)seat3test_check_pass2_canaries_wiring_and_static_subsets: outcome=partial_timeout_with_lean_skips(rc=0)seat3test_check_job_dependencies_unittest: outcome=errored_missing_yq(rc=1)seat3test_check_pr_hygiene_unittest: outcome=timeout_incomplete(rc=124)seat3ci_python_and_shell_lints: outcome=passed_except_rg_missing(rc=0)seat3bash_parse_audit_shard_spec_and_fail_closed_dispatch: outcome=passed_with_p3_note(rc=0)
`anneal-audit` is the sole 38.7m CI critical-path straggler on 4-vCPU
`ubuntu-24.04` runners because one process compiles and kernel-replays
all 379 Pass 1 `theory/` modules before running Pass 2 correspondence
and `ci/check_pass2_canaries.py`, even though Pass 2 transitively
imports only a small subset of `theory/`.
Add minimal, fail-closed sharding scopes to `anneal-audit` and wire
them as a 6-shard matrix on the existing `anneal-audit` check:
- `trusted/audit/src/{repo_audit,lib,cli}.rs`:
- Add `AuditScope::{Full, Pass1TheoryShard { index, total },
CorrespondenceOnly}` alongside `parse_theory_shard_spec`,
`theory_transitive_closure_order`, and `select_theory_shard_order`.
Default (`Full`) behavior and `--json` schema are unchanged
(`compiledTheoryModules`, `totalTheoryModules`, and `auditScope`
are emitted only for non-`Full` sharded scopes).
- `--pass1-theory-shard <index>/<total>` (mutually exclusive with
`--require-correspondence`, `--correspondence-only`,
`--miri-cache-dir`, and `--cargo-boundary-only`) still runs full
Cargo hygiene, full `trusted/lean/` and `theory/` staging, and full
Pass 1 syntactic preflight across every `theory/` file, then
compiles and kernel-replays all `trusted/lean/` modules plus the
deterministic transitive closure of `theory/` family shard
`index/total` (always seeding `Anneal.MirWp` and
`Anneal.MirWp.Canaries` whenever `verifyMirWpCoreTheorems` will
fire). Fails closed if `total` exceeds discovered `theory/`
families (including an empty `theory/` tree).
- `--correspondence-only` (mutually exclusive with
`--pass1-theory-shard` and `--cargo-boundary-only`; implies
`--require-correspondence`) runs full Cargo hygiene, full Pass 1
staging/preflight, full cross-tree module uniqueness across Pass 1,
Pass 2, and `vendor/lean-miri/`, compiles and Pass-1-audits all
`trusted/lean/` modules plus only the `theory/` transitive closure
imported by `correspondence/` (and `Anneal.MirWp` /
`Anneal.MirWp.Canaries`), and runs the full sandboxed Pass 2
`correspondence-preflight`, compilation, and `correspondence-audit`.
- `tests/testkit/src/assertions.rs` and
`tests/audit/tests/boundary_audit/audit_sharding.rs`: Accept optional
sharded-scope JSON fields in `AuditReport`
(`#[serde(deny_unknown_fields)]`) while asserting real
`AuditScope::Full` `anneal-audit --json` omits them and parses
cleanly under `AuditReport::from_json_slice`, plus positive and
negative tests for malformed and conflicting CLI flags,
disjoint-complete Pass 1 shard union, unassigned-family preflight
`sorry` rejection, empty-tree and over-sharding rejection, and
`--correspondence-only` missing-dir and unimported Pass 1/Pass 2
module-collision rejection.
- `ci/checks.toml`, `ci/run_anneal_check.sh`,
`ci/check_pass2_canaries.py`, and CI unit tests: Split `anneal-audit`
into `matrix = { shard = ["correspondence", "pass1-1/4", "pass1-2/4",
"pass1-3/4", "pass1-4/4", "pass2-canaries"] }` while keeping
`anneal-audit` the sole check on `anneal-audit-lite` with
`caches = ["miri-v1"]`. `correspondence` sorts lexicographically
first so `ci-core`'s cache publisher always selects the Pass 2 shard
for `miri-v1` on a cold miss. Default `AUDIT_SHARD=all` preserves
full single-command local runs (while explicit empty `AUDIT_SHARD=""`
and oversized >18-digit shard numbers fail closed), and
`ci/check_pass2_canaries.py` enforces `--lean` wiring across both the
`all` and `pass2-canaries` branches plus `anneal-audit.matrix.shard`.
Intentional policy relaxation (integrity/importability only, not
soundness): Sharded CI (`pass1-1/4..4/4` plus `correspondence`) no
longer imports all `theory/` modules into a single Lean environment
simultaneously, so cross-family constant-name collisions across
disjoint `theory/` families (families sharing neither `Trusted.*`,
`Anneal.MirWp*`, nor a common ancestor) are no longer rejected
pre-merge in CI and are only jointly imported under local
`AUDIT_SHARD=all` (`AuditScope::Full`). Impact is strictly
integrity/importability rather than soundness: any collision fails
closed if jointly imported, and verification claims remain
`Trusted.*`-only. Full Cargo hygiene, full source staging, full
syntactic preflight, module-name uniqueness across Pass 1, Pass 2, and
`vendor/lean-miri/`, kernel replay gates, and `bwrap` sandboxing remain
unchanged.
Agent-authored-by: AI agent acting on joshlf's behalf
b7627f2 to
7ed18f0
Compare
Verification receipt
Checks run (
|
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 2)
- Identity:
one:172aadcb0974480f470bb862329ce215a6b6235e:29f5af0ede60ee07c2737c1bf5a8e463857d1269:dacf27f3b881f2dfb721625e25d00fc2e9f139dab76e0db1fce585faafba8949(base=4ad81da4274c,head=7ed18f0bfe03,tree=29f5af0ede60) - Separation:
author_family=agentvs.reviewer_family=multi - Coverage: 12 inspected, 0 inapplicable, 0 blocked (of 12 changed file(s))
- Review mode:
delta_escalatedrelative to the prior Gate 2 review at headb7627f25c2f327a6c71d5bcfdad2720451ca98f6(escalated to the full panel: range-diff alters 39% of the PR's diff lines (> 30%))
| Seat | Family | Role | Status | Verdict | Findings | Latency |
|---|---|---|---|---|---|---|
seat1 |
claude-frontier-thinking |
tcb_and_api_critic |
completed |
clean |
0 | 542s |
seat2 |
gemini-frontier-thinking |
tcb_and_spec_critic |
completed |
clean |
0 | 886s |
seat3 |
gemini-executable-falsifier |
sandboxed_probe_runner |
completed |
clean |
0 | 791s |
No unresolved P0-P2 findings raised across completed seats.
Non-blocking advisories (P3, not Gate 2 findings)
These notes do not block merge and do not require another Gate 2 round.
G2-R2-A01[P3] (ci/run_anneal_check.sh:732): The audit) AUDIT_RUN_KIND if/elif dispatch has no terminal else that fails closed; currently unreachable because parse_audit_shard_spec validates the kind, but a future parser edit could silently run nothing.G2-R2-A02[P3] (ci/check_pass2_canaries.py:1217): The static CI wiring guard enforces only pass2-canaries membership and AUDIT_SHARD interpolation; completeness of the pass1-i/N set and presence of the correspondence shard rely solely on the exact-list assertion in ci/ci_workflow_tests/ci_core_workflows.py.G2-R2-A03[P3] (ci/checks.toml:733): Documentation in docs/trust-model.md and docs/contributing/testing-architecture.md does not yet reflect the 6-shard anneal-audit CI matrix and its cross-family constant-collision scope boundary.G2-R2-A04[P3] (docs/trust-model.md:765): The governing trust-model doc's CI description (section 2, Pass 1 kernel replay) is not updated to mention the sharded CI scopes or the disclosed no-joint-import relaxation; the relaxation is recorded only in the commit body, Review Receipt, and an AuditScope doc comment.
Executed Sandbox Probes
seat3repo_hygiene_and_theory_shard_simulation: outcome=passedseat3bwrap_root_manifest_sha256: outcome=passedseat3bwrap_python_ci_unit_suites: outcome=passedseat3bwrap_python_canary_static_subset_and_timeouts: outcome=partialseat3bwrap_bash_syntax_and_parse_audit_shard_spec: outcome=passedseat3bwrap_check_ci_wiring_mutations: outcome=passedseat3bwrap_rustc_shard_logic_probe: outcome=passedseat3cargo_and_lean_builds_skipped_light_workload: outcome=not_run
|
Authored by an AI agent acting on joshlf's behalf. Posted |
anneal-auditis the sole 38.7m CI critical-path straggler on 4-vCPUubuntu-24.04runners because one process compiles and kernel-replays all 379 Pass 1theory/modules before running Pass 2 correspondence andci/check_pass2_canaries.py, even though Pass 2 transitively imports only a small subset oftheory/.Add minimal, fail-closed sharding scopes to
anneal-auditand wire them as a 6-shard matrix on the existinganneal-auditcheck:trusted/audit/src/{repo_audit,lib,cli}.rs:AuditScope::{Full, Pass1TheoryShard { index, total }, CorrespondenceOnly}alongsideparse_theory_shard_spec,theory_transitive_closure_order, andselect_theory_shard_order. Default (Full) behavior and--jsonschema are unchanged (compiledTheoryModules,totalTheoryModules, andauditScopeare emitted only for non-Fullsharded scopes).--pass1-theory-shard <index>/<total>(mutually exclusive with--require-correspondence,--correspondence-only,--miri-cache-dir, and--cargo-boundary-only) still runs full Cargo hygiene, fulltrusted/lean/andtheory/staging, and full Pass 1 syntactic preflight across everytheory/file, then compiles and kernel-replays alltrusted/lean/modules plus the deterministic transitive closure oftheory/family shardindex/total(always seedingAnneal.MirWpandAnneal.MirWp.CanarieswheneververifyMirWpCoreTheoremswill fire). Fails closed iftotalexceeds discoveredtheory/families (including an emptytheory/tree).--correspondence-only(mutually exclusive with--pass1-theory-shardand--cargo-boundary-only; implies--require-correspondence) runs full Cargo hygiene, full Pass 1 staging/preflight, full cross-tree module uniqueness across Pass 1, Pass 2, andvendor/lean-miri/, compiles and Pass-1-audits alltrusted/lean/modules plus only thetheory/transitive closure imported bycorrespondence/(andAnneal.MirWp/Anneal.MirWp.Canaries), and runs the full sandboxed Pass 2correspondence-preflight, compilation, andcorrespondence-audit.tests/testkit/src/assertions.rsandtests/audit/tests/boundary_audit/audit_sharding.rs: Accept optional sharded-scope JSON fields inAuditReport(#[serde(deny_unknown_fields)]) while asserting realAuditScope::Fullanneal-audit --jsonomits them and parses cleanly underAuditReport::from_json_slice, plus positive and negative tests for malformed and conflicting CLI flags, disjoint-complete Pass 1 shard union, unassigned-family preflightsorryrejection, empty-tree and over-sharding rejection, and--correspondence-onlymissing-dir and unimported Pass 1/Pass 2 module-collision rejection.ci/checks.toml,ci/run_anneal_check.sh,ci/check_pass2_canaries.py, and CI unit tests: Splitanneal-auditintomatrix = { shard = ["correspondence", "pass1-1/4", "pass1-2/4", "pass1-3/4", "pass1-4/4", "pass2-canaries"] }while keepinganneal-auditthe sole check onanneal-audit-litewithcaches = ["miri-v1"].correspondencesorts lexicographically first soci-core's cache publisher always selects the Pass 2 shard formiri-v1on a cold miss. DefaultAUDIT_SHARD=allpreserves full single-command local runs (while explicit emptyAUDIT_SHARD=""and oversized >18-digit shard numbers fail closed), andci/check_pass2_canaries.pyenforces--leanwiring across both theallandpass2-canariesbranches plusanneal-audit.matrix.shard.Intentional policy relaxation (integrity/importability only, not soundness): Sharded CI (
pass1-1/4..4/4pluscorrespondence) no longer imports alltheory/modules into a single Lean environment simultaneously, so cross-family constant-name collisions across disjointtheory/families (families sharing neitherTrusted.*,Anneal.MirWp*, nor a common ancestor) are no longer rejected pre-merge in CI and are only jointly imported under localAUDIT_SHARD=all(AuditScope::Full). Impact is strictly integrity/importability rather than soundness: any collision fails closed if jointly imported, and verification claims remainTrusted.*-only. Full Cargo hygiene, full source staging, full syntactic preflight, module-name uniqueness across Pass 1, Pass 2, andvendor/lean-miri/, kernel replay gates, andbwrapsandboxing remain unchanged.Authored by an AI agent acting on joshlf's behalf.