{
  "schemaVersion": 1,
  "slug": "watering-schedule-calculator",
  "category": "gardening",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "6e309a739fb773ba7add4ede23c85098ae67816f30f377aa47b003a2900d6f2a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/watering-schedule-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": "I = P × S × k_T; W_s = max(0, A × (I − R) × 0.623); t = W_s ÷ q ÷ N",
    "vars": [
      [
        "P",
        "Plant factor: 0.5–1.5 by type"
      ],
      [
        "S",
        "Soil factor: sand 1.2, loam 1, clay 0.8, potting 1.3"
      ],
      [
        "k_T",
        "Temperature factor: 0.8 / 1 / 1.15 / 1.3"
      ],
      [
        "A",
        "Area (sq ft)"
      ],
      [
        "R",
        "Rainfall (in/week)"
      ],
      [
        "N",
        "Sessions per week"
      ]
    ],
    "note": "q is combined zone flow in US gal/hour; minutes/session = supplemental US gal ÷ q ÷ sessions × 60. Sessions are heuristic; not crop-specific guidance."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const P = { seedlings:0.5, vegetables:1, established:0.75, trees:1.2, lawn:1, containers:1.5 }; const S = { sand:1.2, loam:1, clay:0.8, potting:1.3 }; const tempFactor = temperature > 90 ? 1.3 : temperature > 80 ? 1.15 : temperature < 60 ? 0.8 : 1; const inches = (P[plantType] || 1)*(S[soilType] || 1)*tempFactor; const waterNeeded = area*inches*0.623; const supplement = Math.max(0, area*(inches-rainfall)*0.623); const sessions = plantType === 'containers' ? 7 : inches >= 1.2 ? 2 : 3; const minutesPerSession = emitterFlow > 0 && sessions > 0 ? supplement/emitterFlow/sessions*60 : 0; return { waterNeeded, supplement, sessions, minutesPerSession };",
    "inputs": [
      {
        "name": "area",
        "type": "number",
        "default": 200,
        "min": 1,
        "max": 100000,
        "step": 5
      },
      {
        "name": "plantType",
        "type": "select",
        "default": "vegetables",
        "options": [
          {
            "value": "seedlings"
          },
          {
            "value": "vegetables"
          },
          {
            "value": "established"
          },
          {
            "value": "trees"
          },
          {
            "value": "lawn"
          },
          {
            "value": "containers"
          }
        ]
      },
      {
        "name": "soilType",
        "type": "select",
        "default": "loam",
        "options": [
          {
            "value": "sand"
          },
          {
            "value": "loam"
          },
          {
            "value": "clay"
          },
          {
            "value": "potting"
          }
        ]
      },
      {
        "name": "temperature",
        "type": "number",
        "default": 75,
        "min": 30,
        "max": 120,
        "step": 1,
        "slider": true
      },
      {
        "name": "rainfall",
        "type": "number",
        "default": 0.5,
        "min": 0,
        "max": 10,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "emitterFlow",
        "type": "number",
        "default": 4,
        "min": 0.1,
        "max": 100,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "waterNeeded",
        "precision": 1,
        "unit": "gal"
      },
      {
        "name": "supplement",
        "precision": 1,
        "unit": "gal"
      },
      {
        "name": "sessions",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "minutesPerSession",
        "precision": 0,
        "unit": "min"
      }
    ],
    "interpret": null
  }
}
