{
 "about": "recipe-table 2.0.0: each component's mass or volume for a final volume, the diluent, the per-line refusals and the two recipe refusals. Inputs are decimal strings in base units (L, mol/L, g/L, g/mol, purity as a fraction); `exact` holds each amount as a fraction.",
 "oracle": {
  "name": "Python fractions",
  "version": "Python 3.13.16 fractions",
  "script": "pipeline/lab-calculators/recipe_table_reference_2.py",
  "scriptSha256": "13dd8484e21a26cfef1d2cd688b81fbbcd48878722a630babe10f380712d41f5",
  "command": "python3 pipeline/lab-calculators/recipe_table_reference_2.py"
 },
 "method": "recipe-table@2.0.0",
 "tolerance": "amounts and diluent relative 1e-9; validity, problems and which amount each line has exact",
 "recordedOn": "2026-10-21",
 "count": 21,
 "refused": 11,
 "cases": [
  {
   "name": "default-rows",
   "about": "The sheet's three default rows in 500 mL: Tris and NaCl weighed, EDTA 1 mL from a 500 mM stock",
   "input": {
    "volume": "0.5",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0.05"
      },
      "formulaWeight": "121.136"
     },
     {
      "name": "NaCl",
      "target": {
       "molarity": "0.15"
      },
      "formulaWeight": "58.44"
     },
     {
      "name": "EDTA disodium dihydrate",
      "target": {
       "molarity": "0.001"
      },
      "formulaWeight": "372.238",
      "from": {
       "molarity": "0.5"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "mass": 3.0284,
      "exact": {
       "mass": "7571/2500"
      }
     },
     {
      "mass": 4.383,
      "exact": {
       "mass": "4383/1000"
      }
     },
     {
      "volume": 0.001,
      "exact": {
       "volume": "1/1000"
      }
     }
    ],
    "liquids": 0.001,
    "diluent": 0.499
   }
  },
  {
   "name": "purity",
   "about": "Purity 98 percent scales the weighed mass up by 1/0.98",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0.05"
      },
      "formulaWeight": "121.136",
      "purity": "0.98"
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "mass": 0.6180408163265306,
      "exact": {
       "mass": "7571/12250"
      }
     }
    ],
    "liquids": 0.0,
    "diluent": 0.1
   }
  },
  {
   "name": "purity-on-stock-ignored",
   "about": "Purity on a component from a stock leaves the stock volume as stated",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "EDTA disodium dihydrate",
      "target": {
       "molarity": "0.001"
      },
      "formulaWeight": "372.238",
      "from": {
       "molarity": "0.5"
      },
      "purity": "0.5"
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.0002,
      "exact": {
       "volume": "1/5000"
      }
     }
    ],
    "liquids": 0.0002,
    "diluent": 0.0998
   }
  },
  {
   "name": "mass-solid",
   "about": "1 mg/mL weighed as a solid in 50 mL",
   "input": {
    "volume": "0.05",
    "components": [
     {
      "name": "BSA",
      "target": {
       "massConcentration": "1"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "mass": 0.05,
      "exact": {
       "mass": "1/20"
      }
     }
    ],
    "liquids": 0.0,
    "diluent": 0.05
   }
  },
  {
   "name": "mass-from-mass-stock",
   "about": "1 mg/mL from a 10 mg/mL stock in 50 mL: 5 mL",
   "input": {
    "volume": "0.05",
    "components": [
     {
      "name": "BSA",
      "target": {
       "massConcentration": "1"
      },
      "from": {
       "massConcentration": "10"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.005,
      "exact": {
       "volume": "1/200"
      }
     }
    ],
    "liquids": 0.005,
    "diluent": 0.045
   }
  },
  {
   "name": "mass-from-molar-stock",
   "about": "0.5844 g/L NaCl from a 5 M stock needs the formula weight",
   "input": {
    "volume": "1",
    "components": [
     {
      "name": "NaCl",
      "target": {
       "massConcentration": "0.5844"
      },
      "formulaWeight": "58.44",
      "from": {
       "molarity": "5"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.002,
      "exact": {
       "volume": "1/500"
      }
     }
    ],
    "liquids": 0.002,
    "diluent": 0.998
   }
  },
  {
   "name": "molar-from-mass-stock",
   "about": "10 mM NaCl from a 292.2 g/L stock",
   "input": {
    "volume": "1",
    "components": [
     {
      "name": "NaCl",
      "target": {
       "molarity": "0.01"
      },
      "formulaWeight": "58.44",
      "from": {
       "massConcentration": "292.2"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.002,
      "exact": {
       "volume": "1/500"
      }
     }
    ],
    "liquids": 0.002,
    "diluent": 0.998
   }
  },
  {
   "name": "volume-fraction",
   "about": "10 percent v/v glycerol in 200 mL: 20 mL",
   "input": {
    "volume": "0.2",
    "components": [
     {
      "name": "Glycerol",
      "target": {
       "volumeFraction": "0.1"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.02,
      "exact": {
       "volume": "1/50"
      }
     }
    ],
    "liquids": 0.02,
    "diluent": 0.18
   }
  },
  {
   "name": "volume-fraction-whole",
   "about": "A volume fraction of 1 takes the whole volume and leaves no diluent",
   "input": {
    "volume": "0.01",
    "components": [
     {
      "name": "Water",
      "target": {
       "volumeFraction": "1"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.01,
      "exact": {
       "volume": "1/100"
      }
     }
    ],
    "liquids": 0.01,
    "diluent": 0.0
   }
  },
  {
   "name": "exactly-full",
   "about": "Liquid additions that equal the final volume exactly: valid, diluent zero",
   "input": {
    "volume": "0.01",
    "components": [
     {
      "name": "A",
      "target": {
       "volumeFraction": "0.5"
      }
     },
     {
      "name": "B",
      "target": {
       "molarity": "0.5"
      },
      "from": {
       "molarity": "1"
      }
     }
    ]
   },
   "expected": {
    "valid": true,
    "lines": [
     {
      "volume": 0.005,
      "exact": {
       "volume": "1/200"
      }
     },
     {
      "volume": 0.005,
      "exact": {
       "volume": "1/200"
      }
     }
    ],
    "liquids": 0.01,
    "diluent": 0.0
   }
  },
  {
   "name": "stocks-exceed",
   "about": "Liquid additions above the final volume refuse the recipe (audit B7)",
   "input": {
    "volume": "0.01",
    "components": [
     {
      "name": "A",
      "target": {
       "volumeFraction": "0.6"
      }
     },
     {
      "name": "B",
      "target": {
       "molarity": "0.5"
      },
      "from": {
       "molarity": "1"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "stocks-exceed-final-volume",
    "lines": [
     {
      "volume": 0.006,
      "exact": {
       "volume": "3/500"
      }
     },
     {
      "volume": 0.005,
      "exact": {
       "volume": "1/200"
      }
     }
    ],
    "liquids": 0.011,
    "diluent": null
   }
  },
  {
   "name": "needs-fw-solid",
   "about": "A molarity weighed as a solid with no formula weight",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "X",
      "target": {
       "molarity": "0.01"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "needs-formula-weight"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "needs-fw-cross-stock",
   "about": "A mass target from a molar stock with no formula weight",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "X",
      "target": {
       "massConcentration": "1"
      },
      "from": {
       "molarity": "1"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "needs-formula-weight"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "needs-fw-molar-from-mass",
   "about": "A molar target from a mass stock with no formula weight",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "X",
      "target": {
       "molarity": "0.01"
      },
      "from": {
       "massConcentration": "100"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "needs-formula-weight"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "zero-target",
   "about": "A zero target",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0"
      },
      "formulaWeight": "121.136"
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "not-positive"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "volume-fraction-over-one",
   "about": "A volume fraction above 1",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "X",
      "target": {
       "volumeFraction": "1.5"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "not-positive"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "zero-stock",
   "about": "A stock strength of zero",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "EDTA disodium dihydrate",
      "target": {
       "molarity": "0.001"
      },
      "formulaWeight": "372.238",
      "from": {
       "molarity": "0"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "invalid-stock"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "purity-zero",
   "about": "Purity zero",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0.05"
      },
      "formulaWeight": "121.136",
      "purity": "0"
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "invalid-purity"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "purity-over-one",
   "about": "Purity above 1",
   "input": {
    "volume": "0.1",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0.05"
      },
      "formulaWeight": "121.136",
      "purity": "1.01"
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "invalid-purity"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "zero-volume",
   "about": "A final volume of zero refuses every line",
   "input": {
    "volume": "0",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0.05"
      },
      "formulaWeight": "121.136"
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "problem": "not-positive"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  },
  {
   "name": "one-bad-line",
   "about": "One failed line makes the whole recipe invalid; the good lines keep their amounts",
   "input": {
    "volume": "0.5",
    "components": [
     {
      "name": "Tris",
      "target": {
       "molarity": "0.05"
      },
      "formulaWeight": "121.136"
     },
     {
      "name": "X",
      "target": {
       "molarity": "0.01"
      }
     }
    ]
   },
   "expected": {
    "valid": false,
    "problem": "invalid-components",
    "lines": [
     {
      "mass": 3.0284,
      "exact": {
       "mass": "7571/2500"
      }
     },
     {
      "problem": "needs-formula-weight"
     }
    ],
    "liquids": 0.0,
    "diluent": null
   }
  }
 ]
}
