)]}'
{
  "commit": "2319aabf068d252a12f0a2e04dcf58a5ed017211",
  "tree": "47c2b8c192c27fb58c720618bcd445b1dbb76b33",
  "parents": [
    "39d392201e587275499d6d34e3640ac379ac37f6"
  ],
  "author": {
    "name": "Mark Dittmer",
    "email": "markdittmer@google.com",
    "time": "Wed Dec 02 06:28:30 2026 +0000"
  },
  "committer": {
    "name": "Mark Dittmer",
    "email": "markdittmer@google.com",
    "time": "Wed Dec 02 22:10:42 2026 +0000"
  },
  "message": "[ci] Add code-and-proof Miri oracle and semantics patch checks\n\nCommits 7da5b23 and 39d3922 established Anneal\u0027s isolated red-teaming\nharness for proof-only, specification-preflight, and repository-theory\naudits, where either the Rust crate stays fixed or the specification\nand repository theory are audited independently. That leaves joint\nattacks uncovered: submitting arbitrary Rust source code paired with a\npassing Lean proof (`CrateTheorem` or `CrateTheoremV2`), where\nmismatches between Anneal\u0027s MIR operational semantics and real Rust\nexecution semantics can accept unsafe code that exhibits Undefined\nBehavior (UB), panics, or returns the wrong value.\n\nThis change adds the `code_and_proof_soundness` challenge on top of the\nshared harness and verdict contract in `ci/redteam/` and `docs/`. When\nuntrusted Rust code and Lean proofs pass `cargo anneal verify` and\n`inspect --require-crate-scope`, an isolated Miri and native `rustc`\noracle checks actual runtime behavior, while optional semantics-bug\ncounterexamples can patch Anneal\u0027s MIR rules under `anneal-audit`\npreservation canaries and compiled `.olean` checks for human triage:\n\n- Scenario registry (`ci/redteam/scenarios.py`): adds\n  `code_and_proof_soundness`, which locks `Spec.returnsZero` (requiring\n  a captured `redteam_target() -\u003e u64` body to return `0` without UB or\n  panic, selecting Profile v1 `Specs` or Profile v2 `SpecsV2` via\n  sandboxed capture profiling to match submitted Rust crates) alongside\n  mutually isolated submission slots for Rust source (`src/**/*.rs`,\n  rejecting `Cargo.toml`/`build.rs`, `include*!`, `${...}` macro\n  metavariable expressions, `#[path]`, `global_asm!`/`naked_asm!`, and\n  `debugger_visualizer`), `Proof/*.lean`, optional `witness.json`\n  inputs calling captured crate bodies, paired\n  `incorrectness/{semantics.patch,Proof.lean}` unified diffs scoped\n  strictly to mutable `Trusted/MirSemantics/` files (excluding\n  `Boundary.lean` and `CanaryFixtures.lean`), and `manifest.json`\n  `prose_only_claim`.\n- Miri/`rustc` oracle and verdict pipeline (`ci/redteam/harness.py`,\n  `ci/redteam/dedup.py`): builds and runs a confined Bubblewrap driver\n  (written after untrusted crate compilation as a read-only file with\n  stage-scoped writable outputs and `bwrap --json-status-fd` check so\n  attacker `bwrap:` stderr cannot spoof sandbox errors) matching MIR\n  capture flags (`-C opt-level\u003d0`, `-C debug-assertions\u003dno`,\n  `-C overflow-checks\u003dno`) under Miri (Tree Borrows, extra constant UB\n  checks, leak ignore, fixed seed, `x86_64-unknown-linux-gnu`) and a\n  memory-capped native `rustc` oracle binary, rejecting explicit invalid\n  `--miri-sysroot` paths without ambient fallback (verifying\n  `lib/rustlib/\u003ctarget\u003e/lib`), checking inconclusive failure precedence\n  before `fault` tags (guarding JSON diagnostics on `step \u003d\u003d \"miri\"` and\n  `proc.returncode !\u003d 0`, rejecting ICE/non-interface `E0463`/`E0514`\n  driver compile errors to `HARNESS_ERROR`, gating non-code-and-proof\n  exit-0 wins on known-broken challenge kinds), attributing\n  capture-phase `unsupported` (exit 1) and `compiler_failed` (exit 2)\n  crate rejections via passing defender baseline controls to\n  `DEFENDER_HELD_ANNEAL_FAIL_CLOSED` and `INVALID_SUBMISSION` instead\n  of `HARNESS_ERROR`, and recording `miri_sysroot` provenance. Miri UB\n  (including `-Z extra-const-ub-checks` const-eval `E0080`), panics,\n  early exits, and wrong returns score `ATTACKER_WON_ANNEAL_COMPROMISED`\n  with normalized `RT-CPH-*` finding tags, whereas missing sandboxes,\n  tool/linker errors, OOM, stack overflows, unsupported Miri\n  operations, and timeouts fail closed as `HARNESS_ERROR`. Clean\n  executions hold as `DEFENDER_HELD_CODE_CORRECT` (or\n  `P2 NEEDS_HUMAN_REVIEW` when `prose_only_claim` is true), while\n  paired `semantics.patch` plus `Proof.refute : Not Expected.claim`\n  submissions run `anneal-audit` preservation canaries (sandboxed\n  strictly to the patched workspace while pinning workspace inputs,\n  artifacts, and tools across every exit path) and Bubblewrap-contained\n  topological `.olean` verification (`DEFENDER_HELD_AUDIT_CATCH` when\n  rejected, or `P1 NEEDS_HUMAN_REVIEW` when clean). Note that Rust slot\n  filtering lexes Unicode `UAX #31` identifiers and raw `r#ident` tokens\n  using pinned `rustc_lexer` tables (rejecting unrecognized non-ASCII\n  tokens outside strings and comments), validates block comments as\n  token boundaries, rejects `${...}` macro metavariable expressions\n  including spaced or commented forms, and checks macro attribute\n  splices across the full crate `src/` tree.\n- Proof-role `.olean` kernel inspection (`ci/redteam/olean_audit.lean`):\n  adds `role \u003d\u003d \"proof\"` auditing at `trustLevel :\u003d 0` (`loadExts :\u003d\n  false`), treating pre-verified defender modules (`Trusted.*`,\n  `Captured*`, `Expected`, `Spec*`, `Anneal*`) as trusted base while\n  checking and kernel-replaying attacker helper, `Proof`, and generated\n  `ProbeCheck` modules (verifying `ProbeCheck.check : Not\n  Expected.claim`) against forbidden imports, custom axioms, `sorryAx`,\n  compiler hooks, and reserved namespaces.\n- Documentation, prompt template, and tests\n  (`docs/{red-teaming,workspace-composition}.md`,\n  `ci/redteam/REDTEAM_PROMPT_TEMPLATE.md`,\n  `ci/redteam/test_redteam_harness.py`): documents the joint oracle\n  contract, `trusted/audit/` pinned assets, and role-scoped `.olean`\n  checks, and adds unit and live tests covering Profile v1 and\n  Profile v2 crates, Miri UB (arithmetic, Tree Borrows aliasing,\n  unaligned references), capture-phase rejection attribution, witness\n  panics, native OOM, timeouts, `witness.json` validation, and\n  preservation canaries.\n\nAgent-authored-by: AI agent acting on mdittmer\u0027s behalf\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8af3c166aaa60cdbfe4cf4ec055ad9e4694097ab",
      "old_mode": 33188,
      "old_path": "ci/redteam/REDTEAM_PROMPT_TEMPLATE.md",
      "new_id": "564d3927268fad7de996e71aee5d050a26e70ca7",
      "new_mode": 33188,
      "new_path": "ci/redteam/REDTEAM_PROMPT_TEMPLATE.md"
    },
    {
      "type": "modify",
      "old_id": "a1e6e85d92d8c41f656450d272191daf6dad0da1",
      "old_mode": 33188,
      "old_path": "ci/redteam/dedup.py",
      "new_id": "b100031ea35c49183446921d105b0fdd9dc3ed53",
      "new_mode": 33188,
      "new_path": "ci/redteam/dedup.py"
    },
    {
      "type": "modify",
      "old_id": "2e4e04d85d3df6d8b43c1dfcb1ab1766721c1416",
      "old_mode": 33188,
      "old_path": "ci/redteam/harness.py",
      "new_id": "20e0c2b67af6fe5ac09346083d81fef5d30422bf",
      "new_mode": 33188,
      "new_path": "ci/redteam/harness.py"
    },
    {
      "type": "modify",
      "old_id": "6b40762b996853f9826841b6b14ed9efc34a0f3d",
      "old_mode": 33188,
      "old_path": "ci/redteam/olean_audit.lean",
      "new_id": "26036a455e5da97b7989eccd95ff8fd1eb9cd696",
      "new_mode": 33188,
      "new_path": "ci/redteam/olean_audit.lean"
    },
    {
      "type": "modify",
      "old_id": "e2349124484b6bd3d4a62470edc4213896e74579",
      "old_mode": 33188,
      "old_path": "ci/redteam/scenarios.py",
      "new_id": "95acd57e858b0125a7a5ad099d191849d242b763",
      "new_mode": 33188,
      "new_path": "ci/redteam/scenarios.py"
    },
    {
      "type": "modify",
      "old_id": "5ac09b728d2c18b3e15a08a1eae473649d5f6570",
      "old_mode": 33188,
      "old_path": "ci/redteam/test_redteam_harness.py",
      "new_id": "b278358a14a1b166f31e02b7814bf61ba363c859",
      "new_mode": 33188,
      "new_path": "ci/redteam/test_redteam_harness.py"
    },
    {
      "type": "modify",
      "old_id": "b7eef7e218b0d5cf626c52afc2907e1cb6bcc856",
      "old_mode": 33188,
      "old_path": "docs/red-teaming.md",
      "new_id": "7bb9229b497504a83157d7b3bc9e28c8dcccc821",
      "new_mode": 33188,
      "new_path": "docs/red-teaming.md"
    },
    {
      "type": "modify",
      "old_id": "2ad81ce1545a01aa893c6601a9630427ffbd3ebc",
      "old_mode": 33188,
      "old_path": "docs/workspace-composition.md",
      "new_id": "049490baacb8652a5b2e4b37ee9e557253f6c199",
      "new_mode": 33188,
      "new_path": "docs/workspace-composition.md"
    }
  ]
}
