{
  "schemaVersion": 1,
  "slug": "pasta-portion-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "f39daf5fa57034ae8171e1214e19f351d509f702e769a697e8c0f7ce99a8ceb5",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pasta-portion-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": "dry = n w; cooked = 2.25 dry; sauce = 150 n; E_p = 3.57 w kcal",
    "vars": [
      [
        "n",
        "Number of people"
      ],
      [
        "w",
        "Dry pasta per person (70 / 100 / 130 g)"
      ],
      [
        "E_p",
        "Calories per person (kcal)"
      ]
    ],
    "note": "w lookup: small 70 g, main 100 g, large 130 g; cooked weight uses a 2.25 yield factor."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const per = appetite === 'small' ? 70 : appetite === 'large' ? 130 : 100; const dry = people*per; return { dryPastaGrams: dry, cookedGrams: dry*2.25, sauceGrams: people*150, caloriesPerPerson: per*3.57 };",
    "inputs": [
      {
        "name": "people",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "appetite",
        "type": "select",
        "default": "main",
        "options": [
          {
            "value": "small"
          },
          {
            "value": "main"
          },
          {
            "value": "large"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "dryPastaGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "cookedGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "sauceGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "caloriesPerPerson",
        "precision": 0,
        "unit": "kcal"
      }
    ],
    "interpret": null
  }
}
