{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-benchmark-ingestion-operation-status-schema.json",
  "title": "BenchmarkIngestionOperationStatus",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-benchmark-ingestion-api-openapi.yml#/components/schemas/BenchmarkIngestionOperationStatus",
  "properties": {
    "operation_id": {
      "type": "string",
      "title": "Operation Id"
    },
    "bench_id": {
      "type": "string",
      "title": "Bench Id"
    },
    "status": {
      "type": "string",
      "enum": [
        "uploading",
        "queued",
        "running",
        "cancelled",
        "succeeded",
        "partial_failure",
        "failed"
      ],
      "title": "Status"
    },
    "stage": {
      "type": "string",
      "enum": [
        "verifying",
        "registering",
        "building"
      ],
      "title": "Stage"
    },
    "attempt": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Attempt"
    },
    "max_attempts": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Max Attempts"
    },
    "last_error": {
      "anyOf": [
        {
          "$ref": "#/$defs/BenchmarkIngestionFailure"
        },
        {
          "type": "null"
        }
      ]
    },
    "task_count": {
      "type": "integer",
      "title": "Task Count",
      "default": 0
    },
    "added_count": {
      "type": "integer",
      "title": "Added Count",
      "default": 0
    },
    "updated_count": {
      "type": "integer",
      "title": "Updated Count",
      "default": 0
    },
    "skipped_count": {
      "type": "integer",
      "title": "Skipped Count",
      "default": 0
    },
    "registered_tasks": {
      "type": "integer",
      "title": "Registered Tasks",
      "default": 0
    },
    "total_tasks": {
      "type": "integer",
      "title": "Total Tasks",
      "default": 0
    },
    "ready_runtimes": {
      "type": "integer",
      "title": "Ready Runtimes",
      "default": 0
    },
    "total_runtimes": {
      "type": "integer",
      "title": "Total Runtimes",
      "default": 0
    },
    "failure_count": {
      "type": "integer",
      "title": "Failure Count",
      "default": 0
    },
    "build_images": {
      "type": "boolean",
      "title": "Build Images"
    },
    "ready": {
      "type": "boolean",
      "title": "Ready",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "operation_id",
    "bench_id",
    "status",
    "stage",
    "attempt",
    "max_attempts",
    "build_images"
  ],
  "$defs": {
    "BenchmarkIngestionFailure": {
      "properties": {
        "stage": {
          "type": "string",
          "enum": [
            "verifying",
            "registering",
            "building"
          ],
          "title": "Stage"
        },
        "resource_type": {
          "type": "string",
          "enum": [
            "submission",
            "upload",
            "task",
            "runtime"
          ],
          "title": "Resource Type"
        },
        "resource_id": {
          "type": "string",
          "title": "Resource Id"
        },
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "retryable": {
          "type": "boolean",
          "title": "Retryable"
        },
        "provider_status_code": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 599.0,
              "minimum": 100.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Status Code"
        },
        "affected_tasks_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Affected Tasks Cursor"
        },
        "resolved": {
          "type": "boolean",
          "title": "Resolved",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "stage",
        "resource_type",
        "resource_id",
        "code",
        "message",
        "retryable"
      ],
      "title": "BenchmarkIngestionFailure"
    }
  }
}