File created successfully at: C:\Users\NickV\cubie-verification\tools\summarize_verification.py

#!/usr/bin/env python3
"""
summarize_verification.py — Generate verification_report.md, .json, and gap_report.md.

Reads: roadmap/crosswalk_203.csv, coq/*.v, lean/*.lean
Writes: reports/verification_report.md
        reports/verification_report.json
        reports/gap_report.md
"""
import csv
import json
import re
import sys
from collections import Counter, defaultdict
from datetime import date
from pathlib import Path

def count_declarations(fpath: Path) -> dict:
    """Count Theorem/Lemma/Definition declarations in a Coq .v file."""
    text   = fpath.read_text(encoding="utf-8", errors="replace")
    counts = Counter()
    for line in text.splitlines():
        s = line.strip()
        for kw in ("Theorem", "Lemma", "Definition", "Fixpoint", "Inductive", "Corollary"):
            if s.startswith(kw + " "):
                counts[kw] += 1
                break
    return dict(counts)

def lean_axiom_profile(fpath: Path) -> str:
    """Determine axiom profile of a Lean .lean file."""
    text = fpath.read_text(encoding="utf-8", errors="replace")
    if "sorryAx" in text or "sorry" in text:
        return "USES_SORRY"
    has_propext    = "propext" in text
    has_quot       = "Quot.sound" in text
    has_classical  = "Classical" in text
    has_axiom      = bool(re.search(r"^axiom\s+", text, re.MULTILINE))
    if has_propext and has_quot:
        return "USES_PROPEXT_AND_QUOT_SOUND"
    if has_propext:
        return "USES_PROPEXT"
    if has_classical:
        return "USES_CLASSICAL"
    if has_axiom:
        return "HAS_AXIOM"
    return "AXIOM_FREE"

def load_crosswalk(csv_path: Path) -> list[dict]:
    if not csv_path.exists():
        return []
    with open(csv_path, encoding="utf-8") as f:
        return list(csv.DictReader(f))

def main():
    repo           = Path(__file__).parent.parent
    crosswalk_path = repo / "roadmap" / "crosswalk_203.csv"
    reports_dir    = repo / "reports"
    reports_dir.mkdir(exist_ok=True)
    today = date.today().isoformat()

    # --- Load crosswalk ---
    rows           = load_crosswalk(crosswalk_path)
    status_counts  = Counter(r["actual_status"] for r in rows)
    verified_rows  = [r for r in rows if r["actual_status"].startswith("VERIFIED")]
    future_rows    = [r for r in rows if r["actual_status"] == "FUTURE_OBLIGATION"]
    derived_rows   = [r for r in rows if r["actual_status"] == "DERIVED_CANDIDATE"]
    invariant_rows = [r for r in rows if r["actual_status"] == "ENGINEERING_INVARIANT"]
    empirical_rows = [r for r in rows if r["actual_status"] == "EMPIRICAL_CLAIM"]
    rewrite_rows   = [r for r in rows if r["actual_status"] == "REWRITE_RULE"]

    # --- Coq file analysis ---
    coq_dir    = repo / "coq"
    coq_files  = sorted(coq_dir.glob("*.v")) if coq_dir.exists() else []
    coq_data   = {f.name: count_declarations(f) for f in coq_files}
    total_decl = sum(sum(v.values()) for v in coq_data.values())

    # --- Lean file analysis ---
    lean_dir      = repo / "lean"
    lean_files    = sorted(lean_dir.glob("*.lean")) if lean_dir.exists() else []
    lean_profiles = {f.name: lean_axiom_profile(f) for f in lean_files}

    axiom_free_lean  = [n for n, p in lean_profiles.items() if p == "AXIOM_FREE"]
    uses_propext     = [n for n, p in lean_profiles.items() if "PROPEXT" in p]
    bridge_profile   = lean_profiles.get("CubieBridgeV1_40.lean", "NOT_FOUND")

    # =========================================================================
    # verification_report.md
    # =========================================================================
    md = f"""# Cubie Verification Report

**Generated:** {today}
**Package version:** cubie-verification v3
**Source:** CubieMasterStack PDF (163 theorems, 7 deliverables) + v1.10 Non-Quantum (30 theorems) + Theorem Omega 4.0 (1 theorem)

---

## 1. Critical invariant: CubieBridge V1.40 axiom profile

CubieBridge V1.40 **must** be fully axiom-free in Lean 4.

| File | Lean Axiom Profile | Status |
|------|--------------------|--------|
| CubieBridgeV1_40.lean | {bridge_profile} | {'✅ PASS' if bridge_profile == 'AXIOM_FREE' else '❌ FAIL — must be AXIOM_FREE'} |

---

## 2. Coq files

| File | Theorem | Lemma | Definition | Other | Total |
|------|---------|-------|------------|-------|-------|
"""
    for fname, counts in sorted(coq_data.items()):
        t = counts.get("Theorem", 0)
        l = counts.get("Lemma", 0)
        d = counts.get("Definition", 0)
        o = sum(v for k, v in counts.items() if k not in ("Theorem", "Lemma", "Definition"))
        total = sum(counts.values())
        md += f"| {fname} | {t} | {l} | {d} | {o} | {total} |\n"
    md += f"\n**Total declarations scanned:** {total_decl}  \n"
    md += f"**Coq files present:** {len(coq_files)}/13 expected\n"

    md += f"""
---

## 3. Lean files — axiom profiles

| File | Axiom Profile |
|------|---------------|
"""
    for fname, profile in sorted(lean_profiles.items()):
        flag = " ✅" if profile == "AXIOM_FREE" else (" ⚠" if "PROPEXT" in profile else " ❌")
        md += f"| {fname} | {profile}{flag} |\n"

    md += f"""
**Axiom-free files:** {len(axiom_free_lean)}
**Uses propext:** {len(uses_propext)}
**Lean files present:** {len(lean_files)}/8 expected

---

## 4. Crosswalk summary (203 rows)

| Status | Count | % |
|--------|-------|---|
"""
    total_rows = len(rows) or 1
    for status, count in sorted(status_counts.items()):
        pct = 100 * count / total_rows
        md += f"| {status} | {count} | {pct:.1f}% |\n"

    md += f"""
**Total rows:** {len(rows)}
**Verified (EXACT + EQUIVALENT):** {len(verified_rows)}
**Future obligations:** {len(future_rows)}
**Derived candidates:** {len(derived_rows)}
**Engineering invariants (Verus targets):** {len(invariant_rows)}
**Empirical claims:** {len(empirical_rows)}
**Rewrite rules (doc guardrails):** {len(rewrite_rows)}

---

## 5. Verified theorem mappings

| Row | Title | Coq Theorem | Deliverable |
|-----|-------|-------------|-------------|
"""
    for r in sorted(verified_rows, key=lambda x: int(x["roadmap_id"])):
        coq = r["coq_theorem_name"][:55] if r["coq_theorem_name"] else "(lean only)"
        md += f"| {r['roadmap_id']} | {r['roadmap_name'][:40]} | {coq} | {r['source_deliverable']} |\n"

    md += f"""
---

## 6. What this report does NOT claim

- Coq and Lean compilation is pending `coqc`/`lean` execution (install required).
- SHA-256 hashes are pending population from the PDF manifest (run `make hashes`).
- Verus proofs are stubs — `verus` binary required to verify runtime specs.
- Zero production-correctness claims are made from formal proofs alone.
  Rust_Conformance requires Verus or integration tests (ENGINEERING_INVARIANT rows).
"""

    (reports_dir / "verification_report.md").write_text(md, encoding="utf-8")
    print("WRITTEN: reports/verification_report.md")

    # =========================================================================
    # verification_report.json
    # =========================================================================
    report_json = {
        "generated":        today,
        "version":          "v3",
        "coq": {
            "files_present": len(coq_files),
            "files_expected": 13,
            "declarations":  coq_data,
            "total_decl":    total_decl,
        },
        "lean": {
            "files_present":    len(lean_files),
            "files_expected":   8,
            "axiom_profiles":   lean_profiles,
            "axiom_free_count": len(axiom_free_lean),
            "bridge_v140_profile": bridge_profile,
        },
        "crosswalk": {
            "total_rows":       len(rows),
            "status_counts":    dict(status_counts),
            "verified_count":   len(verified_rows),
            "future_count":     len(future_rows),
            "derived_count":    len(derived_rows),
            "invariant_count":  len(invariant_rows),
            "empirical_count":  len(empirical_rows),
            "rewrite_count":    len(rewrite_rows),
        },
        "verified_rows": [
            {
                "id":          r["roadmap_id"],
                "title":       r["roadmap_name"],
                "coq_theorem": r["coq_theorem_name"],
                "lean_theorem":r["lean_theorem_name"],
                "deliverable": r["source_deliverable"],
                "notes":       r["notes"],
            }
            for r in sorted(verified_rows, key=lambda x: int(x["roadmap_id"]))
        ],
    }
    (reports_dir / "verification_report.json").write_text(
        json.dumps(report_json, indent=2, ensure_ascii=False), encoding="utf-8"
    )
    print("WRITTEN: reports/verification_report.json")

    # =========================================================================
    # gap_report.md
    # =========================================================================
    gap_md = f"""# Gap Report — Cubie Verification v3

**Generated:** {today}

All roadmap rows without a current Coq/Lean source match are listed below.
Each row is classified and has a specific next action.

**Summary:**
- {len(derived_rows)} DERIVED_CANDIDATE rows — provable from verified stack
- {len(future_rows)} FUTURE_OBLIGATION rows — need new formal definitions
- {len(invariant_rows)} ENGINEERING_INVARIANT rows — Verus spec or integration test targets

---

## DERIVED_CANDIDATE rows

These theorems can likely be proven by derivation from the existing verified source stack.
No new axioms are required — only formalization work.

| Row | Title | Cluster | Next Action |
|-----|-------|---------|-------------|
"""
    for r in sorted(derived_rows, key=lambda x: int(x["roadmap_id"])):
        gap_md += (
            f"| {r['roadmap_id']} | {r['roadmap_name'][:45]} | "
            f"{r['cluster'][:35]} | {r['next_action'][:45]} |\n"
        )

    gap_md += f"""
---

## FUTURE_OBLIGATION rows

These theorems require new type definitions or axioms before a proof is possible.

| Row | Title | Cluster | Next Action |
|-----|-------|---------|-------------|
"""
    for r in sorted(future_rows, key=lambda x: int(x["roadmap_id"])):
        gap_md += (
            f"| {r['roadmap_id']} | {r['roadmap_name'][:45]} | "
            f"{r['cluster'][:35]} | {r['next_action'][:45]} |\n"
        )

    gap_md += f"""
---

## ENGINEERING_INVARIANT rows (Verus / integration test targets)

These are runtime invariants. They map to the Verus spec modules in `verus/`.

| Row | Title | Cluster | Next Action |
|-----|-------|---------|-------------|
"""
    for r in sorted(invariant_rows, key=lambda x: int(x["roadmap_id"])):
        gap_md += (
            f"| {r['roadmap_id']} | {r['roadmap_name'][:45]} | "
            f"{r['cluster'][:35]} | {r['next_action'][:45]} |\n"
        )

    gap_md += f"""
---

## EMPIRICAL_CLAIM rows (benchmark targets)

These claims require runtime measurement, not formal proof.

| Row | Title | Measurement Strategy |
|-----|-------|---------------------|
"""
    for r in sorted(empirical_rows, key=lambda x: int(x["roadmap_id"])):
        gap_md += f"| {r['roadmap_id']} | {r['roadmap_name'][:45]} | {r['next_action'][:55]} |\n"

    (reports_dir / "gap_report.md").write_text(gap_md, encoding="utf-8")
    print("WRITTEN: reports/gap_report.md")

    print(f"\nSummary: {len(verified_rows)} verified | "
          f"{len(future_rows)} future | "
          f"{len(derived_rows)} derived | "
          f"{len(invariant_rows)} invariant | "
          f"{len(empirical_rows)} empirical")

if __name__ == "__main__":
    main()


Now run the crosswalk and generate the reports:


Bash

python tools/build_crosswalk.py \
  --jsonl "C:/Users/NickV/Downloads/cubie_theorem_proofs_203_jsonl_v1.jsonl" \
  --out roadmap/crosswalk_203.csv 2>&1

Run crosswalk builder to classify all 203 rows


Error: Exit code 1
crosswalk_203.csv written (203 rows):
  DERIVED_CANDIDATE: 130
  EMPIRICAL_CLAIM: 2
  ENGINEERING_INVARIANT: 10
  FUTURE_OBLIGATION: 15
  OUT_OF_SCOPE: 21
  REWRITE_RULE: 10
