{
  "components": {
    "schemas": {
      "ActionCall": {
        "description": "The body of ``POST /api/plugins/{wf}/actions/{name}`` (08 \u00a7Plugins).\n\n``input`` is whatever the action's form produced, and it is\nvalidated against the action's own model on arrival rather than\ndescribed here: the model is the plugin's, so no schema this\napplication generates could name it (09 \u00a7Declarations, \"the model\n**is** the form\"). An action that declares none takes none, and\nwhatever was sent is ignored.",
        "properties": {
          "input": {
            "description": "The form's value. Validated against the action's model; a misfit is the 422 of 08 \u00a7Conventions, naming each field.",
            "title": "Input"
          },
          "scope": {
            "$ref": "#/components/schemas/ActionScope",
            "description": "The ids the handler's context is resolved from."
          }
        },
        "title": "ActionCall",
        "type": "object"
      },
      "ActionOut": {
        "description": "One action of the manifest, and the form the SPA renders for it.",
        "properties": {
          "confirm": {
            "description": "Whether the SPA asks for confirmation before calling it.",
            "title": "Confirm",
            "type": "boolean"
          },
          "name": {
            "description": "The action's name, as its URL spells it.",
            "title": "Name",
            "type": "string"
          },
          "schema": {
            "additionalProperties": true,
            "description": "JSON Schema of the input model \u2014 the form itself.",
            "title": "Schema",
            "type": "object"
          },
          "scope": {
            "$ref": "#/components/schemas/Slot",
            "description": "What has to be resolved before it can run."
          },
          "title": {
            "description": "What the button and the palette entry say.",
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "name",
          "title",
          "scope",
          "confirm",
          "schema"
        ],
        "title": "ActionOut",
        "type": "object"
      },
      "ActionScope": {
        "description": "Where an action was invoked (08 \u00a7Plugins, 09 \u00a7Context and scopes).\n\nThe three ids a plugin *route* reads off its query string, sent in\nthe body because an action is a ``POST``. All three are optional\nhere: what an action needs resolved is the ``scope`` it declared,\nand :func:`mount_actions` is what holds the body to it.",
        "properties": {
          "node": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The node the action was invoked on.",
            "title": "Node"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The run the action was invoked on.",
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The attempt the action was invoked on.",
            "title": "Task Id"
          }
        },
        "title": "ActionScope",
        "type": "object"
      },
      "AgentStats": {
        "additionalProperties": false,
        "description": "The stats entry of 05 \u00a7Stats entry verbatim.\n\nEvery measurement is optional because 05 omits what it cannot\ndetermine rather than zero-filling it (01 \u00a7Real data only).",
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost"
          },
          "denied_permissions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Denied Permissions"
          },
          "duration_s": {
            "title": "Duration S",
            "type": "number"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          },
          "reason": {
            "anyOf": [
              {
                "enum": [
                  "refusal",
                  "cancelled",
                  "truncated",
                  "timeout",
                  "shutdown",
                  "transport",
                  "no_submission"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "repair_turns": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repair Turns"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "status": {
            "enum": [
              "ok",
              "failed"
            ],
            "title": "Status",
            "type": "string"
          },
          "tool_calls": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Calls"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          }
        },
        "required": [
          "node",
          "attempt",
          "status",
          "duration_s"
        ],
        "title": "AgentStats",
        "type": "object"
      },
      "AgentStatsEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/AgentStats"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "agent.stats",
            "default": "agent.stats",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "AgentStatsEvent",
        "type": "object"
      },
      "AgentTask": {
        "description": "One attempt as the agent running it sees it (08 \u00a7Agent-facing).\n\nThe identity of the attempt, the run's title and description, the\npayload the node was called with, and the work log that is the\ninter-stage channel (D4). Everything an agent needs to start, and\nnothing an operator route would add.",
        "properties": {
          "attempt": {
            "description": "Which attempt of this node this is, from 1.",
            "title": "Attempt",
            "type": "integer"
          },
          "description": {
            "description": "The operator's longer brief for the run.",
            "title": "Description",
            "type": "string"
          },
          "input": {
            "description": "The payload the node was enqueued with; null when it had none.",
            "title": "Input"
          },
          "log": {
            "description": "The run's work log, oldest first and never truncated, without the `stats` entries.",
            "items": {
              "$ref": "#/components/schemas/LogEntry"
            },
            "title": "Log",
            "type": "array"
          },
          "node": {
            "description": "The node this attempt executes.",
            "title": "Node",
            "type": "string"
          },
          "output_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The JSON Schema a submission must fit, when the agent fa\u00e7ade running this attempt declared an `output_model`.",
            "title": "Output Schema"
          },
          "run_id": {
            "description": "The run the attempt belongs to.",
            "title": "Run Id",
            "type": "string"
          },
          "task_id": {
            "description": "This attempt's id; the one the token is for.",
            "title": "Task Id",
            "type": "integer"
          },
          "title": {
            "description": "The operator's title for the run.",
            "title": "Title",
            "type": "string"
          },
          "workflow": {
            "description": "The workflow being run.",
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "run_id",
          "workflow",
          "node",
          "attempt",
          "title",
          "description",
          "log"
        ],
        "title": "AgentTask",
        "type": "object"
      },
      "Answer": {
        "description": "Answer a request (`POST /api/requests/{id}/answer`, 06 \u00a7The model).\n\n``option_id`` for an ``options`` request and ``value`` for a ``text``\nor ``form`` one. Both are optional here because ``value`` may\nlegitimately be any JSON \u2014 including ``null``, which is why \"which one\nwas given\" cannot be decided by looking at the values alone: the\nrequest's own ``mode`` decides, and the request service refuses the\nmismatch with the error code 06 \u00a7Errors names for it.",
        "properties": {
          "option_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The chosen option, for an `options` request.",
            "title": "Option Id"
          },
          "value": {
            "description": "The answer, for a `text` or `form` request.",
            "title": "Value"
          }
        },
        "title": "Answer",
        "type": "object"
      },
      "AnswerAuthor": {
        "description": "Who answered. ``engine`` is a headless fallback: a permission\ntimeout action or a declined elicitation (06 \u00a7Timeouts).",
        "enum": [
          "user",
          "engine"
        ],
        "title": "AnswerAuthor",
        "type": "string"
      },
      "AnswerPoll": {
        "description": "The result of one long-poll (`GET \u2026/requests/{rid}`, 06 \u00a7Surfaces).\n\n``answered`` is the field to branch on. Until it is true the other\ntwo are absent, because a request with no answer has no author\neither; once it is true ``answer`` is the chosen ``option_id`` of an\n``options`` request and the value of a ``text`` or ``form`` one \u2014\nthe same folding :class:`~athanore.store.rows.RequestView` does, so\nan operator reading the request and the agent reading its answer see\nthe same value.\n\nRe-delivery is idempotent: nothing is claimed by a poll, so an agent\nthat lost a response and asked again gets the same answer again.",
        "properties": {
          "answer": {
            "description": "The chosen `option_id`, or the value of a `text` or `form` answer. Null before an answer, and for an answer that was null.",
            "title": "Answer"
          },
          "answered": {
            "description": "Whether an answer has been recorded.",
            "title": "Answered",
            "type": "boolean"
          },
          "answered_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerAuthor"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who answered: the operator, or the engine on a headless fallback. Null until answered."
          },
          "request_id": {
            "description": "The request that was polled.",
            "title": "Request Id",
            "type": "integer"
          }
        },
        "required": [
          "request_id",
          "answered"
        ],
        "title": "AnswerPoll",
        "type": "object"
      },
      "ApiError": {
        "additionalProperties": true,
        "description": "The body of every refusal: ``{error, code, ...extras}``.\n\n``code`` is the :class:`~athanore.api.errors.ErrorCode` vocabulary,\nreferenced rather than inlined, which is how the SPA gets a union\ninstead of a bare string (08 \u00a7OpenAPI). ``errors`` is the extra a\nvalidation failure and a rejected submission carry, and it is 18's\n:class:`~athanore.events.payloads.ValidationError` rather than a\nsecond model of the same three fields: one function\n(:func:`~athanore.agents.submissions.validate_submission`) projects\npydantic's errors onto ``loc``/``msg``/``type``, and the list it\nreturns is what the 422 body carries *and* what ``submission.rejected``\npublishes. The rest of 08's \"...extras\" are open, so the schema allows\nfurther properties rather than pretending the two named fields are all\na body can hold.",
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "The stable code a client branches on; the wording of `error` may change, this may not."
          },
          "error": {
            "description": "What went wrong, for a person to read.",
            "title": "Error",
            "type": "string"
          },
          "errors": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per-field detail, on a validation failure or a rejected submission. Absent otherwise.",
            "title": "Errors"
          }
        },
        "required": [
          "error",
          "code"
        ],
        "title": "ApiError",
        "type": "object"
      },
      "Arrivals": {
        "description": "How much of an open fan-out has reached a join (04 \u00a7Fan-in).\n\nThe innermost pending fan-out, which is the one the operator is\nwaiting on; the SPA renders it as `2 of 3 arrived` (10 \u00a7Graph pane).",
        "properties": {
          "arrived": {
            "description": "Branches that have reached the join.",
            "title": "Arrived",
            "type": "integer"
          },
          "count": {
            "description": "Branches the fan-out opened.",
            "title": "Count",
            "type": "integer"
          }
        },
        "required": [
          "arrived",
          "count"
        ],
        "title": "Arrivals",
        "type": "object"
      },
      "Ask": {
        "description": "A question an agent puts to the operator (`POST \u2026/ask`, 06).\n\n``schema`` is spelled ``schema_`` in Python, as it is in\n:class:`~athanore.api.schemas.requests.RequestView`, and keeps\n``schema`` as its alias \u2014 the name 08 and the curl line of 19 fix on\nthe wire.",
        "properties": {
          "options": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/AskOption"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The choices, for a pick-one question. A bare string is an option that is its own id and label.",
            "title": "Options"
          },
          "prompt": {
            "description": "The question, as the operator will read it.",
            "minLength": 1,
            "title": "Prompt",
            "type": "string"
          },
          "schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "A JSON Schema the answer must fit, for a form question.",
            "title": "Schema"
          }
        },
        "required": [
          "prompt"
        ],
        "title": "Ask",
        "type": "object"
      },
      "AskOption": {
        "description": "One choice an agent offers the operator (08 \u00a7Agent-facing).\n\n``option_id`` is what an answer names and what comes back from the\nlong-poll; ``name`` is what the operator is shown and defaults to the\nid, which is what a bare string in ``options`` is short for.",
        "properties": {
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A label for the option; carried through as given.",
            "title": "Kind"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What to show the operator; the `option_id` when omitted.",
            "title": "Name"
          },
          "option_id": {
            "description": "The id an answer names.",
            "minLength": 1,
            "title": "Option Id",
            "type": "string"
          }
        },
        "required": [
          "option_id"
        ],
        "title": "AskOption",
        "type": "object"
      },
      "AskOut": {
        "description": "The request an ask opened (08 \u00a7Agent-facing).\n\n``mode`` is reported back because the agent did not choose it\ndirectly: it sent options, a schema or neither, and this is what that\nwas read as \u2014 which is also what tells it what shape of answer to\nexpect from the long-poll.",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/RequestMode",
            "description": "The shape of the answer expected."
          },
          "request_id": {
            "description": "The id to poll for an answer.",
            "title": "Request Id",
            "type": "integer"
          }
        },
        "required": [
          "request_id",
          "mode"
        ],
        "title": "AskOut",
        "type": "object"
      },
      "BranchRef": {
        "description": "Which branch an output came out of (D58).\n\nThe index and the key of each frame, and not the frame's ``fanout`` or\n``count``: an output names its branch so a consumer can group by it,\nand the task it came from is in the same entry for anything more.",
        "properties": {
          "index": {
            "description": "The branch's zero-based index in its fan-out.",
            "title": "Index",
            "type": "integer"
          },
          "key": {
            "description": "The payload that branch was given.",
            "title": "Key"
          }
        },
        "required": [
          "index"
        ],
        "title": "BranchRef",
        "type": "object"
      },
      "ChunkKind": {
        "description": "The kinds of the agent transcript (05 \u00a7The ACP client).\n\n``text`` and ``thought`` are the assistant's message and reasoning\nchunks, ``tool_call``/``tool_result`` the ACP tool updates, ``notice``\na line the fa\u00e7ade itself wrote.",
        "enum": [
          "text",
          "thought",
          "tool_call",
          "tool_result",
          "notice"
        ],
        "title": "ChunkKind",
        "type": "string"
      },
      "Created": {
        "description": "The 201 body of ``POST /api/workflows/{name}/runs`` (08 \u00a7Workflows).",
        "properties": {
          "run_id": {
            "description": "The id of the run that was queued.",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id"
        ],
        "title": "Created",
        "type": "object"
      },
      "EdgeKind": {
        "description": "What kind of edge one node's arrow to another is (08 \u00a7Graph semantics).",
        "enum": [
          "forward",
          "back",
          "join"
        ],
        "title": "EdgeKind",
        "type": "string"
      },
      "EditRun": {
        "description": "Change a run's title, its description, or both (`PATCH /api/runs/{id}`).\n\nBoth fields are optional and a field that is absent is left alone \u2014\nwhich is why they are optional rather than defaulted: an edit that\nsent no description must not blank one. An edit that names neither is\naccepted and changes nothing, which is what ``Ops.edit`` does with it:\na patch is not the place to refuse a caller for being redundant.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The new description, if changing.",
            "title": "Description"
          },
          "title": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The new title, if changing.",
            "title": "Title"
          }
        },
        "title": "EditRun",
        "type": "object"
      },
      "EngineRecovered": {
        "additionalProperties": false,
        "description": "Rows reset to ``ready`` at startup. No ``run_id``.",
        "properties": {
          "task_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Task Ids",
            "type": "array"
          }
        },
        "required": [
          "task_ids"
        ],
        "title": "EngineRecovered",
        "type": "object"
      },
      "EngineRecoveredEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/EngineRecovered"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "engine.recovered",
            "default": "engine.recovered",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "EngineRecoveredEvent",
        "type": "object"
      },
      "EngineStopping": {
        "additionalProperties": false,
        "description": "Attempts interrupted by a shutdown (04 \u00a7Shutdown). No ``run_id``.",
        "properties": {
          "task_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Task Ids",
            "type": "array"
          }
        },
        "required": [
          "task_ids"
        ],
        "title": "EngineStopping",
        "type": "object"
      },
      "EngineStoppingEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/EngineStopping"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "engine.stopping",
            "default": "engine.stopping",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "EngineStoppingEvent",
        "type": "object"
      },
      "ErrorCode": {
        "description": "The stable ``code`` of an error body \u2014 08 \u00a7Conventions, in full.\n\nA code is a contract with the SPA and the CLI: it is what a client\nbranches on, so it outlives any wording change to ``error``. Adding\none is a change to 08 and to the TypeScript mirror, never to this\nmodule alone.",
        "enum": [
          "not_found",
          "conflict",
          "forbidden",
          "unauthorized",
          "validation",
          "invalid_option",
          "already_answered",
          "stale_request",
          "graph_error",
          "unknown_workflow",
          "unknown_node",
          "payload_too_large",
          "plugin_error",
          "workflow_load_failed",
          "unknown_pool",
          "registration_unavailable",
          "persist_failed"
        ],
        "title": "ErrorCode",
        "type": "string"
      },
      "EventName": {
        "description": "Every event name in the vocabulary, one member per row of 03.\n\nValues are ``subject.verb``. Adding one is a change to 03 and to the\nTypeScript mirror, never to this module alone.",
        "enum": [
          "run.created",
          "run.started",
          "run.updated",
          "run.reordered",
          "run.paused",
          "run.resumed",
          "run.cancelled",
          "run.deleted",
          "run.completed",
          "run.failed",
          "task.enqueued",
          "join.arrived",
          "task.started",
          "task.done",
          "task.failed",
          "task.dead_lettered",
          "task.waiting",
          "task.resumed",
          "task.cancelled",
          "task.moved",
          "task.status_set",
          "task.stream",
          "submission.accepted",
          "submission.rejected",
          "submission.repair",
          "request.opened",
          "request.answered",
          "log.appended",
          "agent.stats",
          "engine.recovered",
          "engine.stopping",
          "workflow.registered",
          "workflow.replaced",
          "workflow.unregistered"
        ],
        "title": "EventName",
        "type": "string"
      },
      "GraphBranch": {
        "description": "The tasks of one node that belong to one branch of a fan-out.\n\n``from_task`` is the fan-out that produced the branch \u2014 the\n``lineage.from`` of the first task in the branch chain whose parent\nreturned a list \u2014 and is ``null`` for a node reached by a single path,\nwhich has exactly one branch.",
        "properties": {
          "from_task": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The fan-out task this branch came out of.",
            "title": "From Task"
          },
          "tasks": {
            "description": "This node's attempts in that branch, oldest first.",
            "items": {
              "type": "integer"
            },
            "title": "Tasks",
            "type": "array"
          }
        },
        "title": "GraphBranch",
        "type": "object"
      },
      "GraphEdge": {
        "description": "One arrow of the finalized graph, and how often this run took it.\n\n``from`` is a Python keyword, so the field is ``from_`` and carries\n``from`` as its alias \u2014 the name 08 fixes on the wire.",
        "properties": {
          "from": {
            "description": "The node the arrow leaves.",
            "title": "From",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/EdgeKind",
            "description": "Forward, a loop back, or an arrow into a join."
          },
          "to": {
            "description": "The node it points at.",
            "title": "To",
            "type": "string"
          },
          "traversed": {
            "description": "How often this run took the edge: `task.enqueued reason=transition` between the two nodes, plus `join.arrived` for a join edge.",
            "title": "Traversed",
            "type": "integer"
          }
        },
        "required": [
          "from",
          "to",
          "kind",
          "traversed"
        ],
        "title": "GraphEdge",
        "type": "object"
      },
      "GraphNode": {
        "description": "One node of the graph, with this run's history on it.",
        "properties": {
          "arrivals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Arrivals"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a join with a fan-out still open, how much of it has arrived; absent otherwise."
          },
          "attempts": {
            "description": "How many task rows this node has in this run.",
            "title": "Attempts",
            "type": "integer"
          },
          "branches": {
            "description": "The node's tasks grouped by the fan-out that produced them.",
            "items": {
              "$ref": "#/components/schemas/GraphBranch"
            },
            "title": "Branches",
            "type": "array"
          },
          "generation": {
            "description": "BFS depth from the start node.",
            "title": "Generation",
            "type": "integer"
          },
          "join": {
            "description": "Whether the node waits for a fan-out to complete.",
            "title": "Join",
            "type": "boolean"
          },
          "last_task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The highest task id of the node, the one the task drawer opens; null when the node has no task.",
            "title": "Last Task Id"
          },
          "live": {
            "description": "Whether a `node`-slot plugin panel should show: the node is in progress or waiting, or it has at least one done attempt (09 \u00a7Slots).",
            "title": "Live",
            "type": "boolean"
          },
          "name": {
            "description": "The node's name.",
            "title": "Name",
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/NodeState",
            "description": "What the node is doing, by 08's precedence."
          }
        },
        "required": [
          "name",
          "generation",
          "join",
          "state",
          "live",
          "attempts"
        ],
        "title": "GraphNode",
        "type": "object"
      },
      "GraphOut": {
        "description": "The graph of one run (08 \u00a7Runs, `/graph`).",
        "properties": {
          "edges": {
            "description": "Every edge of the finalized graph.",
            "items": {
              "$ref": "#/components/schemas/GraphEdge"
            },
            "title": "Edges",
            "type": "array"
          },
          "nodes": {
            "description": "Every node of the workflow.",
            "items": {
              "$ref": "#/components/schemas/GraphNode"
            },
            "title": "Nodes",
            "type": "array"
          }
        },
        "required": [
          "nodes",
          "edges"
        ],
        "title": "GraphOut",
        "type": "object"
      },
      "Health": {
        "description": "Liveness, version and counts. Unauthenticated, and carries no ids.",
        "properties": {
          "ok": {
            "description": "True whenever the server answers at all.",
            "title": "Ok",
            "type": "boolean"
          },
          "pools": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/PoolHealth"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Every registered pool by name. Omitted when this application has no engine; empty when the engine has no pools.",
            "title": "Pools"
          },
          "runs_running": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Runs in the `running` status. Omitted when this application has no store to ask.",
            "title": "Runs Running"
          },
          "tasks_in_progress": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Attempts in the `in_progress` status; a task parked on a human is `waiting` and is not counted. Omitted when this application has no store to ask.",
            "title": "Tasks In Progress"
          },
          "version": {
            "description": "The running Athanore version.",
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "version"
        ],
        "title": "Health",
        "type": "object"
      },
      "JoinArrived": {
        "additionalProperties": false,
        "description": "One per branch reaching a join.\n\n``arrived == count`` means the join task was enqueued in the same\ntransaction.",
        "properties": {
          "arrived": {
            "title": "Arrived",
            "type": "integer"
          },
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "fanout_task": {
            "title": "Fanout Task",
            "type": "integer"
          },
          "index": {
            "title": "Index",
            "type": "integer"
          },
          "join": {
            "title": "Join",
            "type": "string"
          },
          "late": {
            "title": "Late",
            "type": "boolean"
          }
        },
        "required": [
          "join",
          "fanout_task",
          "index",
          "count",
          "arrived",
          "late"
        ],
        "title": "JoinArrived",
        "type": "object"
      },
      "JoinArrivedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/JoinArrived"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "join.arrived",
            "default": "join.arrived",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "JoinArrivedEvent",
        "type": "object"
      },
      "LogAppended": {
        "additionalProperties": false,
        "description": "``preview`` is the first 200 characters of the entry.",
        "properties": {
          "author": {
            "title": "Author",
            "type": "string"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "log_id": {
            "title": "Log Id",
            "type": "integer"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "preview": {
            "title": "Preview",
            "type": "string"
          }
        },
        "required": [
          "log_id",
          "author",
          "node",
          "preview"
        ],
        "title": "LogAppended",
        "type": "object"
      },
      "LogAppendedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/LogAppended"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "log.appended",
            "default": "log.appended",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "LogAppendedEvent",
        "type": "object"
      },
      "LogAuthor": {
        "description": "Who wrote a work-log entry.",
        "enum": [
          "agent",
          "engine",
          "user"
        ],
        "title": "LogAuthor",
        "type": "string"
      },
      "LogEntry": {
        "description": "One entry of a run's work log, append-only (03).\n\nThe work log is the inter-stage channel (D4): the engine's failures,\nthe operator's notes and every agent deliverable, in one ordered list.\n``kind`` is absent on a plain entry.",
        "properties": {
          "author": {
            "$ref": "#/components/schemas/LogAuthor",
            "description": "Who wrote it."
          },
          "created": {
            "description": "When it was written.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "id": {
            "description": "The entry id; the log is ordered by it.",
            "title": "Id",
            "type": "integer"
          },
          "kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LogKind"
              },
              {
                "type": "null"
              }
            ],
            "description": "What it is, for filtering; absent on a plain entry."
          },
          "node": {
            "description": "The node it was written under; `user` for an operator note with no node in flight.",
            "title": "Node",
            "type": "string"
          },
          "run_id": {
            "description": "The run the entry belongs to.",
            "title": "Run Id",
            "type": "string"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The attempt that wrote it, when one did.",
            "title": "Task Id"
          },
          "text": {
            "description": "The entry itself, never truncated.",
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "id",
          "run_id",
          "node",
          "author",
          "text",
          "created"
        ],
        "title": "LogEntry",
        "type": "object"
      },
      "LogKind": {
        "description": "What a work-log entry is, for filtering (the agent view drops\n``stats``; 08 \u00a7Agent-facing).",
        "enum": [
          "deliverable",
          "note",
          "stats",
          "failure"
        ],
        "title": "LogKind",
        "type": "string"
      },
      "LogRef": {
        "description": "The id of a work-log entry that was appended (08 \u00a7Runs).",
        "properties": {
          "log_id": {
            "description": "The id of the entry that was written.",
            "title": "Log Id",
            "type": "integer"
          }
        },
        "required": [
          "log_id"
        ],
        "title": "LogRef",
        "type": "object"
      },
      "LogText": {
        "description": "Append an entry to a run's work log (`POST /api/runs/{id}/log`).",
        "properties": {
          "text": {
            "description": "The entry, written verbatim and never truncated.",
            "minLength": 1,
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "LogText",
        "type": "object"
      },
      "Me": {
        "description": "What the caller may do, and which server they are talking to.",
        "properties": {
          "auth": {
            "description": "`token` when operator endpoints require a bearer token, `off` on a plain loopback bind.",
            "enum": [
              "off",
              "token"
            ],
            "title": "Auth",
            "type": "string"
          },
          "authenticated": {
            "description": "Whether this request carries operator rights. Always true when `auth` is `off`.",
            "title": "Authenticated",
            "type": "boolean"
          },
          "features": {
            "description": "Optional capabilities this server has. Empty in v1.",
            "items": {
              "type": "string"
            },
            "title": "Features",
            "type": "array"
          },
          "started_at": {
            "description": "When this process came up. A change means a restart, which is the SPA's cue to refetch the plugin manifest.",
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "version": {
            "description": "The running Athanore version.",
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "auth",
          "authenticated",
          "version",
          "started_at",
          "features"
        ],
        "title": "Me",
        "type": "object"
      },
      "Move": {
        "description": "Move a task's work to another node (`POST /api/tasks/{id}/move`).",
        "properties": {
          "node": {
            "description": "The node to enqueue the work at.",
            "minLength": 1,
            "title": "Node",
            "type": "string"
          }
        },
        "required": [
          "node"
        ],
        "title": "Move",
        "type": "object"
      },
      "NewRun": {
        "description": "Submit a run of a workflow (`POST /api/workflows/{name}/runs`).\n\nThe two fields become the start task's payload, which is why editing\neither afterwards does not rewrite it (04 \u00a7Submit a run).",
        "properties": {
          "description": {
            "default": "",
            "description": "Longer context for the run; the workflow's input.",
            "title": "Description",
            "type": "string"
          },
          "title": {
            "description": "The operator's title for the run.",
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "NewRun",
        "type": "object"
      },
      "NodeOut": {
        "description": "One node's edges and its options, as 08 \u00a7Workflows lists them.\n\n``priority`` and ``retries`` of ``null`` mean \"the server default\"\nand ``timeout`` of ``null`` means no wall-clock cap on one attempt \u2014\nthe node metadata of 04 \u00a7Node options, unresolved, because what the\ndefault *is* belongs to the settings of the server running it.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The body's docstring, unless the node overrode it.",
            "title": "Description"
          },
          "edges": {
            "description": "The nodes this one may transition to, in declaration order.",
            "items": {
              "type": "string"
            },
            "title": "Edges",
            "type": "array"
          },
          "generation": {
            "description": "BFS depth from the start node; a loop-back edge targets a generation at or below its source.",
            "title": "Generation",
            "type": "integer"
          },
          "label": {
            "description": "The display name; the function's name by default.",
            "title": "Label",
            "type": "string"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Dispatch priority, or null for the server default.",
            "title": "Priority"
          },
          "retries": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Retry budget, or null for the server default.",
            "title": "Retries"
          },
          "timeout": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seconds one attempt may run, or null for no cap.",
            "title": "Timeout"
          }
        },
        "required": [
          "edges",
          "generation",
          "label"
        ],
        "title": "NodeOut",
        "type": "object"
      },
      "NodeState": {
        "description": "What a node is doing in one run, in 08 \u00a7Graph semantics' precedence.\n\nDeclared in precedence order, highest first, so the rule is the\nmember order and not a table kept somewhere else. ``failed`` outranks\n``done`` but is itself outranked by ``ready``: a failed attempt whose\nretry is queued reports ``ready``, because that retry row exists and\nthe node is going to run again. ``idle`` means no task of this node\nwas ever created in this run.\n\nThe SPA colours by this alone (10 \u00a7Status colours).",
        "enum": [
          "in_progress",
          "waiting",
          "ready",
          "dead_letter",
          "failed",
          "done",
          "cancelled",
          "idle"
        ],
        "title": "NodeState",
        "type": "string"
      },
      "Ok": {
        "description": "An operation that succeeded and has nothing else to report.\n\n``note`` is the one place a router adds a sentence about *how* it\nsucceeded \u2014 08 \u00a7Runs' `{ok, note?}` \u2014 and is omitted when there is\nnothing to say rather than sent as an empty string.",
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What was unusual about the success, when anything was.",
            "title": "Note"
          },
          "ok": {
            "default": true,
            "description": "Always true; a failure is an error body.",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "title": "Ok",
        "type": "object"
      },
      "PanelKind": {
        "description": "The renderer vocabulary of 09 \u00a7Panel kinds, one member per row.\n\nThe kind fixes the shape ``source`` must return: ``markdown`` a\nstring, ``kv`` an object, ``table`` ``{columns, rows}``, ``log`` a\nlist of entries, ``chart`` ``{series, kind}``, ``dashboard``\n``{note?, metrics, table?}``, ``form`` the name of an action, and\n``custom`` nothing at all \u2014 the plugin's own web component reads what\nit needs through ``window.athanore``.\n\nA kind the SPA does not know renders a placeholder card rather than\ncrashing the pane (09), so this enum is the server's vocabulary and\nnot a promise about the browser's.",
        "enum": [
          "markdown",
          "kv",
          "table",
          "log",
          "chart",
          "dashboard",
          "form",
          "custom"
        ],
        "title": "PanelKind",
        "type": "string"
      },
      "PanelOut": {
        "description": "One panel of the manifest (09 \u00a7Wire contract).\n\n``source`` is the mounted URL of the route the panel's data comes\nfrom, or \u2014 for a ``form`` panel \u2014 the name of the action whose model\nis the form. ``node`` is present only on a panel that follows one;\nwhether that node is *live* travels on the run's graph rather than\nhere, because the manifest changes only when a workflow is\nregistered, replaced or removed, never per run (08 \u00a7Graph semantics,\n22 \u00a7Live mounting).",
        "properties": {
          "element": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The custom element tag a `custom` panel renders.",
            "title": "Element"
          },
          "kind": {
            "$ref": "#/components/schemas/PanelKind",
            "description": "Which renderer draws it, and its data shape."
          },
          "name": {
            "description": "The panel's title, unique within its workflow.",
            "title": "Name",
            "type": "string"
          },
          "node": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The node this panel follows, when it follows one.",
            "title": "Node"
          },
          "placement": {
            "description": "A pane of its own, or a card on the run overview.",
            "enum": [
              "pane",
              "card"
            ],
            "title": "Placement",
            "type": "string"
          },
          "refresh_on": {
            "description": "Event-name globs that invalidate this panel's data.",
            "items": {
              "type": "string"
            },
            "title": "Refresh On",
            "type": "array"
          },
          "scope": {
            "$ref": "#/components/schemas/Slot",
            "description": "What has to be resolved before it can load."
          },
          "slot": {
            "$ref": "#/components/schemas/Slot",
            "description": "Where the panel is shown (09 \u00a7Slots)."
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The URL its data comes from, or the action name for a form.",
            "title": "Source"
          }
        },
        "required": [
          "name",
          "slot",
          "placement",
          "kind",
          "scope"
        ],
        "title": "PanelOut",
        "type": "object"
      },
      "PluginEvent": {
        "additionalProperties": false,
        "description": "``plugin.<workflow>.<name>``: the vocabulary's open end.\n\nThe handler's data is free-form, so the wire carries whatever it passed\nto ``ctx.services.events.publish``; 18 requires a JSON object, and the\nregistry \u2014 not this model \u2014 enforces that ``<workflow>`` is the\npublishing workflow.\n\n``name`` is the only one in the union that is not a\n:class:`~typing.Literal`, and it is declared as the whole vocabulary\n\u2014 ``EventName | str`` \u2014 rather than as a bare ``str``. The two are\nthe same set of strings, so nothing is widened; what the wider\nspelling buys is a *reference* to the enum in the generated document,\nwhich is where 08 \u00a7OpenAPI wants the event-name enum published and\nwhere the SPA's TypeScript union is generated from (13 \u00a7Contract\ntests). The validator below is what actually narrows this field, to\nthe ``plugin.`` namespace.",
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "additionalProperties": true,
            "title": "Data",
            "type": "object"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EventName"
              },
              {
                "type": "string"
              }
            ],
            "title": "Name"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "PluginEvent",
        "type": "object"
      },
      "PluginManifestEntry": {
        "description": "What one workflow contributes to the UI (09 \u00a7Wire contract).",
        "properties": {
          "actions": {
            "description": "Its actions, in declaration order.",
            "items": {
              "$ref": "#/components/schemas/ActionOut"
            },
            "title": "Actions",
            "type": "array"
          },
          "assets": {
            "description": "URLs of the JavaScript modules the SPA injects for it, each carrying a `?v=` that changes when the file's bytes do.",
            "items": {
              "type": "string"
            },
            "title": "Assets",
            "type": "array"
          },
          "panels": {
            "description": "Its panels, in declaration order.",
            "items": {
              "$ref": "#/components/schemas/PanelOut"
            },
            "title": "Panels",
            "type": "array"
          },
          "workflow": {
            "description": "The workflow that declared these, or `_builtin` for the views the core ships.",
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow"
        ],
        "title": "PluginManifestEntry",
        "type": "object"
      },
      "PoolHealth": {
        "description": "One pool's capacity and what it is spending right now.",
        "properties": {
          "capacity": {
            "description": "Slots the pool has, in total.",
            "title": "Capacity",
            "type": "integer"
          },
          "in_flight": {
            "description": "Slots leased right now.",
            "title": "In Flight",
            "type": "integer"
          }
        },
        "required": [
          "capacity",
          "in_flight"
        ],
        "title": "PoolHealth",
        "type": "object"
      },
      "Position": {
        "description": "Move a run in the dispatch list (`POST /api/runs/{id}/position`, D57).\n\nExactly one of the two. ``direction`` swaps with the neighbour above\n(``-1``) or below (``+1``) and is a no-op at the ends \u2014 still a 200,\nreporting the position the run already had. ``index`` is the\n**zero-based** list index to move to, clamped to the list; New Run's\n\"top\" is `{\"index\": 0}` and \"bottom\" is the default, which needs no\ncall at all.",
        "properties": {
          "direction": {
            "anyOf": [
              {
                "enum": [
                  -1,
                  1
                ],
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Swap with the neighbour above (-1) or below (1).",
            "title": "Direction"
          },
          "index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The zero-based list index to move to, clamped.",
            "title": "Index"
          }
        },
        "title": "Position",
        "type": "object"
      },
      "PositionOut": {
        "description": "Where a run sits in the dispatch list after a move (D57).",
        "properties": {
          "position": {
            "description": "The run's place in the dispatch list after the move, numbered from 1. The `index` that asked for it is zero-based (D57).",
            "title": "Position",
            "type": "integer"
          }
        },
        "required": [
          "position"
        ],
        "title": "PositionOut",
        "type": "object"
      },
      "RegisterWorkflow": {
        "description": "Register a workflow on the running server (`POST /api/workflows`, 22 \u00a7Wire).\n\n``target`` names the workflow as `athanore serve` would: `module:attr`\nor `path/to/file.py:attr`. The name it registers under is the loaded\n``Workflow``'s own. ``pool`` must already exist on the engine \u2014 a\nlive registration never creates one \u2014 and ``persist`` writes the\n`[workflows.<name>]` row of `athanore.toml` before anything is\nmutated, so a target that does not load is never written down.",
        "properties": {
          "persist": {
            "default": false,
            "description": "Write the registration as a `[workflows.<name>]` row of `athanore.toml`; the response then carries `X-Athanore-Persisted`.",
            "title": "Persist",
            "type": "boolean"
          },
          "pool": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pool to bind the workflow to; the default pool when omitted.",
            "title": "Pool"
          },
          "target": {
            "description": "The workflow to load: `module:attr` or `path/to/file.py:attr`.",
            "minLength": 1,
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "target"
        ],
        "title": "RegisterWorkflow",
        "type": "object"
      },
      "ReloadWorkflow": {
        "description": "Replace a registered workflow (`PUT /api/workflows/{name}`, 22 \u00a7Wire).\n\n``target`` omitted re-resolves the registration's recorded target \u2014\nwhat `athanore serve` or an earlier registration loaded it from \u2014 and\nis refused when there is none. A target that now defines a differently\nnamed workflow is refused too: that is a new workflow, and `POST` is\nhow it arrives. ``pool`` omitted keeps the binding the name has.",
        "properties": {
          "persist": {
            "default": false,
            "description": "Rewrite the `[workflows.<name>]` row of `athanore.toml`; the response then carries `X-Athanore-Persisted`.",
            "title": "Persist",
            "type": "boolean"
          },
          "pool": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pool to move the workflow to; the current binding when omitted. Refused while any attempt of the workflow is in flight.",
            "title": "Pool"
          },
          "target": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The workflow to load; the registration's recorded target when omitted.",
            "title": "Target"
          }
        },
        "title": "ReloadWorkflow",
        "type": "object"
      },
      "RemovedWorkflowOut": {
        "description": "What `DELETE /api/workflows/{name}` did (22 \u00a7Wire).\n\nA body rather than a 204, because the body is the point: the caller\nwants to know what it interrupted (D227). Whether a row of\n`athanore.toml` was removed is the response's `X-Athanore-Persisted`\nheader, not a field \u2014 a receipt about the request belongs on the\nresponse.",
        "properties": {
          "task_ids": {
            "description": "The attempts that were interrupted, in spawn order; empty when nothing of the workflow was in flight.",
            "items": {
              "type": "integer"
            },
            "title": "Task Ids",
            "type": "array"
          },
          "workflow": {
            "description": "The name that was unregistered.",
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow",
          "task_ids"
        ],
        "title": "RemovedWorkflowOut",
        "type": "object"
      },
      "RequestAnswered": {
        "additionalProperties": false,
        "description": "``value`` is not in the event (may be large or sensitive); fetch it.",
        "properties": {
          "author": {
            "enum": [
              "user",
              "engine"
            ],
            "title": "Author",
            "type": "string"
          },
          "option_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Option Id"
          },
          "request_id": {
            "title": "Request Id",
            "type": "integer"
          }
        },
        "required": [
          "request_id",
          "author"
        ],
        "title": "RequestAnswered",
        "type": "object"
      },
      "RequestAnsweredEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RequestAnswered"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "request.answered",
            "default": "request.answered",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RequestAnsweredEvent",
        "type": "object"
      },
      "RequestKind": {
        "description": "What the request is about. A label for the UI; nothing keys on it.",
        "enum": [
          "permission",
          "elicitation",
          "question"
        ],
        "title": "RequestKind",
        "type": "string"
      },
      "RequestMode": {
        "description": "The shape of the answer a request expects (06 \u00a7The model).",
        "enum": [
          "options",
          "form",
          "text"
        ],
        "title": "RequestMode",
        "type": "string"
      },
      "RequestOpened": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "ordinal": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ordinal"
          },
          "request_id": {
            "title": "Request Id",
            "type": "integer"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "mode",
          "kind",
          "source",
          "node"
        ],
        "title": "RequestOpened",
        "type": "object"
      },
      "RequestOpenedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RequestOpened"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "request.opened",
            "default": "request.opened",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RequestOpenedEvent",
        "type": "object"
      },
      "RequestOption": {
        "description": "One choice an ``options`` request offers (06 \u00a7The model).\n\nThe agent's options verbatim for an ACP permission: the operator\npicks under the labels the agent used, and the ``option_id`` that\ngoes back is the one it will be given (05 \u00a7Policies).",
        "properties": {
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The ACP permission kind, when the option came from one.",
            "title": "Kind"
          },
          "name": {
            "description": "What to show the operator.",
            "title": "Name",
            "type": "string"
          },
          "option_id": {
            "description": "The id an answer names.",
            "title": "Option Id",
            "type": "string"
          }
        },
        "required": [
          "option_id",
          "name"
        ],
        "title": "RequestOption",
        "type": "object"
      },
      "RequestSource": {
        "description": "Who raised the request: the agent mid-turn, or the node body.",
        "enum": [
          "agent",
          "node"
        ],
        "title": "RequestSource",
        "type": "string"
      },
      "RequestView": {
        "description": "A request, its answer, and the node that asked (08 \u00a7Requests).\n\n``schema`` is spelled ``schema_`` in Python \u2014 a field named ``schema``\nshadows an attribute of ``BaseModel`` \u2014 and keeps ``schema`` as its\nalias, which is the name 08 fixes on the wire.",
        "properties": {
          "age": {
            "description": "Seconds since it was opened, when it was read.",
            "title": "Age",
            "type": "number"
          },
          "answer": {
            "description": "The chosen `option_id`, or the value of a `text` or `form` answer. Null both before an answer and for an answer that was null.",
            "title": "Answer"
          },
          "answered_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerAuthor"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who answered; the field to test for having an answer at all."
          },
          "created": {
            "description": "When the request was opened.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "id": {
            "description": "The request id.",
            "title": "Id",
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/RequestKind",
            "description": "What the request is about; a label."
          },
          "mode": {
            "$ref": "#/components/schemas/RequestMode",
            "description": "The shape of the answer expected."
          },
          "node": {
            "description": "The node that attempt runs.",
            "title": "Node",
            "type": "string"
          },
          "options": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RequestOption"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The choices, for an `options` request.",
            "title": "Options"
          },
          "pending": {
            "description": "Unanswered, with an attempt still waiting.",
            "title": "Pending",
            "type": "boolean"
          },
          "prompt": {
            "description": "What the operator is being asked.",
            "title": "Prompt",
            "type": "string"
          },
          "run_id": {
            "description": "The run it belongs to.",
            "title": "Run Id",
            "type": "string"
          },
          "schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The JSON Schema the answer must fit, for a `form` request.",
            "title": "Schema"
          },
          "source": {
            "$ref": "#/components/schemas/RequestSource",
            "description": "Whether the agent asked mid-turn or the node body did."
          },
          "stale": {
            "description": "Unanswered, with no attempt left to consume an answer: in history, out of the inbox, and no longer answerable.",
            "title": "Stale",
            "type": "boolean"
          },
          "task_id": {
            "description": "The attempt that asked.",
            "title": "Task Id",
            "type": "integer"
          },
          "tool_call": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the agent was about to do, for a permission request.",
            "title": "Tool Call"
          }
        },
        "required": [
          "id",
          "run_id",
          "task_id",
          "node",
          "prompt",
          "mode",
          "source",
          "kind",
          "pending",
          "stale",
          "created",
          "age"
        ],
        "title": "RequestView",
        "type": "object"
      },
      "Rerun": {
        "description": "Run a node again (`POST /api/runs/{id}/rerun`).\n\nThe payload and branch it last had are re-used; a rerun of a join\nreplays the arrivals it fired on (04 \u00a7Operator operations).",
        "properties": {
          "node": {
            "description": "The node to run again.",
            "minLength": 1,
            "title": "Node",
            "type": "string"
          }
        },
        "required": [
          "node"
        ],
        "title": "Rerun",
        "type": "object"
      },
      "RunCancelled": {
        "additionalProperties": false,
        "properties": {
          "cancelled_tasks": {
            "items": {
              "type": "integer"
            },
            "title": "Cancelled Tasks",
            "type": "array"
          }
        },
        "required": [
          "cancelled_tasks"
        ],
        "title": "RunCancelled",
        "type": "object"
      },
      "RunCancelledEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunCancelled"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.cancelled",
            "default": "run.cancelled",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunCancelledEvent",
        "type": "object"
      },
      "RunChanges": {
        "additionalProperties": false,
        "description": "The fields an edit or an op changed on a run; only those it changed.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "RunChanges",
        "type": "object"
      },
      "RunCompleted": {
        "additionalProperties": false,
        "description": "``output`` follows the shape rule of 04 \u00a7Routing edge cases.\n\n``node`` and ``task_id`` are the last landing task. ``output`` is\nrequired and may be ``null``: a body that returns ``None`` terminates\nthe run with that value, which is not the same as an unknown one.",
        "properties": {
          "node": {
            "title": "Node",
            "type": "string"
          },
          "output": {
            "title": "Output"
          },
          "task_id": {
            "title": "Task Id",
            "type": "integer"
          },
          "terminal_tasks": {
            "items": {
              "type": "integer"
            },
            "title": "Terminal Tasks",
            "type": "array"
          }
        },
        "required": [
          "node",
          "task_id",
          "output",
          "terminal_tasks"
        ],
        "title": "RunCompleted",
        "type": "object"
      },
      "RunCompletedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunCompleted"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.completed",
            "default": "run.completed",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunCompletedEvent",
        "type": "object"
      },
      "RunCreated": {
        "additionalProperties": false,
        "properties": {
          "position": {
            "title": "Position",
            "type": "integer"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "workflow": {
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow",
          "title",
          "position"
        ],
        "title": "RunCreated",
        "type": "object"
      },
      "RunCreatedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunCreated"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.created",
            "default": "run.created",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunCreatedEvent",
        "type": "object"
      },
      "RunDeleted": {
        "additionalProperties": false,
        "description": "The last event of a run: it is deleted with the run, so SSE only.",
        "properties": {
          "title": {
            "title": "Title",
            "type": "string"
          },
          "workflow": {
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow",
          "title"
        ],
        "title": "RunDeleted",
        "type": "object"
      },
      "RunDeletedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunDeleted"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.deleted",
            "default": "run.deleted",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunDeletedEvent",
        "type": "object"
      },
      "RunDetail": {
        "description": "A run, its tasks and its totals (08 \u00a7Runs).",
        "properties": {
          "created": {
            "description": "When the run was submitted.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "current_nodes": {
            "description": "The nodes with an in-progress or waiting attempt right now.",
            "items": {
              "type": "string"
            },
            "title": "Current Nodes",
            "type": "array"
          },
          "description": {
            "default": "",
            "description": "The operator's description.",
            "title": "Description",
            "type": "string"
          },
          "id": {
            "description": "The run id, a ULID.",
            "title": "Id",
            "type": "string"
          },
          "output": {
            "description": "The run's output: one value for a single terminal task, a list in branch order when several branches terminated (D58). Null before the run ends, and also when it ended by returning null.",
            "title": "Output"
          },
          "outputs": {
            "description": "One entry per terminal task, always a list (D58).",
            "items": {
              "$ref": "#/components/schemas/RunOutput"
            },
            "title": "Outputs",
            "type": "array"
          },
          "pending_requests": {
            "default": 0,
            "description": "Unanswered, non-stale requests waiting on a person.",
            "title": "Pending Requests",
            "type": "integer"
          },
          "position": {
            "description": "The run's place in the dispatch list; runs are numbered 1..n in list order.",
            "title": "Position",
            "type": "integer"
          },
          "stats": {
            "$ref": "#/components/schemas/RunStats",
            "description": "The agent totals of the run."
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus",
            "description": "The run state machine of 03."
          },
          "tasks": {
            "description": "Every attempt of the run, oldest first.",
            "items": {
              "$ref": "#/components/schemas/TaskView"
            },
            "title": "Tasks",
            "type": "array"
          },
          "title": {
            "description": "The operator's title for the run.",
            "title": "Title",
            "type": "string"
          },
          "unregistered": {
            "default": false,
            "description": "Whether this server has no workflow of that name registered.",
            "title": "Unregistered",
            "type": "boolean"
          },
          "updated": {
            "description": "When anything about it last changed.",
            "format": "date-time",
            "title": "Updated",
            "type": "string"
          },
          "workflow": {
            "description": "The workflow this run executes.",
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workflow",
          "title",
          "status",
          "position",
          "created",
          "updated"
        ],
        "title": "RunDetail",
        "type": "object"
      },
      "RunFailed": {
        "additionalProperties": false,
        "description": "``code`` is set when the run stalled on a partial join.",
        "properties": {
          "code": {
            "anyOf": [
              {
                "const": "join_incomplete",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "error": {
            "title": "Error",
            "type": "string"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "integer"
          }
        },
        "required": [
          "node",
          "task_id",
          "error"
        ],
        "title": "RunFailed",
        "type": "object"
      },
      "RunFailedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunFailed"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.failed",
            "default": "run.failed",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunFailedEvent",
        "type": "object"
      },
      "RunOutput": {
        "description": "One terminal task's value, with the branch it came out of (D58).",
        "properties": {
          "branch": {
            "description": "The fan-out stack the attempt was inside, outermost first; empty for a run that never fanned out.",
            "items": {
              "$ref": "#/components/schemas/BranchRef"
            },
            "title": "Branch",
            "type": "array"
          },
          "node": {
            "description": "The node that attempt ran.",
            "title": "Node",
            "type": "string"
          },
          "task_id": {
            "description": "The terminal attempt that produced it.",
            "title": "Task Id",
            "type": "integer"
          },
          "value": {
            "description": "What the body returned.",
            "title": "Value"
          }
        },
        "required": [
          "task_id",
          "node"
        ],
        "title": "RunOutput",
        "type": "object"
      },
      "RunPaused": {
        "additionalProperties": false,
        "properties": {},
        "title": "RunPaused",
        "type": "object"
      },
      "RunPausedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunPaused"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.paused",
            "default": "run.paused",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunPausedEvent",
        "type": "object"
      },
      "RunReordered": {
        "additionalProperties": false,
        "properties": {
          "position": {
            "title": "Position",
            "type": "integer"
          },
          "previous": {
            "title": "Previous",
            "type": "integer"
          }
        },
        "required": [
          "position",
          "previous"
        ],
        "title": "RunReordered",
        "type": "object"
      },
      "RunReorderedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunReordered"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.reordered",
            "default": "run.reordered",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunReorderedEvent",
        "type": "object"
      },
      "RunResumed": {
        "additionalProperties": false,
        "properties": {},
        "title": "RunResumed",
        "type": "object"
      },
      "RunResumedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunResumed"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.resumed",
            "default": "run.resumed",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunResumedEvent",
        "type": "object"
      },
      "RunStarted": {
        "additionalProperties": false,
        "description": "The first claim of the run.",
        "properties": {
          "node": {
            "title": "Node",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "integer"
          }
        },
        "required": [
          "task_id",
          "node"
        ],
        "title": "RunStarted",
        "type": "object"
      },
      "RunStartedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunStarted"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.started",
            "default": "run.started",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunStartedEvent",
        "type": "object"
      },
      "RunStats": {
        "description": "A run's agent totals, summed over its attempts (05 \u00a7Stats).\n\nEvery field is optional and nothing is zero-filled: a provider that\nreported no cost leaves ``cost`` absent rather than claiming zero (01\n\u00a7Real data only). ``duration_s`` is the sum of the attempts' durations\nand not wall-clock time, which fan-out would make meaningless.",
        "properties": {
          "cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost"
          },
          "duration_s": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration S"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          },
          "tool_calls": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Calls"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          }
        },
        "title": "RunStats",
        "type": "object"
      },
      "RunStatus": {
        "description": "The run state machine of 03.\n\n``queued`` is new in v1: a run that exists but has dispatched nothing,\nso \"waiting for a slot\" is visible. The three terminal states are\nre-openable by retry, rerun and move.",
        "enum": [
          "queued",
          "running",
          "paused",
          "completed",
          "failed",
          "cancelled"
        ],
        "title": "RunStatus",
        "type": "string"
      },
      "RunSummary": {
        "description": "One row of the run list (08 \u00a7Runs).\n\n``current_nodes`` is plural because a fan-out puts a run in several\nnodes at once. ``unregistered`` is not stored: it says this server has\nno workflow of that name registered, so the run is shown but nothing\nwill dispatch it (03 \u00a7Run).",
        "properties": {
          "created": {
            "description": "When the run was submitted.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "current_nodes": {
            "description": "The nodes with an in-progress or waiting attempt right now.",
            "items": {
              "type": "string"
            },
            "title": "Current Nodes",
            "type": "array"
          },
          "id": {
            "description": "The run id, a ULID.",
            "title": "Id",
            "type": "string"
          },
          "pending_requests": {
            "default": 0,
            "description": "Unanswered, non-stale requests waiting on a person.",
            "title": "Pending Requests",
            "type": "integer"
          },
          "position": {
            "description": "The run's place in the dispatch list; runs are numbered 1..n in list order.",
            "title": "Position",
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus",
            "description": "The run state machine of 03."
          },
          "title": {
            "description": "The operator's title for the run.",
            "title": "Title",
            "type": "string"
          },
          "unregistered": {
            "default": false,
            "description": "Whether this server has no workflow of that name registered.",
            "title": "Unregistered",
            "type": "boolean"
          },
          "updated": {
            "description": "When anything about it last changed.",
            "format": "date-time",
            "title": "Updated",
            "type": "string"
          },
          "workflow": {
            "description": "The workflow this run executes.",
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workflow",
          "title",
          "status",
          "position",
          "created",
          "updated"
        ],
        "title": "RunSummary",
        "type": "object"
      },
      "RunUpdated": {
        "additionalProperties": false,
        "properties": {
          "changed": {
            "$ref": "#/components/schemas/RunChanges"
          }
        },
        "required": [
          "changed"
        ],
        "title": "RunUpdated",
        "type": "object"
      },
      "RunUpdatedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RunUpdated"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "run.updated",
            "default": "run.updated",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "RunUpdatedEvent",
        "type": "object"
      },
      "SetStatus": {
        "description": "Write one of the three statuses an operator may set (08 \u00a7Tasks).\n\nThe other four are the engine's own record of what happened and are\nnot an operator's to declare.",
        "properties": {
          "status": {
            "description": "`ready` re-dispatches the task, `cancelled` stops it, `dead_letter` files it as failed for good.",
            "enum": [
              "ready",
              "cancelled",
              "dead_letter"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "SetStatus",
        "type": "object"
      },
      "Slot": {
        "description": "Where a panel is shown \u2014 09 \u00a7Slots, one member per row.\n\n``run`` is a pane in the selected run's cycle or a card on its\noverview, ``task`` the task drawer, ``node`` a pane live only while\nthe named node has a task in flight or has produced output,\n``workflow`` the library's detail side, and ``global`` a pane shown\nwhen no run is selected.",
        "enum": [
          "run",
          "task",
          "node",
          "workflow",
          "global"
        ],
        "title": "Slot",
        "type": "string"
      },
      "SourceNode": {
        "description": "Where one node's body starts in the returned source.",
        "properties": {
          "line": {
            "description": "The 1-based line of the body's first decorator or `def`.",
            "title": "Line",
            "type": "integer"
          }
        },
        "required": [
          "line"
        ],
        "title": "SourceNode",
        "type": "object"
      },
      "SourceOut": {
        "description": "A workflow's module source, and the line each node begins on.\n\n``nodes`` names the nodes whose bodies are defined **in this file**.\nA workflow may register a function imported from somewhere else; that\nnode has no line in this source, and it is left out rather than given\na number that points at the wrong text (01 \u00a7Real data only).",
        "properties": {
          "file": {
            "description": "The absolute path of the module the source is from.",
            "title": "File",
            "type": "string"
          },
          "nodes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SourceNode"
            },
            "description": "The line each node's body starts on, for the nodes defined here.",
            "title": "Nodes",
            "type": "object"
          },
          "source": {
            "description": "That module's text, in full.",
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "file",
          "source",
          "nodes"
        ],
        "title": "SourceOut",
        "type": "object"
      },
      "StreamChunk": {
        "description": "One segment of an agent transcript (05 \u00a7The ACP client).",
        "properties": {
          "created": {
            "description": "When it was recorded.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ChunkKind",
            "description": "What kind of segment this is."
          },
          "seq": {
            "description": "The per-task cursor `?after=` pages by.",
            "title": "Seq",
            "type": "integer"
          },
          "text": {
            "description": "The segment itself.",
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "seq",
          "kind",
          "text",
          "created"
        ],
        "title": "StreamChunk",
        "type": "object"
      },
      "StreamOut": {
        "description": "A page of one task's transcript (08 \u00a7Tasks).\n\n``last_seq`` is the highest sequence *stored* for the task, not the\nhighest in this page, so a client that has caught up can tell. ``live``\nsays the attempt is still running \u2014 ``in_progress`` or ``waiting``,\nbecause a waiting attempt goes on writing once its request is\nanswered \u2014 which is what stops the SPA polling a transcript that will\nnever grow again.",
        "properties": {
          "chunks": {
            "description": "The page, in sequence order.",
            "items": {
              "$ref": "#/components/schemas/StreamChunk"
            },
            "title": "Chunks",
            "type": "array"
          },
          "last_seq": {
            "description": "The highest sequence stored for this task.",
            "title": "Last Seq",
            "type": "integer"
          },
          "live": {
            "description": "Whether the attempt is still running (`in_progress` or `waiting`), so the transcript may still grow.",
            "title": "Live",
            "type": "boolean"
          }
        },
        "required": [
          "chunks",
          "last_seq",
          "live"
        ],
        "title": "StreamOut",
        "type": "object"
      },
      "SubmissionAccepted": {
        "additionalProperties": false,
        "description": "The payload itself is not in the event; fetch the task.",
        "properties": {
          "node": {
            "title": "Node",
            "type": "string"
          },
          "submission_id": {
            "title": "Submission Id",
            "type": "integer"
          }
        },
        "required": [
          "node",
          "submission_id"
        ],
        "title": "SubmissionAccepted",
        "type": "object"
      },
      "SubmissionAcceptedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/SubmissionAccepted"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "submission.accepted",
            "default": "submission.accepted",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "SubmissionAcceptedEvent",
        "type": "object"
      },
      "SubmissionOut": {
        "description": "One value an agent submitted for a task (03 \u00a7Submission).",
        "properties": {
          "created": {
            "description": "When it was accepted.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "id": {
            "description": "The submission id.",
            "title": "Id",
            "type": "integer"
          },
          "payload": {
            "description": "The value, as it was accepted.",
            "title": "Payload"
          },
          "task_id": {
            "description": "The attempt it was submitted for.",
            "title": "Task Id",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "task_id",
          "created"
        ],
        "title": "SubmissionOut",
        "type": "object"
      },
      "SubmissionRejected": {
        "additionalProperties": false,
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Errors",
            "type": "array"
          },
          "node": {
            "title": "Node",
            "type": "string"
          }
        },
        "required": [
          "node",
          "errors"
        ],
        "title": "SubmissionRejected",
        "type": "object"
      },
      "SubmissionRejectedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/SubmissionRejected"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "submission.rejected",
            "default": "submission.rejected",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "SubmissionRejectedEvent",
        "type": "object"
      },
      "SubmissionRepair": {
        "additionalProperties": false,
        "properties": {
          "node": {
            "title": "Node",
            "type": "string"
          },
          "reason": {
            "enum": [
              "nothing_submitted",
              "rejected"
            ],
            "title": "Reason",
            "type": "string"
          },
          "turn": {
            "title": "Turn",
            "type": "integer"
          }
        },
        "required": [
          "node",
          "turn",
          "reason"
        ],
        "title": "SubmissionRepair",
        "type": "object"
      },
      "SubmissionRepairEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/SubmissionRepair"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "submission.repair",
            "default": "submission.repair",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "SubmissionRepairEvent",
        "type": "object"
      },
      "TaskCancelled": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "title": "From",
            "type": "string"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "reason": {
            "enum": [
              "cancel",
              "move",
              "delete",
              "set_status"
            ],
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "node",
          "from",
          "reason"
        ],
        "title": "TaskCancelled",
        "type": "object"
      },
      "TaskCancelledEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskCancelled"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.cancelled",
            "default": "task.cancelled",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskCancelledEvent",
        "type": "object"
      },
      "TaskDeadLettered": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "error": {
            "title": "Error",
            "type": "string"
          },
          "node": {
            "title": "Node",
            "type": "string"
          }
        },
        "required": [
          "node",
          "attempt",
          "error"
        ],
        "title": "TaskDeadLettered",
        "type": "object"
      },
      "TaskDeadLetteredEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskDeadLettered"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.dead_lettered",
            "default": "task.dead_lettered",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskDeadLetteredEvent",
        "type": "object"
      },
      "TaskDetail": {
        "description": "A task and the values submitted against it (08 \u00a7Tasks).\n\nThe operator view: 08 overloads nothing by credential, so an agent\nreading its own task gets a different model on a different router\n(`/api/agent/`), and this one never has a token to omit.",
        "properties": {
          "attempt": {
            "description": "Which attempt of that node this row is, from 1.",
            "title": "Attempt",
            "type": "integer"
          },
          "branch": {
            "description": "The fan-out stack this attempt is inside.",
            "items": {
              "$ref": "#/components/schemas/athanore__api__schemas__tasks__BranchFrame"
            },
            "title": "Branch",
            "type": "array"
          },
          "created": {
            "description": "When the row was enqueued.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the attempt failed, when it did.",
            "title": "Error"
          },
          "explicit": {
            "description": "Whether that priority was declared on the node rather than defaulted.",
            "title": "Explicit",
            "type": "boolean"
          },
          "finished": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it ended.",
            "title": "Finished"
          },
          "id": {
            "description": "The task id, unique across every run.",
            "title": "Id",
            "type": "integer"
          },
          "lineage": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where this attempt came from: its reason and its parent.",
            "title": "Lineage"
          },
          "node": {
            "description": "The node whose body this attempt runs.",
            "title": "Node",
            "type": "string"
          },
          "payload": {
            "description": "The value the task was enqueued with.",
            "title": "Payload"
          },
          "priority": {
            "description": "The dispatch priority this attempt was given.",
            "title": "Priority",
            "type": "integer"
          },
          "result": {
            "description": "What the body returned, once it has.",
            "title": "Result"
          },
          "run_id": {
            "description": "The run this attempt belongs to.",
            "title": "Run Id",
            "type": "string"
          },
          "started": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was claimed.",
            "title": "Started"
          },
          "stats": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's measurements for this attempt (05 \u00a7Stats entry); absent when nothing measured it.",
            "title": "Stats"
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus",
            "description": "The task state machine of 03."
          },
          "submissions": {
            "description": "Every accepted submission, oldest first.",
            "items": {
              "$ref": "#/components/schemas/SubmissionOut"
            },
            "title": "Submissions",
            "type": "array"
          },
          "terminal": {
            "description": "Whether the attempt finished with no transition, making its `result` a branch output.",
            "title": "Terminal",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "run_id",
          "node",
          "attempt",
          "status",
          "priority",
          "explicit",
          "terminal",
          "created"
        ],
        "title": "TaskDetail",
        "type": "object"
      },
      "TaskDone": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "terminal": {
            "title": "Terminal",
            "type": "boolean"
          },
          "transitions": {
            "items": {
              "type": "string"
            },
            "title": "Transitions",
            "type": "array"
          }
        },
        "required": [
          "node",
          "attempt",
          "transitions",
          "terminal"
        ],
        "title": "TaskDone",
        "type": "object"
      },
      "TaskDoneEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskDone"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.done",
            "default": "task.done",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskDoneEvent",
        "type": "object"
      },
      "TaskEnqueued": {
        "additionalProperties": false,
        "description": "``branch`` omits ``key``; for ``reason=join`` ``from_task`` is the\nfan-out task and ``arrivals`` lists the arriving tasks.",
        "properties": {
          "arrivals": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Arrivals"
          },
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "branch": {
            "items": {
              "$ref": "#/components/schemas/athanore__events__payloads__BranchFrame"
            },
            "title": "Branch",
            "type": "array"
          },
          "from_task": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Task"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "payload_present": {
            "title": "Payload Present",
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "start",
              "transition",
              "retry",
              "rerun",
              "move",
              "manual_retry",
              "set_status",
              "join"
            ],
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "node",
          "attempt",
          "reason",
          "payload_present",
          "branch"
        ],
        "title": "TaskEnqueued",
        "type": "object"
      },
      "TaskEnqueuedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskEnqueued"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.enqueued",
            "default": "task.enqueued",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskEnqueuedEvent",
        "type": "object"
      },
      "TaskFailed": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "error": {
            "title": "Error",
            "type": "string"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "retry_task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry Task Id"
          },
          "retryable": {
            "title": "Retryable",
            "type": "boolean"
          },
          "will_retry": {
            "title": "Will Retry",
            "type": "boolean"
          }
        },
        "required": [
          "node",
          "attempt",
          "error",
          "retryable",
          "will_retry"
        ],
        "title": "TaskFailed",
        "type": "object"
      },
      "TaskFailedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskFailed"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.failed",
            "default": "task.failed",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskFailedEvent",
        "type": "object"
      },
      "TaskMoved": {
        "additionalProperties": false,
        "properties": {
          "new_task_id": {
            "title": "New Task Id",
            "type": "integer"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "to": {
            "title": "To",
            "type": "string"
          }
        },
        "required": [
          "node",
          "to",
          "new_task_id"
        ],
        "title": "TaskMoved",
        "type": "object"
      },
      "TaskMovedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskMoved"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.moved",
            "default": "task.moved",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskMovedEvent",
        "type": "object"
      },
      "TaskRef": {
        "description": "The id of a task an operator verb queued.\n\nThe answer to ``rerun``, ``retry`` and ``move``: each of the three\nends with a **new** attempt row, and this is its id (08 \u00a7Runs,\n\u00a7Tasks).",
        "properties": {
          "task_id": {
            "description": "The id of the task that was enqueued.",
            "title": "Task Id",
            "type": "integer"
          }
        },
        "required": [
          "task_id"
        ],
        "title": "TaskRef",
        "type": "object"
      },
      "TaskResumed": {
        "additionalProperties": false,
        "properties": {
          "node": {
            "title": "Node",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "integer"
          },
          "waited_s": {
            "title": "Waited S",
            "type": "number"
          }
        },
        "required": [
          "node",
          "request_id",
          "waited_s"
        ],
        "title": "TaskResumed",
        "type": "object"
      },
      "TaskResumedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskResumed"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.resumed",
            "default": "task.resumed",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskResumedEvent",
        "type": "object"
      },
      "TaskStarted": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "node": {
            "title": "Node",
            "type": "string"
          }
        },
        "required": [
          "node",
          "attempt"
        ],
        "title": "TaskStarted",
        "type": "object"
      },
      "TaskStartedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskStarted"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.started",
            "default": "task.started",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskStartedEvent",
        "type": "object"
      },
      "TaskStatus": {
        "description": "The task state machine of 03.\n\n``waiting`` is a body parked in ``human_input``; it holds no pool slot\n(04 \u00a7Waiting). ``failed`` is the record of one attempt \u2014 the retry is a\nnew row \u2014 and ``dead_letter`` is the attempt that exhausted them.",
        "enum": [
          "ready",
          "in_progress",
          "waiting",
          "done",
          "failed",
          "dead_letter",
          "cancelled"
        ],
        "title": "TaskStatus",
        "type": "string"
      },
      "TaskStatusSet": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "title": "From",
            "type": "string"
          },
          "node": {
            "title": "Node",
            "type": "string"
          },
          "to": {
            "title": "To",
            "type": "string"
          }
        },
        "required": [
          "node",
          "from",
          "to"
        ],
        "title": "TaskStatusSet",
        "type": "object"
      },
      "TaskStatusSetEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskStatusSet"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.status_set",
            "default": "task.status_set",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskStatusSetEvent",
        "type": "object"
      },
      "TaskStream": {
        "additionalProperties": false,
        "description": "Ephemeral; the content is fetched from ``/api/tasks/{id}/stream``.",
        "properties": {
          "seq_from": {
            "title": "Seq From",
            "type": "integer"
          },
          "seq_to": {
            "title": "Seq To",
            "type": "integer"
          }
        },
        "required": [
          "seq_from",
          "seq_to"
        ],
        "title": "TaskStream",
        "type": "object"
      },
      "TaskStreamEvent": {
        "additionalProperties": false,
        "description": "Ephemeral: published to the bus and SSE, never stored, no ``id``.",
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskStream"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.stream",
            "default": "task.stream",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskStreamEvent",
        "type": "object"
      },
      "TaskView": {
        "description": "One attempt of one node in one run. **Never** carries a token.",
        "properties": {
          "attempt": {
            "description": "Which attempt of that node this row is, from 1.",
            "title": "Attempt",
            "type": "integer"
          },
          "branch": {
            "description": "The fan-out stack this attempt is inside.",
            "items": {
              "$ref": "#/components/schemas/athanore__api__schemas__tasks__BranchFrame"
            },
            "title": "Branch",
            "type": "array"
          },
          "created": {
            "description": "When the row was enqueued.",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the attempt failed, when it did.",
            "title": "Error"
          },
          "explicit": {
            "description": "Whether that priority was declared on the node rather than defaulted.",
            "title": "Explicit",
            "type": "boolean"
          },
          "finished": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it ended.",
            "title": "Finished"
          },
          "id": {
            "description": "The task id, unique across every run.",
            "title": "Id",
            "type": "integer"
          },
          "lineage": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where this attempt came from: its reason and its parent.",
            "title": "Lineage"
          },
          "node": {
            "description": "The node whose body this attempt runs.",
            "title": "Node",
            "type": "string"
          },
          "payload": {
            "description": "The value the task was enqueued with.",
            "title": "Payload"
          },
          "priority": {
            "description": "The dispatch priority this attempt was given.",
            "title": "Priority",
            "type": "integer"
          },
          "result": {
            "description": "What the body returned, once it has.",
            "title": "Result"
          },
          "run_id": {
            "description": "The run this attempt belongs to.",
            "title": "Run Id",
            "type": "string"
          },
          "started": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was claimed.",
            "title": "Started"
          },
          "stats": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's measurements for this attempt (05 \u00a7Stats entry); absent when nothing measured it.",
            "title": "Stats"
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus",
            "description": "The task state machine of 03."
          },
          "terminal": {
            "description": "Whether the attempt finished with no transition, making its `result` a branch output.",
            "title": "Terminal",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "run_id",
          "node",
          "attempt",
          "status",
          "priority",
          "explicit",
          "terminal",
          "created"
        ],
        "title": "TaskView",
        "type": "object"
      },
      "TaskWaiting": {
        "additionalProperties": false,
        "properties": {
          "node": {
            "title": "Node",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "integer"
          }
        },
        "required": [
          "node",
          "request_id"
        ],
        "title": "TaskWaiting",
        "type": "object"
      },
      "TaskWaitingEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/TaskWaiting"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "task.waiting",
            "default": "task.waiting",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "TaskWaitingEvent",
        "type": "object"
      },
      "ValidationError": {
        "additionalProperties": false,
        "description": "One pydantic error, as ``ValidationError.errors()`` reports it.",
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Loc",
            "type": "array"
          },
          "msg": {
            "title": "Msg",
            "type": "string"
          },
          "type": {
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WorkflowOut": {
        "description": "One registered workflow: its graph, its capacity, its plugins.",
        "properties": {
          "capacity": {
            "description": "Slots that pool has, in total.",
            "title": "Capacity",
            "type": "integer"
          },
          "in_flight": {
            "description": "Slots of that pool leased right now, across every workflow bound to it.",
            "title": "In Flight",
            "type": "integer"
          },
          "name": {
            "description": "The workflow's name, as it appears in URLs.",
            "title": "Name",
            "type": "string"
          },
          "nodes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/NodeOut"
            },
            "description": "Every node of the finalized graph, by name.",
            "title": "Nodes",
            "type": "object"
          },
          "plugin": {
            "$ref": "#/components/schemas/WorkflowPlugin",
            "description": "What this workflow contributes to the UI (09)."
          },
          "pool": {
            "description": "The pool this workflow's tasks are dispatched on.",
            "title": "Pool",
            "type": "string"
          },
          "start": {
            "description": "The node a new run begins at.",
            "title": "Start",
            "type": "string"
          },
          "target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The target this workflow was loaded from (`module:attr` or `path.py:attr`), and what `PUT /api/workflows/{name}` without a `target` reloads; `null` for a programmatic registration.",
            "title": "Target"
          }
        },
        "required": [
          "name",
          "start",
          "pool",
          "capacity",
          "in_flight",
          "nodes",
          "plugin"
        ],
        "title": "WorkflowOut",
        "type": "object"
      },
      "WorkflowPlugin": {
        "description": "The panels and actions a workflow contributes (09 \u00a7Wire contract).\n\nBoth lists are empty until the plugin registry lands: the field is\npart of the contract now so the SPA can read a workflow's plugin\nsurface from the workflow itself, and the entries it will carry are\nthe manifest's own (09).",
        "properties": {
          "actions": {
            "description": "Action declarations, as `/api/plugins` lists them.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Actions",
            "type": "array"
          },
          "panels": {
            "description": "Panel declarations, as `/api/plugins` lists them.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Panels",
            "type": "array"
          }
        },
        "title": "WorkflowPlugin",
        "type": "object"
      },
      "WorkflowRegistered": {
        "additionalProperties": false,
        "description": "A workflow added to a serving server (22 \u00a7Add). No ``run_id``.\n\n``target`` is the string it was loaded from, absent for a\nprogrammatic registration.",
        "properties": {
          "pool": {
            "title": "Pool",
            "type": "string"
          },
          "target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target"
          },
          "workflow": {
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow",
          "pool"
        ],
        "title": "WorkflowRegistered",
        "type": "object"
      },
      "WorkflowRegisteredEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowRegistered"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "workflow.registered",
            "default": "workflow.registered",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "WorkflowRegisteredEvent",
        "type": "object"
      },
      "WorkflowReplaced": {
        "additionalProperties": false,
        "description": "A workflow's graph and plugins swapped (22 \u00a7Replace). No ``run_id``.",
        "properties": {
          "pool": {
            "title": "Pool",
            "type": "string"
          },
          "target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target"
          },
          "workflow": {
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow",
          "pool"
        ],
        "title": "WorkflowReplaced",
        "type": "object"
      },
      "WorkflowReplacedEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowReplaced"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "workflow.replaced",
            "default": "workflow.replaced",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "WorkflowReplacedEvent",
        "type": "object"
      },
      "WorkflowUnregistered": {
        "additionalProperties": false,
        "description": "A workflow removed (22 \u00a7Remove). No ``run_id``.\n\n``task_ids`` are the attempts the removal interrupted.",
        "properties": {
          "task_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Task Ids",
            "type": "array"
          },
          "workflow": {
            "title": "Workflow",
            "type": "string"
          }
        },
        "required": [
          "workflow",
          "task_ids"
        ],
        "title": "WorkflowUnregistered",
        "type": "object"
      },
      "WorkflowUnregisteredEvent": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WorkflowUnregistered"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "const": "workflow.unregistered",
            "default": "workflow.unregistered",
            "title": "Name",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          }
        },
        "required": [
          "created",
          "name",
          "data"
        ],
        "title": "WorkflowUnregisteredEvent",
        "type": "object"
      },
      "athanore__api__schemas__tasks__BranchFrame": {
        "description": "One frame of a task's fan-out stack (04 \u00a7Branch frames).\n\nFrames nest, outermost first: a branch that fans out again pushes a\nsecond frame. ``key`` is the payload that branch was given, which is\nthe branch's identity in every list the SPA groups by it.",
        "properties": {
          "count": {
            "description": "How many branches that fan-out opened.",
            "title": "Count",
            "type": "integer"
          },
          "fanout": {
            "description": "The task whose return value fanned out.",
            "title": "Fanout",
            "type": "integer"
          },
          "index": {
            "description": "This branch's zero-based index in that fan-out.",
            "title": "Index",
            "type": "integer"
          },
          "key": {
            "description": "The payload this branch was given.",
            "title": "Key"
          }
        },
        "required": [
          "fanout",
          "index",
          "count"
        ],
        "title": "BranchFrame",
        "type": "object"
      },
      "athanore__events__payloads__BranchFrame": {
        "additionalProperties": false,
        "description": "One fan-out frame of a task's branch, without its (large) key.",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "fanout": {
            "title": "Fanout",
            "type": "integer"
          },
          "index": {
            "title": "Index",
            "type": "integer"
          }
        },
        "required": [
          "fanout",
          "index",
          "count"
        ],
        "title": "BranchFrame",
        "type": "object"
      }
    },
    "securitySchemes": {
      "operatorBearer": {
        "description": "The operator token. Required on a non-loopback bind, or on a loopback bind with `require_token` set; on the default loopback bind these routes take no credential at all. `GET /api/events` additionally accepts it as `?access_token=`, because a browser's EventSource cannot set a header.",
        "scheme": "bearer",
        "type": "http"
      },
      "taskToken": {
        "description": "The per-attempt task token. Minted at claim, valid only for the task it names and only while that attempt is in progress or waiting, and accepted in this header and nowhere else.",
        "in": "header",
        "name": "X-Athanore-Token",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "title": "Athanore",
    "version": "1.4.1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/agent/tasks/{task_id}": {
      "get": {
        "description": "Everything the agent needs to start, and nothing else (08).\n\nThe title and the description are the run's \u2014 the brief an operator\nsubmitted \u2014 and ``input`` is the payload this node was enqueued with,\n``null`` when it had none. ``log`` is the run's work log, oldest\nfirst, uncapped and untruncated: it is the inter-stage channel (D4),\nit is bounded by the number of stages rather than by agent output,\nand a retried attempt reads the ``failure`` entry that says why the\nlast one failed.\n\nThe ``stats`` entries are dropped (D56). ``output_schema`` is here\nonly while a fa\u00e7ade has declared an ``output_model`` on this\nattempt's live context: the ``native`` tooling tier reads it to build\nits ``submit_result`` tool (05 \u00a7Tooling tiers), and an agent with no\nmodel declared is not required to submit anything.",
        "operationId": "get_task_api_agent_tasks__task_id__get",
        "parameters": [
          {
            "description": "The task the token was minted for.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task the token was minted for.",
              "title": "Task Id",
              "type": "integer"
            }
          },
          {
            "description": "The task token, from the claimed attempt.",
            "in": "header",
            "name": "x-athanore-token",
            "required": true,
            "schema": {
              "description": "The task token, from the claimed attempt.",
              "title": "X-Athanore-Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTask"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The task token is not valid for this task."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "taskToken": []
          }
        ],
        "summary": "Read this task: its brief and the work log",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/agent/tasks/{task_id}/ask": {
      "post": {
        "description": "Open a request against this attempt, if the agent may ask at all.\n\n403 unless the fa\u00e7ade running this attempt declared\n``ask_policy=\"http\"`` (05 \u00a7Policies): an agent cannot grant itself\nthe right to interrupt a person, and the policy lives on the agent\nclass the workflow chose. The prompt sections that tell an agent how\nto ask are omitted when it is off (19), so a 403 here is an agent\nthat went looking.\n\nWhat was sent decides the mode: ``options`` for a pick-one question,\n``schema`` for a form \u2014 whose answer is validated against that very\nschema where it lands, by the validator registered here (06\n\u00a7Service) \u2014 and neither for free text. The request is opened with\n``source=\"agent\"`` and no ordinal, because a re-executed attempt does\nnot reproduce a turn statement for statement (06 \u00a7Restart\ndurability).\n\nThe answer does not come back here: the caller polls\n``/requests/{rid}``, which is what lets the agent keep its turn\nrather than holding this connection open.",
        "operationId": "ask_api_agent_tasks__task_id__ask_post",
        "parameters": [
          {
            "description": "The task the token was minted for.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task the token was minted for.",
              "title": "Task Id",
              "type": "integer"
            }
          },
          {
            "description": "The task token, from the claimed attempt.",
            "in": "header",
            "name": "x-athanore-token",
            "required": true,
            "schema": {
              "description": "The task token, from the claimed attempt.",
              "title": "X-Athanore-Token",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ask"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The task token is not valid for this task."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "taskToken": []
          }
        ],
        "summary": "Ask the operator a question",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/agent/tasks/{task_id}/log": {
      "post": {
        "description": "Write one entry to the run's work log, author ``agent``.\n\nThe deliverable of a stage, which is what the next stage reads (D4).\nIt is written through the attempt's own\n:class:`~athanore.engine.services.LogService`, so it carries this\ntask's id and node and emits the ``log.appended`` the SPA re-renders\non \u2014 the same call a node body makes, reached over HTTP.",
        "operationId": "append_log_api_agent_tasks__task_id__log_post",
        "parameters": [
          {
            "description": "The task the token was minted for.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task the token was minted for.",
              "title": "Task Id",
              "type": "integer"
            }
          },
          {
            "description": "The task token, from the claimed attempt.",
            "in": "header",
            "name": "x-athanore-token",
            "required": true,
            "schema": {
              "description": "The task token, from the claimed attempt.",
              "title": "X-Athanore-Token",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogText"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogRef"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The task token is not valid for this task."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "taskToken": []
          }
        ],
        "summary": "Append this attempt's deliverable",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/agent/tasks/{task_id}/requests/{request_id}": {
      "get": {
        "description": "The answer, waiting up to ``wait`` seconds for one to land.\n\n``wait`` is clamped to :data:`MAX_WAIT` rather than refused, so 19's\ninstruction \u2014 poll with ``?wait=60`` and repeat until it says\n``answered`` \u2014 is a loop that costs one request per minute and not a\nspin. The wait ends the moment the answer is recorded, not when the\nclamp expires.\n\nA request of **another** task is a 404, not someone else's answer: a\ntoken names one attempt and this route reads only what that attempt\nopened (12 \u00a7Task tokens).\n\nNothing is claimed. An agent that lost a response and asked again\ngets the same answer again, which is what makes a dropped connection\ncost nothing (06 \u00a7Service).",
        "operationId": "poll_request_api_agent_tasks__task_id__requests__request_id__get",
        "parameters": [
          {
            "description": "The task the token was minted for.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task the token was minted for.",
              "title": "Task Id",
              "type": "integer"
            }
          },
          {
            "description": "A request this task opened.",
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "description": "A request this task opened.",
              "title": "Request Id",
              "type": "integer"
            }
          },
          {
            "description": "Seconds to wait for an answer before reporting that there is none yet. Clamped to [0, 120].",
            "in": "query",
            "name": "wait",
            "required": false,
            "schema": {
              "default": 0.0,
              "description": "Seconds to wait for an answer before reporting that there is none yet. Clamped to [0, 120].",
              "title": "Wait",
              "type": "number"
            }
          },
          {
            "description": "The task token, from the claimed attempt.",
            "in": "header",
            "name": "x-athanore-token",
            "required": true,
            "schema": {
              "description": "The task token, from the claimed attempt.",
              "title": "X-Athanore-Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerPoll"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The task token is not valid for this task."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "taskToken": []
          }
        ],
        "summary": "Wait for the answer to a question",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/agent/tasks/{task_id}/submit": {
      "post": {
        "description": "Record a value for this attempt, if it fits what was asked for.\n\nWith an ``output_model`` declared, a misfit is a 422 carrying\n``errors`` and ``schema`` and nothing is stored: the agent reads the\ntwo in its own tool output and can fix the shape inside the same turn\n(05 \u00a7Submissions). The rejection is also left on the context as\n``ctx.last_rejection``, which is what 19's repair turn quotes back if\nthe turn ends without a valid submission.\n\nWith none declared, any JSON is stored as it arrived.\n\nSubmitting twice is not an error: the **latest valid** payload wins\n(D5), and a body reads it with ``submissions.latest()``. A submission\nnever routes anything \u2014 the node body decides \u2014 so an agent cannot\nmove its own task.",
        "operationId": "submit_api_agent_tasks__task_id__submit_post",
        "parameters": [
          {
            "description": "The task the token was minted for.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task the token was minted for.",
              "title": "Task Id",
              "type": "integer"
            }
          },
          {
            "description": "The task token, from the claimed attempt.",
            "in": "header",
            "name": "x-athanore-token",
            "required": true,
            "schema": {
              "description": "The task token, from the claimed attempt.",
              "title": "X-Athanore-Token",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The result, as JSON. Any shape when no `output_model` is declared; otherwise it must fit the schema `GET /api/agent/tasks/{id}` reports.",
                "title": "Payload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The task token is not valid for this task."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "taskToken": []
          }
        ],
        "summary": "Submit this task's structured result",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/events": {
      "get": {
        "description": "Missed history, then live events, on one connection.\n\n`access_token` is accepted here as a query parameter and on no other\nroute, because a browser's `EventSource` cannot set a header (08\n\u00a7Authentication); the query string is never logged.",
        "operationId": "events_api_events_get",
        "parameters": [
          {
            "description": "Replay stored events after this event id, then go live. Takes precedence over the `Last-Event-ID` header.",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Replay stored events after this event id, then go live. Takes precedence over the `Last-Event-ID` header.",
              "title": "After"
            }
          },
          {
            "description": "Only events of this run.",
            "in": "query",
            "name": "run",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only events of this run.",
              "title": "Run"
            }
          },
          {
            "description": "Comma-separated event-name globs; a `*` matches one dotted segment, so `run.*` selects `run.created`. Omitted means every event.",
            "in": "query",
            "name": "names",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated event-name globs; a `*` matches one dotted segment, so `run.*` selects `run.created`. Omitted means every event.",
              "title": "Names"
            }
          },
          {
            "description": "A browser's reconnect cursor, set by EventSource.",
            "in": "header",
            "name": "last-event-id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A browser's reconnect cursor, set by EventSource.",
              "title": "Last-Event-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {}
            },
            "description": "An SSE stream. Each message is `id: <event id>`, `event: <event name>`, `data: <EventEnvelope as JSON>`. Ephemeral events (`task.stream`) carry no `id:`, and the `resync` control frame \u2014 sent when the replay overran `sse_replay_cap` or the server dropped events for a slow reader \u2014 carries neither an `id:` nor an event envelope."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "The event stream",
        "tags": [
          "events"
        ]
      }
    },
    "/api/health": {
      "get": {
        "description": "Whether the server is up, which version it is, and what it is doing.\n\nPausing every run and then waiting for `tasks_in_progress` to reach\nzero here is how an operator drains a server before stopping it.",
        "operationId": "health_api_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Liveness and version",
        "tags": [
          "system"
        ]
      }
    },
    "/api/me": {
      "get": {
        "description": "Whether this server wants a token, and whether this request has one.\n\nNever requires one itself: a request with no credential on a server\nthat wants one gets a 200 saying `{\"auth\": \"token\", \"authenticated\":\nfalse}`, which is the client's cue to ask for a token.",
        "operationId": "me_api_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Whether the caller needs a token, and has one",
        "tags": [
          "system"
        ]
      }
    },
    "/api/plugins": {
      "get": {
        "description": "The plugin manifest: panels, actions and assets, per workflow.\n\nBuiltins first, then the workflows in registration order. The\nSPA fetches this at boot, again whenever the SSE stream reconnects\nonto a server with a new ``started_at``, and on every\n``workflow.*`` event, because a manifest changes when a workflow\nis registered, replaced or removed (09 \u00a7Wire contract, 22 \u00a7Live\nmounting).",
        "operationId": "manifest_api_plugins_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PluginManifestEntry"
                  },
                  "title": "Response Manifest Api Plugins Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Everything the registered workflows contribute to the UI",
        "tags": [
          "plugins"
        ]
      }
    },
    "/api/plugins/{wf}/actions/{name}": {
      "post": {
        "description": "Validate the input, resolve the scope, run the handler.\n\nThe one way an action is invoked (09 \u00a7Wire contract). It answers\nwith whatever the handler returned, as JSON.",
        "operationId": "run_action_api_plugins__wf__actions__name__post",
        "parameters": [
          {
            "description": "The workflow that declared the action.",
            "in": "path",
            "name": "wf",
            "required": true,
            "schema": {
              "description": "The workflow that declared the action.",
              "title": "Wf",
              "type": "string"
            }
          },
          {
            "description": "The action's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "description": "The action's name.",
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionCall"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Run one of a workflow's declared actions",
        "tags": [
          "plugins"
        ]
      }
    },
    "/api/requests": {
      "get": {
        "description": "The requests of every run, or of one, oldest first.\n\n\"Pending\" is narrower than \"unanswered\": a request whose task has\nended is **stale** and leaves the inbox, because an answer to it\nwould reach nobody (06 \u00a7Restart durability). It stays in the run's\nown history, and ``pending=false`` here shows it too, with\n``stale: true`` on it.\n\nAn application with no store holds no requests and answers with an\nempty list; a ``run`` that names no run is a filter that matches\nnothing rather than a 404.",
        "operationId": "list_requests_api_requests_get",
        "parameters": [
          {
            "description": "Only requests a person can still act on: unanswered, with the attempt that asked still running.",
            "in": "query",
            "name": "pending",
            "required": false,
            "schema": {
              "default": true,
              "description": "Only requests a person can still act on: unanswered, with the attempt that asked still running.",
              "title": "Pending",
              "type": "boolean"
            }
          },
          {
            "description": "Only requests of this run.",
            "in": "query",
            "name": "run",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only requests of this run.",
              "title": "Run"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RequestView"
                  },
                  "title": "Response List Requests Api Requests Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "The inbox: every request still waiting on a person",
        "tags": [
          "requests"
        ]
      }
    },
    "/api/requests/{request_id}": {
      "get": {
        "description": "One request, answered or not, with the node that asked.",
        "operationId": "get_request_api_requests__request_id__get",
        "parameters": [
          {
            "description": "The request id, unique across runs.",
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "description": "The request id, unique across runs.",
              "title": "Request Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestView"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "One request and its answer",
        "tags": [
          "requests"
        ]
      }
    },
    "/api/requests/{request_id}/answer": {
      "post": {
        "description": "Record the one answer this request may have, and return it.\n\n``option_id`` for an ``options`` request and ``value`` for a ``text``\nor ``form`` one; the request's own ``mode`` decides which of the two\nis read, so a ``value`` sent to an ``options`` request is not an\nanswer that request could have (06 \u00a7Service).\n\nThe response is the **updated** view rather than the answer row (08\n\u00a7Requests): the SPA re-renders the card it just answered, and\n``pending``, ``answer`` and ``answered_by`` are all part of what\nchanged. The author is ``user`` \u2014 this route is the operator's, and\nthe other author, ``engine``, belongs to the headless fallbacks that\nrecord an answer without a person (06 \u00a7Timeouts).",
        "operationId": "answer_request_api_requests__request_id__answer_post",
        "parameters": [
          {
            "description": "The request id, unique across runs.",
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "description": "The request id, unique across runs.",
              "title": "Request Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Answer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestView"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Answer a request",
        "tags": [
          "requests"
        ]
      }
    },
    "/api/runs": {
      "get": {
        "description": "The run list of 08 \u00a7Runs, whole.\n\nRun lists are small and return whole (08 \u00a7Conventions). The order is\nthe dispatch order \u2014 ``position`` ascending \u2014 so the list the\noperator reads is the order the scheduler will claim in.\n\nAn application with no store has no runs and answers with an empty\nlist: \"nothing to ask\" and \"nothing queued\" are the same fact for a\nserver that holds no work, unlike ``/api/health``'s counts.",
        "operationId": "list_runs_api_runs_get",
        "parameters": [
          {
            "description": "Only runs in this status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/RunStatus"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only runs in this status.",
              "title": "Status"
            }
          },
          {
            "description": "Only runs of this workflow.",
            "in": "query",
            "name": "workflow",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only runs of this workflow.",
              "title": "Workflow"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RunSummary"
                  },
                  "title": "Response List Runs Api Runs Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Every run, in dispatch order",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}": {
      "delete": {
        "description": "Cancel what is outstanding, then remove the run.\n\nBoth halves are ``Ops.delete``'s, in that order and for its reason:\nthe attempts are killed against rows that still exist.",
        "operationId": "delete_run_api_runs__run_id__delete",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Delete a run and everything under it",
        "tags": [
          "runs"
        ]
      },
      "get": {
        "description": "A run with everything the overview pane draws (08 \u00a7Runs).\n\n``current_nodes`` and ``pending_requests`` are the list query's two\nderived fields, recomputed from this read: the attempts are already\nin hand, so the in-flight nodes cost nothing, and the pending\nrequests are one indexed query over this run alone.",
        "operationId": "get_run_api_runs__run_id__get",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "One run, its attempts and its totals",
        "tags": [
          "runs"
        ]
      },
      "patch": {
        "description": "Write the fields the body names, and answer with the run.\n\nA field the body omits is left alone, which is why an edit that\nnames neither is accepted and changes nothing (``Ops.edit``). The\nresponse is the whole detail rather than the edited row: the SPA\nre-renders the overview from it, and a second GET to get the\nattempts back would be a round trip for nothing.",
        "operationId": "edit_run_api_runs__run_id__patch",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditRun"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Change a run's title or description",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/cancel": {
      "post": {
        "description": "Cancel the run and every outstanding attempt; 409 if it has ended.\n\nThe ``note`` names how many attempts were stopped, because that is\nthe part of the outcome the request could not predict: a run with\nnothing in flight and a run with three agents mid-turn are the same\ncall and very different events. It is omitted when there were none,\nrather than sent as \"0 attempts\".",
        "operationId": "cancel_run_api_runs__run_id__cancel_post",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "End a run and everything under it",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/events": {
      "get": {
        "description": "One page of the run's history, oldest first.\n\nThe same typed envelope the SSE feed sends (18 \u00a7Typing), so a client\nthat caught up from here and then subscribed switches sources\nwithout switching shapes. `task.stream` is ephemeral and is never\nstored, so it never appears in a page.",
        "operationId": "get_events_api_runs__run_id__events_get",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "description": "Return events after this event id.",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Return events after this event id.",
              "minimum": 0,
              "title": "After",
              "type": "integer"
            }
          },
          {
            "description": "How many events to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 500,
              "description": "How many events to return.",
              "maximum": 5000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/RunCreatedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunStartedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunUpdatedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunReorderedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunPausedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunResumedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunCancelledEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunDeletedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunCompletedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RunFailedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskEnqueuedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/JoinArrivedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskStartedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskDoneEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskFailedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskDeadLetteredEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskWaitingEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskResumedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskCancelledEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskMovedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskStatusSetEvent"
                      },
                      {
                        "$ref": "#/components/schemas/TaskStreamEvent"
                      },
                      {
                        "$ref": "#/components/schemas/SubmissionAcceptedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/SubmissionRejectedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/SubmissionRepairEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RequestOpenedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/RequestAnsweredEvent"
                      },
                      {
                        "$ref": "#/components/schemas/LogAppendedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/AgentStatsEvent"
                      },
                      {
                        "$ref": "#/components/schemas/EngineRecoveredEvent"
                      },
                      {
                        "$ref": "#/components/schemas/EngineStoppingEvent"
                      },
                      {
                        "$ref": "#/components/schemas/WorkflowRegisteredEvent"
                      },
                      {
                        "$ref": "#/components/schemas/WorkflowReplacedEvent"
                      },
                      {
                        "$ref": "#/components/schemas/WorkflowUnregisteredEvent"
                      },
                      {
                        "$ref": "#/components/schemas/PluginEvent"
                      }
                    ]
                  },
                  "title": "Response Get Events Api Runs  Run Id  Events Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "A run's stored events",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/graph": {
      "get": {
        "description": "The registered graph with this run's history projected onto it.\n\nA run whose workflow this server does not have registered is a 404\n``unknown_workflow``: there is no graph to project onto, and the run\nlist already says so with ``unregistered`` rather than pretending a\nshape.",
        "operationId": "get_graph_api_runs__run_id__graph_get",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "The workflow's graph, for this run",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/log": {
      "get": {
        "description": "Every entry of the work log, oldest first and never truncated.\n\nWhole, and unpaged: the log is bounded by the number of stages\nrather than by agent output (08 \u00a7Agent-facing). The `stats` entries\nan agent never sees are here \u2014 token counts are operator\ninformation.",
        "operationId": "get_log_api_runs__run_id__log_get",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LogEntry"
                  },
                  "title": "Response Get Log Api Runs  Run Id  Log Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "A run's work log",
        "tags": [
          "runs"
        ]
      },
      "post": {
        "description": "Write a `user` entry under the run's current node.\n\nThe node is the one node with an attempt in flight, and ``user``\nwhen there is not exactly one: a note filed under one branch of a\nfan-out would claim a context it does not have (``Ops.append_log``).",
        "operationId": "append_log_api_runs__run_id__log_post",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogText"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogRef"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Append an operator note to the work log",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/pause": {
      "post": {
        "description": "Pause a `queued` or `running` run; 409 on anything else.\n\nPause is about the **next** task: an attempt already in flight runs\nto its end and enqueues its successor, and that successor waits (04\n\u00a7Operator operations). Killing running work is ``/cancel``.",
        "operationId": "pause_run_api_runs__run_id__pause_post",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Stop a run dispatching",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/position": {
      "post": {
        "description": "Swap with a neighbour, or move to a zero-based index (D57).\n\nBoth ends are a no-op that still answers 200 with the position the\nrun already had, and an ``index`` outside the list is clamped to it:\n\"top\" is `{\"index\": 0}` and there is nothing for the caller to\nbounds-check. The body model has already refused neither-or-both of\nthe two fields.",
        "operationId": "move_run_api_runs__run_id__position_post",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Position"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PositionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Move a run in the dispatch list",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/requests": {
      "get": {
        "description": "Every request the run opened, answered or not, oldest first.\n\nThe run's history rather than the inbox: a stale request \u2014 one whose\nattempt is gone \u2014 stays here and leaves ``/api/requests?pending=true``\n(06 \u00a7Restart durability).",
        "operationId": "get_requests_api_runs__run_id__requests_get",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RequestView"
                  },
                  "title": "Response Get Requests Api Runs  Run Id  Requests Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "A run's requests",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/rerun": {
      "post": {
        "description": "Enqueue a fresh attempt of ``node`` with the payload it last had.\n\nA join replays the arrivals the store holds rather than the payload\nits task was given, which is what makes a rerun the remedy for a\nbranch that arrived late (04 \u00a7Failure and operator semantics).",
        "operationId": "rerun_node_api_runs__run_id__rerun_post",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rerun"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskRef"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Run a node again",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/runs/{run_id}/resume": {
      "post": {
        "description": "Resume a `paused` run; 409 on anything else.",
        "operationId": "resume_run_api_runs__run_id__resume_post",
        "parameters": [
          {
            "description": "The run id, a ULID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The run id, a ULID.",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Let a paused run dispatch again",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/tasks/{task_id}": {
      "get": {
        "description": "The operator view of a task: 08's ``TaskRow`` plus ``submissions``.\n\nEvery accepted submission, oldest first, because \"last valid wins\"\n(D5) is a rule about which one the body reads and not about which\nones happened: an operator reading a repaired attempt wants the\nrejected shape and the accepted one.\n\nNo token, in this response or any other: a task token is\nheader-only (12 \u00a7Task tokens), and ``TaskDetail`` has no field that\ncould carry one.",
        "operationId": "get_task_api_tasks__task_id__get",
        "parameters": [
          {
            "description": "The task id, unique across runs.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task id, unique across runs.",
              "title": "Task Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "One attempt and what was submitted for it",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/tasks/{task_id}/move": {
      "post": {
        "description": "Cancel the attempt and enqueue its payload at ``node``.\n\n409 ``conflict`` when ``node`` is a **join** (04 \u00a7Fan-in): a join is\ndispatched by its arrivals and called with all of them, so a task\nmoved into one would be a join attempt holding a single branch's\npayload, with no arrival recorded and a run left waiting for\nbranches that already landed.",
        "operationId": "move_task_api_tasks__task_id__move_post",
        "parameters": [
          {
            "description": "The task id, unique across runs.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task id, unique across runs.",
              "title": "Task Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Move"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskRef"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Move a task's work to another node",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/tasks/{task_id}/retry": {
      "post": {
        "description": "Enqueue the next attempt of a task that has stopped.\n\nSame node, same payload, same branch and the same ``created``, so a\nretry keeps its place in the dispatch order (``Ops.retry``). Refused\nwith 409 ``conflict`` while the task is still going: a second attempt\nof a task that already has one is two attempts of one task.",
        "operationId": "retry_task_api_tasks__task_id__retry_post",
        "parameters": [
          {
            "description": "The task id, unique across runs.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task id, unique across runs.",
              "title": "Task Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskRef"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Queue another attempt of a task",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/tasks/{task_id}/status": {
      "post": {
        "description": "Put the task in one of the three statuses an operator may write.\n\n``ready`` re-dispatches it and re-opens a terminal run, ``cancelled``\nstops it and ``dead_letter`` files it as failed for good; the other\nfour statuses are the engine's record of what happened and are not an\noperator's to declare, which is why the body's field is a\n``Literal`` and a fourth value is a 422 before the engine is reached.",
        "operationId": "set_status_api_tasks__task_id__status_post",
        "parameters": [
          {
            "description": "The task id, unique across runs.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task id, unique across runs.",
              "title": "Task Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatus"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Write a task's status",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/tasks/{task_id}/stream": {
      "get": {
        "description": "The chunks after ``after``, in transcript order (08 \u00a7Tasks).\n\n``after=0`` is the whole transcript from the start, which is what a\ntab opening on a finished attempt asks for; a client following a\nlive one passes the ``seq_to`` of the ephemeral ``task.stream`` event\nit just received (18) and appends what comes back.",
        "operationId": "get_stream_api_tasks__task_id__stream_get",
        "parameters": [
          {
            "description": "The task id, unique across runs.",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task id, unique across runs.",
              "title": "Task Id",
              "type": "integer"
            }
          },
          {
            "description": "Return chunks after this sequence number.",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Return chunks after this sequence number.",
              "minimum": 0,
              "title": "After",
              "type": "integer"
            }
          },
          {
            "description": "How many chunks to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 500,
              "description": "How many chunks to return.",
              "maximum": 5000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "A page of a task's agent transcript",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/workflows": {
      "get": {
        "description": "The registered workflows, by name.\n\nWhat the New Run overlay's workflow chips and the library's left list\nare built from (10 \u00a7Overlays). A server with nothing registered\nanswers with an empty list: it runs no workflows, which is a fact\nrather than a failure.",
        "operationId": "list_workflows_api_workflows_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WorkflowOut"
                  },
                  "title": "Response List Workflows Api Workflows Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Every workflow this server can run",
        "tags": [
          "workflows"
        ]
      },
      "post": {
        "description": "Load `target` and register the workflow it names, without a restart.\n\nThe name it registers under is the loaded workflow's own. Answers 201\nwith the workflow as `GET /api/workflows/{name}` reports it; 409\n`conflict` if that name is already registered; 422\n`workflow_load_failed` when the load stopped \u2014 its body carries\n`target`, `stage` (`target`, `import`, `attribute`, `finalize`,\n`plugins` or `register`) and `detail`, the underlying error's full\nmessage; 422 `unknown_pool` for a `pool` the engine does not have,\nnaming the ones it does; 500 `persist_failed` (`path`, `detail`) when\n`persist` was asked for and the row could not be written, in which\ncase nothing was registered; 503 `registration_unavailable` from an\napplication built without a registrar. A response that wrote the row\ncarries `X-Athanore-Persisted: <path>`.",
        "operationId": "register_workflow_api_workflows_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterWorkflow"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Register a workflow from a target",
        "tags": [
          "workflows"
        ]
      }
    },
    "/api/workflows/{name}": {
      "delete": {
        "description": "Drop the workflow `name`, interrupting whatever it was running.\n\nEvery attempt of it in flight is cancelled and left where it was \u2014 no\ntask status is written, and the run reads `unregistered: true` until\nthe workflow is registered again, at which point those rows are\nrecovered. Nothing is deleted. Answers 200 with the interrupted task\nids; 404 `unknown_workflow`; 500 `persist_failed`; 503\n`registration_unavailable`. A response that removed the row carries\n`X-Athanore-Persisted: <path>`; one that found no row to remove\ncarries no such header.",
        "operationId": "remove_workflow_api_workflows__name__delete",
        "parameters": [
          {
            "description": "The registered workflow's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "description": "The registered workflow's name.",
              "title": "Name",
              "type": "string"
            }
          },
          {
            "description": "Remove the `[workflows.<name>]` row of `athanore.toml` too; a name with no row is not an error.",
            "in": "query",
            "name": "persist",
            "required": false,
            "schema": {
              "default": false,
              "description": "Remove the `[workflows.<name>]` row of `athanore.toml` too; a name with no row is not an error.",
              "title": "Persist",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemovedWorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Unregister a workflow",
        "tags": [
          "workflows"
        ]
      },
      "get": {
        "description": "One registered workflow, or 404 `unknown_workflow`.",
        "operationId": "get_workflow_api_workflows__name__get",
        "parameters": [
          {
            "description": "The registered workflow's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "description": "The registered workflow's name.",
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "One workflow",
        "tags": [
          "workflows"
        ]
      },
      "put": {
        "description": "Load `target` \u2014 or the registration's recorded one \u2014 and replace `name`.\n\nThe next task of every run of the workflow dispatches on the new\ngraph; an attempt already running finishes on the body it started\nwith. Answers 200 with the workflow as `GET /api/workflows/{name}`\nnow reports it; 404 `unknown_workflow`; 409 `conflict` if the target\nnow defines a differently named workflow (that is a new workflow \u2014\n`POST` it) or `pool` would move the workflow while attempts of it are\nin flight; 422 `workflow_load_failed` as `POST` answers, with `stage:\n\"target\"` when `target` was omitted and the registration has no\nrecorded one; 422 `unknown_pool`; 500 `persist_failed`; 503\n`registration_unavailable`. A response that rewrote the row carries\n`X-Athanore-Persisted: <path>`.",
        "operationId": "reload_workflow_api_workflows__name__put",
        "parameters": [
          {
            "description": "The registered workflow's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "description": "The registered workflow's name.",
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReloadWorkflow"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Reload a registered workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/api/workflows/{name}/runs": {
      "post": {
        "description": "Queue a run of this workflow, and return its id.\n\nThe run is `queued` rather than `running`: waiting for a slot is a\nstate an operator can see, and the first claim of one of its tasks is\nwhat flips it (03 \u00a7Run).",
        "operationId": "submit_run_api_workflows__name__runs_post",
        "parameters": [
          {
            "description": "The registered workflow's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "description": "The registered workflow's name.",
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewRun"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Created"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "Submit a run",
        "tags": [
          "workflows"
        ]
      }
    },
    "/api/workflows/{name}/source": {
      "get": {
        "description": "The module a workflow's nodes are defined in, and their line numbers.\n\nThe file is the one the **start node's** body is defined in \u2014 the\nmodule the author wrote the workflow in \u2014 and ``nodes`` carries a line\nfor each node whose body is defined in that same file. A node whose\nfunction was imported from elsewhere is left out rather than given a\nline into text that does not contain it (01 \u00a7Real data only).\n\nA workflow whose source Python cannot produce \u2014 a body built by\n``exec``, or one whose file has been deleted since import \u2014 is a 404:\nthe workflow is registered, but this view of it does not exist.",
        "operationId": "get_source_api_workflows__name__source_get",
        "parameters": [
          {
            "description": "The registered workflow's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "description": "The registered workflow's name.",
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "No operator token, on a bind that requires one."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The request did not validate. `code` is `validation` and `errors` names each field that failed."
          }
        },
        "security": [
          {
            "operatorBearer": []
          }
        ],
        "summary": "The Python a workflow is defined in",
        "tags": [
          "workflows"
        ]
      }
    },
    "/mcp/agent": {
      "post": {
        "description": "The agent surface as MCP tools: `get_task`, `append_log`, `submit_result`, and \u2014 when the attempt's `ask_policy` is `http` \u2014 `ask_operator` and `wait_answer`. Authenticated by the same `X-Athanore-Token` header as `/api/agent/`; the task is the token's, so no tool takes a task id. The request and response bodies are MCP's own JSON-RPC and are opaque to this document.",
        "operationId": "mcp_agent",
        "parameters": [
          {
            "description": "The task token, from the claimed attempt.",
            "in": "header",
            "name": "X-Athanore-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "One MCP response, as JSON or as an SSE stream."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "description": "The task token is not valid for a live attempt."
          }
        },
        "security": [
          {
            "taskToken": []
          }
        ],
        "summary": "Model Context Protocol server (streamable HTTP)",
        "tags": [
          "agent"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "What this server can run, and how to start a run of it.",
      "name": "workflows"
    },
    {
      "description": "A run's state, its history and the operator verbs that change it.",
      "name": "runs"
    },
    {
      "description": "One attempt of one node: what it submitted, what it streamed, and the verbs that re-attempt it.",
      "name": "tasks"
    },
    {
      "description": "The inbox: everything waiting on a person, and the answers.",
      "name": "requests"
    },
    {
      "description": "What an ACP agent may call, authenticated by the task token of the attempt it is running.",
      "name": "agent"
    },
    {
      "description": "The manifest a workflow's declarations publish, and the routes and actions behind it.",
      "name": "plugins"
    },
    {
      "description": "The live feed: one server-sent event per event of the vocabulary.",
      "name": "events"
    },
    {
      "description": "Liveness and the caller's own standing. Unauthenticated, and carrying no ids.",
      "name": "system"
    }
  ]
}
