{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "const": "placement-context-v1"
    },
    "binding": {
      "type": "object",
      "properties": {
        "workspaceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "projectId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "watchId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "required": [
        "workspaceId",
        "projectId",
        "watchId"
      ],
      "additionalProperties": false
    },
    "revision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Optimistic concurrency revision; supply it as expectedRevision on the next write."
    },
    "applicability": {
      "type": "string"
    },
    "reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Recorded explanation; null when no explanation applies."
        },
        {
          "type": "null"
        }
      ],
      "description": "Recorded explanation; null when no explanation applies."
    },
    "summary": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string"
        },
        "count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "kind",
        "count",
        "role"
      ],
      "additionalProperties": {},
      "description": "Grouped change counts included in this delivery, limited to accessible websites."
    },
    "occurrences": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$",
            "description": "Resource identifier returned by the operation."
          },
          "captureId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Optimistic concurrency revision; supply it as expectedRevision on the next write."
          },
          "evidenceHash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "axes": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "description": "Saved lifecycle or evidence state, as enumerated for this record."
                }
              },
              "required": [
                "value",
                "state"
              ],
              "additionalProperties": {}
            }
          },
          "passages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Resource identifier returned by the operation."
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "text"
              ],
              "additionalProperties": false
            }
          },
          "canCorrect": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "captureId",
          "revision",
          "evidenceHash",
          "axes",
          "passages",
          "canCorrect"
        ],
        "additionalProperties": {}
      }
    },
    "capability": {
      "type": "object",
      "properties": {
        "suggestionsAvailable": {
          "type": "boolean"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Recorded explanation; null when no explanation applies."
            },
            {
              "type": "null"
            }
          ],
          "description": "Recorded explanation; null when no explanation applies."
        }
      },
      "required": [
        "suggestionsAvailable",
        "reason"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version",
    "binding",
    "revision",
    "applicability",
    "reason",
    "summary",
    "occurrences",
    "capability"
  ],
  "additionalProperties": {}
}