Traceback (most recent call last):
  File "C:\Users\NickV\cubie-verification\tools\build_crosswalk.py", line 413, in <module>
    main()
    ~~~~^^
  File "C:\Users\NickV\cubie-verification\tools\build_crosswalk.py", line 408, in main
    print(f"  {status}: {count}{marker}")
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python314\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 21: character maps to <undefined>


Edit

marker = " ✓" if status.startswith("VERIFIED") else ""

marker = " (VERIFIED)" if status.startswith("VERIFIED") else ""


The file C:\Users\NickV\cubie-verification\tools\build_crosswalk.py has been updated successfully.

#!/usr/bin/env python3
"""
build_crosswalk.py — Classify all 203 roadmap rows by actual proof status.

Status values (8):
  VERIFIED_EXACT       - exact theorem name exists in Coq/Lean source stack
  VERIFIED_EQUIVALENT  - semantically equivalent theorem exists
  DERIVED_CANDIDATE    - provable from verified stack; needs formalization
  FUTURE_OBLIGATION    - needs new definitions + formalization
  REWRITE_RULE         - Type R rows (doc/spec guardrail, no formal proof)
  ENGINEERING_INVARIANT - runtime invariant (Verus/integration test target)
  EMPIRICAL_CLAIM      - measurement-based; formally unprovable
  OUT_OF_SCOPE         - outside current formal proof stack

Classification uses original_id (NOT row_no) to identify verified theorems.
The 203-row JSONL row_no 1–203 maps to original_id values that may differ.
"""
import argparse
import csv
import json
import sys
from collections import Counter
from pathlib import Path

# ---------------------------------------------------------------------------
# Known VERIFIED_EXACT mappings
# Key = original_id (from the 203-JSONL original_id field)
# Value = {coq, lean, deliverable}
# Source: CubieMasterStack PDF + user crosswalk spec
# ---------------------------------------------------------------------------
VERIFIED_EXACT: dict[int, dict] = {
    # CubieBridge V1.40 — two-corner decomposition cluster
    57: {
        "coq":         "CubieBridgeV1_40.admit_decomposition",
        "lean":        "CubieBridgeV1_40.admit_decomposition",
        "deliverable": "V1.40",
        "notes":       "WriteOK two-corner decomposition; axiom-free in Lean.",
    },
    58: {
        "coq":         "CubieBridgeV1_40.gpu_failure_implies_denial",
        "lean":        "CubieBridgeV1_40.gpu_failure_implies_denial",
        "deliverable": "V1.40",
        "notes":       "GPU corner failure implies denial.",
    },
    59: {
        "coq":         "CubieBridgeV1_40.deployment_failure_implies_denial",
        "lean":        "CubieBridgeV1_40.deployment_failure_implies_denial",
        "deliverable": "V1.40",
        "notes":       "Deployment corner failure implies denial.",
    },
    60: {
        "coq":         "CubieBridgeV1_40.gpu_only_pass_witness;"
                       "CubieBridgeV1_40.deployment_only_pass_witness",
        "lean":        "CubieBridgeV1_40.gpu_only_pass_witness;"
                       "CubieBridgeV1_40.deployment_only_pass_witness",
        "deliverable": "V1.40",
        "notes":       "Independence witnesses for GPU/deployment corners.",
    },
    # CubieTrustCompiler V1.50 — face and admission cluster
    61: {
        "coq":         "CubieTrustCompilerV1_50.cubie_request_substrate",
        "lean":        "CubieTrustCompilerV1_50.cubie_request_substrate",
        "deliverable": "V1.50",
        "notes":       "CubieRequest face-promotion substrate.",
    },
    62: {
        "coq":         "CubieTrustCompilerV1_50.face_localized_denial_who;"
                       "CubieTrustCompilerV1_50.face_localized_denial_what;"
                       "CubieTrustCompilerV1_50.face_localized_denial_when;"
                       "CubieTrustCompilerV1_50.face_localized_denial_where;"
                       "CubieTrustCompilerV1_50.face_localized_denial_why;"
                       "CubieTrustCompilerV1_50.face_localized_denial_how",
        "lean":        "CubieTrustCompilerV1_50.face_localized_denial",
        "deliverable": "V1.50",
        "notes":       "One denial theorem per face (6 total).",
    },
    63: {
        "coq":         "CubieTrustCompilerV1_50.admit_implies_who_pass;"
                       "CubieTrustCompilerV1_50.admit_implies_what_pass;"
                       "CubieTrustCompilerV1_50.admit_implies_when_pass;"
                       "CubieTrustCompilerV1_50.admit_implies_where_pass;"
                       "CubieTrustCompilerV1_50.admit_implies_why_pass;"
                       "CubieTrustCompilerV1_50.admit_implies_how_pass",
        "lean":        "CubieTrustCompilerV1_50.admit_implies_all_pass",
        "deliverable": "V1.50",
        "notes":       "Admit implies every required face passed.",
    },
    64: {
        "coq":         "CubieTrustCompilerV1_50.denial_count_bounded_54",
        "lean":        "CubieTrustCompilerV1_50.denial_count_bounded_54",
        "deliverable": "V1.50",
        "notes":       "Denial count bounded by 54 oriented facelets.",
    },
    # CubieTrustCompiler V2.0 — lease, replay, epoch cluster
    70: {
        "coq":         "CubieTrustCompilerV2_0.lease_integrity",
        "lean":        "CubieTrustCompilerV2_0.lease_integrity",
        "deliverable": "V2.0",
        "notes":       "Admission lease integrity theorem.",
    },
    71: {
        "coq":         "CubieTrustCompilerV2_0.bypass_no_lease",
        "lean":        "CubieTrustCompilerV2_0.bypass_no_lease",
        "deliverable": "V2.0",
        "notes":       "Bypass-no-lease: no bypass without verified lease.",
    },
    76: {
        "coq":         "CubieTrustCompilerV2_0.epoch_advance_strictly_increases;"
                       "CubieTrustCompilerV2_0.epoch_advance_no_rollback",
        "lean":        "CubieTrustCompilerV2_0.epoch_monotonicity",
        "deliverable": "V2.0",
        "notes":       "Epoch monotonicity — no rollback.",
    },
    95: {
        "coq":         "CubieTrustCompilerV2_0.ha_split_brain_fail_closed",
        "lean":        "CubieTrustCompilerV2_0.ha_split_brain_fail_closed",
        "deliverable": "V2.0",
        "notes":       "HA split-brain must fail closed on high-impact requests.",
    },
    # RamenCornerConsensus V1.19.2 — non-vacuity and count cluster
    201: {
        "coq":         "RamenCornerConsensusV1192.denial_count_zero_iff_authorized",
        "lean":        "RamenCornerConsensusV1192.denial_count_zero_iff_authorized;"
                       "CubieTrustCompilerV1_50.denial_count_zero_iff_request_clean",
        "deliverable": "V1.19.2",
        "notes":       "Denial count zero iff authorized / clean.",
    },
    202: {
        "coq":         "RamenCornerConsensusV1192.denial_count_positive_iff_denied",
        "lean":        "RamenCornerConsensusV1192.denial_count_positive_iff_denied",
        "deliverable": "V1.19.2",
        "notes":       "Denial count positive iff denied.",
    },
    203: {
        "coq":         "RamenCornerConsensusV1192.good_corner_exists;"
                       "RamenCornerConsensusV1192.bad_corner_exists",
        "lean":        "RamenCornerConsensusV1192.good_corner_exists;"
                       "RamenCornerConsensusV1192.bad_corner_exists",
        "deliverable": "V1.19.2",
        "notes":       "Predicate non-vacuity (good and bad corners exist).",
    },
}

# ---------------------------------------------------------------------------
# v1.10 Non-Quantum Centillion verified theorems (VERIFIED_EQUIVALENT)
# These 30 theorems are verified in the v1.10 submission but map to
# roadmap rows that describe semantically equivalent concepts.
# original_ids are TBD pending full cross-reference; listed as candidates.
# ---------------------------------------------------------------------------
VERIFIED_EQUIVALENT: dict[int, dict] = {
    # Placeholder — populate after inspecting roadmap titles vs v1.10 theorem names
    # Example (not confirmed):
    # 88: {"coq": "CubieQv14.read_gate_independent_of_write_gate", ...}
}

def classify_row(row: dict, oid: int) -> dict:
    """Return crosswalk fields for a single roadmap row."""
    rtype   = str(row.get("type", "")).strip()
    cluster = row.get("cluster_no", "")
    cluster_int = int(cluster) if str(cluster).isdigit() else -1

    # --- Rule 1: Known VERIFIED_EXACT (by original_id) ---
    if oid in VERIFIED_EXACT:
        v = VERIFIED_EXACT[oid]
        return {
            "actual_status":      "VERIFIED_EXACT",
            "source_deliverable": v["deliverable"],
            "coq_theorem_name":   v["coq"],
            "lean_theorem_name":  v["lean"],
            "proof_status":       "PASS",
            "next_action":        "",
            "notes":              v["notes"],
        }

    # --- Rule 2: Known VERIFIED_EQUIVALENT ---
    if oid in VERIFIED_EQUIVALENT:
        v = VERIFIED_EQUIVALENT[oid]
        return {
            "actual_status":      "VERIFIED_EQUIVALENT",
            "source_deliverable": v.get("deliverable", ""),
            "coq_theorem_name":   v.get("coq", ""),
            "lean_theorem_name":  v.get("lean", ""),
            "proof_status":       "PASS",
            "next_action":        "",
            "notes":              v.get("notes", "Semantically equivalent to v1.10 theorem."),
        }

    # --- Rule 3: Cluster 0 (claim discipline / terminology) = OUT_OF_SCOPE ---
    if cluster_int == 0:
        return {
            "actual_status":      "OUT_OF_SCOPE",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "N/A",
            "next_action":        "Editorial review of claim classification.",
            "notes":              "Cluster 0 rows are claim-boundary guardrails, not theorems.",
        }

    # --- Rule 4: Pure R type = REWRITE_RULE ---
    if rtype == "R":
        return {
            "actual_status":      "REWRITE_RULE",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "N/A",
            "next_action":        "Audit documented claim; update whitepaper section.",
            "notes":              "Terminology / spec guardrail — no formal proof required.",
        }

    # --- Rule 5: R/C compound = REWRITE_RULE (doc first, then formalize) ---
    if rtype in ("R/C", "C/R"):
        return {
            "actual_status":      "REWRITE_RULE",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "PENDING",
            "next_action":        "Rewrite doc claim; then formalize supporting theorem.",
            "notes":              "Has documentation guardrail component + formal obligation.",
        }

    # --- Rule 6: Pure E type = EMPIRICAL_CLAIM ---
    if rtype == "E":
        return {
            "actual_status":      "EMPIRICAL_CLAIM",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "N/A",
            "next_action":        "Define measurement methodology and benchmark target.",
            "notes":              "Cannot be formally proved — requires runtime measurement.",
        }

    # --- Rule 7: R/E compound = EMPIRICAL_CLAIM (with spec cleanup) ---
    if rtype in ("R/E", "E/R"):
        return {
            "actual_status":      "EMPIRICAL_CLAIM",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "N/A",
            "next_action":        "Define benchmark target; clean up rewrite guardrail.",
            "notes":              "Empirical measurement + spec cleanup required.",
        }

    # --- Rule 8: Pure V type = ENGINEERING_INVARIANT ---
    if rtype == "V":
        return {
            "actual_status":      "ENGINEERING_INVARIANT",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "N/A",
            "next_action":        "Write Verus spec or integration test.",
            "notes":              "Runtime invariant — target for Verus or property-based test.",
        }

    # --- Rule 9: V/C compound = ENGINEERING_INVARIANT (Verus first) ---
    if rtype in ("V/C", "C/V"):
        return {
            "actual_status":      "ENGINEERING_INVARIANT",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "PENDING",
            "next_action":        "Write Verus spec; escalate to Coq/Lean if formal proof needed.",
            "notes":              "Runtime invariant with formal analogue — Verus bridges the gap.",
        }

    # --- Rule 10: F/C compound = FUTURE_OBLIGATION ---
    if "F" in rtype and "C" in rtype:
        return {
            "actual_status":      "FUTURE_OBLIGATION",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "PENDING",
            "next_action":        "Define new types/predicates; formalize in Lean 4 or Coq.",
            "notes":              "Requires new formal definitions — no proof possible yet.",
        }

    # --- Rule 11: C/F compound = FUTURE_OBLIGATION ---
    if rtype in ("C/F", "F"):
        return {
            "actual_status":      "FUTURE_OBLIGATION",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "PENDING",
            "next_action":        "Define new types/predicates; formalize in Lean 4 or Coq.",
            "notes":              "Future formalization obligation.",
        }

    # --- Rule 12: E/C compound = EMPIRICAL_CLAIM (measurable) ---
    if rtype in ("E/C", "C/E"):
        return {
            "actual_status":      "EMPIRICAL_CLAIM",
            "source_deliverable": "",
            "coq_theorem_name":   "",
            "lean_theorem_name":  "",
            "proof_status":       "N/A",
            "next_action":        "Implement benchmark harness; record measurement.",
            "notes":              "Has formal component but requires empirical validation first.",
        }

    # --- Default: pure C type or unrecognized = DERIVED_CANDIDATE ---
    return {
        "actual_status":      "DERIVED_CANDIDATE",
        "source_deliverable": "",
        "coq_theorem_name":   "",
        "lean_theorem_name":  "",
        "proof_status":       "PENDING",
        "next_action":        "Identify parent theorems in source stack; write formal derivation.",
        "notes":              "Likely derivable from verified stack — needs formal proof.",
    }

