{
  "type": "object",
  "required": [
    "schema_version",
    "example_only",
    "task",
    "receipt",
    "events"
  ],
  "properties": {
    "schema_version": {
      "const": "0.1"
    },
    "example_only": {
      "const": true
    },
    "task": {
      "type": "object",
      "required": [
        "task_id",
        "attempt_id",
        "input_sha256",
        "acceptance_profile"
      ],
      "properties": {
        "task_id": {
          "type": "string",
          "minLength": 1
        },
        "attempt_id": {
          "type": "string",
          "minLength": 1
        },
        "input_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "acceptance_profile": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "receipt": {
      "type": "object",
      "required": [
        "task_id",
        "attempt_id",
        "provider_id",
        "runtime_version",
        "output_sha256",
        "delivered_at",
        "status",
        "settlement"
      ],
      "properties": {
        "task_id": {
          "type": "string",
          "minLength": 1
        },
        "attempt_id": {
          "type": "string",
          "minLength": 1
        },
        "provider_id": {
          "type": "string",
          "minLength": 1
        },
        "runtime_version": {
          "type": "string",
          "minLength": 1
        },
        "output_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "delivered_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        },
        "status": {
          "enum": [
            "submitted",
            "accepted",
            "running",
            "delivered",
            "validated",
            "settled",
            "failed",
            "cancelled",
            "expired",
            "rejected",
            "disputed"
          ]
        },
        "settlement": {
          "type": "null"
        }
      },
      "additionalProperties": false
    },
    "events": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "required": [
          "task_id",
          "attempt_id",
          "state",
          "at"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "minLength": 1
          },
          "attempt_id": {
            "type": "string",
            "minLength": 1
          },
          "state": {
            "enum": [
              "submitted",
              "accepted",
              "running",
              "delivered",
              "validated",
              "settled",
              "failed",
              "cancelled",
              "expired",
              "rejected",
              "disputed"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false,
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Ocean6 offline reference fixture v0.1",
  "description": "Proposed reference structure. No production API. Cross-record and lifecycle checks are in the reference verifier."
}
