{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-operator-run-detail-schema.json",
  "title": "OperatorRunDetail",
  "description": "A run with its full paper trail: the history it was given, every model\ncall, and the response envelope's metadata.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-graph-audit-api-openapi.yml#/components/schemas/OperatorRunDetail",
  "properties": {
    "operation_id": {
      "type": "string",
      "title": "Operation Id",
      "description": "The run's operation id; every mutation audit entry the run made carries it as `operation_id`"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Thread Id",
      "description": "The conversation the run belongs to, when the caller threaded it; null for a standalone API call"
    },
    "user_id": {
      "type": "string",
      "title": "User Id",
      "description": "The user the run ran as"
    },
    "operator_type": {
      "type": "string",
      "title": "Operator Type",
      "description": "The operator that ran"
    },
    "mode": {
      "type": "string",
      "title": "Mode",
      "description": "The execution mode the run used"
    },
    "status": {
      "type": "string",
      "enum": [
        "completed",
        "failed",
        "cancelled"
      ],
      "title": "Status",
      "description": "How the run ended"
    },
    "question": {
      "type": "string",
      "title": "Question",
      "description": "The message the run was given"
    },
    "answer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Answer",
      "description": "The operator's answer; null when the run did not reach one"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error",
      "description": "Why a failed run failed"
    },
    "credits_consumed": {
      "type": "number",
      "title": "Credits Consumed",
      "description": "Credits the run's model calls cost",
      "default": 0.0
    },
    "call_count": {
      "type": "integer",
      "title": "Call Count",
      "description": "Model calls the run made",
      "default": 0
    },
    "tools_called": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tools Called",
      "description": "The tools the run called, each named once"
    },
    "write_count": {
      "type": "integer",
      "title": "Write Count",
      "description": "Writes the run made to the graph",
      "default": 0
    },
    "started_at": {
      "type": "string",
      "format": "date-time",
      "title": "Started At",
      "description": "When the run started on the worker"
    },
    "finished_at": {
      "type": "string",
      "format": "date-time",
      "title": "Finished At",
      "description": "When the run ended"
    },
    "duration_ms": {
      "type": "number",
      "title": "Duration Ms",
      "description": "How long the run took"
    },
    "history": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "History",
      "description": "The prior turns the run was given, as role/content pairs"
    },
    "transcript": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Transcript",
      "description": "One entry per model call, in order: the input added since the previous call (the question, then each turn's tool results), the model's output blocks (text and tool calls), stop reason, token usage and credits. The first entry also carries the system prompt's SHA-256 and size and the tool names offered; later entries repeat them only when they change"
    },
    "result": {
      "additionalProperties": true,
      "type": "object",
      "title": "Result",
      "description": "The response envelope's metadata without its result rows: tokens, credits, the Cypher run, the writes made, confidence and loop flags"
    }
  },
  "type": "object",
  "required": [
    "operation_id",
    "user_id",
    "operator_type",
    "mode",
    "status",
    "question",
    "started_at",
    "finished_at",
    "duration_ms"
  ]
}