def validate_output(rows: list[dict]) -> list[str]:
    """Run constraint checks on the output rows. Returns list of errors."""
    errors = []
    ids_seen: set[int] = set()

    for r in rows:
        rid = int(r["roadmap_id"])

        if rid in ids_seen:
            errors.append(f"Row {rid}: duplicate ID")
        ids_seen.add(rid)

        status = r["actual_status"]
        valid_statuses = {
            "VERIFIED_EXACT", "VERIFIED_EQUIVALENT", "DERIVED_CANDIDATE",
            "FUTURE_OBLIGATION", "REWRITE_RULE", "ENGINEERING_INVARIANT",
            "EMPIRICAL_CLAIM", "OUT_OF_SCOPE",
        }
        if status not in valid_statuses:
            errors.append(f"Row {rid}: invalid status '{status}'")

        if status == "VERIFIED_EXACT" and not (r["coq_theorem_name"] or r["lean_theorem_name"]):
            errors.append(f"Row {rid}: VERIFIED_EXACT but no theorem name")

        if status in ("FUTURE_OBLIGATION", "ENGINEERING_INVARIANT", "EMPIRICAL_CLAIM"):
            if not r["next_action"].strip():
                errors.append(f"Row {rid}: {status} but no next_action")

    missing = set(range(1, 204)) - ids_seen
    if missing:
        errors.append(f"Missing IDs: {sorted(missing)[:10]}")

    return errors

def main():
    parser = argparse.ArgumentParser(description="Build crosswalk_203.csv")
    parser.add_argument("--jsonl", required=True, help="Path to 203-row JSONL")
    parser.add_argument("--out",   required=True, help="Output crosswalk_203.csv")
    args = parser.parse_args()

    with open(args.jsonl, encoding="utf-8") as f:
        rows = [json.loads(line) for line in f if line.strip()]

    if len(rows) != 203:
        print(f"ERROR: Expected 203 rows, got {len(rows)}", file=sys.stderr)
        sys.exit(1)

    fieldnames = [
        "roadmap_id", "roadmap_name", "cluster", "desired_status",
        "actual_status", "source_deliverable", "coq_theorem_name",
        "lean_theorem_name", "proof_status", "notes", "next_action",
    ]

    output_rows = []
    for row in rows:
        row_no = int(row["row_no"])
        oid    = int(row["original_id"]) if str(row["original_id"]).isdigit() else -1

        classification = classify_row(row, oid)

        output_rows.append({
            "roadmap_id":      row_no,
            "roadmap_name":    row.get("title", ""),
            "cluster":         row.get("cluster", ""),
            "desired_status":  row.get("formal_status", ""),
            **classification,
        })

    errors = validate_output(output_rows)
    if errors:
        print("VALIDATION ERRORS:", file=sys.stderr)
        for e in errors:
            print(f"  {e}", file=sys.stderr)
        sys.exit(1)

    out_path = Path(args.out)
    out_path.parent.mkdir(parents=True, exist_ok=True)
    with open(out_path, "w", newline="", encoding="utf-8") as f:
        writer = csv.DictWriter(f, fieldnames=fieldnames)
        writer.writeheader()
        writer.writerows(output_rows)

    counts = Counter(r["actual_status"] for r in output_rows)
    print(f"crosswalk_203.csv written ({len(output_rows)} rows):")
    for status, count in sorted(counts.items()):
        marker = " ✓" if status.startswith("VERIFIED") else ""
        print(f"  {status}: {count}{marker}")
    print(f"\nVerified total: {counts['VERIFIED_EXACT'] + counts['VERIFIED_EQUIVALENT']}/203")

if __name__ == "__main__":
    main()

-        marker = " ✓" if status.startswith("VERIFIED") else ""

+        marker = " (VERIFIED)" if status.startswith("VERIFIED") else ""


Bash

python tools/build_crosswalk.py \
  --jsonl "C:/Users/NickV/Downloads/cubie_theorem_proofs_203_jsonl_v1.jsonl" \
  --out roadmap/crosswalk_203.csv 2>&1

Run crosswalk builder


crosswalk_203.csv written (203 rows):
  DERIVED_CANDIDATE: 130
  EMPIRICAL_CLAIM: 2
  ENGINEERING_INVARIANT: 10
  FUTURE_OBLIGATION: 15
  OUT_OF_SCOPE: 21
  REWRITE_RULE: 10
  VERIFIED_EXACT: 15 (VERIFIED)

Verified total: 15/203


cd /c/Users/NickV/cubie-verification
cp "C:/Users/NickV/Downloads/cubie_theorem_proofs_203_jsonl_v1.jsonl" roadmap/cubie_theorem_roadmap_203.jsonl
python tools/summarize_verification.py 2>&1

Copy JSONL and generate reports


WRITTEN: reports/verification_report.md
WRITTEN: reports/verification_report.json
WRITTEN: reports/gap_report.md

Summary: 15 verified | 15 future | 130 derived | 10 invariant | 2 empirical


Now create the manifest and Makefile:


Write

{
  "version": "v3",
  "generated": "2026-05-06",
  "note": "SHA-256 hashes for PDF-extracted files must be populated from the CubieMasterStack PDF manifest section. Run 'python tools/verify_hashes.py' after populating.",
  "sources": {
    "coq": {
      "RamenCornerConsensusV1192.v":           {"sha256": "FILL_FROM_PDF", "deliverable": "V1.19.2", "theorems": 53},
      "ToRAdmissionCompilerV1_30.v":           {"sha256": "FILL_FROM_PDF", "deliverable": "V1.30",   "theorems": 5},
      "ToRCornerSpoofingV1_31.v":              {"sha256": "FILL_FROM_PDF", "deliverable": "V1.31",   "theorems": 2},
      "CubieBridgeV1_40.v":                    {"sha256": "FILL_FROM_PDF", "deliverable": "V1.40",   "theorems": 6, "axiom_profile": "axiom_free"},
      "CubieTrustCompilerV1_50.v":             {"sha256": "FILL_FROM_PDF", "deliverable": "V1.50",   "theorems": 17},
      "CubieTrustCompilerV2_0.v":              {"sha256": "FILL_FROM_PDF", "deliverable": "V2.0",    "theorems": 26},
      "CubieTrustCompilerV2_0_PerPredicate.v": {"sha256": "FILL_FROM_PDF", "deliverable": "V2.0-PP", "theorems": 54}
    },
    "lean": {
      "RamenCornerConsensusV1192.lean":           {"sha256": "FILL_FROM_PDF", "deliverable": "V1.19.2"},
      "ToRAdmissionCompilerV1_30.lean":           {"sha256": "FILL_FROM_PDF", "deliverable": "V1.30"},
      "ToRCornerSpoofingV1_31.lean":              {"sha256": "FILL_FROM_PDF", "deliverable": "V1.31"},
      "CubieBridgeV1_40.lean":                    {"sha256": "FILL_FROM_PDF", "deliverable": "V1.40", "axiom_profile": "axiom_free"},
      "CubieTrustCompilerV1_50.lean":             {"sha256": "FILL_FROM_PDF", "deliverable": "V1.50"},
      "CubieTrustCompilerV2_0.lean":              {"sha256": "FILL_FROM_PDF", "deliverable": "V2.0"},
      "CubieTrustCompilerV2_0_PerPredicate.lean": {"sha256": "FILL_FROM_PDF", "deliverable": "V2.0-PP"}
    }
  },
  "v1_10_submission": {
    "note": "Hashes from v1.10_CubieFinalSubmission_COMPLETE_0427/MANIFEST_WITH_HASHES.txt",
    "coq": {
      "CubieNonQuantum_v1_10.v": {"sha256": "bf57a783ae407bf697938530b9be8ea454485a8755db9414809536a5eed9bb0e", "theorems": 8},
      "TheoremOmega6.v":         {"sha256": "FILL_FROM_MANIFEST", "theorems": 1},
      "CubieQApex.v":            {"sha256": "FILL_FROM_MANIFEST", "theorems": 4},
      "CubieQv14.v":             {"sha256": "FILL_FROM_MANIFEST", "theorems": 8},
      "OmegaSeven.v":            {"sha256": "FILL_FROM_MANIFEST", "theorems": 9}
    },
    "lean": {
      "CubieNonQuantum_v1_10.lean": {"sha256": "449bf73f63c2e1545c23603f493176a1acd86d2dae74bd392ca74096cf133e25", "theorems": 8}
    }
  },
  "tf_omega": {
    "note": "Theorem Omega 4.0 — from tf-OMEGA folder on Desktop",
    "coq": {
      "TheoremOmega4.v":   {"sha256": "FILL_FROM_CERTIFICATE", "theorems": 1}
    },
    "lean": {
      "TheoremOmega4.lean": {"sha256": "FILL_FROM_CERTIFICATE", "theorems": 1}
    }
  },
  "crosswalk_summary": {
    "total_rows":          203,
    "VERIFIED_EXACT":       15,
    "VERIFIED_EQUIVALENT":   0,
    "DERIVED_CANDIDATE":   130,
    "FUTURE_OBLIGATION":    15,
    "REWRITE_RULE":         10,
    "ENGINEERING_INVARIANT":10,
    "EMPIRICAL_CLAIM":       2,
    "OUT_OF_SCOPE":         21
  }
}


File created successfully at: C:\Users\NickV\cubie-verification\manifest.json

SHA-256 hashes for PDF-extracted files must be populated from the CubieMasterStack PDF manifest section. Run 'python tools/verify_hashes.py' after populating.

Theorem Omega 4.0 — from tf-OMEGA folder on Desktop


PDF_MASTER := C:/Users/NickV/Downloads/v1_0 CubieMasterStack 0430.pdf
JSONL_203  := C:/Users/NickV/Downloads/cubie_theorem_proofs_203_jsonl_v1.jsonl
PYTHON     := python

.PHONY: all extract scan verify-coq verify-lean verify-verus crosswalk hashes report test clean help

all: scan crosswalk report

help:
	@echo "cubie-verification v3 Makefile"
	@echo ""
	@echo "Targets:"
	@echo "  extract      Extract Coq/Lean sources from CubieMasterStack PDF"
	@echo "  scan         Scan all sources for Admitted/sorry/unexpected axioms"
	@echo "  verify-coq   Compile all Coq files + run coqchk (requires coq 8.18)"
	@echo "  verify-lean  Check all Lean files (requires lean 4)"
	@echo "  verify-verus Run Verus specs (requires verus binary)"
	@echo "  crosswalk    Build roadmap/crosswalk_203.csv from 203-row roadmap"
	@echo "  hashes       Verify SHA-256 hashes against manifest.json"
	@echo "  report       Generate reports/ (verification + gap)"
	@echo "  test         Run pytest test suite"
	@echo "  clean        Remove compiled Coq artifacts"
	@echo "  all          scan + crosswalk + report (default)"

extract:
	$(PYTHON) tools/extract_sources_from_master.py "$(PDF_MASTER)" --repo . --verbose

scan:
	$(PYTHON) tools/scan_for_unsound_tokens.py

