{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://intelligencecompact.com/claims/reviewed-sources.schema.json",
  "title": "Intelligence Compact Reviewed Source Notes",
  "type": "object",
  "required": [
    "schema",
    "release",
    "dateModified",
    "canonical",
    "description",
    "truthBoundary",
    "sources",
    "claimReviews"
  ],
  "properties": {
    "schema": {
      "const": "intelligencecompact.reviewed-source-notes.v1"
    },
    "release": {
      "type": "string"
    },
    "dateModified": {
      "type": "string",
      "format": "date"
    },
    "canonical": {
      "type": "string",
      "format": "uri"
    },
    "description": {
      "type": "string",
      "minLength": 20
    },
    "truthBoundary": {
      "type": "string",
      "minLength": 20
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "url",
          "documentTitle",
          "issuingInstitution",
          "documentType",
          "legalForce",
          "hostStatus",
          "firstParty",
          "supports",
          "limitation",
          "reviewedForClaims",
          "reviewStatus",
          "reviewDate",
          "reviewer",
          "publicationDate",
          "jurisdiction"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^IC-SRC-[A-F0-9]{12}$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "documentTitle": {
            "type": "string"
          },
          "issuingInstitution": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "publicationDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "jurisdiction": {
            "type": [
              "string",
              "null"
            ]
          },
          "legalForce": {
            "type": "string"
          },
          "hostStatus": {
            "type": "string"
          },
          "firstParty": {
            "type": "boolean"
          },
          "supports": {
            "type": "string",
            "minLength": 20
          },
          "limitation": {
            "type": "string",
            "minLength": 20
          },
          "reviewedForClaims": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^IC-CLAIM-[0-9]{3}$"
            },
            "uniqueItems": true
          },
          "reviewStatus": {
            "const": "document_level_reviewed"
          },
          "reviewDate": {
            "type": "string",
            "format": "date"
          },
          "reviewer": {
            "type": "string"
          },
          "reviewedPassages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "versionNote": {
            "type": "string",
            "minLength": 20
          }
        }
      }
    },
    "claimReviews": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "claimId",
          "claimStateBefore",
          "claimStateAfter",
          "adoptionState",
          "result",
          "reason",
          "sourceIds"
        ],
        "properties": {
          "claimId": {
            "type": "string",
            "pattern": "^IC-CLAIM-[0-9]{3}$"
          },
          "claimStateBefore": {
            "type": "string"
          },
          "claimStateAfter": {
            "type": "string"
          },
          "adoptionState": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "minLength": 20
          },
          "sourceIds": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^IC-SRC-[A-F0-9]{12}$"
            },
            "uniqueItems": true
          }
        }
      }
    }
  }
}
