{
  "schemaVersion": 1,
  "slug": "coffee-ratio-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "332228d4e13ad131e2b0d8dca88726dd8ac22c87322ebf15cf0419108f4e007e",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/coffee-ratio-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": "Wg = C × r; Wml ≈ Wg; cupsUS = Wml ÷ 236.588",
    "vars": [
      [
        "W",
        "water amount (g, equal to ml)"
      ],
      [
        "C",
        "coffee dose in grams"
      ],
      [
        "r",
        "brew ratio multiplier (16 = 1:16)"
      ],
      [
        "cups",
        "cups of coffee"
      ],
      [
        "caf",
        "approx. caffeine in mg"
      ]
    ],
    "note": "Water mass is treated as approximately equal to volume; US cup = 236.588 ml. Caffeine is not estimated."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const water=coffeeGrams*strength;return{waterGrams:water,waterMl:water,cups:water/236.5882365};",
    "inputs": [
      {
        "name": "coffeeGrams",
        "type": "number",
        "default": 18,
        "min": 0,
        "max": 5000,
        "step": 0.5
      },
      {
        "name": "strength",
        "type": "select",
        "default": 16,
        "options": [
          {
            "value": 12
          },
          {
            "value": 15
          },
          {
            "value": 16
          },
          {
            "value": 17
          },
          {
            "value": 18
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "waterGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "waterMl",
        "precision": 0,
        "unit": "ml"
      },
      {
        "name": "cups",
        "precision": 2,
        "unit": "cups"
      }
    ],
    "interpret": null
  }
}
