{
  "schemaVersion": 1,
  "slug": "gravel-calculator",
  "category": "construction",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "51774524cceb7034c0ad3e302125c1045df067230b3c7f9f21bcce85c10f4eaa",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/gravel-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": "T = L×W×(d/12)/27×(1+w/100)×ρ",
    "vars": [
      [
        "L",
        "Length, ft"
      ],
      [
        "W",
        "Width, ft"
      ],
      [
        "d",
        "Depth, in"
      ],
      [
        "w",
        "Waste allowance, %"
      ],
      [
        "ρ",
        "Material density, t/yd³"
      ],
      [
        "T",
        "Total material, short tons"
      ]
    ],
    "note": "Volume (yd³) = length × width × (depth ÷ 12) ÷ 27 × (1 + waste ÷ 100); tons = volume × selected density. Density factors are planning assumptions and vary by material, grading and moisture; confirm supplier yield."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const D = { gravel:1.4, crushed:1.5, pea:1.35, sand:1.35, topsoil:1.1 }; const dens = D[material] || 1.4; const area = length*width; const cubicYards = area*(depthIn/12)/27*(1+waste/100); const tons = cubicYards*dens; return { area, cubicYards, tons, cubicMetres: cubicYards*0.764555, cost: tons*pricePerTon };",
    "inputs": [
      {
        "name": "length",
        "type": "number",
        "default": 40,
        "min": 0,
        "max": 5000,
        "step": 0.5
      },
      {
        "name": "width",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 1000,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "depthIn",
        "type": "number",
        "default": 4,
        "min": 0.5,
        "max": 36,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "material",
        "type": "select",
        "default": "gravel",
        "options": [
          {
            "value": "gravel"
          },
          {
            "value": "crushed"
          },
          {
            "value": "pea"
          },
          {
            "value": "sand"
          },
          {
            "value": "topsoil"
          }
        ]
      },
      {
        "name": "waste",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 30,
        "step": 1,
        "slider": true
      },
      {
        "name": "pricePerTon",
        "type": "number",
        "default": 45,
        "min": 0,
        "max": 1000,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "area",
        "precision": 0,
        "unit": "sq ft"
      },
      {
        "name": "cubicYards",
        "precision": 2,
        "unit": "cu yd"
      },
      {
        "name": "tons",
        "precision": 2,
        "unit": "tons"
      },
      {
        "name": "cubicMetres",
        "precision": 2,
        "unit": "m³"
      },
      {
        "name": "cost",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
