{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.dharma-ai.io/setup-claim-challenge/v1",
  "title": "Public setup claim challenge; not enrollment authority",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "origin", "setupReference", "organizationId", "recipientMembershipId", "publicKeyEd25519", "credentialEncryptionPublicKey", "repositoryFingerprint", "mode", "policyRevision", "scopeDigest", "contractDigest", "method", "path", "nonce", "issuedAt", "expiresAt", "authenticator"],
  "properties": {
    "schema": { "const": "dharma.setup-claim-challenge/v1" },
    "origin": { "type": "string", "maxLength": 256, "pattern": "^https://[^/]+$" },
    "setupReference": { "type": "string", "format": "uuid" },
    "organizationId": { "type": "string", "maxLength": 256, "pattern": "^org_[A-Za-z0-9]+$" },
    "recipientMembershipId": { "type": "string", "format": "uuid" },
    "publicKeyEd25519": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" },
    "credentialEncryptionPublicKey": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" },
    "repositoryFingerprint": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "mode": { "enum": ["source", "join"] },
    "policyRevision": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
    "scopeDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "contractDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "method": { "const": "POST" },
    "path": { "const": "/api/v1/agent-fabric/bootstrap/setup-claim" },
    "nonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" },
    "issuedAt": { "type": "string", "format": "date-time" },
    "expiresAt": { "type": "string", "format": "date-time" },
    "authenticator": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }
  }
}
