{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "attempts.v1"
    },
    "sequence": {
      "type": "integer",
      "minimum": 1
    },
    "previous_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "draw_key": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$"
      },
      "minItems": 3,
      "maxItems": 3
    },
    "attempt": {
      "type": "integer",
      "minimum": 0
    },
    "state": {
      "enum": [
        "REGISTERED",
        "STARTED",
        "SUCCESS",
        "FAILURE",
        "TIMEOUT",
        "SCORER_CRASH",
        "INFRA_KILL",
        "INFRA_UNAVAILABLE"
      ]
    },
    "at": {
      "type": "string",
      "minLength": 1
    },
    "entry_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "artifact_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    }
  },
  "required": [
    "schema_version",
    "sequence",
    "previous_sha256",
    "draw_key",
    "attempt",
    "state",
    "at",
    "entry_sha256"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://torneo.ai/schemas/attempts.v1"
}
