{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/toolpin-dev/json-schema/toolpin-dev-envelope-snapshot-history-schema.json",
  "title": "Envelope[SnapshotHistory]",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/toolpin-dev-openapi.json#/components/schemas/Envelope_SnapshotHistory_",
  "properties": {
    "as_of": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "As Of",
      "description": "When all critical jobs had last succeeded. Null if one has never run."
    },
    "stale": {
      "type": "boolean",
      "title": "Stale",
      "description": "True when a daily job has not succeeded recently. The data is still served, and it is older than it should be."
    },
    "data": {
      "$ref": "#/$defs/SnapshotHistory"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "as_of",
    "stale",
    "data"
  ],
  "$defs": {
    "SnapshotHistory": {
      "properties": {
        "server": {
          "type": "string",
          "title": "Server"
        },
        "count": {
          "type": "integer",
          "title": "Count"
        },
        "has_more": {
          "type": "boolean",
          "title": "Has More"
        },
        "next_before": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Before"
        },
        "retention_days": {
          "type": "integer",
          "title": "Retention Days"
        },
        "snapshots": {
          "items": {
            "$ref": "#/$defs/SnapshotRecord"
          },
          "type": "array",
          "title": "Snapshots"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "server",
        "count",
        "has_more",
        "next_before",
        "retention_days",
        "snapshots"
      ],
      "title": "SnapshotHistory"
    },
    "SnapshotRecord": {
      "properties": {
        "captured_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Captured At"
        },
        "server_hash": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Server Hash"
        },
        "endpoint_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Endpoint Url"
        },
        "tool_count": {
          "type": "integer",
          "title": "Tool Count"
        },
        "tool_hashes": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Tool Hashes"
        },
        "tools": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tools"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "captured_at",
        "server_hash",
        "endpoint_url",
        "tool_count",
        "tool_hashes"
      ],
      "title": "SnapshotRecord"
    }
  }
}