{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://genesiscode.dev/schemas/genesisbench-contamination-attestation-v0.1.json",
  "title": "GenesisBench contamination evidence attestation v0.1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "kind",
    "version",
    "runIdentitySha256",
    "claim",
    "knownExposure",
    "modelRelease",
    "training",
    "task",
    "custody",
    "contentIdentitySha256"
  ],
  "properties": {
    "kind": {"const": "genesis/genesisbench-contamination-attestation-v0.1"},
    "version": {"const": "0.1.0"},
    "runIdentitySha256": {"$ref": "#/$defs/hash"},
    "claim": {"$ref": "#/$defs/label"},
    "knownExposure": {"$ref": "#/$defs/knownExposure"},
    "modelRelease": {"$ref": "#/$defs/modelRelease"},
    "training": {"$ref": "#/$defs/training"},
    "task": {"$ref": "#/$defs/task"},
    "custody": {"$ref": "#/$defs/custody"},
    "contentIdentitySha256": {"$ref": "#/$defs/hash"}
  },
  "$defs": {
    "hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "id": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$"},
    "modelRevision": {"type": "string", "pattern": "^(?:sha256:)?[0-9a-f]{64}$"},
    "label": {"enum": ["declared-contaminated", "declared-uncontaminated", "temporal-clean", "unknown"]},
    "timestamp": {"type": "string", "pattern": "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"},
    "nullableHash": {"oneOf": [{"$ref": "#/$defs/hash"}, {"type": "null"}]},
    "nullableId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]},
    "nullableTimestamp": {"oneOf": [{"$ref": "#/$defs/timestamp"}, {"type": "null"}]},
    "reasonCodes": {
      "type": "array",
      "maxItems": 32,
      "uniqueItems": true,
      "items": {"type": "string", "pattern": "^[a-z][a-z0-9./-]{1,127}$"}
    },
    "knownExposure": {
      "type": "object",
      "additionalProperties": false,
      "required": ["exposed", "reasonCodes", "evidenceIdentitySha256"],
      "properties": {
        "exposed": {"type": "boolean"},
        "reasonCodes": {"$ref": "#/$defs/reasonCodes"},
        "evidenceIdentitySha256": {"$ref": "#/$defs/nullableHash"}
      }
    },
    "modelRelease": {
      "type": "object",
      "additionalProperties": false,
      "required": ["modelId", "modelRevision", "releasedAt", "immutableEvidenceIdentitySha256"],
      "properties": {
        "modelId": {"$ref": "#/$defs/id"},
        "modelRevision": {"$ref": "#/$defs/modelRevision"},
        "releasedAt": {"$ref": "#/$defs/nullableTimestamp"},
        "immutableEvidenceIdentitySha256": {"$ref": "#/$defs/nullableHash"}
      }
    },
    "training": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "cutoffAt",
        "provenanceComplete",
        "nonExposureAttested",
        "attestationIdentitySha256"
      ],
      "properties": {
        "cutoffAt": {"$ref": "#/$defs/nullableTimestamp"},
        "provenanceComplete": {"type": "boolean"},
        "nonExposureAttested": {"type": "boolean"},
        "attestationIdentitySha256": {"$ref": "#/$defs/nullableHash"}
      }
    },
    "task": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "visibilityClass",
        "epochId",
        "commitmentSnapshotIdentitySha256",
        "precommittedAt",
        "disclosedAt"
      ],
      "properties": {
        "visibilityClass": {"enum": ["held-out-commitment", "public-anchor-hidden-oracle", "public-development-reference", "temporal-held-out"]},
        "epochId": {"$ref": "#/$defs/nullableId"},
        "commitmentSnapshotIdentitySha256": {"$ref": "#/$defs/nullableHash"},
        "precommittedAt": {"$ref": "#/$defs/nullableTimestamp"},
        "disclosedAt": {"$ref": "#/$defs/nullableTimestamp"}
      }
    },
    "custody": {
      "type": "object",
      "additionalProperties": false,
      "required": ["separated", "attestationIdentitySha256"],
      "properties": {
        "separated": {"type": "boolean"},
        "attestationIdentitySha256": {"$ref": "#/$defs/nullableHash"}
      }
    }
  }
}
