{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "recordType", "candidateId", "organizationIds", "threshold", "signers", "allVerified"],
  "properties": {
    "schemaVersion": {"const": "2.0.0"},
    "recordType": {"const": "candidate-signature-set"},
    "candidateId": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "organizationIds": {"type": "array", "minItems": 2, "maxItems": 2, "uniqueItems": true, "items": {"type": "string", "pattern": "^organization:[0-9a-f]{64}$"}},
    "threshold": {"const": {"required": 4, "total": 4}},
    "signers": {
      "type": "array", "minItems": 4, "maxItems": 4, "uniqueItems": true,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["identityId", "organizationId", "roleId", "keyType", "publicKeySha256", "authorityEvidenceId", "signedPayloadSha256", "signatureBase64", "verified"],
        "properties": {
          "identityId": {"type": "string", "pattern": "^identity:[0-9a-f]{64}$"},
          "organizationId": {"type": "string", "pattern": "^organization:[0-9a-f]{64}$"},
          "roleId": {"enum": ["release-manager", "independent-reviewer", "authorized-signatory", "partner-authorized-signatory"]},
          "keyType": {"const": "Ed25519"},
          "publicKeySha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
          "authorityEvidenceId": {"type": "string", "pattern": "^[A-Z0-9-]+$"},
          "signedPayloadSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
          "signatureBase64": {"type": "string", "minLength": 88, "maxLength": 88},
          "verified": {"const": true}
        }
      }
    },
    "allVerified": {"const": true}
  }
}
