{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.reits.tech/schemas/auth-s08-owner-ballot.v1.schema.json",
  "title": "Auth S08 R02 独立 Owner Ballot",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "subknifeId",
    "ballotId",
    "dossierSubknifeId",
    "dossierDigest",
    "ownerId",
    "decision",
    "identityRef",
    "keyRef",
    "nonce",
    "issuedAt",
    "expiresAt",
    "evidenceVectorDigest",
    "checksDigest",
    "checkResults",
    "attestation",
    "signatureAlgorithm",
    "signature"
  ],
  "properties": {
    "schemaVersion": {
      "const": "reits.tech/auth-s08-owner-ballot/v1"
    },
    "subknifeId": {
      "const": "D05-A03-P03c-S08-R02-C01"
    },
    "ballotId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 160
    },
    "dossierSubknifeId": {
      "const": "D05-A03-P03c-S08-R01"
    },
    "dossierDigest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "ownerId": {
      "enum": [
        "AUTH",
        "SECURITY",
        "SRE_DBA",
        "QA_WITNESS"
      ]
    },
    "decision": {
      "enum": [
        "ACCEPT",
        "REJECT"
      ]
    },
    "identityRef": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9+.-]*://",
      "minLength": 8,
      "maxLength": 512
    },
    "keyRef": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9+.-]*://",
      "minLength": 8,
      "maxLength": 512
    },
    "nonce": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,}$",
      "maxLength": 256
    },
    "issuedAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "evidenceVectorDigest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "checksDigest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "checkResults": {
      "type": "array",
      "minItems": 6,
      "maxItems": 6,
      "prefixItems": [
        {
          "$ref": "#/$defs/check1"
        },
        {
          "$ref": "#/$defs/check2"
        },
        {
          "$ref": "#/$defs/check3"
        },
        {
          "$ref": "#/$defs/check4"
        },
        {
          "$ref": "#/$defs/check5"
        },
        {
          "$ref": "#/$defs/check6"
        }
      ],
      "items": false
    },
    "attestation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "humanSigner",
        "reviewedIndependently",
        "delegated",
        "executionPermit"
      ],
      "properties": {
        "humanSigner": {
          "const": true
        },
        "reviewedIndependently": {
          "const": true
        },
        "delegated": {
          "const": false
        },
        "executionPermit": {
          "const": false
        }
      }
    },
    "signatureAlgorithm": {
      "const": "ED25519"
    },
    "signature": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    }
  },
  "$defs": {
    "check1": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ordinal",
        "accepted"
      ],
      "properties": {
        "ordinal": {
          "const": 1
        },
        "accepted": {
          "type": "boolean"
        }
      }
    },
    "check2": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ordinal",
        "accepted"
      ],
      "properties": {
        "ordinal": {
          "const": 2
        },
        "accepted": {
          "type": "boolean"
        }
      }
    },
    "check3": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ordinal",
        "accepted"
      ],
      "properties": {
        "ordinal": {
          "const": 3
        },
        "accepted": {
          "type": "boolean"
        }
      }
    },
    "check4": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ordinal",
        "accepted"
      ],
      "properties": {
        "ordinal": {
          "const": 4
        },
        "accepted": {
          "type": "boolean"
        }
      }
    },
    "check5": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ordinal",
        "accepted"
      ],
      "properties": {
        "ordinal": {
          "const": 5
        },
        "accepted": {
          "type": "boolean"
        }
      }
    },
    "check6": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ordinal",
        "accepted"
      ],
      "properties": {
        "ordinal": {
          "const": 6
        },
        "accepted": {
          "type": "boolean"
        }
      }
    }
  }
}
