{
  "swagger": "2.0",
  "info": {
    "title": "grid.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "GridService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/conditions": {
      "get": {
        "summary": "GetConditions returns current, non-event state: per-location weather and\nthe region's fire-weather classification, optionally scoped to a place.\n(Weather alerts are events; road conditions are the road_segment /\nchain_control GeoJSON layers.)",
        "operationId": "GridService_GetConditions",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Conditions"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "place",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/events": {
      "get": {
        "summary": "ListEvents returns store-backed events filtered by place, layer, status,\nseverity_min, and since, with keyset pagination.",
        "operationId": "GridService_ListEvents",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1EventList"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "place",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "layer",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "severityMin",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "since",
            "description": "RFC 3339",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "enhancementIo",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/events/{id}": {
      "get": {
        "summary": "GetEvent returns the current revision of one event by id.",
        "operationId": "GridService_GetEvent",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Event"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "enhancementIo",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/events/{id}/history": {
      "get": {
        "summary": "GetEventHistory returns one event's revisions, newest first, paginated.",
        "operationId": "GridService_GetEventHistory",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1EventRevisionList"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "enhancementIo",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/history": {
      "get": {
        "summary": "ListHistory returns revisions across events over a [from, to) window.",
        "operationId": "GridService_ListHistory",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1EventRevisionList"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "place",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "layer",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "from",
            "description": "RFC 3339",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "to",
            "description": "RFC 3339",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "enhancementIo",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/places": {
      "get": {
        "summary": "ListPlaces returns the place directory filtered by kind and a name query.",
        "operationId": "GridService_ListPlaces",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaceList"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/places/{place}": {
      "get": {
        "summary": "GetPlace returns one place by slug or namespaced id.",
        "operationId": "GridService_GetPlace",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Place"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "place",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/places/{place}/summary": {
      "get": {
        "summary": "GetPlaceSummary is the one-call place rollup: mode, a cross-layer severity\nsummary, per-domain status, top events, the evacuation invariant, and a\nsource-health sidecar. (3-segment path; no collision with GetPlace.)",
        "operationId": "GridService_GetPlaceSummary",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1PlaceSummary"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "place",
            "description": "slug or namespaced id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/places:resolve": {
      "get": {
        "summary": "ResolvePlace maps a lat/lng or address to the containing places,\nmost-specific first (SITE, EVAC_ZONE, TOWN, CORRIDOR, COUNTY, AREA).",
        "operationId": "GridService_ResolvePlace",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ResolvePlaceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "lng",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/scanners": {
      "get": {
        "summary": "ListScanners returns Broadcastify scanner feeds, optionally scoped to a\nplace (an area serves its feeds; otherwise every area's feeds, deduped).",
        "operationId": "GridService_ListScanners",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ScannerList"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "place",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "GridService"
        ]
      }
    },
    "/api/v1/sources": {
      "get": {
        "summary": "ListSources returns the source registry with per-source health — the\nhonesty mechanism clients key layer trust off.",
        "operationId": "GridService_ListSources",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SourceList"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "GridService"
        ]
      }
    }
  },
  "definitions": {
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "v1BoundingBox": {
      "type": "object",
      "properties": {
        "minLat": {
          "type": "number",
          "format": "double"
        },
        "minLng": {
          "type": "number",
          "format": "double"
        },
        "maxLat": {
          "type": "number",
          "format": "double"
        },
        "maxLng": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "v1Conditions": {
      "type": "object",
      "properties": {
        "weather": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1WeatherConditions"
          }
        },
        "fireWeather": {
          "$ref": "#/definitions/v1FireWeatherConditions"
        },
        "lastUpdated": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v1EarthquakeDetail": {
      "type": "object",
      "properties": {
        "magnitude": {
          "type": "number",
          "format": "double"
        },
        "depthKm": {
          "type": "number",
          "format": "double"
        },
        "felt": {
          "type": "integer",
          "format": "int32",
          "title": "USGS DYFI felt-report count"
        }
      }
    },
    "v1Enhancement": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "\"gpt-4o-mini\", \"claude-haiku-4-5\", ..."
        },
        "enhancedAt": {
          "type": "string",
          "format": "date-time"
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "which Event fields were generated"
        },
        "request": {
          "type": "string",
          "description": "Transparency: the exact model input and output, so a client can show what\nwas sent and what came back. `request` is the incident-specific user prompt\n(the static system prompt is not included); `response` is the raw structured\nJSON the model returned. Excluded from the event content hash."
        },
        "response": {
          "type": "string"
        }
      },
      "description": "AI-enhancement provenance so clients can badge AI-summarized text\n(spec §3.1: translate, never assert; originals preserved in description)."
    },
    "v1EvacuationDetail": {
      "type": "object",
      "properties": {
        "zoneId": {
          "type": "string"
        },
        "level": {
          "type": "string",
          "title": "ORDER | WARNING | ADVISORY | SHELTER_IN_PLACE"
        },
        "eventType": {
          "type": "string"
        },
        "county": {
          "type": "string"
        }
      }
    },
    "v1Event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "\"{source_id}:{native_id}\" — matches shipped ids"
        },
        "layer": {
          "$ref": "#/definitions/v1Layer",
          "description": "shipped taxonomy + additions",
          "title": "e.g. \"calfire:2026-salt-springs\""
        },
        "category": {
          "type": "string",
          "title": "source sub-type slug (\"active\", \"order\", ...)"
        },
        "severity": {
          "$ref": "#/definitions/v1Severity",
          "title": "shipped 5-level scale"
        },
        "status": {
          "$ref": "#/definitions/v1EventStatus"
        },
        "headline": {
          "type": "string",
          "title": "card-renderable without knowing the kind"
        },
        "summary": {
          "type": "string",
          "title": "AI-enhanced 2–3 sentences where applicable"
        },
        "description": {
          "type": "string",
          "title": "long form / original text"
        },
        "areaLabel": {
          "type": "string",
          "title": "\"Hathaway Pines \u0026 Avery\""
        },
        "canonicalUrl": {
          "type": "string",
          "title": "scheme-validated (https/http only, per shipped rule)"
        },
        "geometry": {
          "$ref": "#/definitions/v1Geometry",
          "title": "may be absent: county-wide advisories"
        },
        "placeIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "precomputed intersections (spec §4)"
        },
        "provenance": {
          "$ref": "#/definitions/v1Provenance"
        },
        "effective": {
          "type": "string",
          "format": "date-time"
        },
        "expires": {
          "type": "string",
          "format": "date-time"
        },
        "observedAt": {
          "type": "string",
          "format": "date-time",
          "title": "upstream last-update"
        },
        "ingestedAt": {
          "type": "string",
          "format": "date-time"
        },
        "revision": {
          "type": "integer",
          "format": "int64"
        },
        "enhancement": {
          "$ref": "#/definitions/v1Enhancement",
          "title": "AI-enhancement provenance (spec §3.1)"
        },
        "wildfire": {
          "$ref": "#/definitions/v1WildfireDetail"
        },
        "evacuation": {
          "$ref": "#/definitions/v1EvacuationDetail"
        },
        "weatherAlert": {
          "$ref": "#/definitions/v1WeatherAlertDetail"
        },
        "fireWeather": {
          "$ref": "#/definitions/v1FireWeatherDetail"
        },
        "earthquake": {
          "$ref": "#/definitions/v1EarthquakeDetail"
        },
        "roadIncident": {
          "$ref": "#/definitions/v1RoadIncidentDetail"
        },
        "mesh": {
          "$ref": "#/definitions/v1MeshDetail"
        }
      }
    },
    "v1EventList": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Event"
          }
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "v1EventRevision": {
      "type": "object",
      "properties": {
        "revision": {
          "type": "integer",
          "format": "int64"
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "ingestedAt": {
          "type": "string",
          "format": "date-time"
        },
        "event": {
          "$ref": "#/definitions/v1Event"
        }
      }
    },
    "v1EventRevisionList": {
      "type": "object",
      "properties": {
        "revisions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1EventRevision"
          }
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "v1EventStatus": {
      "type": "string",
      "enum": [
        "EVENT_STATUS_UNSPECIFIED",
        "SCHEDULED",
        "ACTIVE",
        "RESOLVED",
        "EXPIRED"
      ],
      "default": "EVENT_STATUS_UNSPECIFIED",
      "title": "- SCHEDULED: planned PSPS, forecast closures\n - RESOLVED: upstream confirmed over\n - EXPIRED: aged out per-source policy; upstream went quiet"
    },
    "v1FireWeatherConditions": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "title": "normal | elevated | red-flag"
        },
        "headline": {
          "type": "string"
        },
        "zones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "v1FireWeatherDetail": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "title": "normal | elevated | red-flag"
        },
        "sourceEvent": {
          "type": "string",
          "title": "NWS product driving the state"
        },
        "zones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "description": "fire_weather is condition-backed (a live projection, not an event); this\nmessage exists for the spec §3 oneof shape."
    },
    "v1Geometry": {
      "type": "object",
      "properties": {
        "geojson": {
          "type": "string",
          "format": "byte",
          "title": "RFC 7946 geometry object, UTF-8"
        },
        "bbox": {
          "$ref": "#/definitions/v1BoundingBox",
          "title": "always populated at ingest"
        },
        "centroid": {
          "$ref": "#/definitions/v1LatLng"
        }
      }
    },
    "v1LatLng": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "format": "double"
        },
        "lng": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "v1Layer": {
      "type": "string",
      "enum": [
        "LAYER_UNSPECIFIED",
        "WILDFIRE",
        "EVACUATION",
        "WEATHER_ALERT",
        "FIRE_WEATHER",
        "EARTHQUAKE",
        "ROAD_INCIDENT",
        "POWER",
        "GAUGE",
        "AIR_QUALITY",
        "MESH",
        "ANNOUNCEMENT"
      ],
      "default": "LAYER_UNSPECIFIED",
      "title": "- POWER: condition-backed layers (ROAD_SEGMENT, CHAIN_CONTROL) are projections, not events"
    },
    "v1MeshDetail": {
      "type": "object",
      "properties": {
        "publicKey": {
          "type": "string",
          "title": "full Ed25519 public key, hex (also the Event.id native part)"
        },
        "nodeType": {
          "type": "string",
          "title": "companion | repeater | room_server | sensor"
        },
        "name": {
          "type": "string",
          "title": "advertised node name"
        },
        "telemetry": {
          "$ref": "#/definitions/v1MeshTelemetry",
          "title": "VOLATILE — excluded from the content hash"
        }
      },
      "description": "MeshCore mesh-node presence (Layer_MESH). One event per node, keyed by\nits Ed25519 public key. Stable identity + advertised location live here (and\nmint a revision on change); the per-packet signal metrics live in the nested\nMeshTelemetry, which the store's ContentHash zeroes — so the firehose of\nadverts refreshes liveness (last_seen_at) without ever writing a revision."
    },
    "v1MeshTelemetry": {
      "type": "object",
      "properties": {
        "snr": {
          "type": "number",
          "format": "double",
          "title": "last SNR (dB), gateway-reported"
        },
        "rssi": {
          "type": "integer",
          "format": "int32",
          "title": "last RSSI (dBm), gateway-reported"
        },
        "hopCount": {
          "type": "integer",
          "format": "int64",
          "title": "path length of the last-heard advert"
        },
        "gateways": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "origin ids of the gateways/brokers that heard it"
        },
        "lastAdvertAt": {
          "type": "string",
          "format": "date-time",
          "title": "sender-stamped time of the last advert"
        }
      },
      "description": "MeshTelemetry is the volatile, per-advert signal state. It is deliberately\ngrouped into one sub-message so store.ContentHash can zero the whole field:\nnone of it mints a revision."
    },
    "v1Place": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "\"area:ebbetts-pass\" — existing area ids preserved under a kind"
        },
        "kind": {
          "$ref": "#/definitions/v1PlaceKind"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "geometry": {
          "$ref": "#/definitions/v1Geometry"
        },
        "parentId": {
          "type": "string"
        }
      }
    },
    "v1PlaceKind": {
      "type": "string",
      "enum": [
        "PLACE_KIND_UNSPECIFIED",
        "AREA",
        "COUNTY",
        "TOWN",
        "EVAC_ZONE",
        "CORRIDOR",
        "SITE"
      ],
      "default": "PLACE_KIND_UNSPECIFIED",
      "title": "- AREA: existing configured areas; org footprints live here too"
    },
    "v1PlaceList": {
      "type": "object",
      "properties": {
        "places": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Place"
          }
        }
      }
    },
    "v1PlaceSummary": {
      "type": "object",
      "properties": {
        "place": {
          "type": "string",
          "title": "slug"
        },
        "placeId": {
          "type": "string"
        },
        "placeName": {
          "type": "string"
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "mode": {
          "type": "string",
          "title": "QUIET | WATCH | ACTIVE"
        },
        "summary": {
          "$ref": "#/definitions/v1SummaryStats"
        },
        "domains": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1SummaryDomain"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1SummarySourceHealth"
          }
        }
      },
      "description": "PlaceSummary is the one-call place rollup (the former hand-built summary,\nnow proto so it is camelCase like the rest of the surface). active_evacuations\nis a wrapper so it can serialize as an explicit JSON null: null when the\nevacuation source is UNAVAILABLE (unknown — render \"check Genasys\"), 0 when\nconfirmed-empty (OK/STALE with no active zones), N when active. An error must\nnever become a 0."
    },
    "v1Provenance": {
      "type": "object",
      "properties": {
        "sourceId": {
          "type": "string"
        },
        "sourceName": {
          "type": "string",
          "title": "denormalized: \"CAL FIRE\""
        },
        "attribution": {
          "type": "string",
          "title": "\"CAL FIRE / WFIGS\""
        },
        "sourceUrl": {
          "type": "string"
        },
        "fetchedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v1ResolvePlaceResponse": {
      "type": "object",
      "properties": {
        "query": {
          "$ref": "#/definitions/v1ResolveQuery"
        },
        "places": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Place"
          }
        }
      }
    },
    "v1ResolveQuery": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number",
          "format": "double"
        },
        "lng": {
          "type": "number",
          "format": "double"
        },
        "matchedAddress": {
          "type": "string"
        }
      }
    },
    "v1RoadIncidentDetail": {
      "type": "object",
      "properties": {
        "logNumber": {
          "type": "string"
        },
        "impact": {
          "type": "string",
          "title": "AI-assessed: none | light | moderate | severe"
        },
        "duration": {
          "type": "string",
          "title": "AI-assessed: unknown | \u003c 1 hour | several hours | ongoing"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "title": "structured extras from AI analysis (internal keys stripped)"
        }
      },
      "description": "Kind-specific only. The incident type is the envelope `category`, the human\nlocation is `area_label`, and the short line is the `headline` — none are\nrepeated here."
    },
    "v1Scanner": {
      "type": "object",
      "properties": {
        "feedId": {
          "type": "string"
        },
        "channelLabel": {
          "type": "string"
        },
        "agency": {
          "type": "string"
        },
        "broadcastifyUrl": {
          "type": "string"
        }
      }
    },
    "v1ScannerList": {
      "type": "object",
      "properties": {
        "scanners": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Scanner"
          }
        }
      }
    },
    "v1Severity": {
      "type": "string",
      "enum": [
        "INFO",
        "MINOR",
        "MODERATE",
        "SEVERE",
        "EXTREME"
      ],
      "default": "INFO",
      "description": "The shipped scale, unchanged. rank = enum value; INFO=0 ... EXTREME=4."
    },
    "v1Source": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "attribution": {
          "type": "string"
        },
        "homepageUrl": {
          "type": "string"
        },
        "pollIntervalSeconds": {
          "type": "integer",
          "format": "int64"
        },
        "staleAfterSeconds": {
          "type": "integer",
          "format": "int64",
          "title": "per-source tunable; default 3x poll interval"
        },
        "expireAfterSeconds": {
          "type": "integer",
          "format": "int64",
          "title": "per-source tunable; missing-from-feed → EXPIRED"
        },
        "lastSuccessAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastAttemptAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastError": {
          "type": "string"
        },
        "status": {
          "$ref": "#/definitions/v1SourceStatus",
          "title": "shipped semantics, now per-source not per-layer"
        }
      }
    },
    "v1SourceList": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1Source"
          }
        }
      }
    },
    "v1SourceStatus": {
      "type": "string",
      "enum": [
        "SOURCE_STATUS_UNSPECIFIED",
        "OK",
        "STALE",
        "UNAVAILABLE"
      ],
      "default": "SOURCE_STATUS_UNSPECIFIED"
    },
    "v1SummaryDomain": {
      "type": "object",
      "properties": {
        "domain": {
          "type": "string",
          "title": "fire | evacuation | weather | roads | seismic"
        },
        "status": {
          "type": "string",
          "title": "worst source_status across the domain's layers"
        },
        "highestSeverity": {
          "type": "string"
        },
        "activeCount": {
          "type": "integer",
          "format": "int32"
        },
        "headlines": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1SummaryDomainHeadline"
          },
          "title": "top 3 by severity"
        }
      }
    },
    "v1SummaryDomainHeadline": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "severity": {
          "type": "string"
        },
        "headline": {
          "type": "string"
        }
      }
    },
    "v1SummarySourceHealth": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "lastSuccessAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v1SummaryStats": {
      "type": "object",
      "properties": {
        "highestSeverity": {
          "type": "string"
        },
        "highestSeverityRank": {
          "type": "integer",
          "format": "int32"
        },
        "severityCounts": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "format": "int32"
          }
        },
        "totalActive": {
          "type": "integer",
          "format": "int32"
        },
        "activeEvacuations": {
          "type": "integer",
          "format": "int32",
          "description": "NULLABLE: serializes as JSON `null` (not 0) when evacuation data is\nUNAVAILABLE. The OpenAPI type is `integer` only because Swagger 2.0 cannot\nexpress a nullable scalar — do NOT coerce null→0 (an error must never become\na 0). null = UNAVAILABLE, 0 = confirmed no active zones, N = active."
        },
        "evacuationStatus": {
          "type": "string",
          "title": "OK | STALE | UNAVAILABLE"
        },
        "topEvents": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1SummaryTopEvent"
          }
        }
      }
    },
    "v1SummaryTopEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "layer": {
          "type": "string",
          "title": "lowercase layer slug (\"weather_alert\")"
        },
        "severity": {
          "type": "string"
        },
        "severityRank": {
          "type": "integer",
          "format": "int32"
        },
        "headline": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "title": "provenance source id (\"usgs\")"
        }
      }
    },
    "v1WeatherAlertDetail": {
      "type": "object",
      "properties": {
        "nwsSeverity": {
          "type": "string",
          "title": "raw NWS vocabulary (Extreme..Minor), distinct from unified severity"
        },
        "certainty": {
          "type": "string"
        },
        "urgency": {
          "type": "string"
        },
        "instruction": {
          "type": "string"
        },
        "areaDesc": {
          "type": "string",
          "title": "NWS free-text area (no envelope equivalent for zone alerts)"
        },
        "zones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "NWS forecast zones, e.g. \"CAZ064\""
        }
      },
      "title": "Detail messages carry only KIND-SPECIFIC fields not already in the Event\nenvelope. Fields that duplicate an envelope field are NOT repeated here:\n  - the NWS event name is the envelope `category`\n  - the sending office is `provenance.source_name`"
    },
    "v1WeatherConditions": {
      "type": "object",
      "properties": {
        "locationId": {
          "type": "string"
        },
        "locationName": {
          "type": "string"
        },
        "weatherMain": {
          "type": "string"
        },
        "weatherDescription": {
          "type": "string"
        },
        "weatherIcon": {
          "type": "string"
        },
        "temperatureCelsius": {
          "type": "integer",
          "format": "int32"
        },
        "feelsLikeCelsius": {
          "type": "integer",
          "format": "int32"
        },
        "humidityPercent": {
          "type": "integer",
          "format": "int32"
        },
        "windSpeedKmh": {
          "type": "integer",
          "format": "int32"
        },
        "windDirectionDegrees": {
          "type": "integer",
          "format": "int32"
        },
        "visibilityKm": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "v1WildfireDetail": {
      "type": "object",
      "properties": {
        "acres": {
          "type": "number",
          "format": "double"
        },
        "containment": {
          "type": "integer",
          "format": "int32",
          "title": "percent contained, 0-100"
        },
        "county": {
          "type": "string"
        },
        "cause": {
          "type": "string"
        },
        "hasPerimeter": {
          "type": "boolean",
          "title": "true when geometry is a WFIGS perimeter polygon"
        }
      }
    }
  }
}
