OpenIslet

scripts/verify_cellgemma_islet_v0_1.py

Standalone Zero-GPU / Pure-CPU Fail-Closed Verifier for OpenIslet CellGemma-Islet v0.9.0.

script Release v0.8.0 gen-eb955f8266035aba 77 KB · 6 sections

Use this file in any AI chat (paste-only or attachment-capable):

Download as text (.txt) Download section (.txt)

Pinned raw file: https://openislet.org/files/gen-eb955f8266035aba/scripts/verify_cellgemma_islet_v0_1.py · SHA-256: 31b99284adcaabe1…

            ("IIP A Fixed-Ceiling High", "IIP_A_NON_A_FIXED_CEIL_HIGH", "**None (ALL systemic ceilings fixed)**"),
            ("IIP A Firewalled Ceiling-Lift Low", "IIP_A_NON_A_CEIL_LIFT_LOW", "`c4_pouch_a=0.85` fixed; `c4_pouch_bx=c4_r3p=0.870`, `c4_univ=0.935`"),
            ("IIP A Firewalled Ceiling-Lift High", "IIP_A_NON_A_CEIL_LIFT_HIGH", "`c4_pouch_a=0.85` fixed; `c4_pouch_bx=c4_r3p=0.885`, `c4_univ=0.945`"),
        ],
        p25,
        p50,
    )
    verify_sec6_table_binding(
        IIP_DRAFT_FILES["B"],
        draft_texts["B"],
        [
            ("Wave-5 `L3B` Baseline", "L3B_WAVE5_STRICT_ZERO_DRUG_BASELINE", "None (`c2=0.87/0.95`, `c3=0.925`, `c4=0.85/0.92`)"),
            ("IIP B Fixed-Ceiling Low", "IIP_B_NON_A_FIXED_CEIL_LOW", "**None (ALL systemic ceilings fixed)**"),
            ("IIP B Fixed-Ceiling High", "IIP_B_NON_A_FIXED_CEIL_HIGH", "**None (ALL systemic ceilings fixed)**"),
            ("IIP B Firewalled Ceiling-Lift Low", "IIP_B_NON_A_CEIL_LIFT_LOW", "`c2_a=0.87` fixed, `c2_bx/y=0.88`, `c2_univ=0.953`; `c4_pouch_a=0.85` fixed, `c4_bx/r3p=0.86`, `c4_univ=0.928`"),
            ("IIP B Firewalled Ceiling-Lift High", "IIP_B_NON_A_CEIL_LIFT_HIGH", "`c2_a=0.87` fixed, `c2_bx/y=0.89`, `c2_univ=0.956`; `c4_pouch_a=0.85` fixed, `c4_bx/r3p=0.87`, `c4_univ=0.935`"),
            ("Combined A+B+C Fixed-Ceiling Low", "COMBINED_ABC_FIXED_CEIL_LOW", "**None (ALL systemic ceilings fixed)**"),
            ("Combined A+B+C Fixed-Ceiling High", "COMBINED_ABC_FIXED_CEIL_HIGH", "**None (ALL systemic ceilings fixed)**"),
            ("Combined A+B+C Ceiling-Lift Low", "COMBINED_ABC_CEIL_LIFT_LOW", "`c2` from B-Low, `c3=0.930` from C-Low, `c4` `subadditive_overlap(0.50)` (`c4_pouch_a=0.85` fixed)"),
            ("Combined A+B+C Ceiling-Lift High", "COMBINED_ABC_CEIL_LIFT_HIGH", "`c2` from B-High, `c3=0.937` from C-High, `c4` `subadditive_overlap(0.50)` (`c4_pouch_a=0.85` fixed)"),
        ],
        p25,
        p50,
    )
    verify_draft_b_band_and_discount_lines(draft_texts["B"], omega_band, b_disc)

    verify_sec6_table_binding(
        IIP_DRAFT_FILES["C"],
        draft_texts["C"],
        [
            ("Wave-5 `L3B` Baseline", "L3B_WAVE5_STRICT_ZERO_DRUG_BASELINE", "None (`c3 = 0.925`)"),
            ("IIP C Fixed-Ceiling Low", "IIP_C_GENETIC_FIXED_CEIL_LOW", "**None (ALL systemic ceilings fixed)**"),
            ("IIP C Fixed-Ceiling High", "IIP_C_GENETIC_FIXED_CEIL_HIGH", "**None (ALL systemic ceilings fixed)**"),
            ("IIP C Ceiling-Lift Low", "IIP_C_GENETIC_CEIL_LIFT_LOW", "`c3: 0.925 -> 0.930`"),
            ("IIP C Ceiling-Lift High", "IIP_C_GENETIC_CEIL_LIFT_HIGH", "`c3: 0.925 -> 0.937`"),
        ],
        p25,
        p50,
    )

    sec6_d = draft_texts["D"].split("## 6.", 1)[1].split("## 7.", 1)[0]
    ln_d_pros = _find_single_line(sec6_d, "Prospective additive upside", "Draft D §6")
    require(re.findall(r"[+-]?\d+\.\d{2}\s+pp", ln_d_pros) == ["+0.00 pp"], "Draft D §6 prospective delta mismatch")

    # Verify promoted raw-to-table scalars across Drafts A-D directly from receipt IDs
    verify_promoted_table_scalars(receipt, draft_texts)
    print("[PASS 10/10] Strict Section-6 live-odds (+0.00 pp), BOTH BPR-05 bounds, exact header-roles & Col-1 ceilings, phi=0.25/0.50 bands, & promoted scalars verified across 4/4 drafts")

    print("\nALL 10/10 FAIL-CLOSED CHECKS PASSED (ZERO GPU REQUIRED; OPTIMIZED-PYTHON SAFE).")


if __name__ == "__main__":
    main()