#!/usr/bin/env python3
"""LUMEN Second Edition -- Falsification chapter verifier.

The dated scorecard: each forward prediction with its measured value (or 'unmeasured') and the
pre-committed kill-window that would refute it. Cosmological rows in sigma; the seed identity in
ppb; the open neutrino/CP rows show their survival windows. Also records the retractions.

Independently pinned by verify_P040.py (refutation ledger), verify_P388.py (scorecard),
verify_P400.py (register). Measured values as of 2026-06."""
import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from numpy import pi, sqrt
from se_verify_common import Report

R = Report("Discipline & the Repair Ledger",
    "the dated scorecard, each row with the measurement that would kill it",
    "each prediction vs current data, with its pre-committed kill-window",
    sources=["Planck 2018", "CODATA-2022", "NuFIT 6.0 (delta_CP)", "DESI DR2", "JUNO/Hyper-K (pending)"],
    pins=["verify_P040.py", "verify_P388.py", "verify_P400.py"])

Lam0 = 1 - pi**2/32
R.check("Omega_Lambda", Lam0, 0.6847, source="Planck 2018", sigma=(Lam0-0.6847)/0.0073,
        note="PASS; kill-window outside [0.685, 0.695]")
ai = 4*pi**3 + pi**2 + pi
kappa = (1/ai)**1.25
a_corr = ai*sqrt(1 - kappa**2*(1 - pi/ai))
R.check("alpha^-1 (corrected)", a_corr, 137.035999177, source="CODATA-2022",
        sigma=(a_corr-137.035999177)/0.000000021, note="0.43 ppb; seed-gap debt at 2.2 ppm flagged")
R.check("leptonic delta_CP", 180.0, 212.0, unit="deg", source="NuFIT 6.0 (NO, IC24+SK)", sigma=(212-180)/41.0,
        note="predict pi (CP-conserving); ~270 deg refutes [DUNE/Hyper-K]")
R.check("m_nu3 (heaviest neutrino)", 48.7, kind="note", note="48.7 meV, no direct measurement; NuFIT 6.0 global fit in standing tension (see Falsifiability); kill-window ~[45,52] [JUNO]")
H0 = 75.8; eH0 = H0*(0.26/1.20)/2
R.check("H0 vs SH0ES", H0, 73.04, unit="km/s/Mpc", source="SH0ES 2022",
        sigma=(H0-73.04)/sqrt(eH0**2+1.04**2), note="anchor-limited, consistent")
R.check("DE evolution (constant Lambda_0)", "constant", kind="note",
        note="DESI DR2 prefers evolving DE at 2.8-4.2 sigma -> live TENSION")
R.check("retracted on the record", 3, kind="note",
        note="delta_CP=240 deg, tri-bimaximal theta13=0, strong-CP -- refuted and withdrawn")
R.emit()
