"delayed_sprout_length_7d_pct": [100.0] * 5, "delayed_branching_7d_pct": [100.0] * 5, "delayed_lumen_formation_7d_pct": [100.0] * 5, } _a0a_fit_sn = _sign_receipt({**a0a_fit_ok, "raw_replicates_sha256": sha256_bytes(canonical_json_bytes(_a0a_reps_selfnorm))}) chk(evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**a0a_ok, "a0a_donor_replicates_by_conc": _a0a_reps_selfnorm, "a0a_fit_artifact_receipt": _a0a_fit_sn})})["verdict"] == "PASS_ROUTE_FREE_A0A_ONLY", "G40_a0a_exact_self_normalized_0uM_vehicle_passes") # 4. A-0a nominal margin 1.60x (>= 1.5x) eroded below 1.5x once dialysis fu uncertainty is propagated FAILS! _a0a_wide_fu = { "fibrosis_efficacy_assay": {**a0a_ok["a0a_matrix_fu_by_assay"]["fibrosis_efficacy_assay"], "dialysis_fu_replicates": [0.32, 0.37, 0.42, 0.47, 0.52]}, "vascular_viability_assay": {**a0a_ok["a0a_matrix_fu_by_assay"]["vascular_viability_assay"], "dialysis_fu_replicates": [0.38, 0.44, 0.50, 0.56, 0.62]}, } _a0a_fit_m16 = _sign_receipt({**a0a_fit_ok, "cc10_free_7d_l95_uM": 120.0, "c_sprout_max_free_7d_l95_uM": 120.0}) chk("FAIL_GATE_A0A_FU_PROPAGATED_MARGIN_BELOW_1P5X" in evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**a0a_ok, "cc10_free_7d_l95_uM": 120.0, "c_sprout_max_free_7d_l95_uM": 120.0, "c_upper_provisional_7d_l95_uM": 120.0, "a0a_matrix_fu_by_assay": _a0a_wide_fu, "a0a_fit_artifact_receipt": _a0a_fit_m16})})["failures"], "G40_a0a_fu_propagated_margin_below_1p5x_fails") # --- GATE-41 (IIP-0063) B-0a Skewed Efficacy HOLD & B-2b Quantitative Upstream Analytical Row Digest Binding (2 tests) --- # 5. B-0a skewed efficacy replicates (high mean=68%, high Student-t LCB > 50%, yet severely skewed failing Shapiro-Wilk/Q-Q) -> HOLDS! _b0a_e_skew = [dict(r) for r in b0a_e_reps_ok] _sk_vals = [67.0, 67.1, 67.15, 67.2, 67.25, 72.3] _b0a_e_skew[3] = {**_b0a_e_skew[3], "iec_ibmir_marker_suppression_pct": _sk_vals, "raw_unit_measurements": {**_b0a_e_skew[3]["raw_unit_measurements"], "iec_ibmir_marker_suppression_pct": _mk_b0a_raw_ratio(_sk_vals, _b0a_e_skew[3]["matched_vehicle_record_id"], 250.0, is_inhib=True)}} _b0a_an_sk = _sign_receipt({**b0a_an_ok, "raw_efficacy_replicates_sha256": sha256_bytes(canonical_json_bytes(_b0a_e_skew))}) _r_esk = evaluate_gate41_deucravacitinib_tyk2({"phase": "ROUTE_FREE_B0A", "b0a_evidence": _sign_receipt({**b0a_ok, "efficacy_replicates_by_conc": _b0a_e_skew, "b0a_analysis_receipt": _b0a_an_sk})}) chk(_r_esk["verdict"] == "HOLD" and "HOLD_GATE_B0A_NONNORMAL_OR_SKEWED_EFFICACY_REPLICATES:3:iec_ibmir_marker_suppression_pct" in _r_esk["holds"], "G41_b0a_skewed_otherwise_passing_efficacy_holds") # 6. B-2b-bench keeping identical sample_ids and hours while altering one concentration value (contradicting B-1/B-2 raw_analytical_row_sha256!) -> HOLDS! _b2b_tamp = _mk_r8_b2b_replicates() _b2b_tamp["timepoint_replicate_records"][0]["local_parent_total_replicates_nM"][0] = 109.5 _r_btamp = evaluate_gate41_deucravacitinib_tyk2({**g41_bench, "b2b_bench_evidence": _sign_receipt({**b2bb_y, **_b2b_tamp})}) chk(_r_btamp["verdict"] == "HOLD" and "HOLD_GATE_B2B_BENCH_UPSTREAM_ANALYTICAL_ROW_DIGEST_MISMATCH" in _r_btamp["holds"], "G41_b2b_tampered_value_vs_upstream_analytical_digest_holds") # --- GATE-42 (IIP-0064) Clean n=3 EXACT_TWO_SIDED_SIGN_FLIP Descriptive Pilot (1 test) --- # 7. Clean n=3 C-1 pilot labeled EXACT_TWO_SIDED_SIGN_FLIP cleanly returns DESCRIPTIVE_PILOT_ONLY_NON_ADVANCING! _c1_prereg_p3_sf = _sign_receipt({**c1_prereg_p3, "statistical_test_method": "EXACT_TWO_SIDED_SIGN_FLIP"}) _c1_p3_sf = _sign_receipt({**c1_p3, "statistical_test_method": "EXACT_TWO_SIDED_SIGN_FLIP", "prerequisite_receipt_sha256s": {**c1_p3["prerequisite_receipt_sha256s"], "C-1-PREREGISTRATION": _c1_prereg_p3_sf["receipt_sha256"]}}) _r_p3_sf = evaluate_gate42_gy032_channel_c_screen({**_g42_p3_only, "c1_preregistered_plan_receipt": _c1_prereg_p3_sf, "c1_evidence": _c1_p3_sf}) chk(_r_p3_sf["verdict"] == "DESCRIPTIVE_PILOT_ONLY_NON_ADVANCING" and not _r_p3_sf["failures"], "G42_c1_clean_n3_exact_sign_flip_pilot_returns_descriptive") # --- GATE-43 (IIP-0065) Check D-1 Arm-B Withdrawal Elevated Basal / Lost Glucose Responsiveness (1 test) --- # 8. Check D-1 healthy retained-T3 control (SI=4.2/4.8) + Arm-B preserved stimulated output yet elevated basal collapsing SI_b to 1.4 -> HOLDS! _d1_armb_lost = (lambda _b: {**_b, "record_sha256": sha256_bytes(canonical_json_bytes(_b))})({ "lot_id": "D1-LOT-001", "plate_id": "D1-PLATE-01", "sibling_aliquot_pair_id": "D1-SIBPAIR-01", "arm_a_acquired_at_utc": "2026-10-03T12:30:00Z", "arm_b_acquired_at_utc": "2026-10-03T12:35:00Z", "insulin_normalization_basis": "PER_IEQ_PER_HOUR", "raw_trace_sha256": "6" * 64, "arm_a_basal_40": 0.40, "arm_a_stim_40": 1.68, "arm_b_basal_40": 1.17, "arm_b_stim_40": 1.64, "arm_a_basal_100": 0.45, "arm_a_stim_100": 2.16, "arm_b_basal_100": 1.51, "arm_b_stim_100": 2.115, "arm_a_si_40": 4.2, "arm_b_si_40": 1.4, "arm_a_si_100": 4.8, "arm_b_si_100": 1.4, }) _g43_blost = {**g43_base, "check_d1_paired_gsis_record": _d1_armb_lost} _g43_blost["check_d1_paired_assay_receipt"] = _mk_d1_unified(_g43_blost) _r_blost = evaluate_gate43_cellgemma_guardrails_and_pilots(_g43_blost) chk(_r_blost["verdict"] == "HOLD" and "HOLD_CHECK_D1_WITHDRAWAL_ARM_LOSS_OF_GLUCOSE_RESPONSIVENESS" in _r_blost["holds"], "G43_d1_arm_b_elevated_basal_lost_responsiveness_holds") # --- GATE-40 (IIP-0062) f_u-Uncertainty-Adjusted Operative Limits Carry-Forward into A-0b & A-1 (2 tests) --- # 1. Wide dialysis f_u uncertainty shifts operative window from [75, 260] -> ~[86.1, 222.8] (with 14d ceiling 220*0.857=188.5): # A-0a passes (>= 1.5x margin), while A-0b exposure [80, 195] (inside unadjusted [75, 220], outside adjusted [86.1, 188.5]) FAILS both trough & peak! _a0a_wide_carry_mfu = { "fibrosis_efficacy_assay": { **a0a_ok["a0a_matrix_fu_by_assay"]["fibrosis_efficacy_assay"], "dialysis_fu_replicates": [0.36, 0.39, 0.42, 0.45, 0.48], # mean=0.42, u95~0.482 -> factor ~1.148 -> ic50_op ~86.1 uM }, "vascular_viability_assay": { **a0a_ok["a0a_matrix_fu_by_assay"]["vascular_viability_assay"], "dialysis_fu_replicates": [0.43, 0.465, 0.50, 0.535, 0.57], # mean=0.50, l95~0.428 -> factor ~0.857 -> c7d_op ~222.8, c14d_op ~188.5 uM }, } _a0a_wc = _sign_receipt({**a0a_ok, "a0a_matrix_fu_by_assay": _a0a_wide_carry_mfu}) _r_a0a_wc = evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _a0a_wc}) _a0b_wc_bad = _sign_receipt({ **a0b_y, "parent_receipt_sha256": _a0a_wc["receipt_sha256"], "sustained_free_parent_lower_uM": 80.0, "peak_free_parent_u95_uM": 195.0, "a0b_local_exposure_timepoints": _mk_pfd_tp_rows( ((6.0, 192.0), (24.0, 180.0), (72.0, 150.0), (144.0, 130.0), (216.0, 110.0), (288.0, 95.0), (336.0, 82.0)), coat_a["coating_lot_id"], "A0BWC", ), }) _r_a0b_wc = evaluate_gate40_pirfenidone_h4({**g40_ok, "a0a_evidence": _a0a_wc, "a0b_evidence": _a0b_wc_bad}) chk( _r_a0a_wc["verdict"] == "PASS_ROUTE_FREE_A0A_ONLY" and _r_a0a_wc["a0a_operative_limits_uM"]["ic50_u95_fu_adjusted_uM"] > 85.0 and "FAIL_GATE_A0B_SUSTAINED_FREE_BELOW_IC50_U95" in _r_a0b_wc["failures"] and "FAIL_GATE_A0B_PEAK_FREE_NOT_BELOW_ALL4_CEILINGS" in _r_a0b_wc["failures"], "G40_a0b_rejects_unadjusted_window_outside_fu_adjusted_bounds", ) # 2. Same f_u-adjusted operative bounds enforced in A-1 (d14=80 < 86.1, d1=192 >= 188.5) AND understated already-adjusted flag FAILS! _a1b_wc_bad = _sign_receipt({ **a1b_y, "parent_receipt_sha256": _a0b_wc_bad["receipt_sha256"], "day1_intact_parent_free_uM": 192.0, "day14_intact_parent_free_uM": 80.0, "a1_local_free_parent_timepoints": _mk_pfd_tp_rows( ((6.0, 190.0), (24.0, 180.0), (72.0, 150.0), (144.0, 130.0), (216.0, 110.0), (288.0, 95.0), (336.0, 81.0), (600.0, 20.0), (840.0, 3.0)), coat_a["coating_lot_id"], "A1WC", ), }) _r_a1_wc = evaluate_gate40_pirfenidone_h4({**g40_ok, "a0a_evidence": _a0a_wc, "a0b_evidence": _a0b_wc_bad, "a1_bench_evidence": _a1b_wc_bad}) _r_a0a_spoof_adj = evaluate_gate40_pirfenidone_h4({"phase": "ROUTE_FREE_A0A", "a0a_evidence": _sign_receipt({**_a0a_wc, "a0a_limits_already_fu_adjusted": True})}) chk( "FAIL_GATE_A1_BENCH_DAY14_INTACT_PARENT_BELOW_IC50_U95" in _r_a1_wc["failures"] and "FAIL_GATE_A1_BENCH_DAY1_INTACT_PARENT_EXCEEDS_CEILING" in _r_a1_wc["failures"] and "FAIL_GATE_A0A_CLAIMED_FU_ADJUSTED_LIMITS_UNDERSTATED" in _r_a0a_spoof_adj["failures"], "G40_a1_rejects_unadjusted_window_and_spoofed_fu_adjusted_flag", ) # --- GATE-41 (IIP-0063) B-0a-exact Biological Unit Denominator & Block-Level Aggregation (1 test) --- # 3. Anonymous raw list in B-0a-exact HOLDS for missing biological unit denominator; unaggregated block mismatch FAILS! _b0a_ex_anon = _sign_receipt({**b0a_ex_y, "cassette_retention_replicates_by_conc": [[99.6, 99.8, 100.0, 100.2, 100.4] for _ in range(6)]}) _ex0_ba = b0a_ex_y["cassette_retention_replicates_by_conc"][0] _ex0_ba_tech = [[80.0, 80.0, 80.0]] + _ex0_ba["technical_replicates_per_unit_pct"][1:] _b0a_ex_bad_agg = _sign_receipt({ **b0a_ex_y, "cassette_retention_replicates_by_conc": [ { **_ex0_ba, "technical_replicates_per_unit_pct": _ex0_ba_tech, "raw_unit_measurements": { **_ex0_ba["raw_unit_measurements"], "treated_by_unit_tech": [[800.0, 804.0, 796.0]] + _ex0_ba["raw_unit_measurements"]["treated_by_unit_tech"][1:], }, }, *b0a_ex_y["cassette_retention_replicates_by_conc"][1:], ], }) chk( "HOLD_GATE_B0A_EXACT_MISSING_BIOLOGICAL_UNIT_DENOMINATOR" in evaluate_gate41_deucravacitinib_tyk2({**g41_ok, "b0a_exact_evidence": _b0a_ex_anon})["holds"] and "FAIL_GATE_B0A_EXACT_BLOCK_AGGREGATION_MISMATCH:0:B0AEX-BLK-1" in evaluate_gate41_deucravacitinib_tyk2({**g41_ok, "b0a_exact_evidence": _b0a_ex_bad_agg})["failures"], "G41_b0a_exact_biological_unit_denominator_and_block_aggregation", ) # --- GATE-42 (IIP-0064) C-3-NK Specimen Binding, Exact Fraction Casp9, & Common Family Acquisition (3 tests) --- # 4. C-3-NK Readout-3B kinetic trace carrying an unrelated specimen_id FAILS; missing provenance HOLDS! _r3b_unlinked = _mk_r8_readout3b(include_sirpa_low=True, specimen_id="SPEC-UNRELATED-MATERIAL", specimen_lot_id=ly, intervention_cohort_id=c1_cohort_y) _r3b_no_prov = _mk_r8_readout3b(include_sirpa_low=True) chk( "FAIL_GATE_C3_NK_READOUT3B_SPECIMEN_LOT_OR_COHORT_MISMATCH" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c3_nk_evidence": _sign_receipt({**c3_nk_y, "readout3b_evidence": _r3b_unlinked})})["failures"] and "HOLD_GATE_C3_NK_READOUT3B_MISSING_SPECIMEN_PROVENANCE" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c3_nk_evidence": _sign_receipt({**c3_nk_y, "readout3b_evidence": _r3b_no_prov})})["holds"], "G42_c3_nk_specimen_provenance_and_kinetic_trace_binding", ) # 5. Exact Fraction sibling caspase-9 catches float64-colliding decimal string mismatch ("49.0000000000000001" vs 49.0)! _c1_n_f64_mm = { **c1_norm_6, "all_five_arms_paired_data": { **c1_norm_6["all_five_arms_paired_data"], tg_dual: { **c1_norm_6["all_five_arms_paired_data"][tg_dual], "casp9_treated_raw_by_block": [f"{c1_norm_6['casp9_treated_raw_by_block'][0]:.1f}000000000000001", *c1_norm_6["casp9_treated_raw_by_block"][1:]], }, }, } chk( float(f"{c1_norm_6['casp9_treated_raw_by_block'][0]:.1f}000000000000001") == float(c1_norm_6["casp9_treated_raw_by_block"][0]) and "FAIL_GATE_C1_NORMOXIA_ACTIVE_ARM_MISMATCH_WITH_5ARM_TABLE" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _sign_receipt({**c1_y, "c1_normoxia": _c1_n_f64_mm})})["failures"], "G42_c1_exact_fraction_casp9_catches_float64_collision", ) # 6. C-1 common producer family acquisition record & preregistered batch/arm-order enforcement! _c1_no_cacq = _sign_receipt({**c1_y, "c1_common_family_acquisition_record": None}) _c1_bad_batch = _sign_receipt({**c1_y, "c1_normoxia": {**c1_norm_6, "differentiation_batch_ids": ["WRONG-BAT-1", *c1_norm_6["differentiation_batch_ids"][1:]]}}) _c1_bad_cacq_sha = _sign_receipt({**c1_y, "c1_common_family_acquisition_record": {**c1_common_acq_6, "common_family_acquisition_sha256": "0" * 64}}) chk( "HOLD_GATE_C1_MISSING_COMMON_FAMILY_ACQUISITION_RECORD" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _c1_no_cacq})["holds"] and "FAIL_GATE_C1_NORMOXIA_BATCH_OR_ARM_ORDER_MISMATCH_PREREG" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _c1_bad_batch})["failures"] and "FAIL_GATE_C1_COMMON_FAMILY_ACQUISITION_MISMATCH" in evaluate_gate42_gy032_channel_c_screen({**g42_ok, "c1_evidence": _c1_bad_cacq_sha})["failures"] and evaluate_gate42_gy032_channel_c_screen(g42_ok)["c1_common_family_acquisition_sha256"] == c1_common_acq_6["common_family_acquisition_sha256"], "G42_c1_common_family_acquisition_and_batch_allocation_enforced", ) # --- GATE-43 (IIP-0065) Check D-1 Recomputed SI Responsiveness Boundary (2 tests) --- # 7. Computed stim/basal = 1.96 with reported SI = 2.00 (within 0.05 reconciliation tolerance) HOLDS on BOTH Arm A and Arm B! _d1_196_a = (lambda _b: {**_b, "record_sha256": sha256_bytes(canonical_json_bytes(_b))})({ "lot_id": "D1-LOT-001", "plate_id": "D1-PLATE-01", "sibling_aliquot_pair_id": "D1-SIBPAIR-01", "arm_a_acquired_at_utc": "2026-10-03T12:30:00Z", "arm_b_acquired_at_utc": "2026-10-03T12:35:00Z", "insulin_normalization_basis": "PER_IEQ_PER_HOUR", "raw_trace_sha256": "6" * 64, "arm_a_basal_40": 1.00, "arm_a_stim_40": 1.96, "arm_b_basal_40": 1.00, "arm_b_stim_40": 2.20, "arm_a_basal_100": 1.00, "arm_a_stim_100": 2.20, "arm_b_basal_100": 1.00, "arm_b_stim_100": 2.20, "arm_a_si_40": 2.00, "arm_b_si_40": 2.20, "arm_a_si_100": 2.20, "arm_b_si_100": 2.20, }) _d1_196_b = (lambda _b: {**_b, "record_sha256": sha256_bytes(canonical_json_bytes(_b))})({ "lot_id": "D1-LOT-001", "plate_id": "D1-PLATE-01", "sibling_aliquot_pair_id": "D1-SIBPAIR-01", "arm_a_acquired_at_utc": "2026-10-03T12:30:00Z", "arm_b_acquired_at_utc": "2026-10-03T12:35:00Z", "insulin_normalization_basis": "PER_IEQ_PER_HOUR", "raw_trace_sha256": "6" * 64, "arm_a_basal_40": 1.00, "arm_a_stim_40": 2.20, "arm_b_basal_40": 1.00, "arm_b_stim_40": 1.96, "arm_a_basal_100": 1.00, "arm_a_stim_100": 2.20, "arm_b_basal_100": 1.00, "arm_b_stim_100": 2.20, "arm_a_si_40": 2.20, "arm_b_si_40": 2.00, "arm_a_si_100": 2.20, "arm_b_si_100": 2.20, }) _g43_196a = {**g43_base, "check_d1_paired_gsis_record": _d1_196_a}; _g43_196a["check_d1_paired_assay_receipt"] = _mk_d1_unified(_g43_196a) _g43_196b = {**g43_base, "check_d1_paired_gsis_record": _d1_196_b}; _g43_196b["check_d1_paired_assay_receipt"] = _mk_d1_unified(_g43_196b) _r_196a = evaluate_gate43_cellgemma_guardrails_and_pilots(_g43_196a) _r_196b = evaluate_gate43_cellgemma_guardrails_and_pilots(_g43_196b) chk( _r_196a["verdict"] == "HOLD" and "HOLD_CHECK_D1_UNRESPONSIVE_RETAINED_T3_CONTROL" in _r_196a["holds"] and not _r_196a["failures"] and _r_196b["verdict"] == "HOLD" and "HOLD_CHECK_D1_WITHDRAWAL_ARM_LOSS_OF_GLUCOSE_RESPONSIVENESS" in _r_196b["holds"] and not _r_196b["failures"] and _r_196b["release_authorizing"] is False and _r_196b["adoption_authority"] is False and _r_196b["gy037_warn_retained"] is True, "G43_d1_recomputed_si_1p96_with_reported_2p00_holds", ) # 8. Exact computed stim/basal == 2.00 with reported SI == 2.00 clears responsiveness check with all authority flags False! _d1_200 = (lambda _b: {**_b, "record_sha256": sha256_bytes(canonical_json_bytes(_b))})({ "lot_id": "D1-LOT-001", "plate_id": "D1-PLATE-01", "sibling_aliquot_pair_id": "D1-SIBPAIR-01", "arm_a_acquired_at_utc": "2026-10-03T12:30:00Z", "arm_b_acquired_at_utc": "2026-10-03T12:35:00Z", "insulin_normalization_basis": "PER_IEQ_PER_HOUR", "raw_trace_sha256": "6" * 64, "arm_a_basal_40": 1.00, "arm_a_stim_40": 2.00, "arm_b_basal_40": 1.00, "arm_b_stim_40": 2.00, "arm_a_basal_100": 1.00, "arm_a_stim_100": 2.00, "arm_b_basal_100": 1.00, "arm_b_stim_100": 2.00, "arm_a_si_40": 2.00, "arm_b_si_40": 2.00, "arm_a_si_100": 2.00, "arm_b_si_100": 2.00, }) _g43_200 = {**g43_base, "check_d1_paired_gsis_record": _d1_200}; _g43_200["check_d1_paired_assay_receipt"] = _mk_d1_unified(_g43_200) _r_200 = evaluate_gate43_cellgemma_guardrails_and_pilots(_g43_200) chk( _r_200["verdict"] == "PASS_DESCRIPTIVE_PILOT_ZERO_ODDS_GY037_WARN_RETAINED" and not _r_200["failures"] and not _r_200["holds"] and _r_200["release_authorizing"] is False and _r_200["adoption_authority"] is False and _r_200["live_ledger_authenticated"] is False and _r_200["gy037_revocation_eligible"] is False and _r_200["gy037_warn_retained"] is True, "G43_d1_recomputed_si_exact_2p00_passes_descriptive_only", ) # --- GATE-40 (IIP-0062) Unified Recomputed Dialysis f_u Mean & Separate Efficacy-Culture Viability (3 tests) --- # 1. Low f_u disagreement (recomputed m_mu=0.020 vs submitted measured_fu_mean=0.029 -> diff 0.009, 1.45x inflation!) FAILS! _a0a_low_fu_inf = { **a0a_ok["a0a_matrix_fu_by_assay"], "vascular_viability_assay": { "matrix_id": "human_iec_sprouting_media", "nominal_conc_uM_grid": [round(x / 0.029, 4) for x in (0.0, 20.0, 40.0, 75.0, 150.0, 260.0, 500.0)], "dialysis_fu_replicates": [0.0195, 0.0198, 0.0200, 0.0202, 0.0205], "measured_fu_mean": 0.029,