verify-coq:
	@echo "=== Compiling Coq files ==="
	@for f in coq/RamenCornerConsensusV1192.v \
	           coq/ToRAdmissionCompilerV1_30.v \
	           coq/ToRCornerSpoofingV1_31.v \
	           coq/CubieBridgeV1_40.v \
	           coq/CubieTrustCompilerV1_50.v \
	           coq/CubieTrustCompilerV2_0.v \
	           coq/CubieTrustCompilerV2_0_PerPredicate.v \
	           coq/CubieNonQuantum_v1_10.v \
	           coq/TheoremOmega4.v; do \
	  echo "  coqc $$f"; \
	  coqc "$$f" || exit 1; \
	done
	@echo ""
	@echo "=== Running coqchk ==="
	@for mod in RamenCornerConsensusV1192 \
	             ToRAdmissionCompilerV1_30 \
	             ToRCornerSpoofingV1_31 \
	             CubieBridgeV1_40 \
	             CubieTrustCompilerV1_50 \
	             CubieTrustCompilerV2_0 \
	             CubieTrustCompilerV2_0_PerPredicate; do \
	  echo "  coqchk $$mod"; \
	  coqchk "$$mod" || exit 1; \
	done
	@echo "PASS: all Coq files compiled and coqchk passed"

verify-lean:
	@echo "=== Checking Lean files ==="
	@for f in lean/CubieBridgeV1_40.lean \
	           lean/CubieTrustCompilerV1_50.lean \
	           lean/CubieTrustCompilerV2_0.lean \
	           lean/RamenCornerConsensusV1192.lean \
	           lean/TheoremOmega4.lean; do \
	  echo "  lean $$f"; \
	  lean "$$f" || exit 1; \
	done
	@echo "PASS: all Lean files checked"

