{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dealeragentprotocol.com/conformance/claim.schema.json",
  "title": "Dealer Agent Protocol conformance claim",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "claim_version", "claim_id", "status", "specification", "implementation",
    "profiles", "mcp_revisions", "test_run", "issued_at", "expires_at", "signer"
  ],
  "properties": {
    "claim_version": { "const": "1" },
    "claim_id": { "type": "string", "minLength": 1, "maxLength": 200 },
    "status": { "const": "active" },
    "specification": {
      "type": "object",
      "additionalProperties": false,
      "required": ["version", "uri", "digest"],
      "properties": {
        "version": { "const": "0.1" },
        "uri": { "type": "string", "format": "uri" },
        "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
      }
    },
    "implementation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name", "version", "endpoint", "source_revision", "operator",
        "organization_ids", "rooftop_ids", "tools", "resources", "auth_modes"
      ],
      "properties": {
        "name": { "type": "string", "minLength": 1, "maxLength": 200 },
        "version": { "type": "string", "minLength": 1, "maxLength": 80 },
        "endpoint": { "type": "string", "format": "uri" },
        "source_revision": { "type": "string", "minLength": 7, "maxLength": 128 },
        "operator": { "type": "string", "minLength": 1, "maxLength": 200 },
        "organization_ids": {
          "type": "array", "minItems": 1, "uniqueItems": true,
          "items": { "$ref": "../spec/v0.1/schemas/common.schema.json#/$defs/identifier" }
        },
        "rooftop_ids": {
          "type": "array", "minItems": 1, "uniqueItems": true,
          "items": { "$ref": "../spec/v0.1/schemas/common.schema.json#/$defs/identifier" }
        },
        "tools": {
          "type": "array", "minItems": 1, "uniqueItems": true,
          "items": { "type": "string", "pattern": "^dealeragent\\.[a-z0-9._-]+$" }
        },
        "resources": {
          "type": "array", "minItems": 1, "uniqueItems": true,
          "items": { "type": "string", "pattern": "^dealeragent://" }
        },
        "auth_modes": {
          "type": "array", "minItems": 1, "uniqueItems": true,
          "items": { "type": "string", "enum": ["public", "oauth_2_1", "workload_identity"] }
        },
        "extensions": {
          "type": "array", "uniqueItems": true,
          "items": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)+/[0-9]+\\.[0-9]+$" }
        }
      }
    },
    "profiles": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^dealeragent\\.[a-z0-9.-]+/0\\.1$" }
    },
    "mcp_revisions": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
      "contains": { "const": "2026-07-28" }
    },
    "test_run": {
      "type": "object",
      "additionalProperties": false,
      "required": ["suite_version", "result", "completed_at", "report_digest", "report_uri"],
      "properties": {
        "suite_version": { "type": "string", "minLength": 1, "maxLength": 80 },
        "result": { "const": "pass" },
        "completed_at": { "type": "string", "format": "date-time" },
        "report_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
        "report_uri": { "type": "string", "format": "uri" }
      }
    },
    "exceptions": {
      "type": "array",
      "maxItems": 32,
      "items": { "type": "string", "minLength": 1, "maxLength": 500 }
    },
    "issued_at": { "type": "string", "format": "date-time" },
    "expires_at": { "type": "string", "format": "date-time" },
    "signer": {
      "type": "object",
      "additionalProperties": false,
      "required": ["organization", "key_id", "signature"],
      "properties": {
        "organization": { "type": "string", "minLength": 1, "maxLength": 200 },
        "key_id": { "type": "string", "minLength": 1, "maxLength": 500 },
        "signature": { "type": "string", "minLength": 32, "maxLength": 8192 }
      }
    }
  }
}
