{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://intelligencecompact.com/claims.schema.json",
  "title": "Intelligence Compact Claim Registry",
  "type": "object",
  "required": [
    "schema",
    "release",
    "canonical",
    "claims"
  ],
  "properties": {
    "schema": {
      "const": "intelligencecompact.claim-registry.v1"
    },
    "release": {
      "type": "string"
    },
    "canonical": {
      "type": "string",
      "format": "uri"
    },
    "claims": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "title",
          "claim",
          "claimClass",
          "evidenceState",
          "adoptionState",
          "scope",
          "strongestObjection",
          "whatWouldChange",
          "supportingReports",
          "challengingReports",
          "sourceTraceability"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^IC-CLAIM-[0-9]{3}$"
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "title": {
            "type": "string",
            "minLength": 12
          },
          "claim": {
            "type": "string",
            "minLength": 40
          },
          "claimClass": {
            "type": "string"
          },
          "evidenceState": {
            "type": "string"
          },
          "adoptionState": {
            "type": "string"
          },
          "decisionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "supportingReports": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "challengingReports": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "whatWouldChange": {
            "type": "string",
            "minLength": 30
          },
          "sourceTraceability": {
            "type": "object",
            "required": [
              "sourceMap",
              "supportingSourceCount",
              "challengingSourceCount",
              "summary"
            ],
            "properties": {
              "sourceMap": {
                "type": "string",
                "format": "uri-reference"
              },
              "supportingSourceCount": {
                "type": "integer",
                "minimum": 0
              },
              "challengingSourceCount": {
                "type": "integer",
                "minimum": 0
              },
              "supportingDirectSourceCount": {
                "type": "integer",
                "minimum": 0
              },
              "challengingDirectSourceCount": {
                "type": "integer",
                "minimum": 0
              },
              "summary": {
                "type": "string",
                "minLength": 40
              }
            }
          },
          "reviewedSourceTraceability": {
            "type": "object",
            "required": [
              "reviewedSourceLedger",
              "reviewedSourceCount",
              "reviewedSourceIds",
              "reviewResult",
              "reviewReason"
            ],
            "properties": {
              "reviewedSourceLedger": {
                "type": "string",
                "format": "uri-reference"
              },
              "reviewedSourceCount": {
                "type": "integer",
                "minimum": 1
              },
              "reviewedSourceIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^IC-SRC-[A-F0-9]{12}$"
                },
                "uniqueItems": true
              },
              "reviewResult": {
                "type": "string"
              },
              "reviewReason": {
                "type": "string",
                "minLength": 80
              }
            }
          }
        }
      }
    }
  }
}
