{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://consentocracy.com/schemas/consentocracy-conformance.schema.json",
  "title": "Consentocracy Conformance Claim Schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "implementation",
    "claims_conformance_to",
    "charter_version",
    "assessment_status",
    "assessment_date",
    "expires_at",
    "scope",
    "requirements",
    "evidence_policy",
    "known_exceptions",
    "unresolved_risks",
    "assessor",
    "disclaimer"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "implementation": {
      "type": "string"
    },
    "implementation_url": {
      "type": "string",
      "format": "uri"
    },
    "claims_conformance_to": {
      "type": "string",
      "format": "uri"
    },
    "charter_version": {
      "type": "string"
    },
    "assessment_status": {
      "enum": [
        "self-declared",
        "independently-reviewed",
        "withdrawn",
        "expired"
      ]
    },
    "assessment_date": {
      "type": "string",
      "format": "date"
    },
    "expires_at": {
      "type": "string",
      "format": "date"
    },
    "scope": {
      "type": "object",
      "required": [
        "included",
        "excluded"
      ],
      "properties": {
        "included": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excluded": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "requirements": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "requirement_id",
          "status",
          "evidence",
          "notes"
        ],
        "properties": {
          "requirement_id": {
            "type": "string",
            "pattern": "^CO-REQ-[0-9]{3}$"
          },
          "status": {
            "enum": [
              "conformant",
              "partial",
              "nonconformant",
              "not-assessed",
              "not-applicable"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "evidence_policy": {
      "type": "string"
    },
    "known_exceptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "unresolved_risks": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "assessor": {
      "type": "object",
      "required": [
        "name",
        "independence"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "independence": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "disclaimer": {
      "type": "string"
    }
  }
}
