{
  "title": "GB Carbon-Aware Compute – Forecast & Actual Intensity",
  "type": "object",
  "schemaVersion": 1,
  "properties": {
    "mode": {
      "title": "Time window",
      "type": "string",
      "editor": "select",
      "description": "Forecast: next 24 hours from the current UTC half-hour. Previous day: the prior UTC calendar day unless date is set. Values are source estimates, not measured data-centre emissions.",
      "enum": [
        "forecast",
        "previousDay"
      ],
      "enumTitles": [
        "Next 24 hours forecast",
        "Previous UTC day"
      ],
      "default": "forecast",
      "prefill": "forecast"
    },
    "date": {
      "title": "Historical date (optional)",
      "type": "string",
      "editor": "textfield",
      "description": "Only for previousDay mode. A real past YYYY-MM-DD UTC date; leave empty for yesterday. Forecast mode rejects a date.",
      "default": "",
      "prefill": ""
    },
    "orderBy": {
      "title": "Choose intervals by",
      "type": "string",
      "editor": "select",
      "description": "Chronological selects the earliest returned intervals. Lowest forecast selects the lowest forecast values within the available requested window, with time as tie-breaker. No dispatch or guaranteed emissions saving.",
      "enum": [
        "chronological",
        "lowestForecast"
      ],
      "enumTitles": [
        "Earliest intervals",
        "Lowest forecast intensity"
      ],
      "default": "chronological",
      "prefill": "chronological"
    },
    "maxIntervals": {
      "title": "Intervals to select",
      "type": "integer",
      "description": "Select at most this many real half-hour intervals from the requested source window. This is a bounded selection, not all electricity data.",
      "minimum": 1,
      "maximum": 48,
      "default": 4,
      "prefill": 4
    },
    "maxResults": {
      "title": "Maximum saved observations",
      "type": "integer",
      "description": "Cap real output rows. A smaller cap than the matching selected window marks coverage incomplete and preserves the previous baseline.",
      "default": 4,
      "prefill": 4,
      "minimum": 1,
      "maximum": 48
    },
    "comparePrevious": {
      "title": "Compare saved observations",
      "type": "boolean",
      "description": "First complete run establishes history. Later complete runs add exact changes; incomplete source/output/spending-limited runs do not advance it.",
      "default": false,
      "prefill": false
    },
    "onlyChanges": {
      "title": "Return only new or changed observations",
      "type": "boolean",
      "description": "Enables comparison. A valid unchanged run can return zero rows. No missing-item removal inference.",
      "default": false,
      "prefill": false
    },
    "snapshotName": {
      "title": "Watchlist history name",
      "type": "string",
      "description": "Use a stable name for the same scope. Letters, numbers, underscore or hyphen; 1–80 characters.",
      "default": "default",
      "prefill": "default",
      "pattern": "^[-\\w]{1,80}$",
      "editor": "textfield"
    },
    "maxRunSeconds": {
      "title": "Run time budget (seconds)",
      "type": "integer",
      "description": "Requests and pacing honor the remaining time. Time-limited runs preserve prior history.",
      "default": 120,
      "prefill": 120,
      "minimum": 30,
      "maximum": 120
    }
  },
  "required": []
}
