{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aiwg.io/schemas/decision/HeldoutCalibrationPhase.v1.schema.json",
  "title": "HeldoutCalibrationPhase",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "study",
    "runId",
    "corpusDigest",
    "preregistrationDigest",
    "approvalDigest",
    "sealedAt",
    "rowIds",
    "lineage",
    "lineageDigest"
  ],
  "properties": {
    "schemaVersion": {
      "const": "decision-heldout-calibration-phase/v1"
    },
    "study": {
      "enum": [
        "D17",
        "D29"
      ]
    },
    "runId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"
    },
    "corpusDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "preregistrationDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "approvalDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "sealedAt": {
      "type": "string",
      "format": "date-time"
    },
    "rowIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20000,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"
      }
    },
    "lineage": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "runId",
          "evidenceDigest"
        ],
        "properties": {
          "runId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"
          },
          "evidenceDigest": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          }
        }
      }
    },
    "lineageDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    }
  }
}
