OpenIslet

scripts/verify_wave7_cellgemma_2p24_rebase.py

Wave-7 CellGemma-Islet (IIP-0062 to IIP-0065 / GATE-40 to GATE-43) Pure-CPU

script Release v0.8.0 gen-eb955f8266035aba 1.37 MB · 90 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_wave7_cellgemma_2p24_rebase.py · SHA-256: 5f31a6369f25031d…

        _lp_m = sum(_tp_row["local_parent_total_replicates_nM"]) / len(_tp_row["local_parent_total_replicates_nM"])
        _lb_t = [round(max(0.20, 0.14 * _lp_m) * (1.0 + d), 4) for d in (-0.01, -0.005, 0.0, 0.0, 0.005, 0.01)]
        _tp_row["local_bmt_total_replicates_nM"] = _lb_t
        _tp_row["local_bmt_blq_flags"] = [False] * 6
    # Sampled free ratio min is ~0.135, so r_lo=0.11 covers ALL sampled replicates, but continuous lower bound drops well below 0.11 -> MUST FAIL!
    mix_high_rlo = _sign_receipt({**mix_rcpt_ok, "tested_bmt_to_parent_ratio_min": 0.11, "tested_bmt_to_parent_ratio_max": 2.0, "mixture_dose_response_evidence": _mk_mix_dr(0.11, 2.0, 6.5, 21.0)})
    chk("FAIL_GATE_B2B_BENCH_MIXTURE_REQUAL_RATIO_DOES_NOT_COVER_OBSERVED_BMT_PARENT" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **b2b_pos_bmt, "c_bmt_local_total_u_alloc_nM": 25.0, "c_bmt_local_free_u_alloc_nM": 5.0, "u95_joint_peak_free_nM": 20.8, "mixture_requalified": True, "mixture_requalification_receipt": mix_high_rlo})})["failures"], "ADV_G41_b2b_continuous_lower_ratio_trough_below_sampled_min_fails")
    # 10. Same continuous LOWER BMT/parent ratio trough check on B-4!
    b4_pos_lbf = [round(0.14 * p, 4) for p in b4_lpf]
    b4_pos_rep = _mk_r8_b4_replicates(b4_hrs, b4_lpf, b4_pos_lbf, b4_spf, b4_sbf)
    mix_b4_high_rlo = _sign_receipt({**mix_ex_ref, "tested_bmt_to_parent_ratio_min": 0.11, "tested_bmt_to_parent_ratio_max": 3.0, "mixture_dose_response_evidence": _mk_mix_dr(0.11, 3.0, 5.0, 25.0, tested_product_id=py)})
    chk("FAIL_GATE_B4_MIXTURE_REQUAL_RATIO_DOES_NOT_COVER_OBSERVED_BMT_PARENT" in evaluate_gate41_deucravacitinib_tyk2({**g41_ok, "b4_evidence": _sign_receipt({**b4_y, "serial_pk_local_bmt_free_nM": b4_pos_lbf, **b4_pos_rep, "invivo_u95_joint_peak_free_nM": 21.5, "mixture_requalification_receipt": mix_b4_high_rlo})})["failures"], "ADV_G41_b4_continuous_lower_ratio_trough_below_sampled_min_fails")
    # 11. Restored B-2 endothelial PGF watch item (< 80% ctrl) FAILS!
    chk("FAIL_GATE_B2_IEC_PGF_LT_80PCT" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2_evidence": _sign_receipt({**b2_y, "iec_pgf_pct_ctrl": 72.0})})["failures"], "ADV_G41_b2_iec_pgf_below_80pct_fails")
    # 12. Restored B-2 endothelial C3 watch item (> 1.2x ctrl) FAILS!
    chk("FAIL_GATE_B2_IEC_C3_GT_1P2" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2_evidence": _sign_receipt({**b2_y, "iec_c3_fold_vs_ctrl": 1.35})})["failures"], "ADV_G41_b2_iec_c3_above_1p2_fails")

    # --- GATE-42 (IIP-0064) Regressions (4 tests) ---
    # 13. Missing start-of-window engagement (> 24 h after window start) emits distinct MISSING_START_COVERAGE HOLD (not decayed)!
    eng_late_sm = _mk_c_eng(c1_cohort_y, "2026-10-01T16:00:00Z", stage_name="C-3-GSIS", lot_s_id=ly, win_start="2026-09-30T13:00:00Z", win_end="2026-10-01T18:00:00Z", start_measured_utc="2026-10-01T14:00:00Z")
    r_late_sm = evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c3_gsis_evidence": _sign_receipt({**c3_gsis_y, "transient_target_engagement_record": eng_late_sm})})
    chk("HOLD_GATE_C_TRANSIENT_ENGAGEMENT_MISSING_START_COVERAGE:C-3-GSIS" in r_late_sm["holds"] and not any("DECAYED" in h for h in r_late_sm["holds"]), "ADV_G42_engagement_missing_start_coverage_distinct_hold")
    # 14. Reusing a single aliquot assay record ID for both start & end over a multi-day window FAILS!
    eng_same_aid = _mk_c_eng(c1_cohort_y, "2026-10-01T12:00:00Z", stage_name="C-3-GSIS", lot_s_id=ly, win_start="2026-09-30T13:00:00Z", win_end="2026-10-01T18:00:00Z", start_aliquot_id="ONE-ALIQUOT-ONLY", end_aliquot_id="ONE-ALIQUOT-ONLY")
    chk("FAIL_GATE_C_INVALID_OR_UNBOUND_TRANSIENT_ENGAGEMENT:C-3-GSIS" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c3_gsis_evidence": _sign_receipt({**c3_gsis_y, "transient_target_engagement_record": eng_same_aid})})["failures"], "ADV_G42_engagement_reused_start_end_aliquot_id_fails")
    # 15. Insufficient start-of-window KD (35%) even with active end-of-window KD (78%) HOLDS as DECAYED!
    eng_low_start = _mk_c_eng(c1_cohort_y, "2026-09-25T08:00:00Z", stage_name="C-2", lot_s_id=ly, win_start="2026-09-22T08:00:00Z", win_end="2026-09-25T09:00:00Z", kd_start_v=35.0, kd_v=78.0)
    chk("HOLD_GATE_C_TRANSIENT_ENGAGEMENT_DECAYED_BEFORE_ASSAY:C-2" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c2_evidence": _sign_receipt({**c2_y, "transient_target_engagement_record": eng_low_start})})["holds"], "ADV_G42_engagement_start_kd_decayed_while_end_ok_holds")
    # 16. Invalid engagement_measurement_mode FAILS!
    eng_bad_mode = _mk_c_eng(c1_cohort_y, "2026-09-25T08:00:00Z", stage_name="C-2", lot_s_id=ly, win_start="2026-09-22T08:00:00Z", win_end="2026-09-25T09:00:00Z", mode="SINGLE_ENDPOINT_ONLY")
    chk("FAIL_GATE_C_INVALID_OR_UNBOUND_TRANSIENT_ENGAGEMENT:C-2" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c2_evidence": _sign_receipt({**c2_y, "transient_target_engagement_record": eng_bad_mode})})["failures"], "ADV_G42_engagement_invalid_mode_fails")

    # --- GATE-43 (IIP-0065) Regressions (4 tests -> total 606/606!) ---
    # 17. D-3(a) missing source_iec_preparation_id FAILS!
    chk("FAIL_CHECK_D3A_DUPLICATE_OR_MISSING_SOURCE_IEC_PREP_ID:IEC-LOT-1" in evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_full_a, "check_d3a_per_lot_records": [_mk_d3a_lot(1, source_iec_preparation_id=""), d3a_ok_lots[1], d3a_ok_lots[2]]})["failures"], "ADV_G43_d3a_missing_source_iec_prep_id_fails")
    # 18. D-3(a) duplicate source_iec_preparation_id across lots FAILS!
    chk("FAIL_CHECK_D3A_DUPLICATE_OR_MISSING_SOURCE_IEC_PREP_ID:IEC-LOT-2" in evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_full_a, "check_d3a_per_lot_records": [_mk_d3a_lot(1, source_iec_preparation_id="SAME-PREP-01"), _mk_d3a_lot(2, source_iec_preparation_id="SAME-PREP-01"), d3a_ok_lots[2]]})["failures"], "ADV_G43_d3a_duplicate_source_iec_prep_id_fails")
    # 19. D-1 unmatched arm exposure duration (Arm A 24h vs Arm B 21h) FAILS!
    d1_bad_dur = _mk_d1_unified(g43_base, arm_b_exposure_end_utc="2026-10-03T09:05:00Z")
    chk("FAIL_CHECK_D1_EXPOSURE_WINDOW_UNMATCHED_OR_INVALID" in evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_base, "check_d1_paired_assay_receipt": d1_bad_dur})["failures"], "ADV_G43_d1_unmatched_arm_exposure_duration_fails")
    # 20. D-1 arm exposure ending AFTER assay_acquired_at_utc FAILS!
    d1_post_acq = _mk_d1_unified(g43_base, arm_b_exposure_start_utc="2026-10-02T15:00:00Z", arm_b_exposure_end_utc="2026-10-03T15:00:00Z")
    chk("FAIL_CHECK_D1_EXPOSURE_WINDOW_UNMATCHED_OR_INVALID" in evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_base, "check_d1_paired_assay_receipt": d1_post_acq})["failures"], "ADV_G43_d1_exposure_ends_after_assay_acquired_fails")


    # ========================================================================
    # ADVERSARIAL REGRESSION SUITE (22 NEW TESTS -> 628/628 TOTAL!)
    # Adversarial fail-closed invariant regression tests.
    # ========================================================================
    # --- Shared Readout-2 Zero-Variance Parity (4 tests) ---
    # 1. Zero between-block variance on Z2 WITH within_lot_technical_var_z2 = 0.008 STILL FAILS (live wetlab_contract.py parity)!
    r2_z2_zvar = _mk_r8_readout2(matched_comparator_id=bv_a, block_prefix="A2B", lot_id=ly)
    for _iz, _b in enumerate(r2_z2_zvar["o2_40_mmhg"]["blocks"]):
        _b["low2_value"] = 0.44
        _b["high2_value"] = 2.582857
        _b["z2_increment"] = round(_b["eta_sort_viable_recovery"] * (2.582857 - 0.44), 4)
        _b["pulse2_si"] = round(2.582857 / 0.44, 4)
        _b["kcl_value"] = round(2.582857 + 1.40 + 0.04 * _iz, 6)
        _b["matched_control_output_ratio"] = round(_b["z2_increment"] / _b["matched_control_z2_increment"], 6)
    chk("FAIL_GATE_A2_READOUT2_O2_40_RECOMPUTED_L95_Z2_BELOW_ZMIN" in evaluate_gate40_pirfenidone_h4({**g40_ok, "a2_evidence": _sign_receipt({**a2_y, "readout2_evidence": r2_z2_zvar})})["failures"], "ADV_shared_r2_z2_zero_variance_with_tech_var_fails")
    # 2. Constant Gate 0M stepdown_t90_min = [2.6]*6 HOLDS + FAILS (zero fallback to point estimate)!
    r2_t90_zvar = _mk_r8_readout2(matched_comparator_id="CTRL-LOT-1", block_prefix="D2L1", meas_id="MEAS-D2-LOT-1", lot_id="D2-LOT-1", lot_jitter=1.0)
    for _b in r2_t90_zvar["o2_40_mmhg"]["blocks"]:
        _b["stepdown_t90_min"] = 2.6
    r_t90_zv = evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_full_a, "check_d2_per_lot_records": [_mk_d2_lot(1, readout2_evidence=r2_t90_zvar), _mk_d2_lot(2), _mk_d2_lot(3)]})
    chk("HOLD_CHECK_D2_D2-LOT-1_READOUT2_O2_40_DEGENERATE_ZERO_VARIANCE_UNESTIMABLE" in r_t90_zv["holds"] and "FAIL_CHECK_D2_D2-LOT-1_READOUT2_O2_40_GATE0M_SHUTOFF_T90_U95_GT_3MIN_FAILED" in r_t90_zv["failures"], "ADV_shared_r2_gate0m_t90_zero_variance_holds_and_fails")
    # 3. Constant Gate 0M glucagon_fold = [2.5]*6 HOLDS + FAILS!
    r2_gcg_zvar = _mk_r8_readout2(matched_comparator_id="CTRL-LOT-1", block_prefix="D2L1", meas_id="MEAS-D2-LOT-1", lot_id="D2-LOT-1", lot_jitter=1.0)
    for _b in r2_gcg_zvar["o2_40_mmhg"]["blocks"]:
        _b["glucagon_fold"] = 2.5
    r_gcg_zv = evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_full_a, "check_d2_per_lot_records": [_mk_d2_lot(1, readout2_evidence=r2_gcg_zvar), _mk_d2_lot(2), _mk_d2_lot(3)]})
    chk("HOLD_CHECK_D2_D2-LOT-1_READOUT2_O2_40_DEGENERATE_ZERO_VARIANCE_UNESTIMABLE" in r_gcg_zv["holds"] and "FAIL_CHECK_D2_D2-LOT-1_READOUT2_O2_40_GATE0M_PARACRINE_GLUCAGON_L95_FAILED" in r_gcg_zv["failures"], "ADV_shared_r2_gate0m_paracrine_zero_variance_holds_and_fails")
    # 4. Constant stored_insulin_per_lot_iu = [110.0]*6 HOLDS!
    r2_st_zvar = _mk_r8_readout2(matched_comparator_id=bv_a, block_prefix="A2B", lot_id=ly)
    r2_st_zvar["stored_insulin_per_lot_iu"] = [110.0] * 6
    chk("HOLD_GATE_A2_READOUT2_STORED_INSULIN_ZERO_VARIANCE_UNESTIMABLE" in evaluate_gate40_pirfenidone_h4({**g40_ok, "a2_evidence": _sign_receipt({**a2_y, "readout2_evidence": r2_st_zvar})})["holds"], "ADV_shared_r2_stored_insulin_zero_variance_holds")

    # --- GATE-40 (IIP-0062) Regressions (3 tests) ---
    # 5. A-0b omitting explicit 24.0 h sample ([6, 48, 120, 192, 264, 336]) FAILS!
    a0b_tp_no24 = _mk_pfd_tp_rows(((6.0, 182.0), (48.0, 160.0), (120.0, 140.0), (192.0, 128.0), (264.0, 116.0), (336.0, 108.0)), coat_a["coating_lot_id"], "A0BNO24")
    chk("FAIL_GATE_A0B_LOCAL_EXPOSURE_SCHEDULE_GAP_OR_MALFORMED" in evaluate_gate40_pirfenidone_h4({**g40_bench, "a0b_evidence": _sign_receipt({**a0b_y, "a0b_local_exposure_timepoints": a0b_tp_no24})})["failures"], "ADV_G40_a0b_missing_24h_sample_fails")
    # 6. Direct clipped subinterval check on boundary-straddling [6.0, 48.0] catches trough on [24.0, 48.0] < 75 uM!
    _, tr_straddle = _compute_pfd_continuous_envelope_24_336(
        [6.0, 48.0, 336.0], [180.0, 150.0, 110.0], [82.0, 78.0, 95.0], ke_a=0.015, kr_a=0.015, ke_w=0.015,
    )
    chk(tr_straddle < 75.0, "ADV_G40_pfd_envelope_boundary_straddle_6_48h_trough_caught")
    # 7. A-1 continuous trough dip across [24.0, 96.0] below IC50_U95=75 uM FAILS even when every sampled point >= 78 uM!
    a1_tp_ctdip = _mk_pfd_tp_rows(((6.0, 92.0), (24.0, 82.0), (96.0, 80.0), (168.0, 82.0), (240.0, 84.0), (312.0, 86.0), (336.0, 86.0), (600.0, 22.0), (840.0, 3.2)), coat_a["coating_lot_id"], "A1CT", deltas=(-0.4, 0.0, 0.4, 0.2))
    a1e_env_mid = _mk_pfd_env("exact_product", "BENCH_ELUTION_LOCAL_PERI_GRAFT", ke_a=0.008, kr_a=0.008, ke_w=0.010)
    chk("FAIL_GATE_A1_DAYS1_14_INTERIOR_FREE_PARENT_DIP_BELOW_IC50_U95" in evaluate_gate40_pirfenidone_h4({**g40_ok, "a1_evidence": _sign_receipt({**a1_y, "day1_intact_parent_free_uM": 120.0, "day14_intact_parent_free_uM": 82.0, "a1_local_free_parent_timepoints": a1_tp_ctdip, "a1_local_pk_envelope": a1e_env_mid})})["failures"], "ADV_G40_a1_continuous_trough_24_96h_dip_below_ic50_fails")

    # --- GATE-41 (IIP-0063) Regressions (7 tests) ---
    # 8. B-0a omitting 3rd biological efficacy grid (efficacy_iec_ibmir_pct_grid) FAILS!
    chk("FAIL_GATE_B0A_MISSING_RAW_CONC_RESPONSE_GRID" in evaluate_gate41_deucravacitinib_tyk2({"phase": "ROUTE_FREE_B0A", "b0a_evidence": _sign_receipt({k: v for k, v in b0a_ok.items() if k not in ("efficacy_iec_ibmir_pct_grid", "receipt_sha256")})})["failures"], "ADV_G41_b0a_missing_3_endpoint_efficacy_grids_fails")
    # 9. B-0a where beta & NK pass (>= 70%) at EC50_U95=6 nM while endothelial IBMIR suppression L95 < 50% HOLDS!
    b0a_ei_weak = list(b0a_ei_grid); b0a_ei_weak[3] = 44.0
    b0a_e_reps_weak = [dict(r) for r in b0a_e_reps_ok]
    _weak_vals = [43.62, 43.80, 43.94, 44.06, 44.20, 44.38]
    b0a_e_reps_weak[3] = {**b0a_e_reps_weak[3], "iec_ibmir_marker_suppression_pct": _weak_vals, "raw_unit_measurements": {**b0a_e_reps_weak[3]["raw_unit_measurements"], "iec_ibmir_marker_suppression_pct": _mk_b0a_raw_ratio(_weak_vals, b0a_e_reps_weak[3]["matched_vehicle_record_id"], 250.0, is_inhib=True)}}
    b0a_an_weak = _sign_receipt({**b0a_an_ok, "raw_efficacy_replicates_sha256": sha256_bytes(canonical_json_bytes(b0a_e_reps_weak))})
    chk("HOLD_GATE_B0A_EC50_U95_UNSUBSTANTIATED_BY_EFFICACY_REPLICATES" in evaluate_gate41_deucravacitinib_tyk2({"phase": "ROUTE_FREE_B0A", "b0a_evidence": _sign_receipt({**b0a_ok, "efficacy_inhibition_pct_grid": b0a_ei_weak, "efficacy_iec_ibmir_pct_grid": b0a_ei_weak, "efficacy_replicates_by_conc": b0a_e_reps_weak, "b0a_analysis_receipt": b0a_an_weak})})["holds"], "ADV_G41_b0a_single_endpoint_iec_ibmir_below_50pct_holds")
    # 10. B-2b non-zero efficacy_window_start_h = 4.0 (skipping Day-0 first blood contact) FAILS!
    b2b_eff4 = _mk_r8_b2b_replicates()
    eb_eff4 = {k: v for k, v in b2b_eff4["intersample_pk_envelope"].items() if k != "envelope_receipt_sha256"}
    eb_eff4["efficacy_window_start_h"] = 4.0
    b2b_eff4["intersample_pk_envelope"] = {**eb_eff4, "envelope_receipt_sha256": sha256_bytes(canonical_json_bytes(eb_eff4))}
    chk("FAIL_GATE_B2B_BENCH_INVALID_INTERSAMPLE_ENVELOPE_PARAMS" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **b2b_eff4})})["failures"], "ADV_G41_b2b_nonzero_efficacy_window_start_h_fails")
    # 11. B-4 non-zero efficacy_window_start_h = 2.0 (skipping Day-0 first blood contact) FAILS!
    eb4_eff2 = {k: v for k, v in b4_y["intersample_pk_envelope"].items() if k != "envelope_receipt_sha256"}
    eb4_eff2["efficacy_window_start_h"] = 2.0
    eb4_eff2["envelope_receipt_sha256"] = sha256_bytes(canonical_json_bytes(eb4_eff2))
    chk("FAIL_GATE_B4_INVALID_INTERSAMPLE_ENVELOPE_PARAMS" in evaluate_gate41_deucravacitinib_tyk2({**g41_ok, "b4_evidence": _sign_receipt({**b4_y, "intersample_pk_envelope": eb4_eff2})})["failures"], "ADV_G41_b4_nonzero_efficacy_window_start_h_fails")
    # 12. B-2b recirc_assay_matrix == "whole_blood" WITHOUT systemic_kbp_calibration FAILS!
    chk("FAIL_GATE_B2B_BENCH_MISSING_OR_INVALID_WHOLE_BLOOD_KBP_CALIBRATION" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, "recirc_assay_matrix": "whole_blood"})})["failures"], "ADV_G41_b2b_whole_blood_missing_kbp_calibration_fails")
    # 13. B-2b whole_blood with low K_bp (0.15) pushes plasma equivalent >= 0.5 nM -> FAILS, while valid K_bp (1.25) PASSES!
    kbp_b2b_low_b = {
        "kbp_assay_method_id": "BENCH-WHOLE-BLOOD-KBP-V1",
        "blood_to_plasma_ratio_parent_replicates": [0.14, 0.15, 0.16, 0.15, 0.14, 0.16],
        "blood_to_plasma_ratio_bmt_replicates": [0.14, 0.15, 0.16, 0.15, 0.14, 0.16],
        "alpha_kbp_parent": 0.004, "alpha_kbp_bmt": 0.004,
    }
    kbp_b2b_low = {**kbp_b2b_low_b, "calibration_sha256": sha256_bytes(canonical_json_bytes(kbp_b2b_low_b))}
    kbp_b2b_ok_b = {**kbp_b2b_low_b, "blood_to_plasma_ratio_parent_replicates": [1.24, 1.25, 1.26, 1.25, 1.24, 1.26], "blood_to_plasma_ratio_bmt_replicates": [1.20, 1.22, 1.21, 1.23, 1.22, 1.24]}
    kbp_b2b_ok = {**kbp_b2b_ok_b, "calibration_sha256": sha256_bytes(canonical_json_bytes(kbp_b2b_ok_b))}
    wb_rec_fu_ok = [0.118, 0.119, 0.120, 0.120, 0.121, 0.122]
    b1_wb = _sign_receipt({**b1_y, "analytical_sample_ledger": _mk_b12_ledger("B-1", recirc_assay_matrix="whole_blood")})
    b2_wb = _sign_receipt({**b2_y, "parent_receipt_sha256": b1_wb["receipt_sha256"], "analytical_sample_ledger": _mk_b12_ledger("B-2", recirc_assay_matrix="whole_blood")})
    b2bb_wb_base = {**b2bb_y, "parent_receipt_sha256": b2_wb["receipt_sha256"], "prerequisite_receipt_sha256s": {"B-1": b1_wb["receipt_sha256"], "B-2": b2_wb["receipt_sha256"]}, "recirc_assay_matrix": "whole_blood", "alpha_conc": 0.018, "alpha_fu_parent": 0.010, "alpha_fu_bmt": 0.010, "recirc_fu_bmt_replicates": wb_rec_fu_ok, "alpha_fu_bmt_recirc": 0.004}
    r_b2b_wb_fail = evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b1_evidence": b1_wb, "b2_evidence": b2_wb, "b2b_bench_evidence": _sign_receipt({**b2bb_wb_base, "systemic_kbp_calibration": kbp_b2b_low})})
    r_b2b_wb_ok = evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b1_evidence": b1_wb, "b2_evidence": b2_wb, "b2b_bench_evidence": _sign_receipt({**b2bb_wb_base, "systemic_kbp_calibration": kbp_b2b_ok})})
    chk("FAIL_GATE_B2B_BENCH_RECOMPUTED_SYSTEMIC_U95_GE_0P5NM" in r_b2b_wb_fail["failures"] and r_b2b_wb_ok["verdict"] == "PASS_BENCH_ONLY_UNEDITED_PRE_MATERIALIZATION", "ADV_G41_b2b_whole_blood_low_kbp_fails_and_valid_kbp_passes")
    # 14. Endpoint-only [0.0, 0.25] (no interior curve) AND wide sparse [0.0, 1.5, 3.0] (gap 1.5 > 0.50) both FAIL!
    dr_ep_only = {k: v for k, v in _mk_mix_dr(0.0, 0.25, 6.5, 21.0).items() if k != "evidence_sha256"}
    dr_ep_only["mixture_composition_curves"] = [dr_ep_only["mixture_composition_curves"][0], dr_ep_only["mixture_composition_curves"][-1]]
    dr_ep_only["evidence_sha256"] = sha256_bytes(canonical_json_bytes(dr_ep_only))
    dr_wide_sp = {k: v for k, v in _mk_mix_dr(0.0, 3.0, 6.5, 21.0).items() if k != "evidence_sha256"}
    dr_wide_sp["mixture_composition_curves"] = [dr_wide_sp["mixture_composition_curves"][0], dr_wide_sp["mixture_composition_curves"][3], dr_wide_sp["mixture_composition_curves"][-1]]
    dr_wide_sp["evidence_sha256"] = sha256_bytes(canonical_json_bytes(dr_wide_sp))
    chk(