{
 "about": {
  "generatedBy": "pipeline/sequence-toolkit/buffer_admissibility.py",
  "scriptSha256": "a6449a7f00d1ec02a1f2a271464a9a7d9752430f7e38e4aaf04144c89b50d028",
  "recordedOn": "2026-10-12",
  "oracle": "Independent Python restatement of the CSO bounds (10 October 2026) with free Mg2+ by bisection; Biopython 1.88 Tm_NN cross-check on every admitted buffer",
  "ruling": "docs/board/memos/2026-10-12-cso-sequence-stage.md, SCI-09",
  "tolerance": "admitted, rule and structure exact; monovalent_mM and freeMg_mM within 1e-9 mM",
  "python": "3.13.16",
  "biopython": "1.88"
 },
 "cases": [
  {
   "id": "plain-na",
   "note": "Na+ alone, the default buffer",
   "input": {
    "oligo_nM": 250,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 50.0,
    "freeMg_mM": 0,
    "structure": "computed",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "pcr-mg-dntp",
   "note": "A PCR buffer: Na+ 50, Mg2+ 1.5, dNTP 0.6 mM",
   "input": {
    "oligo_nM": 250,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 1.5,
    "dntp_mM": 0.6
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 50.0,
    "freeMg_mM": 0.9209579612775931,
    "structure": "computed",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "audit-na0-mg1-dntp2",
   "note": "The audit's buffer (SCI-09): dNTPs chelate the Mg2+, no monovalent",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 1,
    "dntp_mM": 2
   },
   "expected": {
    "admitted": false,
    "rule": "monovalent-floor",
    "monovalent_mM": 0.0,
    "freeMg_mM": 0.031309407425786556,
    "structure": "refused"
   }
  },
  {
   "id": "na-below-floor",
   "note": "Na+ 0.5 mM and no Mg2+: below the monovalent floor; the structure engine used to admit it",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0.5,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "monovalent-floor",
    "monovalent_mM": 0.5,
    "freeMg_mM": 0,
    "structure": "refused"
   }
  },
  {
   "id": "na-at-floor",
   "note": "Na+ 1 mM exactly: at the floor, admitted",
   "input": {
    "oligo_nM": 250,
    "na_mM": 1,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 1.0,
    "freeMg_mM": 0,
    "structure": "computed",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "mg-only",
   "note": "No Na+, Mg2+ 2 mM: free Mg2+ above its floor; positive sodium equivalent",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 2,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 0.0,
    "freeMg_mM": 2,
    "structure": "computed",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "mg-chelated-floor",
   "note": "No Na+, Mg2+ 2, dNTP 1.95 mM: free Mg2+ near its floor",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 2,
    "dntp_mM": 1.95
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 0.0,
    "freeMg_mM": 0.26666666666666666,
    "structure": "computed",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "mg-chelated-equal",
   "note": "No Na+, Mg2+ equal to dNTP 2 mM: free Mg2+ decides; no sodium equivalent",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 2,
    "dntp_mM": 2
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 0.0,
    "freeMg_mM": 0.2420695782710004,
    "structure": "withheld-no-sodium-equivalent",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "k-only",
   "note": "K+ 50 mM, no Na+: admitted; the structure model has no K+ term",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0,
    "k_mM": 50,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 50.0,
    "freeMg_mM": 0,
    "structure": "withheld-k-tris",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "k-with-na",
   "note": "Na+ 40 and K+ 10 mM",
   "input": {
    "oligo_nM": 250,
    "na_mM": 40,
    "k_mM": 10,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 50.0,
    "freeMg_mM": 0,
    "structure": "withheld-k-tris",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "tris-with-na",
   "note": "Na+ 50 and Tris 20 mM (Tris+/2 in [Mon+])",
   "input": {
    "oligo_nM": 250,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 20,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 60.0,
    "freeMg_mM": 0,
    "structure": "withheld-k-tris",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "tris-only-floor",
   "note": "Tris 1.5 mM alone: 0.75 mM monovalent, below the floor",
   "input": {
    "oligo_nM": 250,
    "na_mM": 0,
    "k_mM": 0,
    "tris_mM": 1.5,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "monovalent-floor",
    "monovalent_mM": 0.75,
    "freeMg_mM": 0,
    "structure": "refused"
   }
  },
  {
   "id": "mono-max",
   "note": "Na+ 2000 mM: at the ceiling, admitted",
   "input": {
    "oligo_nM": 250,
    "na_mM": 2000,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": true,
    "rule": null,
    "monovalent_mM": 2000.0,
    "freeMg_mM": 0,
    "structure": "computed",
    "biopythonTmFinite": true
   }
  },
  {
   "id": "mono-over",
   "note": "Na+ 1990 and K+ 20 mM: over the monovalent ceiling",
   "input": {
    "oligo_nM": 250,
    "na_mM": 1990,
    "k_mM": 20,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "monovalent-max",
    "monovalent_mM": 2010.0,
    "freeMg_mM": 0,
    "structure": "refused"
   }
  },
  {
   "id": "mg-over",
   "note": "Mg2+ over its ceiling",
   "input": {
    "oligo_nM": 250,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 1001,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "mg-max",
    "monovalent_mM": 50.0,
    "freeMg_mM": 1001,
    "structure": "refused"
   }
  },
  {
   "id": "dntp-over",
   "note": "dNTPs over their ceiling",
   "input": {
    "oligo_nM": 250,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 2,
    "dntp_mM": 101
   },
   "expected": {
    "admitted": false,
    "rule": "dntp-max",
    "monovalent_mM": 50.0,
    "freeMg_mM": 0.000673169439679288,
    "structure": "refused"
   }
  },
  {
   "id": "oligo-zero",
   "note": "A zero oligo concentration",
   "input": {
    "oligo_nM": 0,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "invalid:oligo_nM",
    "structure": "refused"
   }
  },
  {
   "id": "oligo-low",
   "note": "An oligo below the floor",
   "input": {
    "oligo_nM": 0.0005,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "oligo-min",
    "monovalent_mM": 50.0,
    "freeMg_mM": 0,
    "structure": "refused"
   }
  },
  {
   "id": "na-negative",
   "note": "A negative Na+",
   "input": {
    "oligo_nM": 250,
    "na_mM": -1,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": 0,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "invalid:na_mM",
    "structure": "refused"
   }
  },
  {
   "id": "mg-negative",
   "note": "A negative Mg2+",
   "input": {
    "oligo_nM": 250,
    "na_mM": 50,
    "k_mM": 0,
    "tris_mM": 0,
    "mg_mM": -0.5,
    "dntp_mM": 0
   },
   "expected": {
    "admitted": false,
    "rule": "invalid:mg_mM",
    "structure": "refused"
   }
  }
 ]
}
