{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "installationId",
    "revision",
    "status",
    "observedAt",
    "receivedAt",
    "softwareVersion",
    "measurement"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "installationId": {
      "$ref": "#/$defs/d0_installationId"
    },
    "revision": {
      "oneOf": [
        {
          "$ref": "#/$defs/d1_cursor"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "enum": [
        "offline",
        "stale",
        "online"
      ]
    },
    "observedAt": {
      "oneOf": [
        {
          "$ref": "#/$defs/d2_dateTime"
        },
        {
          "type": "null"
        }
      ]
    },
    "receivedAt": {
      "oneOf": [
        {
          "$ref": "#/$defs/d2_dateTime"
        },
        {
          "type": "null"
        }
      ]
    },
    "softwareVersion": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 128
    },
    "measurement": {
      "oneOf": [
        {
          "$ref": "#/$defs/d3_measurement"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "d0_installationId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "d1_cursor": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "d2_dateTime": {
      "type": "string",
      "format": "date-time"
    },
    "d4_uint256": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$",
      "maxLength": 78,
      "format": "uint256-decimal"
    },
    "d3_measurement": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "counterEpoch",
        "cumulativeWorkUnits",
        "provenance",
        "coreStatus"
      ],
      "properties": {
        "counterEpoch": {
          "type": "string",
          "format": "uuid"
        },
        "cumulativeWorkUnits": {
          "$ref": "#/$defs/d4_uint256"
        },
        "provenance": {
          "enum": [
            "hardware",
            "simulated",
            "replay",
            "derived"
          ]
        },
        "coreStatus": {
          "enum": [
            "IDLE",
            "ACTIVE",
            "COUNTER_FAULT"
          ]
        }
      }
    }
  },
  "$comment": "Public response structure from source snapshot 9e38b9313c9b4926ad15c7cd691d7f5789bdbc55. See endpoint notes for semantic constraints."
}
