{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-benchmark-details-schema.json",
  "title": "BenchmarkDetails",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-benchmarks-api-openapi.yml#/components/schemas/BenchmarkDetails",
  "properties": {
    "ingestion": {
      "anyOf": [
        {
          "$ref": "#/$defs/BenchmarkUploadProgress"
        },
        {
          "type": "null"
        }
      ]
    },
    "bench_id": {
      "type": "string",
      "title": "Bench Id"
    },
    "task_count": {
      "type": "integer",
      "title": "Task Count"
    },
    "tasks": {
      "items": {
        "$ref": "#/$defs/BenchmarkSpecTask"
      },
      "type": "array",
      "title": "Tasks"
    },
    "tools": {
      "items": {
        "$ref": "#/$defs/BenchmarkSpecTool"
      },
      "type": "array",
      "title": "Tools"
    },
    "runtimes": {
      "items": {
        "$ref": "#/$defs/BenchmarkRuntime"
      },
      "type": "array",
      "title": "Runtimes"
    }
  },
  "type": "object",
  "required": [
    "bench_id",
    "task_count"
  ],
  "$defs": {
    "BenchmarkRuntime": {
      "properties": {
        "organization_id": {
          "type": "string",
          "title": "Organization Id"
        },
        "runtime_id": {
          "type": "string",
          "title": "Runtime Id"
        },
        "image_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Ref"
        },
        "dockerfile_uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dockerfile Uri"
        },
        "content_hash": {
          "type": "string",
          "title": "Content Hash"
        },
        "provider": {
          "type": "string",
          "title": "Provider"
        },
        "blueprint_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Blueprint Id",
          "description": "Image ID of the resulting build."
        },
        "build_status": {
          "type": "string",
          "title": "Build Status"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "organization_id",
        "runtime_id",
        "content_hash",
        "provider",
        "build_status",
        "created_at"
      ],
      "title": "BenchmarkRuntime"
    },
    "BenchmarkSpecTask": {
      "properties": {
        "task_id": {
          "type": "string",
          "title": "Task Id"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Label"
        },
        "split": {
          "anyOf": [
            {
              "$ref": "#/$defs/TaskSplit"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Input Message"
        },
        "task_categories": {
          "items": {
            "$ref": "#/$defs/BenchmarkTaskCategory"
          },
          "type": "array",
          "title": "Task Categories"
        },
        "runtime_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Runtime Id"
        },
        "run_command": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Run Command",
          "description": "For SDK evaluation and training, the command to run your agent in the sandbox, e.g. `python /app/agent.py`; include the executable, not only its arguments. Your script must call the model, run any tools, log a reward, and finalize the trajectory before exiting."
        },
        "build_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Build Status"
        },
        "env_vars": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/SecretRef"
              }
            ]
          },
          "type": "object",
          "title": "Env Vars",
          "description": "Keys must match [A-Za-z_][A-Za-z0-9_]* and cannot start with TRAJECTORY_ or use MODEL_ENDPOINT_ID, MODEL_ENDPOINT_ACCESS_TOKEN, or MODEL_ENDPOINT_URL."
        }
      },
      "type": "object",
      "required": [
        "task_id"
      ],
      "title": "BenchmarkSpecTask"
    },
    "BenchmarkSpecTool": {
      "properties": {
        "tool_id": {
          "type": "string",
          "title": "Tool Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "tool_id",
        "name"
      ],
      "title": "BenchmarkSpecTool"
    },
    "BenchmarkTaskCategory": {
      "properties": {
        "task_category_id": {
          "type": "string",
          "title": "Task Category Id"
        },
        "label": {
          "type": "string",
          "title": "Label"
        }
      },
      "type": "object",
      "required": [
        "task_category_id",
        "label"
      ],
      "title": "BenchmarkTaskCategory"
    },
    "BenchmarkUploadProgress": {
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "uploading",
            "queued",
            "running",
            "cancelled",
            "succeeded",
            "partial_failure",
            "failed"
          ],
          "title": "Status"
        },
        "stage": {
          "type": "string",
          "enum": [
            "verifying",
            "registering",
            "building"
          ],
          "title": "Stage"
        },
        "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
        }
      },
      "type": "object",
      "required": [
        "status",
        "stage"
      ],
      "title": "BenchmarkUploadProgress"
    },
    "SecretRef": {
      "properties": {
        "secret_ref": {
          "type": "string",
          "title": "Secret Ref",
          "description": "Organization secret name. The containing env_vars key names the runtime variable."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "secret_ref"
      ],
      "title": "SecretRef"
    },
    "TaskSplit": {
      "type": "string",
      "enum": [
        "train",
        "test"
      ],
      "title": "TaskSplit"
    }
  }
}