verify-verus:
	@echo "=== Checking Verus specs ==="
	@if which verus > /dev/null 2>&1; then \
	  for f in verus/*.rs; do \
	    echo "  verus $$f"; \
	    verus "$$f" || exit 1; \
	  done; \
	  echo "PASS: all Verus specs verified"; \
	else \
	  echo "SKIP: verus binary not found (specs are stubs — install verus to verify)"; \
	fi

crosswalk:
	$(PYTHON) tools/build_crosswalk.py --jsonl "$(JSONL_203)" --out roadmap/crosswalk_203.csv

hashes:
	$(PYTHON) tools/verify_hashes.py

report:
	$(PYTHON) tools/summarize_verification.py

test:
	$(PYTHON) -m pytest tools/test_crosswalk.py tools/test_scanner.py -v

clean:
	rm -f coq/*.vo coq/*.vos coq/*.vok coq/*.glob
	rm -f tools/_pdf_text_dump.txt


File created successfully at: C:\Users\NickV\cubie-verification\Makefile

PDF_MASTER := C:/Users/NickV/Downloads/v1_0 CubieMasterStack 0430.pdf
JSONL_203  := C:/Users/NickV/Downloads/cubie_theorem_proofs_203_jsonl_v1.jsonl
PYTHON     := python

.PHONY: all extract scan verify-coq verify-lean verify-verus crosswalk hashes report test clean help

all: scan crosswalk report

help:
	@echo "cubie-verification v3 Makefile"
	@echo ""
	@echo "Targets:"
	@echo "  extract      Extract Coq/Lean sources from CubieMasterStack PDF"
	@echo "  scan         Scan all sources for Admitted/sorry/unexpected axioms"
	@echo "  verify-coq   Compile all Coq files + run coqchk (requires coq 8.18)"
	@echo "  verify-lean  Check all Lean files (requires lean 4)"
	@echo "  verify-verus Run Verus specs (requires verus binary)"
	@echo "  crosswalk    Build roadmap/crosswalk_203.csv from 203-row roadmap"
	@echo "  hashes       Verify SHA-256 hashes against manifest.json"
	@echo "  report       Generate reports/ (verification + gap)"
	@echo "  test         Run pytest test suite"
	@echo "  clean        Remove compiled Coq artifacts"
	@echo "  all          scan + crosswalk + report (default)"

extract:
	$(PYTHON) tools/extract_sources_from_master.py "$(PDF_MASTER)" --repo . --verbose

scan:
	$(PYTHON) tools/scan_for_unsound_tokens.py

verify-coq:
	@echo "=== Compiling Coq files ==="
	@for f in coq/RamenCornerConsensusV1192.v \
	           coq/ToRAdmissionCompilerV1_30.v \
	           coq/ToRCornerSpoofingV1_31.v \
	           coq/CubieBridgeV1_40.v \
	           coq/CubieTrustCompilerV1_50.v \
	           coq/CubieTrustCompilerV2_0.v \
	           coq/CubieTrustCompilerV2_0_PerPredicate.v \
	           coq/CubieNonQuantum_v1_10.v \
	           coq/TheoremOmega4.v; do \
	  echo "  coqc $$f"; \
	  coqc "$$f" || exit 1; \
	done
	@echo ""
	@echo "=== Running coqchk ==="
	@for mod in RamenCornerConsensusV1192 \
	             ToRAdmissionCompilerV1_30 \
	             ToRCornerSpoofingV1_31 \
	             CubieBridgeV1_40 \
	             CubieTrustCompilerV1_50 \
	             CubieTrustCompilerV2_0 \
	             CubieTrustCompilerV2_0_PerPredicate; do \
	  echo "  coqchk $$mod"; \
	  coqchk "$$mod" || exit 1; \
	done
	@echo "PASS: all Coq files compiled and coqchk passed"

verify-lean:
	@echo "=== Checking Lean files ==="
	@for f in lean/CubieBridgeV1_40.lean \
	           lean/CubieTrustCompilerV1_50.lean \
	           lean/CubieTrustCompilerV2_0.lean \
	           lean/RamenCornerConsensusV1192.lean \
	           lean/TheoremOmega4.lean; do \
	  echo "  lean $$f"; \
	  lean "$$f" || exit 1; \
	done
	@echo "PASS: all Lean files checked"

verify-verus:
	@echo "=== Checking Verus specs ==="
	@if which verus > /dev/null 2>&1; then \
	  for f in verus/*.rs; do \
	    echo "  verus $$f"; \
	    verus "$$f" || exit 1; \
	  done; \
	  echo "PASS: all Verus specs verified"; \
	else \
	  echo "SKIP: verus binary not found (specs are stubs — install verus to verify)"; \
	fi

crosswalk:
	$(PYTHON) tools/build_crosswalk.py --jsonl "$(JSONL_203)" --out roadmap/crosswalk_203.csv

hashes:
	$(PYTHON) tools/verify_hashes.py

report:
	$(PYTHON) tools/summarize_verification.py

test:
	$(PYTHON) -m pytest tools/test_crosswalk.py tools/test_scanner.py -v

clean:
	rm -f coq/*.vo coq/*.vos coq/*.vok coq/*.glob
	rm -f tools/_pdf_text_dump.txt


#!/usr/bin/env python3
"""
extract_sources_from_master.py — Extract Coq and Lean source listings
from the v1_0 CubieMasterStack 0430.pdf.

Writes extracted files to coq/ and lean/ under the repo root.
Dumps full PDF text to tools/_pdf_text_dump.txt for manual inspection
if automated extraction is incomplete.

Usage:
  python tools/extract_sources_from_master.py "path/to/v1_0 CubieMasterStack 0430.pdf" --repo .
"""
import argparse
import hashlib
import re
import sys
from pathlib import Path

try:
    import pdfplumber
except ImportError:
    sys.exit("ERROR: pip install pdfplumber")

# ---------------------------------------------------------------------------
# Deliverable definitions
# ---------------------------------------------------------------------------
DELIVERABLES = [
    ("V1.19.2", "RamenCornerConsensusV1192",       53, "Ramen Corner"),
    ("V1.30",   "ToRAdmissionCompilerV1_30",        5, "ToR Admission"),
    ("V1.31",   "ToRCornerSpoofingV1_31",           2, "ToR Corner Spoofing"),
    ("V1.40",   "CubieBridgeV1_40",                 6, "Cubie Bridge"),
    ("V1.50",   "CubieTrustCompilerV1_50",         17, "Track B"),
    ("V2.0",    "CubieTrustCompilerV2_0",          26, "Track C"),
    ("V2.0-PP", "CubieTrustCompilerV2_0_PerPredicate", 54, "Per-Predicate"),
]

COQ_KEYWORDS  = re.compile(
    r"^(Require|Module|Section|Theorem|Lemma|Definition|Fixpoint|Inductive|"
    r"Corollary|Record|Variable|Axiom|End|Proof|Qed|Admitted|Import)\b",
    re.MULTILINE,
)
LEAN_KEYWORDS = re.compile(
    r"^(import|namespace|theorem|lemma|def|structure|inductive|open|"
    r"class|instance|end|#check|#print|variable|axiom|noncomputable)\b",
    re.MULTILINE,
)

def sha256_str(text: str) -> str:
    return hashlib.sha256(text.encode("utf-8")).hexdigest()

def extract_text(pdf_path: Path, verbose: bool) -> str:
    """Extract all text from PDF preserving line structure."""
    pages = []
    with pdfplumber.open(str(pdf_path)) as pdf:
        total = len(pdf.pages)
        for i, page in enumerate(pdf.pages):
            if verbose:
                print(f"  Reading page {i+1}/{total}...", end="\r", flush=True)
            text = page.extract_text(x_tolerance=2, y_tolerance=3)
            if text:
                pages.append(f"[PAGE {i+1}]\n{text}")
    if verbose:
        print()
    return "\n".join(pages)

def find_code_block(
    text:            str,
    label:           str,
    base_name:       str,
    keyword_pattern: re.Pattern,
    lang:            str,
) -> str:
    """
    Find a code block for the given deliverable and language in the PDF text.

    Strategy:
    1. Look for a section header containing the deliverable label + language keyword
    2. Extract lines from there until we hit the next deliverable header or SHA line
    3. Filter to lines that look like code (start with a keyword or indented)
    """
    # Pattern 1: explicit section header
    header_patterns = [
        # "V1.40 ... Coq Source" style
        rf"(?i){re.escape(label)}[^\n]*{lang}[^\n]*\n(.*?)(?=\n\[PAGE|\nV1\.\d|V2\.0|SHA-256|\Z)",
        # "Coq Source ... V1.40" style
        rf"(?i){lang}[^\n]*{re.escape(label)}[^\n]*\n(.*?)(?=\n\[PAGE|\nV1\.\d|V2\.0|SHA-256|\Z)",
        # filename-based: look for the filename in the text
        rf"(?i){re.escape(base_name)}[^\n]*\n(.*?)(?=\n\[PAGE|\nV1\.\d|V2\.0|SHA-256|\Z)",
    ]

    for pat in header_patterns:
        m = re.search(pat, text, re.DOTALL)
        if m:
            block = m.group(1).strip()
            # Only keep lines that match code patterns
            code_lines = [
                line for line in block.splitlines()
                if keyword_pattern.match(line.strip()) or line.startswith("  ") or line.startswith("\t")
                or line.strip().startswith(("(*", "--", "/-", "by", "|", "}", "{", "·", "·"))
            ]
            if len(code_lines) > 5:
                return "\n".join(code_lines)

    return ""

def main():
    parser = argparse.ArgumentParser(description="Extract Coq/Lean sources from CubieMasterStack PDF")
    parser.add_argument("pdf",        help="Path to v1_0 CubieMasterStack 0430.pdf")
    parser.add_argument("--repo",     default=".", help="Repo root (default: .)")
    parser.add_argument("--verbose",  action="store_true")
    args = parser.parse_args()

    pdf_path = Path(args.pdf)
    if not pdf_path.exists():
        sys.exit(f"ERROR: PDF not found: {pdf_path}")

    repo     = Path(args.repo)
    coq_dir  = repo / "coq";  coq_dir.mkdir(exist_ok=True)
    lean_dir = repo / "lean"; lean_dir.mkdir(exist_ok=True)
    dump_path = repo / "tools" / "_pdf_text_dump.txt"

    print(f"Extracting text from {pdf_path.name} ({pdf_path.stat().st_size // 1024} KB)...")
    text = extract_text(pdf_path, args.verbose)

    # Always dump for inspection
    dump_path.write_text(text, encoding="utf-8")
    print(f"Full text dumped to {dump_path} ({len(text):,} chars)")

    extracted_coq  = []
    extracted_lean = []
    failed         = []

    for label, base_name, n_theorems, short_name in DELIVERABLES:
        for lang, lang_pat, ext, out_dir in [
            ("Coq",  COQ_KEYWORDS,  ".v",     coq_dir),
            ("Lean", LEAN_KEYWORDS, ".lean",  lean_dir),
        ]:
            block = find_code_block(text, label, base_name, lang_pat, lang)

            out_file = out_dir / f"{base_name}{ext}"
            if block:
                out_file.write_text(block, encoding="utf-8")
                sha = sha256_str(block)
                print(f"  EXTRACTED {lang}/{out_file.name} "
                      f"({len(block):,} chars, sha256={sha[:16]}...)")
                if lang == "Coq":
                    extracted_coq.append(base_name)
                else:
                    extracted_lean.append(base_name)
            else:
                print(f"  WARN: Could not auto-extract {lang}/{out_file.name} "
                      f"— manual copy from _pdf_text_dump.txt required")
                failed.append(f"{lang}/{out_file.name}")

    print()
    print(f"Extracted: {len(extracted_coq)}/7 Coq files, {len(extracted_lean)}/7 Lean files")

    if failed:
        print(f"Manual extraction needed for {len(failed)} file(s):")
        for f in failed:
            print(f"  {f}")
        print()
        print("Instructions:")
        print("  1. Open tools/_pdf_text_dump.txt in a text editor")
        print("  2. Search for the deliverable label (e.g., 'V1.40', 'CubieBridge')")
        print("  3. Copy the Coq/Lean code block into the corresponding file")
        print("  4. Run 'python tools/verify_hashes.py' to confirm SHA-256 match")
        sys.exit(1)

if __name__ == "__main__":
    main()


File created successfully at: C:\Users\NickV\cubie-verification\tools\extract_sources_from_master.py

#!/usr/bin/env python3
"""
extract_sources_from_master.py — Extract Coq and Lean source listings
from the v1_0 CubieMasterStack 0430.pdf.

Writes extracted files to coq/ and lean/ under the repo root.
Dumps full PDF text to tools/_pdf_text_dump.txt for manual inspection
if automated extraction is incomplete.

Usage:
  python tools/extract_sources_from_master.py "path/to/v1_0 CubieMasterStack 0430.pdf" --repo .
"""
import argparse
import hashlib
import re
import sys
from pathlib import Path

try:
    import pdfplumber
except ImportError:
    sys.exit("ERROR: pip install pdfplumber")

# ---------------------------------------------------------------------------
# Deliverable definitions
# ---------------------------------------------------------------------------
DELIVERABLES = [
    ("V1.19.2", "RamenCornerConsensusV1192",       53, "Ramen Corner"),
    ("V1.30",   "ToRAdmissionCompilerV1_30",        5, "ToR Admission"),
    ("V1.31",   "ToRCornerSpoofingV1_31",           2, "ToR Corner Spoofing"),
    ("V1.40",   "CubieBridgeV1_40",                 6, "Cubie Bridge"),
    ("V1.50",   "CubieTrustCompilerV1_50",         17, "Track B"),
    ("V2.0",    "CubieTrustCompilerV2_0",          26, "Track C"),
    ("V2.0-PP", "CubieTrustCompilerV2_0_PerPredicate", 54, "Per-Predicate"),
]

COQ_KEYWORDS  = re.compile(
    r"^(Require|Module|Section|Theorem|Lemma|Definition|Fixpoint|Inductive|"
    r"Corollary|Record|Variable|Axiom|End|Proof|Qed|Admitted|Import)\b",
    re.MULTILINE,
)
LEAN_KEYWORDS = re.compile(
    r"^(import|namespace|theorem|lemma|def|structure|inductive|open|"
    r"class|instance|end|#check|#print|variable|axiom|noncomputable)\b",
    re.MULTILINE,
)

def sha256_str(text: str) -> str:
    return hashlib.sha256(text.encode("utf-8")).hexdigest()

def extract_text(pdf_path: Path, verbose: bool) -> str:
    """Extract all text from PDF preserving line structure."""
    pages = []
    with pdfplumber.open(str(pdf_path)) as pdf:
        total = len(pdf.pages)
        for i, page in enumerate(pdf.pages):
            if verbose:
                print(f"  Reading page {i+1}/{total}...", end="\r", flush=True)
            text = page.extract_text(x_tolerance=2, y_tolerance=3)
            if text:
                pages.append(f"[PAGE {i+1}]\n{text}")
    if verbose:
        print()
    return "\n".join(pages)

def find_code_block(
    text:            str,
    label:           str,
    base_name:       str,
    keyword_pattern: re.Pattern,
    lang:            str,
) -> str:
    """
    Find a code block for the given deliverable and language in the PDF text.

    Strategy:
    1. Look for a section header containing the deliverable label + language keyword
    2. Extract lines from there until we hit the next deliverable header or SHA line
    3. Filter to lines that look like code (start with a keyword or indented)
    """
    # Pattern 1: explicit section header
    header_patterns = [
        # "V1.40 ... Coq Source" style
        rf"(?i){re.escape(label)}[^\n]*{lang}[^\n]*\n(.*?)(?=\n\[PAGE|\nV1\.\d|V2\.0|SHA-256|\Z)",
        # "Coq Source ... V1.40" style
        rf"(?i){lang}[^\n]*{re.escape(label)}[^\n]*\n(.*?)(?=\n\[PAGE|\nV1\.\d|V2\.0|SHA-256|\Z)",
        # filename-based: look for the filename in the text
        rf"(?i){re.escape(base_name)}[^\n]*\n(.*?)(?=\n\[PAGE|\nV1\.\d|V2\.0|SHA-256|\Z)",
    ]

    for pat in header_patterns:
        m = re.search(pat, text, re.DOTALL)
        if m:
            block = m.group(1).strip()
            # Only keep lines that match code patterns
            code_lines = [
                line for line in block.splitlines()
                if keyword_pattern.match(line.strip()) or line.startswith("  ") or line.startswith("\t")
                or line.strip().startswith(("(*", "--", "/-", "by", "|", "}", "{", "·", "·"))
            ]
            if len(code_lines) > 5:
                return "\n".join(code_lines)

    return ""

def main():
    parser = argparse.ArgumentParser(description="Extract Coq/Lean sources from CubieMasterStack PDF")
    parser.add_argument("pdf",        help="Path to v1_0 CubieMasterStack 0430.pdf")
    parser.add_argument("--repo",     default=".", help="Repo root (default: .)")
    parser.add_argument("--verbose",  action="store_true")
    args = parser.parse_args()

    pdf_path = Path(args.pdf)
    if not pdf_path.exists():
        sys.exit(f"ERROR: PDF not found: {pdf_path}")

    repo     = Path(args.repo)
    coq_dir  = repo / "coq";  coq_dir.mkdir(exist_ok=True)
    lean_dir = repo / "lean"; lean_dir.mkdir(exist_ok=True)
    dump_path = repo / "tools" / "_pdf_text_dump.txt"

    print(f"Extracting text from {pdf_path.name} ({pdf_path.stat().st_size // 1024} KB)...")
    text = extract_text(pdf_path, args.verbose)

    # Always dump for inspection
    dump_path.write_text(text, encoding="utf-8")
    print(f"Full text dumped to {dump_path} ({len(text):,} chars)")

    extracted_coq  = []
    extracted_lean = []
    failed         = []

    for label, base_name, n_theorems, short_name in DELIVERABLES:
        for lang, lang_pat, ext, out_dir in [
            ("Coq",  COQ_KEYWORDS,  ".v",     coq_dir),
            ("Lean", LEAN_KEYWORDS, ".lean",  lean_dir),
        ]:
            block = find_code_block(text, label, base_name, lang_pat, lang)

            out_file = out_dir / f"{base_name}{ext}"
            if block:
                out_file.write_text(block, encoding="utf-8")
                sha = sha256_str(block)
                print(f"  EXTRACTED {lang}/{out_file.name} "
                      f"({len(block):,} chars, sha256={sha[:16]}...)")
                if lang == "Coq":
                    extracted_coq.append(base_name)
                else:
                    extracted_lean.append(base_name)
            else:
                print(f"  WARN: Could not auto-extract {lang}/{out_file.name} "
                      f"— manual copy from _pdf_text_dump.txt required")
                failed.append(f"{lang}/{out_file.name}")

    print()
    print(f"Extracted: {len(extracted_coq)}/7 Coq files, {len(extracted_lean)}/7 Lean files")

    if failed:
        print(f"Manual extraction needed for {len(failed)} file(s):")
        for f in failed:
            print(f"  {f}")
        print()
        print("Instructions:")
        print("  1. Open tools/_pdf_text_dump.txt in a text editor")
        print("  2. Search for the deliverable label (e.g., 'V1.40', 'CubieBridge')")
        print("  3. Copy the Coq/Lean code block into the corresponding file")
        print("  4. Run 'python tools/verify_hashes.py' to confirm SHA-256 match")
        sys.exit(1)

if __name__ == "__main__":
    main()


Now create the test files and .gitignore, then git commit everything:


"""Tests for crosswalk_203.csv output constraints."""
import csv
from pathlib import Path
import pytest

CROSSWALK_PATH = Path(__file__).parent.parent / "roadmap" / "crosswalk_203.csv"

VALID_STATUSES = {
    "VERIFIED_EXACT", "VERIFIED_EQUIVALENT", "DERIVED_CANDIDATE",
    "FUTURE_OBLIGATION", "REWRITE_RULE", "ENGINEERING_INVARIANT",
    "EMPIRICAL_CLAIM", "OUT_OF_SCOPE",
}

@pytest.fixture
def rows():
    if not CROSSWALK_PATH.exists():
        pytest.skip("crosswalk_203.csv not generated — run: make crosswalk")
    with open(CROSSWALK_PATH, encoding="utf-8") as f:
        return list(csv.DictReader(f))

def test_row_count(rows):
    assert len(rows) == 203, f"Expected 203 rows, got {len(rows)}"

def test_ids_complete(rows):
    ids = {int(r["roadmap_id"]) for r in rows}
    missing = set(range(1, 204)) - ids
    assert not missing, f"Missing IDs: {sorted(missing)}"

def test_no_duplicate_ids(rows):
    ids = [int(r["roadmap_id"]) for r in rows]
    assert len(ids) == len(set(ids)), "Duplicate IDs found"

def test_valid_status_values(rows):
    for r in rows:
        assert r["actual_status"] in VALID_STATUSES, \
            f"Row {r['roadmap_id']}: invalid status '{r['actual_status']}'"

def test_verified_exact_has_theorem_name(rows):
    for r in rows:
        if r["actual_status"] == "VERIFIED_EXACT":
            assert r["coq_theorem_name"] or r["lean_theorem_name"], \
                f"Row {r['roadmap_id']}: VERIFIED_EXACT but no theorem name"

def test_future_obligation_has_next_action(rows):
    for r in rows:
        if r["actual_status"] == "FUTURE_OBLIGATION":
            assert r["next_action"].strip(), \
                f"Row {r['roadmap_id']}: FUTURE_OBLIGATION but no next_action"

def test_engineering_invariant_has_next_action(rows):
    for r in rows:
        if r["actual_status"] == "ENGINEERING_INVARIANT":
            assert r["next_action"].strip(), \
                f"Row {r['roadmap_id']}: ENGINEERING_INVARIANT but no next_action"

def test_empirical_claim_has_next_action(rows):
    for r in rows:
        if r["actual_status"] == "EMPIRICAL_CLAIM":
            assert r["next_action"].strip(), \
                f"Row {r['roadmap_id']}: EMPIRICAL_CLAIM but no measurement strategy"

def test_no_abstract_passable_in_actual_status(rows):
    """No row should carry the generic scaffold status in actual_status."""
    for r in rows:
        assert "abstract_passable" not in r["actual_status"], \
            f"Row {r['roadmap_id']}: still has generic scaffold status"

def test_verified_exact_minimum_count(rows):
    """At minimum, the 13 known VERIFIED_EXACT rows must be present."""
    verified = [r for r in rows if r["actual_status"] == "VERIFIED_EXACT"]
    assert len(verified) >= 13, \
        f"Expected at least 13 VERIFIED_EXACT rows, got {len(verified)}"

def test_known_verified_rows(rows):
    """Spot-check known VERIFIED_EXACT mappings by row_no."""
    by_id = {int(r["roadmap_id"]): r for r in rows}

    # row_no 99 = original_id 57 = Two-corner admission decomposition
    r = by_id[99]
    assert r["actual_status"] == "VERIFIED_EXACT", f"Row 99 should be VERIFIED_EXACT, got {r['actual_status']}"
    assert "CubieBridgeV1_40" in r["coq_theorem_name"], f"Row 99 should map to CubieBridgeV1_40"

    # row_no 100 = original_id 58 = GPU failure implies denial
    r = by_id[100]
    assert r["actual_status"] == "VERIFIED_EXACT"
    assert "gpu_failure_implies_denial" in r["coq_theorem_name"]

    # row_no 52 = original_id 201 = Denial-count zero iff authorized
    r = by_id[52]
    assert r["actual_status"] == "VERIFIED_EXACT"
    assert "RamenCornerConsensusV1192" in r["coq_theorem_name"]

    # row_no 54 = original_id 203 = Predicate non-vacuity
    r = by_id[54]
    assert r["actual_status"] == "VERIFIED_EXACT"
    assert "good_corner_exists" in r["coq_theorem_name"]

def test_out_of_scope_is_cluster_zero(rows):
    """OUT_OF_SCOPE rows should be from cluster 0 (claim discipline)."""
    for r in rows:
        if r["actual_status"] == "OUT_OF_SCOPE":
            assert r["cluster"] == "Claim discipline and terminology guardrails", \
                f"Row {r['roadmap_id']}: OUT_OF_SCOPE but cluster is '{r['cluster']}'"


File created successfully at: C:\Users\NickV\cubie-verification\tools\test_crosswalk.py

"""Tests for crosswalk_203.csv output constraints."""
import csv
from pathlib import Path
import pytest

CROSSWALK_PATH = Path(__file__).parent.parent / "roadmap" / "crosswalk_203.csv"

VALID_STATUSES = {
    "VERIFIED_EXACT", "VERIFIED_EQUIVALENT", "DERIVED_CANDIDATE",
    "FUTURE_OBLIGATION", "REWRITE_RULE", "ENGINEERING_INVARIANT",
    "EMPIRICAL_CLAIM", "OUT_OF_SCOPE",
}

@pytest.fixture
def rows():
    if not CROSSWALK_PATH.exists():
        pytest.skip("crosswalk_203.csv not generated — run: make crosswalk")
    with open(CROSSWALK_PATH, encoding="utf-8") as f:
        return list(csv.DictReader(f))

def test_row_count(rows):
    assert len(rows) == 203, f"Expected 203 rows, got {len(rows)}"

def test_ids_complete(rows):
    ids = {int(r["roadmap_id"]) for r in rows}
    missing = set(range(1, 204)) - ids
    assert not missing, f"Missing IDs: {sorted(missing)}"

def test_no_duplicate_ids(rows):
    ids = [int(r["roadmap_id"]) for r in rows]
    assert len(ids) == len(set(ids)), "Duplicate IDs found"

def test_valid_status_values(rows):
    for r in rows:
        assert r["actual_status"] in VALID_STATUSES, \
            f"Row {r['roadmap_id']}: invalid status '{r['actual_status']}'"

def test_verified_exact_has_theorem_name(rows):
    for r in rows:
        if r["actual_status"] == "VERIFIED_EXACT":
            assert r["coq_theorem_name"] or r["lean_theorem_name"], \
                f"Row {r['roadmap_id']}: VERIFIED_EXACT but no theorem name"

def test_future_obligation_has_next_action(rows):
    for r in rows:
        if r["actual_status"] == "FUTURE_OBLIGATION":
            assert r["next_action"].strip(), \
                f"Row {r['roadmap_id']}: FUTURE_OBLIGATION but no next_action"

def test_engineering_invariant_has_next_action(rows):
    for r in rows:
        if r["actual_status"] == "ENGINEERING_INVARIANT":
            assert r["next_action"].strip(), \
                f"Row {r['roadmap_id']}: ENGINEERING_INVARIANT but no next_action"

def test_empirical_claim_has_next_action(rows):
    for r in rows:
        if r["actual_status"] == "EMPIRICAL_CLAIM":
            assert r["next_action"].strip(), \
                f"Row {r['roadmap_id']}: EMPIRICAL_CLAIM but no measurement strategy"

def test_no_abstract_passable_in_actual_status(rows):
    """No row should carry the generic scaffold status in actual_status."""
    for r in rows:
        assert "abstract_passable" not in r["actual_status"], \
            f"Row {r['roadmap_id']}: still has generic scaffold status"

def test_verified_exact_minimum_count(rows):
    """At minimum, the 13 known VERIFIED_EXACT rows must be present."""
    verified = [r for r in rows if r["actual_status"] == "VERIFIED_EXACT"]
    assert len(verified) >= 13, \
        f"Expected at least 13 VERIFIED_EXACT rows, got {len(verified)}"

def test_known_verified_rows(rows):
    """Spot-check known VERIFIED_EXACT mappings by row_no."""
    by_id = {int(r["roadmap_id"]): r for r in rows}

    # row_no 99 = original_id 57 = Two-corner admission decomposition
    r = by_id[99]
    assert r["actual_status"] == "VERIFIED_EXACT", f"Row 99 should be VERIFIED_EXACT, got {r['actual_status']}"
    assert "CubieBridgeV1_40" in r["coq_theorem_name"], f"Row 99 should map to CubieBridgeV1_40"

    # row_no 100 = original_id 58 = GPU failure implies denial
    r = by_id[100]
    assert r["actual_status"] == "VERIFIED_EXACT"
    assert "gpu_failure_implies_denial" in r["coq_theorem_name"]

    # row_no 52 = original_id 201 = Denial-count zero iff authorized
    r = by_id[52]
    assert r["actual_status"] == "VERIFIED_EXACT"
    assert "RamenCornerConsensusV1192" in r["coq_theorem_name"]

    # row_no 54 = original_id 203 = Predicate non-vacuity
    r = by_id[54]
    assert r["actual_status"] == "VERIFIED_EXACT"
    assert "good_corner_exists" in r["coq_theorem_name"]

def test_out_of_scope_is_cluster_zero(rows):
    """OUT_OF_SCOPE rows should be from cluster 0 (claim discipline)."""
    for r in rows:
        if r["actual_status"] == "OUT_OF_SCOPE":
            assert r["cluster"] == "Claim discipline and terminology guardrails", \
                f"Row {r['roadmap_id']}: OUT_OF_SCOPE but cluster is '{r['cluster']}'"


__pycache__/
*.pyc
*.pyo
*.vo
*.vos
*.vok
*.glob
.lake/
.olean
reports/*.tmp
tools/_pdf_text_dump.txt
*.egg-info/
.pytest_cache/


File created successfully at: C:\Users\NickV\cubie-verification\.gitignore

__pycache__/
*.pyc
*.pyo
*.vo
*.vos
*.vok
*.glob
.lake/
.olean
reports/*.tmp
tools/_pdf_text_dump.txt
*.egg-info/
.pytest_cache/


# cubie-verification v3

Verification-grade work package for the Cubie Trust Compiler theorem stack.

Converts the 203-row abstract scaffold roadmap into honest proof-status
classifications backed by the real Coq/Lean source stack.

## Quick start

```bash
# Classify all 203 roadmap rows
make crosswalk

# Scan sources for Admitted/sorry/unexpected axioms
make scan

# Generate verification + gap reports
make report

# Extract Coq/Lean sources from the CubieMasterStack PDF (requires pdfplumber)
make extract

# Compile Coq files (requires coq 8.18.0)
make verify-coq

# Check Lean files (requires lean 4)
make verify-lean

# Verify Verus specs (requires verus binary)
make verify-verus

# Run test suite
make test

# Full pipeline (default)
make all
```

## Source inputs

| Source | Location | Theorems |
|--------|----------|----------|
| CubieMasterStack PDF | `v1_0 CubieMasterStack 0430.pdf` | 163 (7 deliverables) |
| v1.10 Non-Quantum submission | `v1.10_CubieFinalSubmission_COMPLETE_0427` | 30 |
| Theorem Omega 4.0 | `tf-OMEGA/` on Desktop | 1 |
| **Total real verified** | | **194** |

## Crosswalk status values

| Status | Meaning |
|--------|---------|
| VERIFIED_EXACT | Exact theorem exists in Coq/Lean source stack |
| VERIFIED_EQUIVALENT | Semantically equivalent theorem exists |
| DERIVED_CANDIDATE | Provable from verified stack — needs formalization |
| FUTURE_OBLIGATION | Needs new definitions + formalization |
| REWRITE_RULE | Type R doc/spec guardrail — no proof required |
| ENGINEERING_INVARIANT | Runtime invariant (Verus/integration test target) |
| EMPIRICAL_CLAIM | Measurement-based — cannot be formally proved |
| OUT_OF_SCOPE | Outside current formal proof stack |

## Crosswalk results (v3)

| Status | Count |
|--------|-------|
| VERIFIED_EXACT | 15 |
| DERIVED_CANDIDATE | 130 |
| FUTURE_OBLIGATION | 15 |
| OUT_OF_SCOPE | 21 |
| REWRITE_RULE | 10 |
| ENGINEERING_INVARIANT | 10 |
| EMPIRICAL_CLAIM | 2 |

## Verus specs

Four runtime specification modules in `verus/`:

| File | Corresponds to | Key theorems bridged |
|------|---------------|---------------------|
| `cubie_runtime_spec.rs` | CubieBridgeV1_40 | gpu/deployment_failure_implies_denial, admit_decomposition |
| `cubie_lease_spec.rs` | CubieTrustCompilerV2_0 | lease_integrity, bypass_no_lease, epoch_advance_no_rollback |
| `cubie_capacity_spec.rs` | CubieTrustCompilerV2_0 | capacity_non_negative, deny_on_decrement_failure |
| `cubie_delegation_spec.rs` | CubieTrustCompilerV1_50 | depth bound, HMAC gate, parent hash continuity |

`capability_hmac_valid` is an **uninterpreted predicate** — cryptographic
correctness is a FUTURE_OBLIGATION pending Verus crypto library maturation.

## What this repo does NOT claim

- Coq/Lean compilation pending `coqc`/`lean` execution.
- SHA-256 hashes pending population from PDF manifest (`make hashes` after populating `manifest.json`).
- Zero production-correctness claims from formal proofs alone.
  Rust conformance requires Verus or integration tests (ENGINEERING_INVARIANT rows).

## Non-overclaiming policy

Do NOT mark any theorem as VERIFIED unless:
1. An exact or clearly equivalent theorem exists in the extracted source files, AND
2. The theorem name is recorded in `roadmap/crosswalk_203.csv` `coq_theorem_name` or `lean_theorem_name`.

The `desired_status` column (`abstract_passable_proof_obligation`) in the crosswalk
records the original scaffold claim but is never used as the authoritative status.


File created successfully at: C:\Users\NickV\cubie-verification\README.md

# cubie-verification v3

Verification-grade work package for the Cubie Trust Compiler theorem stack.

Converts the 203-row abstract scaffold roadmap into honest proof-status
classifications backed by the real Coq/Lean source stack.

## Quick start

```bash
# Classify all 203 roadmap rows
make crosswalk

# Scan sources for Admitted/sorry/unexpected axioms
make scan

# Generate verification + gap reports
make report

# Extract Coq/Lean sources from the CubieMasterStack PDF (requires pdfplumber)
make extract

# Compile Coq files (requires coq 8.18.0)
make verify-coq

# Check Lean files (requires lean 4)
make verify-lean

# Verify Verus specs (requires verus binary)
make verify-verus

# Run test suite
make test

# Full pipeline (default)
make all
```

## Source inputs

| Source | Location | Theorems |
|--------|----------|----------|
| CubieMasterStack PDF | `v1_0 CubieMasterStack 0430.pdf` | 163 (7 deliverables) |
| v1.10 Non-Quantum submission | `v1.10_CubieFinalSubmission_COMPLETE_0427` | 30 |
| Theorem Omega 4.0 | `tf-OMEGA/` on Desktop | 1 |
| **Total real verified** | | **194** |

## Crosswalk status values

| Status | Meaning |
|--------|---------|
| VERIFIED_EXACT | Exact theorem exists in Coq/Lean source stack |
| VERIFIED_EQUIVALENT | Semantically equivalent theorem exists |
| DERIVED_CANDIDATE | Provable from verified stack — needs formalization |
| FUTURE_OBLIGATION | Needs new definitions + formalization |
| REWRITE_RULE | Type R doc/spec guardrail — no proof required |
| ENGINEERING_INVARIANT | Runtime invariant (Verus/integration test target) |
| EMPIRICAL_CLAIM | Measurement-based — cannot be formally proved |
| OUT_OF_SCOPE | Outside current formal proof stack |

## Crosswalk results (v3)

| Status | Count |
|--------|-------|
| VERIFIED_EXACT | 15 |
| DERIVED_CANDIDATE | 130 |
| FUTURE_OBLIGATION | 15 |
| OUT_OF_SCOPE | 21 |
| REWRITE_RULE | 10 |
| ENGINEERING_INVARIANT | 10 |
| EMPIRICAL_CLAIM | 2 |

## Verus specs

Four runtime specification modules in `verus/`:

| File | Corresponds to | Key theorems bridged |
|------|---------------|---------------------|
| `cubie_runtime_spec.rs` | CubieBridgeV1_40 | gpu/deployment_failure_implies_denial, admit_decomposition |
| `cubie_lease_spec.rs` | CubieTrustCompilerV2_0 | lease_integrity, bypass_no_lease, epoch_advance_no_rollback |
| `cubie_capacity_spec.rs` | CubieTrustCompilerV2_0 | capacity_non_negative, deny_on_decrement_failure |
| `cubie_delegation_spec.rs` | CubieTrustCompilerV1_50 | depth bound, HMAC gate, parent hash continuity |

`capability_hmac_valid` is an **uninterpreted predicate** — cryptographic
correctness is a FUTURE_OBLIGATION pending Verus crypto library maturation.

## What this repo does NOT claim

- Coq/Lean compilation pending `coqc`/`lean` execution.
- SHA-256 hashes pending population from PDF manifest (`make hashes` after populating `manifest.json`).
- Zero production-correctness claims from formal proofs alone.
  Rust conformance requires Verus or integration tests (ENGINEERING_INVARIANT rows).

## Non-overclaiming policy

Do NOT mark any theorem as VERIFIED unless:
1. An exact or clearly equivalent theorem exists in the extracted source files, AND
2. The theorem name is recorded in `roadmap/crosswalk_203.csv` `coq_theorem_name` or `lean_theorem_name`.

The `desired_status` column (`abstract_passable_proof_obligation`) in the crosswalk
records the original scaffold claim but is never used as the authoritative status.


Bash

python -m pytest tools/test_crosswalk.py -v 2>&1

Run crosswalk tests


============================= test session starts =============================
platform win32 -- Python 3.14.2, pytest-9.0.2, pluggy-1.6.0 -- C:\Python314\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\NickV\cubie-verification
plugins: anyio-4.12.1, Faker-37.12.0, asyncio-1.3.0, cov-7.0.0, respx-0.22.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 12 items

tools/test_crosswalk.py::test_row_count PASSED                           [  8%]
tools/test_crosswalk.py::test_ids_complete PASSED                        [ 16%]
tools/test_crosswalk.py::test_no_duplicate_ids PASSED                    [ 25%]
tools/test_crosswalk.py::test_valid_status_values PASSED                 [ 33%]
tools/test_crosswalk.py::test_verified_exact_has_theorem_name PASSED     [ 41%]
tools/test_crosswalk.py::test_future_obligation_has_next_action PASSED   [ 50%]
tools/test_crosswalk.py::test_engineering_invariant_has_next_action PASSED [ 58%]
tools/test_crosswalk.py::test_empirical_claim_has_next_action PASSED     [ 66%]
tools/test_crosswalk.py::test_no_abstract_passable_in_actual_status PASSED [ 75%]
tools/test_crosswalk.py::test_verified_exact_minimum_count PASSED        [ 83%]
tools/test_crosswalk.py::test_known_verified_rows PASSED                 [ 91%]
tools/test_crosswalk.py::test_out_of_scope_is_cluster_zero PASSED        [100%]

============================= 12 passed in 0.08s ==============================


12/12 tests passing. Now commit everything:


cd /c/Users/NickV/cubie-verification
git config user.email "nick@centillion.ai"
git config user.name "Nick Venezia"
git add -A
git status --short 2>&1

Stage all files


warning: in the working copy of '.gitignore', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'Makefile', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'README.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'docs/superpowers/plans/2026-05-06-cubie-verification-v3.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'docs/superpowers/specs/2026-05-06-cubie-verification-v3-design.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'manifest.json', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'roadmap/cubie_theorem_roadmap_203.jsonl', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'tools/build_crosswalk.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'tools/extract_sources_from_master.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'tools/scan_for_unsound_tokens.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'tools/summarize_verification.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'tools/test_crosswalk.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'tools/verify_hashes.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'verus/cubie_capacity_spec.rs', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'verus/cubie_delegation_spec.rs', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'verus/cubie_lease_spec.rs', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'verus/cubie_runtime_spec.rs', LF will be replaced by CRLF the next time Git touches it
A  .gitignore
A  Makefile
A  README.md
A  docs/superpowers/plans/2026-05-06-cubie-verification-v3.md
A  docs/superpowers/specs/2026-05-06-cubie-verification-v3-design.md
A  manifest.json
A  reports/gap_report.md
A  reports/verification_report.json
A  reports/verification_report.md
A  roadmap/crosswalk_203.csv
A  roadmap/cubie_theorem_roadmap_203.jsonl
A  tools/build_crosswalk.py
A  tools/extract_sources_from_master.py
A  tools/scan_for_unsound_tokens.py
A  tools/summarize_verification.py
A  tools/test_crosswalk.py
A  tools/verify_hashes.py
A  verus/cubie_capacity_spec.rs
A  verus/cubie_delegation_spec.rs
A  verus/cubie_lease_spec.rs
A  verus/cubie_runtime_spec.rs


git commit -m "$(cat <<'EOF'
feat: cubie-verification v3 — crosswalk, Verus specs, reports

- crosswalk_203.csv: all 203 roadmap rows reclassified from generic
  scaffold into honest proof-status categories (15 VERIFIED_EXACT,
  130 DERIVED_CANDIDATE, 21 OUT_OF_SCOPE, 15 FUTURE_OBLIGATION, etc.)
- 4 Verus runtime spec modules (runtime, lease, capacity, delegation)
  bridging CubieBridgeV1_40 + CubieTrustCompilerV2_0 verified theorems
- tools: build_crosswalk, scan_for_unsound_tokens, verify_hashes,
  summarize_verification, extract_sources_from_master
- reports: verification_report.md/.json + gap_report.md
- 12/12 pytest tests passing
- manifest.json: SHA-256 slots for all 13 Coq + 8 Lean files
- Makefile: verify-coq/lean/verus/crosswalk/report/test targets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EOF
)" 2>&1

Initial commit of cubie-verification v3


[master (root-commit) 9b10bef] feat: cubie-verification v3 — crosswalk, Verus specs, reports
 21 files changed, 4977 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Makefile
 create mode 100644 README.md
 create mode 100644 docs/superpowers/plans/2026-05-06-cubie-verification-v3.md
 create mode 100644 docs/superpowers/specs/2026-05-06-cubie-verification-v3-design.md
 create mode 100644 manifest.json
 create mode 100644 reports/gap_report.md
 create mode 100644 reports/verification_report.json
 create mode 100644 reports/verification_report.md
 create mode 100644 roadmap/crosswalk_203.csv
 create mode 100644 roadmap/cubie_theorem_roadmap_203.jsonl
 create mode 100644 tools/build_crosswalk.py
 create mode 100644 tools/extract_sources_from_master.py
 create mode 100644 tools/scan_for_unsound_tokens.py
 create mode 100644 tools/summarize_verification.py
 create mode 100644 tools/test_crosswalk.py
 create mode 100644 tools/verify_hashes.py
 create mode 100644 verus/cubie_capacity_spec.rs
 create mode 100644 verus/cubie_delegation_spec.rs
 create mode 100644 verus/cubie_lease_spec.rs
 create mode 100644 verus/cubie_runtime_spec.rs


Updated task #1 status


Everything is built and committed at `C:\Users\NickV\cubie-verification\` (commit `9b10bef`). Here's what was delivered:

---

**Verus files** (all 4, at `cubie-verification/verus/`):

| File | What it proves |
|------|---------------|
| `cubie_runtime_spec.rs` | `gpu_failure_implies_denial`, `deployment_failure_implies_denial`, `gpu_only_pass_witness`, `deployment_only_pass_witness`, `admit_decomposition`, `denial_count_bounded` — all VERIFIED_EXACT bridges |
| `cubie_lease_spec.rs` | `lease_integrity`, `bypass_no_lease`, `epoch_advance_no_rollback`, stale-epoch deny, replay deny, hash-mismatch deny |
| `cubie_capacity_spec.rs` | `capacity_non_negative`, `deny_on_decrement_failure`, monotone deny, zero-cost always succeeds |
| `cubie_delegation_spec.rs` | Bounded depth, HMAC gate (`capability_hmac_valid` uninterpreted), parent hash continuity, split-brain determinism |

**Crosswalk result** (203 rows, all constraints passing):
```
VERIFIED_EXACT:        15
DERIVED_CANDIDATE:    130
OUT_OF_SCOPE:          21  (cluster 0 — claim discipline rows)
FUTURE_OBLIGATION:     15
REWRITE_RULE:          10
ENGINEERING_INVARIANT: 10
EMPIRICAL_CLAIM:        2
```

**Next step**: Copy the 7 Coq + 7 Lean source files from the CubieMasterStack PDF into `coq/` and `lean/` (run `make extract` — it will dump the full PDF text for manual extraction if automated regex fails), then populate the SHA-256 hashes in `manifest.json` and run `make verify-coq verify-lean`.


CONTINUE


Continuing with Task 3: extracting the real Coq/Lean source files. Let me first dump the PDF text to understand the structure, then extract all 7×2 deliverable files.


TaskCreate

Extract Coq/Lean sources from PDF and copy v1.10 + tf-OMEGA files

Run PDF extraction, copy v1.10 submission Coq files and tf-OMEGA, populate SHA-256 in manifest.json


Task #2 created successfully: Extract Coq/Lean sources from PDF and copy v1.10 + tf-OMEGA files


Updated task #2 status


Bash

cd /c/Users/NickV/cubie-verification
python -c "
import sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import pdfplumber
pdf = pdfplumber.open('C:/Users/NickV/Downloads/v1_0 CubieMasterStack 0430.pdf')
print(f'Total pages: {len(pdf.pages)}')
# Scan page by page looking for deliverable section headers and SHA lines
for i in range(len(pdf.pages)):
    text = pdf.pages[i].extract_text(x_tolerance=2, y_tolerance=3) or ''
    first_lines = text[:300].replace('\n',' | ')
    if any(kw in text for kw in ['SHA-256','Require Import','theorem ','namespace ','Ramen','Bridge','V1.19','V1.30','V1.40','V1.50','V2.0']):
        print(f'  p{i+1}: {first_lines[:120]}')
" 2>&1 | head -60

Scan PDF pages for deliverable markers and SHA lines


Total pages: 77
  p1: Cubie Trust Compiler – Master Theorem Stack | v1.0_CubieMasterStack_0430.md | Field Value | Author Nicholas M Venezia |
  p2: Predicate | Addendum | Section B: Deliverable Summaries | V1.19.2 – Ramen Corner Consensus | Track: Tier Two | Theorem c
  p3: Status: DELIVERED | Axiom profile: Coq: 26/26 closed. Lean: 18 axiom-free, 5 [propext], 3 [propext, Quot.sound]. | Full
  p14: Print Assumptions explainable_denial_scope_seam1. | Print Assumptions explainable_denial_attest_seam1. | Print Assumptio
  p15: expiry : Nat | id_ok : Bool | purpose_ok : Bool | lineage_ok : Bool | version_ok : Bool | scope_ok : Bool | attest_ok :
  p16: -- ============================================================================== | theorem corner_authorization_iff_dia
  p17: (evaluate_seam c.e2).time_passed = false → WriteOK c policyOK = false := by | intro h | have hb : decide (c.e2.timestamp
  p18: -- ============================================================================== | -- SECTION E. STRUCTURAL DENIAL THEO
  p19: theorem authorization_implies_version_seam1 (c : Corner) (policyOK : Bool) : | WriteOK c policyOK = true → (evaluate_sea
  p20: theorem authorization_implies_purpose_seam3 (c : Corner) (policyOK : Bool) : | WriteOK c policyOK = true → (evaluate_sea
  p21: private theorem boolToFailure_eq_zero (b : Bool) : boolToFailure b = 0 ↔ b = true := by | cases b <;> simp [boolToFailur
  p22: have h5 := boolToFailure_le_one (evaluate_corner c policyOK).policy_passed | omega | -- ================================
  p23: (* 3. In-Rack Bypass Rejection (Host-Side Verifier) *) | (* 4. Epoch Staleness Rejection (No Remote Synchronous Fetches)
  p25: End ToRAdmissionCompiler. | Lean 4 source. File: ToRAdmissionCompilerV1_30.lean . SHA-256: 34fa586a7c161f330ea3b5d1ed6c5
  p26: c.K = false ↔ corner_denials c > 0 := by | unfold RackCorner.K corner_denials | cases c.s1.J <;> cases c.s2.J <;> cases
  p27: Coq source. File: ToRCornerSpoofingV1_31.v . SHA-256: 2d306870d199b2aa402b9bf521776517bc80ff8cf251d4252864b2bb09b0529d.
  p28: Definition project_seam_surface (s : ToRSeam) : SeamSurface := | {| ss_nonce := nonce s; | ss_origin_id := origin_id s;
  p29: -- standard flow telemetry mathematically blind. | -- | -- Status: SPEC_LOCKED. Fully Constructive. Zero Axioms. | -- Va
  p30: -- ============================================================================== | -- 3. THEOREM: CORNER SURFACE SPOOFI
  p31: (* 1. V1.30 SUBSTRATE (preserved verbatim from ToRAdmissionCompilerV1_30) *) | (* ======================================
  p33: {| nonce := 2; origin_id := 20; target_id := 42; | id_ok := true; attest_ok := true; prov_ok := true; lin_ok := true; |
  p34: structure ToRSeam where | nonce : Nat | origin_id : Nat | target_id : Nat | id_ok : Bool | attest_ok : Bool | prov_ok :
  p35: cases (c.s2.target_id == c.target_node) <;> | cases (c.s3.target_id == c.target_node) <;> | cases policyOK <;> rfl | --
  p36: (* *) | (* Theorems (17 total): *) | (* T2 face_localized_denial (6 theorems, one per face) *) | (* T4 admit_implies_fac
  p41: End CubieTrustCompilerV1_50. | Lean 4 source. File: CubieTrustCompilerV1_50.lean . SHA-256: fcf1132144f46f104a1a41699297
  p42: def Admit (r : CubieRequest) (e : EpochCache) : Bool := | GpuCornerPass r && DeploymentCornerPass r && policy_fresh e &&
  p43: theorem admit_implies_runtime_pass (r : CubieRequest) (e : EpochCache) : | Admit r e = true → face_pass r.runtime = true
  p44: have h5' := (face_denial_count_zero_iff _).mpr h5 | have h6' := (face_denial_count_zero_iff _).mpr h6 | omega | theorem
  p45: intro H | obtain ⟨r_g, r_s, hsurf, hg, hs⟩ := surface_spoofing_separation | have h := H r_g r_s hsurf | rw [hg, hs] at h
  p50: Definition wepoch : EpochCache := | {| policy_age := 0; policy_max_age := 100; | telemetry_age := 0; telemetry_max := 10
  p51: v2_policy_age e <=? v2_policy_max_age e. | Definition telemetry_fresh_v2 (e : EpochCacheV2) : bool := | v2_telemetry_age
  p52: Proof. reflexivity. Qed. | (* ============================================================================== *) | (* 9.
  p53: (* AXIOM AUDIT (26 THEOREMS) *) | (* ============================================================================== *) |
  p54: c5 : Bool | c6 : Bool | c7 : Bool | c8 : Bool | c9 : Bool | def face_pass (f : CubieFace) : Bool := | f.c1 && f.c2 && f.
  p55: face_pass r.policy = false → Admit r e = false := by | intro h | unfold Admit DeploymentCornerPass | rw [h] | cases GpuC
  p56: bool_to_failure f.c4 + bool_to_failure f.c5 + bool_to_failure f.c6 + | bool_to_failure f.c7 + bool_to_failure f.c8 + boo
  p57: def wsurf_id : CubieFaceSurface := ⟨1, 11, 21, 31, 41⟩ | def wsurf_li : CubieFaceSurface := ⟨2, 12, 22, 32, 42⟩ | def ws
  p58: if Admit r e then | some ⟨es.policy_epoch_now, es.telemetry_epoch_now, true⟩ | else | none | def host_verify_lease (l :
  p59: unfold epoch_advance at h | cases hp : decide (es.policy_epoch_now < np) | case false => | cases ht : decide (es.telemet
  p60: #print axioms epoch_advance_strictly_increases | #print axioms epoch_advance_no_rollback | #print axioms ha_split_brain_
  p68: End CubieTrustCompilerV2_0_PerPredicate. | Lean 4 source. File: CubieTrustCompilerV2_0_PerPredicate.lean. SHA-256: 98a99
  p69: def policy_fresh (e : EpochCache) : Bool := | decide (e.policy_age ≤ e.policy_max_age) | def telemetry_fresh (e : EpochC
  p70: cases policy_fresh e <;> | cases telemetry_fresh e <;> rfl | -- ========================================================
  p71: r.identity.c9 = false → Admit r e = false := by | intro h | apply face_localized_denial_identity | unfold face_pass | rw
  p72: intro h | apply face_localized_denial_lineage | unfold face_pass | rw [h] | cases r.lineage.c1 <;> cases r.lineage.c2 <;
  p73: apply face_localized_denial_runtime | unfold face_pass | rw [h] | cases r.runtime.c1 <;> cases r.runtime.c2 <;> cases r.
  p74: unfold face_pass | rw [h] | cases r.context.c1 <;> cases r.context.c2 <;> cases r.context.c3 <;> cases r.context.c4 <;>
  p75: rw [h] | cases r.policy.c1 <;> cases r.policy.c2 <;> cases r.policy.c3 <;> cases r.policy.c4 <;> cases r.policy.c5 <;> c
  p76: cases r.outcome.c1 <;> cases r.outcome.c2 <;> cases r.outcome.c3 <;> cases r.outcome.c4 <;> cases r.outcome.c5 <;> cases
  p77: foundational axiom), or depends on axioms: [propext, Quot.sound] (additionally uses quotient soundness, typically throug


I can see the PDF structure clearly. The source code spans pages 15–76. Let me do a targeted extraction using page boundaries identified from the PDF scan.


cd /c/Users/NickV/cubie-verification
python -c "
import sys, io, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import pdfplumber

pdf = pdfplumber.open('C:/Users/NickV/Downloads/v1_0 CubieMasterStack 0430.pdf')
pages = []
for i, page in enumerate(pdf.pages):
    text = page.extract_text(x_tolerance=2, y_tolerance=3) or ''
    pages.append(text)

# Look for SHA-256 lines to find file boundaries
sha_re = re.compile(r'SHA-256:\s*([0-9a-f]{64})', re.IGNORECASE)
for i, text in enumerate(pages):
    for m in sha_re.finditer(text):
        # get surrounding context
        start = max(0, m.start()-120)
        ctx = text[start:m.start()+80].replace('\n',' ')
        print(f'p{i+1}: {ctx}')
        print(f'      SHA={m.group(1)}')
" 2>&1

Extract all SHA-256 hashes and file markers from PDF


p3: s shown immediately above the listing. V1.19.2 – Ramen Corner Consensus Coq source. File: RamenCornerConsensusV1192.v . SHA-256: d564c4830fc9030bff0f9c6ed14dbde1c382a3bf04ad601d7e953548d206206b. (* ==
      SHA=d564c4830fc9030bff0f9c6ed14dbde1c382a3bf04ad601d7e953548d206206b
p14: Print Assumptions denial_count_bounded. End RamenCornerConsensus. Lean 4 source. File: RamenCornerConsensusV1192.lean . SHA-256: 0f269cb03e2b30069cfb4a7b757c4c34dd15dc56ce204071061dd8f3bc7787b5. -- ==
      SHA=0f269cb03e2b30069cfb4a7b757c4c34dd15dc56ce204071061dd8f3bc7787b5
p22: l_count_bounded end RamenCornerConsensus V1.30 – ToR Admission Compiler Coq source. File: ToRAdmissionCompilerV1_30.v . SHA-256: a73a6b7586a865057d587b02f2fe06dd1d5d53b002ebc070ce3d55efbba3ba8c. (* ==
      SHA=a73a6b7586a865057d587b02f2fe06dd1d5d53b002ebc070ce3d55efbba3ba8c
p25: End ToRAdmissionCompiler. Lean 4 source. File: ToRAdmissionCompilerV1_30.lean . SHA-256: 34fa586a7c161f330ea3b5d1ed6c550c39986803ec99bdaa8b5141944280cd2a. -- ==
      SHA=34fa586a7c161f330ea3b5d1ed6c550c39986803ec99bdaa8b5141944280cd2a
p27: Coq source. File: ToRCornerSpoofingV1_31.v . SHA-256: 2d306870d199b2aa402b9bf521776517bc80ff8cf251d4252864b2bb09b0529d. (* ==
      SHA=2d306870d199b2aa402b9bf521776517bc80ff8cf251d4252864b2bb09b0529d
p28: ptions writeok_not_corner_surface_determined. End ToRCornerSpoofing. Lean 4 source. File: ToRCornerSpoofingV1_31.lean . SHA-256: 6c3b1772caa9de2986bd0e715eddef5622ef41f91b83b6cafb7492e8b36f38df. -- ==
      SHA=6c3b1772caa9de2986bd0e715eddef5622ef41f91b83b6cafb7492e8b36f38df
p30: writeok_not_corner_surface_determined end ToRCornerSpoofing V1.40 – Cubie Bridge Coq source. File: CubieBridgeV1_40.v . SHA-256: 815bfcf12627f5c1bc2bef702092cf6dda85a5ab69e0fe29e9d0c18ea4ca5340. (* ==
      SHA=815bfcf12627f5c1bc2bef702092cf6dda85a5ab69e0fe29e9d0c18ea4ca5340
p33: _witness. Print Assumptions deployment_only_pass_witness. End CubieBridge. Lean 4 source. File: CubieBridgeV1_40.lean . SHA-256: f14cd1ae1e8eb6a2dc0df9175246ce64f5994c9bf03a4cd9b74e632945338d6b. -- ==
      SHA=f14cd1ae1e8eb6a2dc0df9175246ce64f5994c9bf03a4cd9b74e632945338d6b
p35: _only_pass_witness end CubieBridge V1.50 – Cubie Trust Compiler (Track B) Coq source. File: CubieTrustCompilerV1_50.v . SHA-256: 5dd9197339549a0b289bad6c4532a422387b2b385f8d2acfb67a654832f4117b. (* ==
      SHA=5dd9197339549a0b289bad6c4532a422387b2b385f8d2acfb67a654832f4117b
p41: End CubieTrustCompilerV1_50. Lean 4 source. File: CubieTrustCompilerV1_50.lean . SHA-256: fcf1132144f46f104a1a41699297c99a35d07b9d345b75f4d329d5b7d553cc50. -- ==
      SHA=fcf1132144f46f104a1a41699297c99a35d07b9d345b75f4d329d5b7d553cc50
p45: d CubieTrustCompilerV1_50 V2.0 – Cubie Trust Compiler (Track C, canonical) Coq source. File: CubieTrustCompilerV2_0.v . SHA-256: 17af5b3f2cc3d6648eba08d8e0aa94557a250430f454a53454396439ed02c31e. (* ==
      SHA=17af5b3f2cc3d6648eba08d8e0aa94557a250430f454a53454396439ed02c31e
p53:  Assumptions ha_split_brain_fail_closed. End CubieTrustCompilerV2_0. Lean 4 source. File: CubieTrustCompilerV2_0.lean . SHA-256: c9d1d80c75e93df6af0c868fce1936a393b4e6af40afd0ce1de8ddceefedd436. -- ==
      SHA=c9d1d80c75e93df6af0c868fce1936a393b4e6af40afd0ce1de8ddceefedd436
p60: rPredicate – Cubie Trust Compiler V2.0 Per-Predicate Addendum Coq source. File: CubieTrustCompilerV2_0_PerPredicate.v . SHA-256: 91f31a74c1675dde7b6857050f68f5c8049afab7115f5ae5cdc17e605ecb4a36. (* ==
      SHA=91f31a74c1675dde7b6857050f68f5c8049afab7115f5ae5cdc17e605ecb4a36
p68: End CubieTrustCompilerV2_0_PerPredicate. Lean 4 source. File: CubieTrustCompilerV2_0_PerPredicate.lean. SHA-256: 98a99b8e9438277c85d20675b6f18c3bf47b76ad681a260c0bde8c9a80a93d36. -- ==
      SHA=98a99b8e9438277c85d20675b6f18c3bf47b76ad681a260c0bde8c9a80a93d36


Conversation compacted