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…

    dr_pw = {k: v for k, v in _mk_mix_dr(0.0, 0.25, 6.5, 21.0).items() if k != "evidence_sha256"}
    dr_pw["mixture_composition_curves"][2]["mixture_efficacy_replicates_by_conc"][2]["beta_cytokine_protection_pct"] = [51.0, 52.5, 54.0, 55.5, 57.0]
    dr_pw["evidence_sha256"] = sha256_bytes(canonical_json_bytes(dr_pw))
    chk("HOLD_GATE_B2B_BENCH_MIXTURE_REPLICATES_DO_NOT_SUBSTANTIATE_WINDOW" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, "c_bmt_local_total_u_alloc_nM": 0.25, "mixture_requalified": True, "mixture_requalification_receipt": _sign_receipt({**mix_rcpt_ok, "mixture_dose_response_evidence": dr_pw})})})["holds"], "G41_mix_pointwise_only_fails_simultaneous_bonferroni_holds")
    # 11. BMT-alone panel with zero-dispersion OR sprouting < 90% HOLDS!
    bmt_bad_sp = {k: v for k, v in _mk_bmt_alone("BENCH_UNEDITED_PANEL").items() if k != "evidence_sha256"}
    bmt_bad_sp["bmt_alone_safety_replicates_by_conc"][4]["sprouting_pct"] = [87.8, 87.9, 88.0, 88.1, 88.2]
    bmt_bad_sp["evidence_sha256"] = sha256_bytes(canonical_json_bytes(bmt_bad_sp))
    mix_bmt88 = _sign_receipt({**mix_full_both, "bmt_alone_qualification_evidence": bmt_bad_sp})
    chk("HOLD_GATE_B2B_BENCH_BMT_ALONE_REPLICATES_DO_NOT_SUBSTANTIATE_WINDOW" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **b2b_both_blq_fin, "u95_joint_peak_free_nM": 23.5, "c_bmt_local_total_u_alloc_nM": 3.0, "c_bmt_local_free_u_alloc_nM": 0.6, "mixture_requalification_receipt": mix_bmt88})})["holds"], "G41_bmt_alone_sprouting_88pct_holds")
    # 12. Readout-3B missing covalent HLA-E SCT comparator on HLA-E engineered product Y FAILS!
    r3b_no_sct = _mk_r8_readout3b(include_sirpa_low=True, matched_vehicle_lot_id=bv_b)
    r3b_no_sct["covalent_hla_e_sct_comparator"] = None
    chk("FAIL_GATE_B3_READOUT3B_MISSING_COVALENT_HLAE_SCT_COMPARATOR" in evaluate_gate41_deucravacitinib_tyk2({**g41_ok, "b3_evidence": _sign_receipt({**b3_y, "readout3b_evidence": r3b_no_sct})})["failures"], "G41_b3_r3b_missing_covalent_hlae_sct_fails")
    # 13. Readout-3B Regime II continuous 0-24 h kinetic trace spiking to 14% at 12 h FAILS even when terminal 24 h passes!
    r3b_kspike = _mk_r8_readout3b(include_sirpa_low=True, matched_vehicle_lot_id=bv_b)
    _kt0 = {k: v for k, v in r3b_kspike["donor_records"][0]["regime_ii_t0_unpreinduced"]["continuous_0_24h_kinetic_trace"].items() if k != "trace_sha256"}
    _kt0["target_lysis_pct_series"] = [0.0, 4.0, 9.5, 14.2, 8.0, 5.2]
    r3b_kspike["donor_records"][0]["regime_ii_t0_unpreinduced"]["continuous_0_24h_kinetic_trace"] = {**_kt0, "trace_sha256": sha256_bytes(canonical_json_bytes(_kt0))}
    chk("FAIL_GATE_B3_READOUT3B_R2_MISSING_0_24H_KINETIC_TRACE:NK-D1" in evaluate_gate41_deucravacitinib_tyk2({**g41_ok, "b3_evidence": _sign_receipt({**b3_y, "readout3b_evidence": r3b_kspike})})["failures"], "G41_b3_r3b_0_24h_kinetic_spike_fails")

    # --- GATE-42 (IIP-0064) C-1 Mandatory Delivery-Only Mock-Transfection Control (3 tests) ---
    # 14. C-1 omitting mock_transfection_control_by_block HOLDS!
    chk("HOLD_GATE_C1_NORMOXIA_MISSING_MOCK_TRANSFECTION_CONTROL" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "mock_transfection_control_by_block": None}})})["holds"], "G42_c1_missing_mock_transfection_holds")
    # 15. C-1 toxic delivery reagent (unstressed mock survival drops to 55% vs 90% vehicle) FAILS!
    mock_tox = [{**m, "unstressed_mock_surviving": 5500} for m in c1_norm_6["mock_transfection_control_by_block"]]
    chk("FAIL_GATE_C1_NORMOXIA_MOCK_DELIVERY_TOXICITY_EXCESSIVE" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "mock_transfection_control_by_block": mock_tox}})})["failures"], "G42_c1_mock_delivery_toxicity_fails")
    # 16. C-1 stressed mock showing artifactual rescue (+20 pp above stressed NT) FAILS concordance/specificity!
    mock_art = [{**m, "stressed_mock_surviving": 7600} for m in c1_norm_6["mock_transfection_control_by_block"]]
    chk("FAIL_GATE_C1_NORMOXIA_MOCK_CONTROL_CONCORDANCE_OR_SPECIFICITY_FAILED" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "mock_transfection_control_by_block": mock_art}})})["failures"], "G42_c1_mock_artifactual_rescue_fails")


    # ========================================================================
    # ADVERSARIAL REGRESSION SUITE (16 NEW TESTS -> 704/704 TOTAL!)
    # ========================================================================
    # --- GATE-41 (IIP-0063) Metabolite-Specific Rates & Compact [0,1] Fraction Coverage (5 tests) ---
    # 1. Exact midpoint surge counterexample: parent 1.0->0.98->1.0, BMT 0.01->0.03->0.01 (flat total 1.01, k_rise_local=0.01/h, k_rise_bmt=1.0/h) catches midpoint ratio >= 0.0306 (vs old combined-rate 0.01051)!
    _env_bmt_surge = _mk_env_t(
        k_elim_local_max_per_h=0.01, k_rise_local_max_per_h=0.01,
        k_elim_parent_max_per_h=0.04, k_rise_parent_max_per_h=0.04,
        k_elim_bmt_max_per_h=1.0, k_rise_bmt_max_per_h=1.0,
        k_elim_sys_max_per_h=0.02, k_rise_sys_max_per_h=0.02,
        efficacy_window_start_h=0.0, envelope_model_sha256="b" * 64,
    )
    _, _r_surge_max, _ = _compute_continuous_bmt_parent_ratio_bounds(
        [0.0, 2.0], [0.01, 0.01], [0.01, 0.01], [1.0, 1.0], [1.0, 1.0],
        _env_bmt_surge, fails=[], prefix="TSURGE",
    )
    chk(_r_surge_max > 0.028, "G41_bmt_specific_rate_catches_midpoint_surge_under_flat_total")
    # 2. Envelope omitting k_rise_bmt_max_per_h FAILS!
    _eb_nobmt = {k: v for k, v in b2bb_y["intersample_pk_envelope"].items() if k not in ("k_rise_bmt_max_per_h", "envelope_receipt_sha256")}
    _eb_nobmt["envelope_receipt_sha256"] = sha256_bytes(canonical_json_bytes(_eb_nobmt))
    chk("FAIL_GATE_B2B_BENCH_MISSING_QUANTITATIVE_INTERSAMPLE_ENVELOPE" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, "intersample_pk_envelope": _eb_nobmt})})["failures"], "G41_envelope_missing_bmt_specific_rate_fails")
    # 3. Parent-BLQ with finite max == 0 omitting mixture_dose_response_evidence STILL HOLDS (never skipped)!
    _b2b_all_pblq = _mk_r8_b2b_replicates()
    for _tp_r in _b2b_all_pblq["timepoint_replicate_records"]:
        _tp_r["local_parent_total_replicates_nM"] = [0.0] * 6
        _tp_r["local_parent_blq_flags"] = [True] * 6
    _mix_only_bmt = _sign_receipt({
        "stage": "MIXTURE_REQUALIFICATION", "verdict": "PASS", "product_id": py, "bank_id": by, "lot_id": ly, "route_id": ry,
        "evidence_scope": "bench_unedited", "recorded_at_utc": "2026-09-12T09:00:00Z", **coat_b,
        "analysis_record_sha256": "d" * 64, "tested_bmt_to_parent_ratio_min": 0.0, "tested_bmt_to_parent_ratio_max": 0.25,
        "mixture_ec50_eff_u95_free_nM": 5.0, "mixture_c_safe_max_l95_free_nM": 25.0,
        "metabolite_dominant_unbounded_ratio_qualified": True,
        "bmt_alone_qualification_evidence": bmt_alone_ok_ref,
    })
    chk("HOLD_GATE_B2B_BENCH_MISSING_MIXTURE_DOSE_RESPONSE_EVIDENCE" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **_b2b_all_pblq, "mixture_requalification_receipt": _mix_only_bmt})})["holds"], "G41_parent_blq_cannot_skip_mixture_panel_holds")
    # 4. Parent-BLQ with mixture grid stopping at f_BMT=0.50 (r=1.0) + bmt_alone leaves high-finite (0.50, 1.0) untested -> HOLDS!
    _mix_gap_hi = _sign_receipt({**mix_full_both, "mixture_dose_response_evidence": _mk_mix_dr(0.0, 1.0, 5.0, 25.0, cover_unbounded_to_1=False)})
    chk("HOLD_GATE_B2B_BENCH_UNBOUNDED_HIGH_FINITE_MIXTURE_GAP_UNQUALIFIED" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **b2b_both_blq_fin, "u95_joint_peak_free_nM": 23.5, "c_bmt_local_total_u_alloc_nM": 3.0, "c_bmt_local_free_u_alloc_nM": 0.6, "mixture_requalification_receipt": _mix_gap_hi})})["holds"], "G41_parent_blq_high_finite_composition_gap_holds")
    # 5. Parent-BLQ with sparse fraction grid [0.0, 0.20, 1.0] (gap 0.80 > 0.25!) HOLDS!
    _dr_sp_f = {k: v for k, v in _mk_mix_dr(0.0, 1.0, 5.0, 25.0, cover_unbounded_to_1=True).items() if k != "evidence_sha256"}
    _dr_sp_f["mixture_composition_curves"] = [_dr_sp_f["mixture_composition_curves"][0], _dr_sp_f["mixture_composition_curves"][1], _dr_sp_f["mixture_composition_curves"][-1]]
    _dr_sp_f["evidence_sha256"] = sha256_bytes(canonical_json_bytes(_dr_sp_f))
    chk("HOLD_GATE_B2B_BENCH_UNBOUNDED_HIGH_FINITE_MIXTURE_GAP_UNQUALIFIED" in evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **b2b_both_blq_fin, "u95_joint_peak_free_nM": 23.5, "c_bmt_local_total_u_alloc_nM": 3.0, "c_bmt_local_free_u_alloc_nM": 0.6, "mixture_requalification_receipt": _sign_receipt({**mix_full_both, "mixture_dose_response_evidence": _dr_sp_f})})})["holds"], "G41_parent_blq_sparse_fraction_grid_holds")

    # --- GATE-42 (IIP-0064) Live GY-016 Lineage-Block Diversion & Even-Count Hodges-Lehmann (5 tests) ---
    # 6. C-1 diversion missing PLVAP_iEC lineage HOLDS!
    _div_no_iec = {**c1_norm_6["death_pathway_diversion_assay"], "lineage_block_diversion_records": {"INS_beta": c1_norm_6["death_pathway_diversion_assay"]["lineage_block_diversion_records"]["INS_beta"]}}
    chk("HOLD_GATE_C1_NORMOXIA_DIVERSION_MISSING_REQUIRED_LINEAGE" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "death_pathway_diversion_assay": _div_no_iec}})})["holds"], "G42_c1_gy016_missing_iec_lineage_holds")
    # 7. C-1 diversion with only 2 timepoints [0 h, 24 h] (no intermediate <= 12 h or 48 h) HOLDS!
    _div_2pt = {**c1_norm_6["death_pathway_diversion_assay"], "locked_timecourse_schedule_h": [0.0, 24.0]}
    chk("HOLD_GATE_C1_NORMOXIA_DIVERSION_TIMECOURSE_COVERAGE_INCOMPLETE" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "death_pathway_diversion_assay": _div_2pt}})})["holds"], "G42_c1_gy016_2pt_timecourse_incomplete_holds")
    # 8. C-1 PLVAP_iEC single block necroptosis rescue spike (Nec-1s = +8.5 pp while INS_beta passes) FAILS!
    _iec_nec_rows = [dict(r) for r in c1_norm_6["death_pathway_diversion_assay"]["lineage_block_diversion_records"]["PLVAP_iEC"]]
    _iec_nec_rows[2] = {**_iec_nec_rows[2], "necrostatin1s_rescue_delta_pp": 8.5}
    _div_iec_nec = {**c1_norm_6["death_pathway_diversion_assay"], "lineage_block_diversion_records": {**c1_norm_6["death_pathway_diversion_assay"]["lineage_block_diversion_records"], "PLVAP_iEC": _iec_nec_rows}}
    chk("FAIL_GATE_C1_NORMOXIA_UNDECLARED_NECROPTOSIS_DIVERSION" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "death_pathway_diversion_assay": _div_iec_nec}})})["failures"], "G42_c1_gy016_iec_single_block_nec1s_spike_fails")
    # 9. C-1 diversion paired_viability_timecourse_pct contradicting lineage_timecourse_counts FAILS!
    _beta_mm_rows = [dict(r) for r in c1_norm_6["death_pathway_diversion_assay"]["lineage_block_diversion_records"]["INS_beta"]]
    _beta_mm_rows[0] = {**_beta_mm_rows[0], "paired_viability_timecourse_pct": [{**_beta_mm_rows[0]["paired_viability_timecourse_pct"][0]}, {**_beta_mm_rows[0]["paired_viability_timecourse_pct"][1]}, {**_beta_mm_rows[0]["paired_viability_timecourse_pct"][2]}, {"hour_h": 48.0, "treated_viab_pct": 99.0, "ctrl_viab_pct": 54.0}]}
    _div_mm = {**c1_norm_6["death_pathway_diversion_assay"], "lineage_block_diversion_records": {**c1_norm_6["death_pathway_diversion_assay"]["lineage_block_diversion_records"], "INS_beta": _beta_mm_rows}}
    chk("FAIL_GATE_C1_NORMOXIA_INVALID_DIVERSION_ASSAY_VALUES" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "death_pathway_diversion_assay": _div_mm}})})["failures"], "G42_c1_gy016_viability_mismatch_vs_lineage_counts_fails")
    # 10. Exact even-count Hodges-Lehmann median boundary (n=8 -> 36 Walsh averages): upper central wa[18]=+1/2 > 0 while true exact_hodges_lehmann_median = 0 <= 0!
    _hl8_diffs = [Fraction(x, 1) for x in (-10, -8, -6, -4, -1, 5, 11, 20)]  # sum=+7 > 0; wa[17]=-1/2, wa[18]=+1/2 -> true HL=0 <= 0!
    _hl8_wa = sorted((_hl8_diffs[i] + _hl8_diffs[j]) / 2 for i in range(8) for j in range(i, 8))
    _hl8_prod = exact_hodges_lehmann_median(_hl8_diffs)
    _hl6_prod = exact_hodges_lehmann_median([Fraction(1, 1), Fraction(2, 1), Fraction(3, 1), Fraction(4, 1), Fraction(5, 1), Fraction(6, 1)])  # n=6 -> 21 odd Walsh avgs, med=3.5
    chk(len(_hl8_wa) == 36 and _hl8_wa[18] == Fraction(1, 2) and _hl8_prod == Fraction(0, 1) and _hl8_prod <= 0 and _hl6_prod == Fraction(7, 2), "G42_hl_even_walsh_boundary_true_median_neg_while_upper_pos")

    # --- GATE-40 (IIP-0062) A-0a 7d Vascular Components & A-0b/A-1 3-Lot Replication (4 tests) ---
    # 11. A-0a healthy sprout length (95%) with failing Day-0 branching (82% < 90%) FAILS!
    _a0a_br_bad = [dict(r) for r in a0a_reps_ok]
    _a0a_br_bad[5] = {**_a0a_br_bad[5], "day0_branching_7d_pct": [81.7, 81.85, 82.0, 82.15, 82.3], "sprouting_7d_pct": [81.7, 81.85, 82.0, 82.15, 82.3]}
    _a0a_fit_br = _sign_receipt({**a0a_fit_ok, "raw_replicates_sha256": sha256_bytes(canonical_json_bytes(_a0a_br_bad))})
    chk("FAIL_GATE_A0A_SPROUTING_CEILING_EXCEEDS_DAY0_OR_DELAYED_DONOR_L95" in evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**a0a_ok, "sprouting_7d_pct_grid": [100.0, 99.0, 97.0, 96.0, 94.0, 82.0, 76.0], "a0a_donor_replicates_by_conc": _a0a_br_bad, "a0a_fit_artifact_receipt": _a0a_fit_br})})["failures"], "G40_a0a_branching_below_90pct_fails")
    # 12. A-0a composite sprouting overstating failing branching component FAILS!
    _a0a_ov = [dict(r) for r in a0a_reps_ok]
    _a0a_ov[5] = {**_a0a_ov[5], "day0_branching_7d_pct": [82.0, 82.0, 82.0, 82.0, 82.0]}
    _a0a_fit_ov = _sign_receipt({**a0a_fit_ok, "raw_replicates_sha256": sha256_bytes(canonical_json_bytes(_a0a_ov))})
    chk("FAIL_GATE_A0A_VASCULAR_COMPOSITE_OVERSTATES_COMPONENT:5:DAY0" in evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**a0a_ok, "a0a_donor_replicates_by_conc": _a0a_ov, "a0a_fit_artifact_receipt": _a0a_fit_ov})})["failures"], "G40_a0a_composite_overstating_branching_fails")
    # 13. A-0b single manufacturing lot (3 specimens from 1 batch) FAILS 3-lot replication!
    _a0b_tp_1lot = _mk_pfd_tp_rows(a0b_tp_pts, coat_a["coating_lot_id"], "A0B1L", single_lot_only=True)
    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_1lot})})["failures"], "G40_a0b_single_lot_specimens_fails_3lot_rule")
    # 14. A-1 release traces with only 1 manufacturing lot FAILS!
    chk("FAIL_GATE_A1_REQUIRES_AT_LEAST_3_DISTINCT_MANUFACTURING_LOTS" in evaluate_gate40_pirfenidone_h4({**g40_ok, "a1_evidence": _sign_receipt({**a1_y, "manufacturing_lot_release_records": a1_y["manufacturing_lot_release_records"][:1]})})["failures"], "G40_a1_single_lot_release_trace_fails")

    # --- GATE-43 (IIP-0065) D-2 Cross-Lot Trace Uniqueness & D-1 Strict-Int Wash Counts (2 tests) ---
    # 15. D-2 reusing a single trace_id across two otherwise distinct lots FAILS!
    _r2_dup_tr = _mk_r8_readout2(matched_comparator_id="CTRL-LOT-2", block_prefix="D2L2", meas_id="MEAS-D2-LOT-2", lot_id="D2-LOT-2", lot_jitter=1.08)
    _r2_dup_tr["o2_40_mmhg"]["blocks"][0]["trace_id"] = _mk_d2_lot(1)["readout2_receipt"]["readout2_evidence"]["o2_40_mmhg"]["blocks"][0]["trace_id"]
    chk("FAIL_CHECK_D2_REUSED_TRACE_ID_ACROSS_LOTS:D2-LOT-2" in evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_full_a, "check_d2_per_lot_records": [_mk_d2_lot(1), _mk_d2_lot(2, readout2_evidence=_r2_dup_tr), _mk_d2_lot(3)]})["failures"], "G43_d2_reused_trace_id_across_lots_fails")
    # 16. D-1 float wash count (3.0 instead of strict int 3) inside unified receipt FAILS!
    _d1_fl_w = _mk_d1_unified(g43_base, arm_a_washes=3.0)
    chk("FAIL_CHECK_D1_UNIFIED_ASSAY_RECEIPT_FIELD_MISMATCH" in evaluate_gate43_cellgemma_guardrails_and_pilots({**g43_base, "check_d1_paired_assay_receipt": _d1_fl_w})["failures"], "G43_d1_float_wash_count_in_unified_receipt_fails")


    # ========================================================================
    # ADVERSARIAL REGRESSION SUITE (12 NEW TESTS -> 716/716 TOTAL!)
    # ========================================================================
    # --- GATE-40 (IIP-0062) A-0a Lumen Formation Schema, Missing-Lumen HOLD, & Timing-Arm Failures (3 tests) ---
    # 1. Identical viability/length/branching with missing lumen_formation HOLDS!
    _a0a_no_lum = [{k: v for k, v in r.items() if k != "day0_lumen_formation_7d_pct"} for r in a0a_reps_ok]
    _a0a_fit_nl = _sign_receipt({**a0a_fit_ok, "raw_replicates_sha256": sha256_bytes(canonical_json_bytes(_a0a_no_lum))})
    chk("HOLD_GATE_A0A_MISSING_LUMEN_FORMATION_DATA" in evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**a0a_ok, "a0a_donor_replicates_by_conc": _a0a_no_lum, "a0a_fit_artifact_receipt": _a0a_fit_nl})})["holds"], "G40_a0a_missing_lumen_formation_holds")
    # 2. Identical healthy viability/length/branching with failing Day-0 lumen_formation (82% < 90%) FAILS!
    _a0a_lum0_bad = [dict(r) for r in a0a_reps_ok]
    _a0a_lum0_bad[5] = {**_a0a_lum0_bad[5], "day0_lumen_formation_7d_pct": [81.7, 81.85, 82.0, 82.15, 82.3], "sprouting_7d_pct": [81.7, 81.85, 82.0, 82.15, 82.3]}
    _a0a_fit_l0 = _sign_receipt({**a0a_fit_ok, "raw_replicates_sha256": sha256_bytes(canonical_json_bytes(_a0a_lum0_bad))})
    chk("FAIL_GATE_A0A_SPROUTING_CEILING_EXCEEDS_DAY0_OR_DELAYED_DONOR_L95" in evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**a0a_ok, "sprouting_7d_pct_grid": [100.0, 99.0, 97.0, 96.0, 94.0, 82.0, 76.0], "a0a_donor_replicates_by_conc": _a0a_lum0_bad, "a0a_fit_artifact_receipt": _a0a_fit_l0})})["failures"], "G40_a0a_day0_lumen_below_90pct_fails")
    # 3. Identical healthy viability/length/branching with failing delayed lumen_formation (82% < 90%) FAILS!