{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "project",
            "project_review_session"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "type",
        "id"
      ]
    },
    "bundle": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "commentary_evidence"
        },
        "contractVersion": {
          "const": 1
        },
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[^\\s]+$"
              },
              "revisionId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[^\\s]+$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "requirement",
                  "claim",
                  "evidence"
                ]
              },
              "title": {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              "targets": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProjectAgentExactTarget"
                },
                "maxItems": 100,
                "minItems": 1
              },
              "expectedOutcomeMarkdown": {
                "type": "string",
                "maxLength": 32768,
                "minLength": 1
              },
              "statementMarkdown": {
                "type": "string",
                "maxLength": 32768,
                "minLength": 1
              },
              "evidenceRevisionIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512,
                  "pattern": "^[^\\s]+$"
                },
                "maxItems": 100,
                "minItems": 0,
                "uniqueItems": true
              },
              "requirementRevisionIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512,
                  "pattern": "^[^\\s]+$"
                },
                "maxItems": 100,
                "minItems": 0,
                "uniqueItems": true
              },
              "relations": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "requirement",
                            "claim",
                            "evidence"
                          ]
                        },
                        "revisionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512,
                          "pattern": "^[^\\s]+$"
                        }
                      },
                      "required": [
                        "kind",
                        "revisionId"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "resource"
                          ]
                        },
                        "target": {
                          "$ref": "#/components/schemas/ProjectAgentExactTarget"
                        }
                      },
                      "required": [
                        "kind",
                        "target"
                      ]
                    }
                  ]
                },
                "maxItems": 100,
                "minItems": 0
              },
              "result": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "providerReference": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "github",
                      "azure_devops"
                    ]
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "pattern": "^[^\\s]+$"
                  },
                  "commitSha": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{40,64}$"
                  }
                },
                "required": [
                  "provider",
                  "runId",
                  "commitSha"
                ]
              },
              "report": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "html",
                      "xml",
                      "json",
                      "log"
                    ]
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 262144
                  }
                },
                "required": [
                  "format",
                  "content"
                ]
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "revisionId",
              "kind",
              "title",
              "targets",
              "relations",
              "archived"
            ]
          },
          "maxItems": 100,
          "minItems": 0
        }
      },
      "required": [
        "kind",
        "contractVersion",
        "entries"
      ]
    }
  },
  "required": [
    "context",
    "bundle"
  ]
}