Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8e5c4b3
Family C real-Lean repair turn: candidate Lean compiles under lake bu…
Nov 20, 2026
31f928d
chore: regenerate oracles_verification_receipt after Family C prose fix
Nov 20, 2026
62164d6
verification: regenerate final receipt for Family C repair turn
cursoragent Nov 20, 2026
1dad320
Merge branch 'feat/formal-verification-loop-v0.2' into feat/family-c-…
cursoragent Nov 20, 2026
36d2221
Merge branch 'feat/formal-verification-loop-v0.2' into feat/family-c-…
cursoragent Nov 20, 2026
e1fc6df
Pin Family C checks to the harness statement.
cursoragent Nov 20, 2026
98838c5
Keep the Family C lake manifest so a correct proof passes bar.
cursoragent Nov 20, 2026
02d6b69
Reject Family C elaboration commands anywhere in the candidate.
cursoragent Nov 20, 2026
c32a47c
Reject hidden Family C IO before lake build.
cursoragent Nov 20, 2026
4829f7f
Merge branch 'feat/formal-verification-loop-v0.2' into feat/family-c-…
cursoragent Nov 20, 2026
17ac686
Merge branch 'feat/formal-verification-loop-v0.2' into feat/family-c-…
cursoragent Nov 20, 2026
3788ee4
Confine every candidate Lean build and import in bubblewrap.
cursoragent Nov 20, 2026
fc3acf9
Merge branch 'feat/formal-verification-loop-v0.2' into feat/family-c-…
cursoragent Nov 20, 2026
6d1133d
Merge branch 'feat/formal-verification-loop-v0.2' into feat/family-c-…
cursoragent Nov 20, 2026
28281fa
Confine the remaining Lean compiles and hide the host from the sandbox.
cursoragent Nov 20, 2026
f146fb7
Run the comparator inside the sandbox and restore trusted inputs.
cursoragent Nov 20, 2026
3f49c6b
Stop restoring trusted files through a candidate-controlled tree.
cursoragent Nov 20, 2026
9d41156
Refuse candidate opens when symlink-safe flags are missing.
cursoragent Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Run the full Tier 2 oracle gates and Family `A` to `D` graders. On Linux, `lake
## What is not proved

- Passing Tier 2 oracles proves only the machine-checked properties enforced by each checker. Whether a theorem statement matches human intent remains a Tier 1 human specification judgment.
- `datasets/scripts/grade_item.py` grades Family C items by deterministic structural claim-tier and `meta["bar_status"]` replay rather than re-running Lean compilation on prose-only reports.
- `datasets/scripts/grade_item.py` grades Family C items by deterministic structural claim-tier and `meta["bar_status"]` replay. The `bar_check` replay pins `spec_meta.statements` and does not emit an identity scaffold. It does not re-run Lean compilation. `verdict_audit` items, including `PUB-C-V02`, check a verdict JSON block and do not use the Family C Lean repair path.
- Live `8` GiB RTX 3080 `T-C5` telemetry (`stack/results/final/ux582hs_rtx3080_tc5_live_receipt.json`) measured Windows 11 NVIDIA Optimus (`driver 566.07`, `0 MiB` idle WDDM VRAM), while bare-metal Linux kernel execution on `UX582HS` remains tracked separately.

## What you must trust
Expand Down
2 changes: 1 addition & 1 deletion bin/bootstrap-deps
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from mcproof.lineage import ( # noqa: E402


def _clone_at_exact_sha(url: str, commit: str, dest: Path) -> None:
if not COMMIT_RE.match(commit):
if not COMMIT_RE.fullmatch(commit):
raise ValueError(f"refusing non-40-hex commit pin {commit!r} for {url}")
if (dest / ".git").exists():
head = subprocess.run(
Expand Down
2 changes: 1 addition & 1 deletion datasets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ All 144 `PUB-` prompts stay strictly inside four reserved public subtopics so th

- **Family A (`formal_proof`, 24 compile / 12 validation)**: stock-`Init` Lean `v4.35.0` proofs and `WeakStatement` vacuous-hypothesis traps checked across all six kernels of `lake comparator --paranoid`, `leanchecker`, `collectAxioms`, and `soko` `lean4_auditor.py`.
- **Family B (`code`, 24 compile / 12 validation)**: exact `int` and `Fraction` Python certificate verifiers (`def verify(inst, cert) -> bool`) audited for distinct AST alpha-skeletons, zero `float` or `/` coercion, zero `assert` under `mde guard --code-audit`, clean `python3 -O -B -W error` execution, and 100% planted-bug mutation kills (`>= 80%` floor).
- **Family C (`formal_proof`, 24 compile / 12 validation)**: epistemic claim-tier hygiene and refusal traps checked by `mcproof`, `mission/bar/check.py`, `formal-claims-audit/scripts/check_verdicts.py`, and `f0/scripts/gate.py`.
- **Family C (`formal_proof`, 24 compile / 12 validation)**: epistemic claim-tier hygiene and refusal traps checked by `mcproof`, `mission/bar/check.py`, `formal-claims-audit/scripts/check_verdicts.py`, and `f0/scripts/gate.py`. The `bar_check` oracle is the one that builds a Lean project from pinned `spec_meta.statements`. `PUB-C-V02` is a `verdict_audit` item and does not use that path.
- **Family D (`formal_proof`, 24 compile / 12 validation)**: mixed-register technical notes combining plain prose (`check-prose.py` and `--dupes`), `<div class="formal-claim" data-eido-skip>` protection, full 40-character verdict SHAs, kernel-checked Lean 4 blocks, and mandatory boundary sections.

## Re-check Commands
Expand Down
4 changes: 2 additions & 2 deletions datasets/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
a584a5b6254aae9dbf800643dcea3c9786a93198ee6975adea00fcc0eaa56007 README.md
42b9a50198da3641a98deefcc754bca2ce474b453918ea7a274c4ffd73f1f2c9 README.md
067059259c5d2238a8ab3f6a6b01ebcedeed2dc0d19d2f7a02a3e170f52f7f31 compile.jsonl
6d3918122d61d92e74752b4a26f70dbc3e5786657df596b54e54a384cb1c9140 harnesses/family_a/PUB-A-C01.json
3e5993ed8ed763e630129fe2426eadea2e0c03dc48d705de8dcbe75a4faedcec harnesses/family_a/PUB-A-C02.json
Expand Down Expand Up @@ -146,7 +146,7 @@ dfc1d7b0f63c89861c06453993d6aec79249231272f3200a0c3e378a7131658c harnesses/fami
011e0e35a21fe2cd7e54bb9c4efed1e8208923d35a1110e4ff18b7ce1f51631a harnesses/family_d/PUB-D-V12.json
ba2e9b277eeb8d9ea5965b27d73ca8efc6c55c732ad800ee2bdfea41266eeeae hybrid_k0.jsonl
93a27e6c37e501153ff5837abaebec10ff80a85b84dc9c15897809687d822142 manifest.json
1c774b9040622baf59c4d0ca2ab3e49807131d83b66cdb6aa16387ddaf8113e7 scripts/grade_item.py
cd97d19a0c6b773636fb2fab15bd3dff10fcfe242d32aa77b69e8f0d20d05556 scripts/grade_item.py
f5cb4f7d69da62e4be17a4947049b89928d1ea82c1a2a93dd7d7851ee623611d targets/family_a/PUB-A-C01.lean
7e688d533d3e502b272bfe1b166d6eceaa7f635ac4c511ca7a1449b591257f69 targets/family_a/PUB-A-C02.lean
f1f8e95c36306ca5a9abc45cee000ffe7d783d8f012eb3e9a47e583e6fbee82b targets/family_a/PUB-A-C03.lean
Expand Down
55 changes: 31 additions & 24 deletions datasets/scripts/grade_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
Delegates primary Family A/B/C/D checks to `bin/mcproof` and runs structural
claim/metadata replay (`mission/bar/check.py` README/bar.toml consistency,
verdict JSON field checks, and `f0/scripts/gate.py` feed schema checks) for
Family C items when `--id` is supplied. Note: Family C audits prose/metadata
alignment and claim-tier honesty, whereas Lean 4 theorem proving is tested in
Family A and Family D.
Family C items when `--id` is supplied. A `bar_check` replay pins
`spec_meta.statements` and does not emit an identity scaffold. It does not
compile Lean. A `verdict_audit` item, including `PUB-C-V02`, checks a verdict
JSON block and does not build a Lean project. Lean 4 theorem proving is tested
in Family A and Family D.
"""
from __future__ import annotations

Expand Down Expand Up @@ -51,6 +53,17 @@ def _resolve_deps_root() -> Path:
MCPROOF_BIN = _resolve_mcproof_bin()
DEPS_ROOT = _resolve_deps_root()

if str(REPO_ROOT / "src") not in sys.path:
sys.path.insert(0, str(REPO_ROOT / "src"))

from mcproof.repair_loop import ( # noqa: E402
_family_c_lakefile,
_family_c_root_source,
_family_c_spec_source,
_family_c_statement_headers,
_family_c_code_under_proof,
)


def _load_item(item_id: str) -> dict[str, Any]:
for name in ("compile.jsonl", "validation.jsonl"):
Expand Down Expand Up @@ -83,41 +96,35 @@ def _run_family_c_structural_replay(harness: dict[str, Any], completion_text: st
errs: list[str] = []

if otype == "bar_check":
pkg = str(meta["pkg"])
thms = list(meta["theorem_names"])
headers = _family_c_statement_headers(meta, thms)
if headers is None:
return False, [
"target_statements_absent: spec_meta.statements must pin the header of every theorem_names entry"
]
bar_tpl = DEPS_ROOT / "mission" / "bar" / "template"
bar_chk = DEPS_ROOT / "mission" / "bar" / "check.py"
if not bar_tpl.is_dir() or not bar_chk.is_file():
return False, [f"missing_mission_dep_under_{DEPS_ROOT.name}__run_bin_bootstrap_deps"]
pkg = str(meta["pkg"])
thms = list(meta["theorem_names"])
readme_body = re.sub(r"(?im)^Claim-Tier:[^\n]*\n+", "", completion_text, count=1)
# Take bar_status strictly from harness metadata; candidate prose cannot self-promote status.
bar_status = str(meta["bar_status"])
code_toml = ", ".join(json.dumps(name) for name in _family_c_code_under_proof(pkg, meta))
with tempfile.TemporaryDirectory(prefix="mcproof_ds_bar_") as td:
root = Path(td)
shutil.copytree(bar_tpl, root, dirs_exist_ok=True)
(root / "Clamp.lean").unlink(missing_ok=True)
shutil.rmtree(root / "Clamp", ignore_errors=True)
(root / f"{pkg}.lean").write_text(f"namespace {pkg}\ndef op (x : Nat) : Nat := x\nend {pkg}\n", encoding="utf-8")
(root / f"{pkg}.lean").write_text(_family_c_root_source(pkg, meta), encoding="utf-8")
(root / pkg).mkdir(exist_ok=True)
spec_lines = [f"import {pkg}", f"namespace {pkg}.Spec"]
proof_lines = [f"import {pkg}", f"namespace {pkg}.Spec"]
for tfull in thms:
tshort = tfull.split(".")[-1]
spec_lines.append(f"theorem {tshort} (x : Nat) : {pkg}.op x = x := by sorry")
proof_lines.append(f"theorem {tshort} (x : Nat) : {pkg}.op x = x := rfl")
spec_lines.append(f"end {pkg}.Spec\n")
proof_lines.append(f"end {pkg}.Spec\n")
(root / pkg / "Spec.lean").write_text("\n".join(spec_lines), encoding="utf-8")
(root / pkg / "Proofs.lean").write_text("\n".join(proof_lines), encoding="utf-8")
(root / "Main.lean").write_text(f'import {pkg}\ndef main : IO Unit := IO.println s!"{{{pkg}.op 1}}"\n', encoding="utf-8")
(root / "lakefile.toml").write_text(
f'name = "{pkg.lower()}"\nversion = "0.1.0"\ndefaultTargets = ["{pkg}"]\n\n'
f'[[lean_lib]]\nname = "{pkg}"\n\n'
f'[[lean_lib]]\nname = "{pkg}.Spec"\n\n'
f'[[lean_lib]]\nname = "{pkg}.Proofs"\n\n'
f'[[lean_exe]]\nname = "{pkg.lower()}"\nroot = "Main"\n',
(root / pkg / "Spec.lean").write_text(_family_c_spec_source(pkg, headers), encoding="utf-8")
(root / pkg / "Proofs.lean").write_text(f"import {pkg}\n", encoding="utf-8")
(root / "Main.lean").write_text(
f'import {pkg}\ndef main : IO Unit := IO.println "ok"\n',
encoding="utf-8",
)
(root / "lakefile.toml").write_text(_family_c_lakefile(pkg), encoding="utf-8")
(root / "comparator.json").write_text(
json.dumps(
{
Expand All @@ -134,7 +141,7 @@ def _run_family_c_structural_replay(harness: dict[str, Any], completion_text: st
(root / "bar.toml").write_text(
f'[project]\nname = "{pkg.lower()}"\nstatus = "{bar_status}"\npage = "README.md"\n'
f'spec_authors = ["example-author"]\nentry_points = ["Main.lean"]\n\n'
f'[spec]\nfiles = ["SPEC.md", "{pkg}/Spec.lean"]\ncode = ["{pkg}.op"]\n\n'
f'[spec]\nfiles = ["SPEC.md", "{pkg}/Spec.lean"]\ncode = [{code_toml}]\n\n'
f'[tests]\nresults = "tests/TEST-RESULTS.md"\ncommand = "{meta["test_cmd"]}"\nfiles = ["tests/run_tests.py"]\n',
encoding="utf-8",
)
Expand Down
12 changes: 12 additions & 0 deletions docs/CONTINUITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,15 @@ python3 verification/build_final_receipt.py

1. **Multi-layer `blk.28..31` `TangentBetaEdit` live serving promotion:** Wire 4-layer `TangentBetaEdit` (`weft` `c33bbf4f`) into live `warp-modeld` Stage 1 to 4 admission and measure multi-turn `k = 1..4` pass curves with `blk.28..31` non-uniform depth allocation (`alpha_l*` proportional to `R_l^2 / (gamma_l^2 * rho_l)`).
2. **Concrete graph-hypothesis coupling for `Mcproof.TransitionBounds`:** Mechanize finite-table checkers discharging projection and cut-capacity hypotheses directly inside Lean `v4.35.0` alongside Python `verify_dual_product_parity`.

## D11 Family C real-Lean repair turn (2026-11-20)
- **Defect closed in `src/mcproof/repair_loop.py`:** the public Family C scorer parsed `says_verified` from candidate prose and rebuilt an identity `rfl` scaffold while running the comparator with `--no-lean`. Candidate Lean never compiled, and prose could self-promote `bar_status`.
- **What uses the Lean path:** `_run_family_c_real_lean_turn` runs only when `oracle_type` is `bar_check`. Public `bar_check` items include `PUB-C-V01` (`CrtPair`) and `PUB-C-C01` (`ModInv`). `bar_status` comes from harness `spec_meta`. A spoofed verified claim yields `FAMILY_C_STATUS_SELF_ATTESTATION`. Missing lean blocks and `sorry` or `admit` fail closed before `lake`.
- **What does not use it:** `PUB-C-V02` is `oracle_type: verdict_audit` in `datasets/harnesses/family_c/PUB-C-V02.json`. That path checks a fenced verdict JSON block. It does not build a Lean project, does not hash a theorem statement, and does not call `lake`. A solve of `PUB-C-V02` is a verdict-audit result. It is not evidence that this Lean path accepted a proof.
- **Statement pin:** `spec_meta.statements` supplies the target header for each fully-qualified theorem name. The guard hashes that header. It does not hash `op x = x`. A fully qualified `rfl` of the identity fails with `FAMILY_C_STATEMENT_MISMATCH`. A missing header fails with `FAMILY_C_TARGET_STATEMENT_ABSENT` and is not replaced by an identity scaffold.
- **`defaultTargets`:** the generated project targets `["{pkg}", "{pkg}.Spec", "{pkg}.Proofs"]`, so `lake build` compiles the candidate proofs. The old `["{pkg}"]` list left broken proofs uncompiled.
- **Lean evidence in this lane:** `test_family_c_known_bad_proof_reaches_lake_build` states the pinned headers and closes them with `exact Nat.noSuchLemma`. The turn records `LAKE_BUILD_FAILED` and keeps the compiler `file:line:column` tail.
- **Skip rule:** that test skips only when `lean` and `lake` are absent, and the skip reason says the lake path was not exercised. `test_family_c_lean_error_text_reaches_next_turn_prompt` only checks `format_diagnostics` on a hand-written finding. It does not run `lake`.
- **`datasets/scripts/grade_item.py`:** the structural bar replay writes those same pinned headers into `Spec.lean`. It does not write an identity `op` or an identity `rfl` proof. `defaultTargets` includes the spec and proofs libraries. Harnesses that omit `statements`, which is every frozen `bar_check` file today, fail closed with `target_statements_absent`. This replay still does not compile Lean.
- **Known wart:** `verify_lean4_project_comparator` still keeps only the last 6 `lake build` lines. The repair turn records its own `lake build` first and keeps lines that contain `.lean:line:column`, so a failed candidate proof does not depend on that truncated tail.
- **Envelope:** this section describes the code on this branch. This lane did not re-run the public validation split, and it did not touch the vault or the sealed holdout.
Loading
Loading