{
  "schemaVersion": 1,
  "slug": "meat-serving-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "9f20a9f1b195fb35363ee8900468ea1923437154e2069af34dd0a6fc40538342",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/meat-serving-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": "raw = G × q ÷ (1 − L)",
    "vars": [
      [
        "raw",
        "raw meat needed, g"
      ],
      [
        "G",
        "number of guests"
      ],
      [
        "q",
        "cooked portion per guest, g"
      ],
      [
        "L",
        "shrinkage loss fraction"
      ]
    ],
    "note": "L lookup: beef/pork 0.25, chicken/turkey 0.30, lamb 0.28, ham 0.15, fish 0.18. rawKg = raw ÷ 1000; pounds = raw ÷ 453.59237."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const S = { beef:0.25, chicken:0.30, turkey:0.30, pork:0.25, lamb:0.28, ham:0.15, fish:0.18 }; const loss = S[meatType] || 0.25; const cooked = guests*portionSize; const raw = cooked/(1-loss); return { rawGrams: raw, rawKg: raw/1000, rawPounds: raw/453.59237, shrinkage: loss*100 };",
    "inputs": [
      {
        "name": "guests",
        "type": "number",
        "default": 8,
        "min": 0,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "meatType",
        "type": "select",
        "default": "beef",
        "options": [
          {
            "value": "beef"
          },
          {
            "value": "chicken"
          },
          {
            "value": "turkey"
          },
          {
            "value": "pork"
          },
          {
            "value": "lamb"
          },
          {
            "value": "ham"
          },
          {
            "value": "fish"
          }
        ]
      },
      {
        "name": "portionSize",
        "type": "number",
        "default": 180,
        "min": 0,
        "max": 2000,
        "step": 10,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "rawGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "rawKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "rawPounds",
        "precision": 2,
        "unit": "lb"
      },
      {
        "name": "shrinkage",
        "precision": 0,
        "unit": "%"
      }
    ],
    "interpret": null
  }
}
