{
  "schemaVersion": 1,
  "slug": "compost-calculator",
  "category": "gardening",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "c3e27fd859aaec316abb9ea506f57a06fb0bf81abda9edfab137c0fbff788708",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/compost-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": "V=A×d÷12; V_f=P×(1−s÷100); piles=ceil(V÷V_f)",
    "vars": [
      [
        "A",
        "bed area (sq ft)"
      ],
      [
        "d",
        "depth (in)"
      ],
      [
        "V",
        "volume needed (cu ft)"
      ],
      [
        "P",
        "starting pile volume (cu ft)"
      ],
      [
        "s",
        "shrinkage (%)"
      ],
      [
        "V_f",
        "finished volume from one pile"
      ]
    ],
    "note": "1 yd³ = 27 ft³; bags are 1-ft³ equivalents and round up; whole starting piles round up. Actual shrinkage varies."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const compostNeeded=bedArea*(depthIn/12); const finishedFromPile=pileVolume*(1-shrinkage/100); return {compostNeeded,compostYards:compostNeeded/27,bags:Math.ceil(compostNeeded),finishedFromPile,pilesNeeded:finishedFromPile>0?Math.ceil(compostNeeded/finishedFromPile):null};",
    "inputs": [
      {
        "name": "bedArea",
        "type": "number",
        "default": 300,
        "min": 1,
        "max": 100000,
        "step": 10
      },
      {
        "name": "depthIn",
        "type": "number",
        "default": 1.5,
        "min": 0.25,
        "max": 6,
        "step": 0.25,
        "slider": true
      },
      {
        "name": "shrinkage",
        "type": "number",
        "default": 66,
        "min": 20,
        "max": 85,
        "step": 1,
        "slider": true
      },
      {
        "name": "pileVolume",
        "type": "number",
        "default": 27,
        "min": 1,
        "max": 10000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "compostNeeded",
        "precision": 1,
        "unit": "cu ft"
      },
      {
        "name": "compostYards",
        "precision": 2,
        "unit": "cu yd"
      },
      {
        "name": "bags",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "finishedFromPile",
        "precision": 1,
        "unit": "cu ft"
      },
      {
        "name": "pilesNeeded",
        "precision": 1,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
