docs/FOUNDRY-V1-3-CLEANROOM-BIOLOGICS-PROTOCOL.md
Use this file in any AI chat (paste-only or attachment-capable):
Pinned raw file: https://openislet.org/files/gen-eb955f8266035aba/docs/FOUNDRY-V1-3-CLEANROOM-BIOLOGICS-PROTOCOL.md · SHA-256: 9827aee26492fc25…
## 4. Exact Independent Alignment Specification for `IIP-0042` (`Gate 30-SHIELD-SPR` & `GATE-30` Protocol)
Both `data/protocols/iip0042_portfolio_and_trackb_side_contract_v0.8.0.json` (parsed via typed JSON schema checks) and `docs/GATE-30-PORTFOLIO-AND-TRACKB-CONTINGENCY-PROTOCOL.md` (checked separately on authored Markdown) are verified **independently** by `verify_iip0044_foundry_v1_3_biologics.py` (deleting any lead, analyte, control, register separation, or cytotoxicity rule from either file independently fails verification):
1. **Retire Stale `v1.3` Hold Wording:** Replace `"HOLD for v1.3 affinity maturation"` with **`"HOLD for post-SPR v1.4 affinity/selectivity maturation (yeast-display / combinatorial library)"`**.
2. **Concrete 2-Component Cocktail Identity & Complete 4-Analyte Coverage:** Name both registered cocktail legs explicitly — Component 1 `IsletSHIELD_QF09_pI2` and Component 2 `IsletSHIELD_Comp2_T006` — and require ALL four mandatory on-target SPR analytes (**`HLA-DQ2.5 + HIP11`**, **`HLA-DQ8-trans + HIP11`**, **`HLA-DQ2.2 + HIP11`**, and **`HLA-DQ8 + native WT InsB:9-23` [`SHLVEALYLVCGERG`]**) plus reagent QC on BOTH surfaces (deleting any one of the four mandatory analytes from either surface independently fails verification).
3. **Mandatory Component 1 & Component 2 Bench Controls & Separated `1JK8` / `WT InsB:9-23` / `6DFX` Register QC:**
- **Control 1 (Off-Target SPR/BLI Analytes — `7` Mandatory Controls, Batch-Linked, Each `replicates_n >= 3`):** Mandate BOTH Component 1 off-target look-alikes (`HLA-DQ2.5 + CLIP1`, `HLA-DQ2.5 + Self_IGKV2_EAED`, `HLA-DQ2.5 + cel_glutenin_L1`, `HLA-DQ8-trans + Cpep_Nterm_EAED`) AND Component 2 off-target analytes (`HLA-DQ8 + CLIP1`, `HLA-DQ8 + DQ8-glia-gamma1a`, `HLA-DQ8-trans + WT InsB:9-23`, where the cross-allele WT15 off-target row additionally enforces exact `peptide_sequence == "SHLVEALYLVCGERG"` and exact matching unpadded `peptide_reagent_lot_id` reconciled to validated `register_qc_records.native_wt_insb9_23_15aa` strictly BEFORE selectivity biological `FAIL` adjudication and batch-linkage credit).
- **Control 2 (Per-Mixture Quantitative SEC-MALS / DLS Monomer & 1:1 Co-Formulation Stability Screen):** Explicitly test the Component 2 homodimerization flag (`Protenix-v1 max iPTM 0.6691`) on `IsletSHIELD_Comp2_T006` alone, `IsletSHIELD_QF09_pI2` alone, and **each physical `1:1` co-formulation mixture (`qualified_coformulation_mixtures`)** prior to cellular blockade assays, enforcing **`comp1_monomer_pct >= 95.0%`**, **`comp2_monomer_pct >= 95.0%`**, **`cocktail_1to1_monomer_pct >= 95.0%`**, **`dls_pdi <= 0.15`**, and **`no_aggregates_or_precipitation == True`** reconciled against boolean QC flags both at the top level and per physical mixture record (`mixture_id`, exact `comp1_expression_batch_id` + `comp2_expression_batch_id`, `monomer_pct >= 95.0%`, `dls_pdi <= 0.15`, `no_aggregates_or_precipitation == True`, `qc_passed == True`). Biologically, out-of-spec protein material (`< 95.0%` monomer, `dls_pdi > 0.15`, or detected aggregates with consistent `qc_passed=False`) is an **unqualified material input** (`HOLD_INVALID_OR_MISSING_INPUT`, `failure_domain = None`, `physicochemical_out_of_spec_disposition = "HOLD_INVALID_OR_MISSING_INPUT_UNQUALIFIED_MATERIAL"`, diagnostic `PHYSICOCHEMICAL_OUT_OF_SPEC_MATERIAL_UNQUALIFIED_HOLD`), NOT biological target `FAIL`; missing/malformed SEC-MALS inputs, top-level overstatement relative to any mixture, or boolean `qc_passed=True` contradicting a failing measured value such as `1%` monomer emit distinct diagnostic `PHYSICOCHEMICAL_MISSING_OR_MALFORMED_INPUT_HOLD` (also `HOLD_INVALID_OR_MISSING_INPUT`, `failure_domain = None`). **Per-mixture donor material qualification binding:** EVERY donor row MUST declare its exact `cocktail_mixture_id` referencing a passing physical mixture record in `sec_mals_dls_monomer_coformulation.qualified_coformulation_mixtures` whose exact `(comp1_expression_batch_id, comp2_expression_batch_id)` lot pair matches the donor row's exact cocktail `expression_batch_ids` (donor material is matched to physical lot pair while `1:1` molar ratio remains a laboratory attestation when optional ratio fields are omitted) before its suppression or cytotoxicity outcomes contribute to `PASS`/`FAIL`, Track-B candidacy, or batch-linkage credit (crossed, missing, disjoint, or out-of-spec mixture lots exclude that donor to `HOLD_INVALID_OR_MISSING_INPUT` with zero donor credit while preserving valid dependency topology, immutable `N_roster`, and independent qualified SPR `FAIL`).
- **Control 3 (Parallel Comparator & Matched-Batch Separated Register-2 vs Register-3 Screen):** Synthesize and screen `IsletSHIELD_Comp2_T006` in parallel with `SHIELD2_QQ`, `R3_shv2_stk1`, `SH2_MP01`, `SH2_MP06`, and `SH2_MP08` using strict closed-schema per-comparator **`register_control_screens`** records covering BOTH mandatory register analytes on EVERY comparator construct: (a) mandatory primary native 15-aa `WT InsB:9-23` (`native_wt_insb9_23_15aa`, `SHLVEALYLVCGERG`, `P01308[33..47]`) with orthogonal Register-2 occupancy QC and exact matching `peptide_reagent_lot_id`, (b) **optional physical** 14-aa `PDB 1JK8` chain C crystal-matched `InsB:11-23+G` (`crystal_ref_1jk8_14aa`, `LVEALYLVCGERGG`) control (mandatory in reference-identity documentation, optional in `register_qc_records` and `register_control_screens` at runtime — omitting `crystal_ref_1jk8_14aa` OR setting JSON `null` both pass cleanly, while any non-null value triggers strict sequence/QC/batch validation and strict validation of `peptide_reagent_lot_id` whenever present), and (c) mandatory 12-aa engineered `PDB 6DFX p8E9E` (`engineered_6dfx_p8e9e_12aa`, `VEELYLVAGEEG`) Register-3 comparator with distinct validated `peptide_reagent_lot_id` (cannot reuse WT15 lot), construct-bound `expression_batch_ids`, per-condition `replicates_n >= 3`, unique `evidence_record_id`, **AND a non-empty shared comparator-batch intersection evaluated across BOTH `WT15` and `6DFX` (`len(wt15_batches & dfx_batches) >= 1` matched comparator protein material per required comparator)** before granting complete-comparator credit or Track-B candidacy (disjoint WT15 vs 6DFX batch conditions confound the register contrast and fail closed to `HOLD_INVALID_OR_MISSING_INPUT` while preserving independent qualified SPR `FAIL`).
4. **Full Typed `Gate 30-SHIELD-SPR` Evidence Contract, Mandatory Hash-Pinned Pre-Registered Donor Roster (Raw-Set Pre-Dedup Reconciliation), Cluster-Conservative Distribution-Free Clopper–Pearson Suppression (Narrowed Strictly to Simple Random/Consecutive Cohorts), Typed Contradiction-Guarded `GY-018` Justification, Two-Pass Canonical Key Uniqueness, Construct-Bound Batches, Exact `Decimal` `deff == 1.0`, Fixed-Roster Bonferroni Cytotoxicity `FWER <= 0.05`, Machine-Checked `trackb_shield_trigger_state` & Unified Fail-First Precedence (Character-for-Character Identical Across `77/77` Shared AST Symbols in `verify_iip0044` and `verify_iip0042`):**
- **Pre-Adjudication Input Integrity (Precedes Decision Precedence):** Non-dict payloads or ANY non-finite (`NaN`/`Inf`) or overflowing numeric anywhere in the input tree raise `ValueError` BEFORE decision precedence: strict JSON decoding (`load_strict_json_text`) parses floats with `Decimal`, checks `Decimal(raw_token).copy_abs() > Decimal("1e300")` on raw JSON decimal tokens (rejecting `"1.00000000000000001e300"` at parse time), and **preserves exact `Decimal` precision on `design_effect_deff` without binary64 rounding** (rejecting raw JSON `1.00000000000000001` and `0.99999999999999999` while accepting `1.0` and `1`), while direct Python callables enforce IEEE-754 binary64 `abs(x) > 1e300` for `float` and exact `abs(x) > 10**300` for `int`.
- **Mandatory Cryptographically Hash-Pinned Outcome-Blind Pre-Registered Donor Roster & Fixed-Horizon Analysis Plan (Checked on ALL Raw Submitted/Excluded Donor IDs BEFORE Deduplication) & 100%-Measured Cytotoxicity `PASS`:** Authorization-grade overall `PASS` or donor-based `FAIL` REQUIRES a mandatory closed-schema `preregistered_donor_family_roster` block (NEVER optional and NEVER defaulting to submitted row count) containing unpadded `roster_id`, ISO-8601 UTC `preregistration_timestamp_utc`, `outcome_blind_lock_attestation == True`, **`single_look_fixed_horizon_plan_locked == True`**, **`planned_analysis_looks == 1`**, `>= 3` unique unpadded canonical T1D `roster_donor_ids` (`>= 9` required for confirmatory suppression `PASS`), `planned_t1d_donor_family_n == len(roster_donor_ids)`, **fixed per-donor cytotoxicity sample size `predeclared_per_donor_unit_count_n >= 60` or exact per-donor map `predeclared_per_donor_unit_counts`**, and exact lowercase 64-hex `roster_sha256` over canonical sorted compact UTF-8 JSON committing **the full fixed-horizon plan `{planned_analysis_looks, predeclared_per_donor_unit_counts, preregistration_timestamp_utc, roster_donor_ids, roster_id, single_look_fixed_horizon_plan_locked[, predeclared_per_donor_unit_count_n]}`**. 100% of `roster_donor_ids` MUST be reconciled on ALL raw submitted donor rows (including duplicated and malformed rows) plus optional documented pre-assay `excluded_donor_records` **BEFORE deduplication or quarantine filtering**, AND every donor row's `raw_independent_units_n`, `apc_cytotoxicity_n_eff`, and `gy018_independence_justification.predeclared_per_donor_unit_count_n` MUST match that donor's hash-pinned pre-committed sample size `N` (so reusing the same `roster_sha256` from `N=66` while taking an unauthorized second look at `17/170`, mutating `N`, or declaring `planned_analysis_looks > 1` immediately sets `authorization_grade_fwer_bound_valid = False` and fails closed to `HOLD_INVALID_OR_MISSING_INPUT`). Missing, tampered, multi-look, sample-size-mismatched, or incompletely reconciled rosters set `authorization_grade_fwer_bound_valid = False` and fail closed to non-authorizing `HOLD_INVALID_OR_MISSING_INPUT` for donor adjudication (NEVER authorizing overall `PASS` or donor-based `FAIL`, while independent valid non-donor SPR failures remain fail-first `FAIL` with `failure_domain = "INDEPENDENT_NON_DONOR_SPR"`, whereas out-of-spec physicochemical SEC-MALS/DLS measurements hold as unqualified material inputs with `failure_domain = None`). Confirmatory cytotoxicity `PASS` additionally requires **100% measured valid cytotoxicity evidence across EVERY rostered donor (`0` pre-assay exclusions; any documented pre-assay exclusion withholds confirmatory `PASS` to `HOLD` while keeping full `N_roster` Bonferroni `FAIL` active)**. Local JSON replay verifies internal cryptographic integrity and timestamps only (`external_preregistration_custody_required = True`); exact distribution-free fixed-horizon `FWER <= 0.05` Boole bounds apply strictly to the fixed-roster, fixed-per-donor-`N`, single-look donor cytotoxicity family (`fwer_bound_scope = "FIXED_ROSTER_DONOR_CYTOTOXICITY_FAMILY_ONLY_NOT_UNION_WITH_SPR_OR_SUPPRESSION"`, NOT the union with SPR or suppression) conditional on independent external outcome-blind custody/time-stamping of the **full analysis plan** prior to assay readouts.
- **Cluster-Conservative Distribution-Free Exact Clopper–Pearson Suppression Inference (`suppression_student_t_authorizing = False`), Retained Donor Batch/Run Topology, Explicit Donor/Cluster Probability Assumptions, Assay Acceptance Range `[-1000.0, 100.0]%` & Signed Non-Inverted Diagnostics:** Replaces Student-t authorization completely with exact finite-sample calibrated Clopper–Pearson responder-proportion inference defined over the **HLA-DQ-eligible (`HLA-DQ2.5`, `HLA-DQ8`, `HLA-DQ8-trans`, or `HLA-DQ2.2`) T1D donor sampling frame**, fixed `N_roster`, AND expression-batch connected components, assay-run clusters, and joint `(batch U run)` connected components (`eff_L95_CP = min(donor, batch-cluster, run-cluster, joint-cluster)`), paired with mandatory closed-schema `donor_sampling_and_independence_design` and per-donor unpadded `assay_run_id` (estimand `p_resp = P(donor_suppression_pct >= 70.0%)`, where every excluded/missing/non-evaluable rostered donor counts as non-responder `Y_i = 0`). **Retained batch/run dependency topology:** every submitted donor's syntactically valid `expression_batch_ids` and `assay_run_id` edges are retained in the Union-Find dependency graph independently of unrelated per-donor optional APC cytotoxicity CI or outcome failures (so disqualifying a bridge donor never splits a connected cluster into singletons; corrupted/missing/conflicted donor batch/run topology sets `donor_topology_complete_for_suppression = False` and withholds suppression inference to `HOLD_INVALID_OR_MISSING_INPUT` while preserving independent SPR `FAIL` and fixed-roster Bonferroni cytotoxicity `FAIL`). **Explicit cluster probability condition & descriptive-only U95 scope:** for each independent connected component `C_j`, the cluster-level all-positive event probability `P(all donors in C_j meet threshold)` is bounded above by the applicable single-donor marginal probability `p_donor` **only** across independent components with non-informative cluster sizes and identical marginal response distributions across assay conditions; informative cluster sizes or systematically differing batch/run assay conditions remain external sampling and laboratory QA assumptions not verified by ID graph topology alone. Only one-sided lower bounds (`L95_CP`) drive `PASS`/`FAIL` adjudication; `suppression_responder_u95_clopper_pearson_pct` carries `suppression_responder_u95_scope = "DESCRIPTIVE_DIAGNOSTIC_ONLY_NO_MARGINAL_UPPER_COVERAGE_GUARANTEE"` (no general marginal upper-coverage guarantee under cluster-all-positive events). **Narrowed sampling-design authorization:** unweighted Clopper–Pearson suppression `PASS` and unweighted population-rate suppression `FAIL` are authorized **strictly** for simple random or consecutive independent target-population cohorts (`sampling_design_class == "SIMPLE_RANDOM_OR_CONSECUTIVE_INDEPENDENT_T1D_COHORT"`); recognized stratified cohorts (`sampling_design_class == "STRATIFIED_INDEPENDENT_T1D_HLA_DQ_COHORT"`) set `suppression_inference_authorized_by_sampling_design = False` and route population suppression adjudication cleanly to non-authorizing `HOLD` with reason code **`STRATIFIED_COHORT_REQUIRES_TARGET_WEIGHTED_SUPPRESSION_ESTIMATOR`** (neither certifying unweighted `PASS` nor firing unweighted suppression `FAIL`, while preserving independent non-donor SPR `FAIL`, fixed-roster Bonferroni cytotoxicity `FAIL`, and anti-enhancement `HOLD`; legacy `PROSPECTIVE_INDEPENDENT_T1D_DONOR_COHORT` and unrecognized/quota classes fail closed to `HOLD_INVALID_OR_MISSING_INPUT`). Confirmatory `PASS` requires `sampling_design_class == "SIMPLE_RANDOM_OR_CONSECUTIVE_INDEPENDENT_T1D_COHORT"` AND `donor_topology_complete_for_suppression == True` AND `eff_L95_CP(k_ge_70) >= 70.0%` (**requiring `>= 9` disjoint batch/run clusters**: `9/9` disjoint clusters gives `71.687116% >= 70.0%` with exact null false-`PASS` `0.70^9 = 0.040354 <= 0.05`, whereas sharing batches or runs across donors collapses cluster-level `L95_CP` -> `HOLD`, `N = 3` `[80, 80, 80]` gives `36.840315% -> HOLD`, `N = 8` gives `68.765602% -> HOLD`, `8/9` gives `57.086445% -> HOLD`) **AND** suppression within the **assay acceptance range `[-1000.0, 100.0]%`** (extreme finite outliers such as `-1e200` fail closed to `HOLD_INVALID_OR_MISSING_INPUT` without `OverflowError`) **AND** hard anti-enhancement guard `min_donor_suppression >= 0.0%` (valid negative enhancement values in `[-1000.0, 0.0)%` such as `-5.0%` route to `HOLD`) **AND** cohort mean `>= 70.0%`. Biological suppression `FAIL` triggers strictly when `suppression_inference_authorized_by_sampling_design == True` and `donor_topology_complete_for_suppression == True` and cluster-conservative `eff_L95_CP(k_lt_40) > 60.0%` (exact null false-`FAIL <= 0.05` for all `N_roster`). Overflow-immune signed tabulated Student-t bounds (`df = 1..30` + Cornish–Fisher `df > 30`) on `[-1000.0, 100.0]%` guarantee non-inverted `L <= mean <= U` on negative observations (e.g., nine `-5.0%` values yield `[-5.0%, -5.0%]`) and remain strictly non-authorizing descriptive diagnostics.