{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "number",
      "const": 1
    },
    "identity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$",
          "description": "Resource identifier returned by the operation."
        },
        "selection": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8192
        },
        "workspace_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Workspace that owns this record."
        },
        "project_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Project that owns this record."
        },
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "kinds": {
          "minItems": 1,
          "maxItems": 4,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "found",
              "back",
              "lost",
              "missing"
            ]
          }
        },
        "through_sequence": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "retention_floor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "issued_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "expires_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        }
      },
      "required": [
        "id",
        "selection",
        "workspace_id",
        "project_id",
        "from",
        "to",
        "kinds",
        "through_sequence",
        "retention_floor",
        "issued_at",
        "expires_at"
      ],
      "additionalProperties": false
    },
    "coverage": {
      "type": "object",
      "properties": {
        "basis": {
          "type": "string",
          "const": "retained_watch_transition_events"
        },
        "clock": {
          "type": "string",
          "const": "event_recorded_at"
        },
        "unit": {
          "type": "string",
          "const": "watch_transition_events"
        },
        "whole_web_coverage": {
          "type": "boolean",
          "const": false,
          "description": "False: these results do not measure the whole web."
        },
        "unique_physical_links": {
          "type": "boolean",
          "const": false
        },
        "includes_archived_watches": {
          "type": "boolean",
          "const": true
        },
        "scan_limited": {
          "type": "boolean",
          "const": false
        },
        "retained_selection_complete": {
          "type": "boolean",
          "const": true
        },
        "historical_completeness": {
          "type": "string",
          "enum": [
            "no_recorded_retention_gap",
            "retention_gap"
          ]
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "basis",
        "clock",
        "unit",
        "whole_web_coverage",
        "unique_physical_links",
        "includes_archived_watches",
        "scan_limited",
        "retained_selection_complete",
        "historical_completeness",
        "limitations"
      ],
      "additionalProperties": false,
      "description": "Dataset scope and completeness, including limits on what these results establish."
    },
    "totals": {
      "type": "object",
      "properties": {
        "new": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "recovered": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lost": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "went_missing": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "net": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "records": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "new",
        "recovered",
        "lost",
        "went_missing",
        "net",
        "records"
      ],
      "additionalProperties": false
    },
    "daily": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "new": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "recovered": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lost": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "went_missing": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "net": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "records": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "day": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        },
        "required": [
          "new",
          "recovered",
          "lost",
          "went_missing",
          "net",
          "records",
          "day"
        ],
        "additionalProperties": false
      }
    },
    "category_history": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "const": "unavailable",
          "description": "Saved lifecycle or evidence state, as enumerated for this record."
        },
        "reason": {
          "type": "string",
          "description": "Recorded explanation; null when no explanation applies."
        },
        "values": {
          "type": "null"
        }
      },
      "required": [
        "state",
        "reason",
        "values"
      ],
      "additionalProperties": false
    },
    "authority_history": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "const": "unavailable",
          "description": "Saved lifecycle or evidence state, as enumerated for this record."
        },
        "reason": {
          "type": "string",
          "description": "Recorded explanation; null when no explanation applies."
        },
        "values": {
          "type": "null"
        }
      },
      "required": [
        "state",
        "reason",
        "values"
      ],
      "additionalProperties": false
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "schema_version",
    "identity",
    "coverage",
    "totals",
    "daily",
    "category_history",
    "authority_history",
    "notes"
  ],
  "additionalProperties": {}
}
