{
  "schemaVersion": 1,
  "slug": "canning-time-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "693a0f14d051660d4c4a85d7d901b5607b486f3d3737287b88c4d22c6aa76868",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/canning-time-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "n_b = ⌈j ÷ b⌉",
    "vars": [
      [
        "j",
        "Total jars"
      ],
      [
        "b",
        "Jars per batch"
      ],
      [
        "n_b",
        "Batches"
      ]
    ],
    "note": "Only batch count is calculated. A tested recipe must supply time and pressure for the exact food, pack style, jar, canner and altitude. Low-acid foods must not be water-bath canned."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "if(!Number.isInteger(jarCount)||!Number.isInteger(batchesPossible)||jarCount<1||batchesPossible<1)return{batches:null,methodStatus:null,processGuidance:null,__error:'inputError'};const lowAcid=food==='beans'||food==='meat'||food==='soup';return{batches:Math.ceil(jarCount/batchesPossible),methodStatus:lowAcid&&method==='waterbath'?'Unsafe for low-acid food':'Method requires a tested recipe',processGuidance:'Use a tested recipe for the exact food, pack style, jar size, canner gauge and altitude; do not infer time or pressure from these inputs.'};",
    "inputs": [
      {
        "name": "method",
        "type": "select",
        "default": "waterbath",
        "options": [
          {
            "value": "waterbath"
          },
          {
            "value": "pressure"
          }
        ]
      },
      {
        "name": "food",
        "type": "select",
        "default": "tomatoes",
        "options": [
          {
            "value": "tomatoes"
          },
          {
            "value": "fruit"
          },
          {
            "value": "pickles"
          },
          {
            "value": "beans"
          },
          {
            "value": "meat"
          },
          {
            "value": "soup"
          }
        ]
      },
      {
        "name": "jarCount",
        "type": "number",
        "default": 6,
        "min": 1,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "batchesPossible",
        "type": "number",
        "default": 6,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "batches",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "methodStatus",
        "type": "text",
        "unit": ""
      },
      {
        "name": "processGuidance",
        "type": "text",
        "unit": ""
      }
    ],
    "interpret": null
  }
}
