{
  "openapi": "3.1.0",
  "info": {
    "title": "Bandwise API",
    "version": "v1",
    "description": "Bandwise management and run API. Generated from the operation registry in apps/console/src/server/operations and the zod contracts in @bandwise/core. Do not edit by hand; run `pnpm openapi`."
  },
  "servers": [
    {
      "url": "/",
      "description": "The console origin. Every path carries the /api/v1 prefix."
    }
  ],
  "paths": {
    "/api/v1/sets/{ref}/run": {
      "post": {
        "operationId": "set.run",
        "summary": "Run a question set and return the standard RunResult envelope.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "staging"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Bandwise-Interface",
            "in": "header",
            "required": false,
            "description": "The interface major the caller was built against. A different live major returns 409 interface_mismatch.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRunRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetRunResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "run",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "review.created",
          "model.alias_moved"
        ],
        "x-bandwise-mcp-tool": "run_set"
      }
    },
    "/api/v1/sets/{ref}/manifest": {
      "get": {
        "operationId": "set.manifest",
        "summary": "Read a set's manifest: its interface without instructions, criteria or thresholds.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Manifest"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/runs": {
      "get": {
        "operationId": "run.list",
        "summary": "List run summaries, without state.",
        "tags": [
          "run"
        ],
        "parameters": [
          {
            "name": "set",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "staging",
                "pinned",
                "draft"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "console",
                "playground",
                "api",
                "embed",
                "extension",
                "mcp",
                "eval",
                "cli",
                "ingest"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ok",
                "error",
                "rate_limited",
                "quota_exceeded"
              ]
            }
          },
          {
            "name": "band",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "high",
                "medium",
                "low"
              ]
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "auto",
                "review",
                "fallback",
                "escalate_to_llm"
              ]
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "runs:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/runs/{id}": {
      "get": {
        "operationId": "run.get",
        "summary": "Read one run with its stage payloads, answers and review items.",
        "tags": [
          "run"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "runs:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/usage": {
      "get": {
        "operationId": "usage.get",
        "summary": "Read run, spend and savings totals per set over a time range (default: the last 7 days).",
        "tags": [
          "usage"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "set",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "usage:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/tokens/browser": {
      "post": {
        "operationId": "browser_token.create",
        "summary": "Mint a short-lived browser token for an origin and a subset of the app token's sets.",
        "tags": [
          "browser_token"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserTokenCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserTokenCreateResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          }
        ],
        "x-bandwise-scope": "run",
        "x-bandwise-min-role": "none",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "apiKey"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": false
        }
      }
    },
    "/api/v1/runs/ingest": {
      "post": {
        "operationId": "run.ingest",
        "summary": "Record a run made by a standalone export, so the ledger, review and calibration keep working.",
        "tags": [
          "run"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunIngestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 4b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "runs:write",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "review.created"
        ],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "operationId": "project.list",
        "summary": "List the org's projects.",
        "tags": [
          "project"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_projects",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "project.create",
        "summary": "Create a project.",
        "tags": [
          "project"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/goals": {
      "get": {
        "operationId": "goal.list",
        "summary": "List goals with their quality targets.",
        "tags": [
          "goal"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoalListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_goals",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "goal.create",
        "summary": "Create a goal with a quality target and business KPI.",
        "tags": [
          "goal"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoalCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "create_goal",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/goals/{id}": {
      "patch": {
        "operationId": "goal.update",
        "summary": "Update a goal.",
        "tags": [
          "goal"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoalUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/templates": {
      "get": {
        "operationId": "template.list",
        "summary": "List the seeded question set templates.",
        "tags": [
          "template"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_templates"
      }
    },
    "/api/v1/sets": {
      "get": {
        "operationId": "set.list",
        "summary": "List question sets visible to the caller.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_sets"
      },
      "post": {
        "operationId": "set.create",
        "summary": "Create a question set with an empty draft, a template draft or a copy of another version.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetCreateResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "create_set"
      }
    },
    "/api/v1/sets/{ref}": {
      "get": {
        "operationId": "set.get",
        "summary": "Read a set with its channel pointers, rollout stages, experiments and live interface major.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetCreateResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_set"
      },
      "patch": {
        "operationId": "set.update",
        "summary": "Change a set's name, protection, labeling, staging dispatch, value settings, gate margins, storage mode, user-generated flag or result cache TTL.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "update_set",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/archive": {
      "post": {
        "operationId": "set.archive",
        "summary": "Archive a set.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/draft": {
      "get": {
        "operationId": "draft.get",
        "summary": "Read the set's draft spec. The ETag header carries its spec_hash.",
        "tags": [
          "draft"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionSetSpec"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "The draft's spec_hash, quoted.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_draft"
      },
      "put": {
        "operationId": "draft.update",
        "summary": "Replace the whole draft spec. Requires If-Match with the draft ETag.",
        "tags": [
          "draft"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The draft ETag (its spec_hash).",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionSetSpecInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftUpdateResponse"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "The draft's spec_hash, quoted.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "update_draft"
      }
    },
    "/api/v1/sets/{ref}/draft/validate": {
      "post": {
        "operationId": "draft.validate",
        "summary": "Lint a spec (default: the stored draft) and return errors and warnings. Writes nothing.",
        "tags": [
          "draft"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DraftValidateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftValidateResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "validate_draft"
      }
    },
    "/api/v1/sets/{ref}/versions": {
      "get": {
        "operationId": "version.list",
        "summary": "List a set's versions.",
        "tags": [
          "version"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/sets/{ref}/versions/{n}": {
      "get": {
        "operationId": "version.get",
        "summary": "Read one version: the full spec for sessions and agent tokens, the manifest for app tokens.",
        "tags": [
          "version"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/sets/{ref}/diff": {
      "get": {
        "operationId": "version.diff",
        "summary": "Diff two sides of a set: version numbers, draft or channel names.",
        "tags": [
          "version"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "draft"
                },
                {
                  "type": "string",
                  "enum": [
                    "production",
                    "staging"
                  ]
                },
                {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "draft"
                },
                {
                  "type": "string",
                  "enum": [
                    "production",
                    "staging"
                  ]
                },
                {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecDiff"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "diff_versions"
      }
    },
    "/api/v1/sets/{ref}/publish": {
      "post": {
        "operationId": "set.publish",
        "summary": "Freeze the draft into a new version and point a channel at it. Requires If-Match.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "description": "Preview: run the checks and return a DryRunResult. Writes nothing.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The draft ETag (its spec_hash).",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPublishRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetPublishResponse"
                }
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:<channel>",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "set.published",
          "interface.breaking_published",
          "experiment.started"
        ],
        "x-bandwise-mcp-tool": "publish"
      }
    },
    "/api/v1/sets/{ref}/channels/{channel}/rollback": {
      "post": {
        "operationId": "channel.rollback",
        "summary": "Point a channel back at an earlier version (default: the previous one).",
        "tags": [
          "channel"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "staging"
              ]
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "description": "Preview: run the checks and return a DryRunResult. Writes nothing.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelRollbackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelRollbackResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:<channel>",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "safety",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "release.rolled_back"
        ],
        "x-bandwise-mcp-tool": "rollback"
      }
    },
    "/api/v1/sets/{ref}/channels/{channel}/promote": {
      "post": {
        "operationId": "channel.promote",
        "summary": "Point production at the version staging serves, with the same lints and gates as a publish.",
        "tags": [
          "channel"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "const": "production"
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "description": "Preview: run the checks and return a DryRunResult. Writes nothing.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelPromoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:production",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "release.promoted",
          "experiment.started"
        ],
        "x-bandwise-mcp-tool": "promote",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/releases": {
      "get": {
        "operationId": "release.list",
        "summary": "List a set's release history.",
        "tags": [
          "release"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/channels/{channel}/rollout": {
      "get": {
        "operationId": "rollout.get",
        "summary": "Read a channel's rollout stage, next-stage gates and auto-demote status.",
        "tags": [
          "rollout"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "staging"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RolloutGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_rollout_gates"
      },
      "put": {
        "operationId": "rollout.change",
        "summary": "Move a channel to another rollout stage. Pausing is never gated.",
        "tags": [
          "rollout"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "staging"
              ]
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "description": "Preview: run the checks and return a DryRunResult. Writes nothing.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolloutChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RolloutChangeResponse"
                }
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:<channel>",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent",
          "system"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "rollout.changed"
        ],
        "x-bandwise-mcp-tool": "change_rollout"
      }
    },
    "/api/v1/sets/{ref}/experiments": {
      "post": {
        "operationId": "experiment.start",
        "summary": "Start a champion/challenger experiment on a channel.",
        "tags": [
          "experiment"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExperimentStartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:<channel>",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "experiment.started"
        ],
        "x-bandwise-mcp-tool": "start_experiment",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/experiments/{id}": {
      "get": {
        "operationId": "experiment.get",
        "summary": "Read an experiment and its current metrics.",
        "tags": [
          "experiment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_experiment",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/experiments/{id}/promote": {
      "post": {
        "operationId": "experiment.promote",
        "summary": "Move the pointer to the challenger when the promotion rule holds.",
        "tags": [
          "experiment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExperimentPromoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:<channel>",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "release.promoted",
          "experiment.decided"
        ],
        "x-bandwise-mcp-tool": "decide_experiment",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/experiments/{id}/stop": {
      "post": {
        "operationId": "experiment.stop",
        "summary": "Stop an experiment and keep the champion.",
        "tags": [
          "experiment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExperimentStopRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "release:<channel>",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "safety",
        "x-bandwise-actors": [
          "user",
          "agent",
          "system"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "experiment.decided"
        ],
        "x-bandwise-mcp-tool": "decide_experiment",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/datasets": {
      "get": {
        "operationId": "dataset.list",
        "summary": "List datasets.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_datasets",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "dataset.create",
        "summary": "Create a dataset.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "create_dataset",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/datasets/{id}/cases": {
      "post": {
        "operationId": "dataset.import",
        "summary": "Import cases as JSON Lines, one { state, expected, tags? } per line.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-ndjson": {
              "schema": {
                "$ref": "#/components/schemas/DatasetImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "import_dataset_cases",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "get": {
        "operationId": "dataset.cases",
        "summary": "List a dataset's drafting and calibration cases. Test-split cases are never returned.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetCasesResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/datasets/{id}/snapshots": {
      "post": {
        "operationId": "dataset.snapshot",
        "summary": "Freeze the dataset's current case ids. Returns no cases.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetSnapshotResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/datasets/{id}/export": {
      "get": {
        "operationId": "dataset.export",
        "summary": "Export a dataset as a job whose result is a download link. The export is audited.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/datasets/{id}/features": {
      "get": {
        "operationId": "dataset.features",
        "summary": "Per-question probabilities, noul values and scores joined with labels, drafting and calibration splits only.",
        "tags": [
          "dataset"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/evals": {
      "post": {
        "operationId": "eval.run",
        "summary": "Evaluate a set version on a dataset snapshot as a job.",
        "tags": [
          "eval"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalRunRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "evals:run",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "start_eval"
      }
    },
    "/api/v1/evals/{id}": {
      "get": {
        "operationId": "eval.get",
        "summary": "Read an eval run. The test split returns aggregate metrics only.",
        "tags": [
          "eval"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/compare": {
      "post": {
        "operationId": "set.compare",
        "summary": "Compare two sides of a set on given states or a dataset, as a job.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetCompareRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "evals:run",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "operationId": "job.get",
        "summary": "Poll a job. Retry-After is set while it runs.",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "any",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_job"
      }
    },
    "/api/v1/review": {
      "get": {
        "operationId": "review.list",
        "summary": "List review items with why each was picked.",
        "tags": [
          "review"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "action",
                "label"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "pending_confirmation",
                "resolved",
                "dismissed"
              ]
            }
          },
          {
            "name": "set",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "band",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "high",
                "medium",
                "low"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "review:read",
        "x-bandwise-min-role": "reviewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_review_items"
      }
    },
    "/api/v1/review/{id}/assign": {
      "post": {
        "operationId": "review.assign",
        "summary": "Assign a review item.",
        "tags": [
          "review"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewAssignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "review:write",
        "x-bandwise-min-role": "reviewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/review/{id}/resolve": {
      "post": {
        "operationId": "review.resolve",
        "summary": "Resolve a review item. From an agent token the resolution waits for a person to confirm it.",
        "tags": [
          "review"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewResolveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResolveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "review:write",
        "x-bandwise-min-role": "reviewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "review.resolved"
        ],
        "x-bandwise-mcp-tool": "resolve_review_item"
      }
    },
    "/api/v1/review/{id}/dismiss": {
      "post": {
        "operationId": "review.dismiss",
        "summary": "Dismiss a review item. Agents cannot; they resolve with a proposed answer instead.",
        "tags": [
          "review"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResolveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "review:write",
        "x-bandwise-min-role": "reviewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "review.resolved"
        ]
      }
    },
    "/api/v1/review/{id}/confirm": {
      "post": {
        "operationId": "review.confirm",
        "summary": "Confirm an agent's label or resolution, or replace it. Console session only.",
        "tags": [
          "review"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResolveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "session_only",
        "x-bandwise-min-role": "reviewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "review.resolved"
        ]
      }
    },
    "/api/v1/feedback": {
      "post": {
        "operationId": "feedback.report",
        "summary": "Report what happened after 1 to 1,000 decisions, matched by runId or externalRef.",
        "tags": [
          "feedback"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackReportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackReportResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "feedback:write",
        "x-bandwise-min-role": "reviewer",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "report_feedback"
      }
    },
    "/api/v1/sets/{ref}/health": {
      "get": {
        "operationId": "health.get",
        "summary": "Read a set's health: precision, coverage, drift and review load against its target.",
        "tags": [
          "health"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetHealth"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "reports:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_set_health"
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "health.list",
        "summary": "List every set's health, worst first.",
        "tags": [
          "health"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "reports:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/sets/{ref}/policy-suggestions": {
      "post": {
        "operationId": "policy.suggest",
        "summary": "Suggest thresholds from stored answers as a job. With apply it writes the draft and needs If-Match.",
        "tags": [
          "policy"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "The draft ETag (its spec_hash).",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicySuggestRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "suggest_thresholds",
        "x-bandwise-placeholder": {
          "input": true,
          "output": false
        }
      }
    },
    "/api/v1/proposals": {
      "get": {
        "operationId": "proposal.list",
        "summary": "List open proposals.",
        "tags": [
          "proposal"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProposalListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_proposals",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/proposals/{id}/accept": {
      "post": {
        "operationId": "proposal.accept",
        "summary": "Apply a proposal's patch to the draft. Requires If-Match. Never publishes.",
        "tags": [
          "proposal"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The draft ETag (its spec_hash).",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "decide_proposal",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/proposals/{id}/reject": {
      "post": {
        "operationId": "proposal.reject",
        "summary": "Reject a proposal.",
        "tags": [
          "proposal"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposalRejectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "decide_proposal",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions": {
      "get": {
        "operationId": "studio.list",
        "summary": "List Studio sessions.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "setId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudioListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "studio.create",
        "summary": "Start a Studio session.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions/{id}": {
      "get": {
        "operationId": "studio.get",
        "summary": "Read a Studio session with its drafting and calibration examples, never the test split.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions/{id}/examples": {
      "post": {
        "operationId": "studio.add_examples",
        "summary": "Add labeled examples with reasons as JSON Lines. The server assigns splits.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioAddExamplesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions/{id}/draft-definition": {
      "post": {
        "operationId": "studio.draft_definition",
        "summary": "Draft a definition from the drafting split.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioDraftDefinitionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions/{id}/decompose": {
      "post": {
        "operationId": "studio.decompose",
        "summary": "Split a definition into questions from the drafting split.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioDecomposeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions/{id}/calibrate": {
      "post": {
        "operationId": "studio.calibrate",
        "summary": "Calibrate on the calibration split as a job. Per-case results burn those cases.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioCalibrateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "evals:run",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": false
        }
      }
    },
    "/api/v1/studio/sessions/{id}/request-labels": {
      "post": {
        "operationId": "studio.request_labels",
        "summary": "Create label review items for people to answer.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioRequestLabelsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "review.created"
        ],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/studio/sessions/{id}/promote": {
      "post": {
        "operationId": "studio.promote",
        "summary": "Check the test split and, on a pass, write the set's draft or create the set.",
        "tags": [
          "studio"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "The draft ETag (its spec_hash).",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioPromoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/improve": {
      "post": {
        "operationId": "set.improve",
        "summary": "Propose a draft diff with metric deltas as a job. Never publishes.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetImproveRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "evals:run",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "improve_set",
        "x-bandwise-placeholder": {
          "input": true,
          "output": false
        }
      }
    },
    "/api/v1/models": {
      "get": {
        "operationId": "model.list",
        "summary": "List the System One models this org can select, with their profiles. The org default has isDefault: true.",
        "tags": [
          "model"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_models"
      }
    },
    "/api/v1/models/{id}": {
      "get": {
        "operationId": "model.get",
        "summary": "Read one model profile.",
        "tags": [
          "model"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelProfile"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/model-upgrades": {
      "get": {
        "operationId": "model.upgrades",
        "summary": "List model upgrade candidates for the org's sets.",
        "tags": [
          "model"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/try-model": {
      "post": {
        "operationId": "set.try_model",
        "summary": "Eval production against the same spec on another model, as a job that opens a proposal.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "description": "Preview: run the checks and return a DryRunResult. Writes nothing.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetTryModelRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted. Poll GET /api/v1/jobs/{id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "evals:run",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3b",
        "x-bandwise-async": true,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "try_model"
      }
    },
    "/api/v1/apps": {
      "get": {
        "operationId": "app.list",
        "summary": "List the org's apps.",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "app.create",
        "summary": "Register an app.",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "create_app",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/apps/{id}": {
      "patch": {
        "operationId": "app.update",
        "summary": "Update an app.",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/apps/{id}/tokens": {
      "post": {
        "operationId": "app_token.create",
        "summary": "Mint an app token for one channel. The secret is shown once.",
        "tags": [
          "app_token"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppTokenCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/apps/{id}/tokens/{tokenId}": {
      "delete": {
        "operationId": "app_token.revoke",
        "summary": "Revoke an app token. Never gated.",
        "tags": [
          "app_token"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "safety",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/apps/{id}/opportunities": {
      "get": {
        "operationId": "opportunity.list",
        "summary": "List an app's opportunities.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      },
      "post": {
        "operationId": "opportunity.create",
        "summary": "Record a proposed decision point in an app. Never source code.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Opportunity"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpportunityRecord"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "add_opportunity"
      }
    },
    "/api/v1/apps/{id}/opportunities/{oid}": {
      "patch": {
        "operationId": "opportunity.update",
        "summary": "Update an opportunity's status or linked set.",
        "tags": [
          "opportunity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "oid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpportunityUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 4b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "update_opportunity",
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/apps/{id}/bindings": {
      "get": {
        "operationId": "binding.list",
        "summary": "List an app's set bindings.",
        "tags": [
          "binding"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 4b.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BindingListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "binding.create",
        "summary": "Record that an app uses a set on a channel through a deploy target.",
        "tags": [
          "binding"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BindingCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 4b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "binding.created"
        ],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/apps/{id}/bindings/{bid}": {
      "delete": {
        "operationId": "binding.remove",
        "summary": "Remove an app binding.",
        "tags": [
          "binding"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 4b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "apps:write",
        "x-bandwise-min-role": "editor",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/sets/{ref}/codegen": {
      "get": {
        "operationId": "set.codegen",
        "summary": "Generate a typed client for a set. With appId it also records a binding.",
        "tags": [
          "set"
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ts",
                "py"
              ]
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "staging"
              ]
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "appId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "target",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "managed_typed",
                "standalone"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 4b.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "4b",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "binding.created"
        ],
        "x-bandwise-mcp-tool": "generate_client",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/reports/{name}": {
      "get": {
        "operationId": "report.get",
        "summary": "Read a named report as JSON, CSV or PDF.",
        "tags": [
          "report"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "pdf"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "reports:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_report",
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/alerts": {
      "get": {
        "operationId": "alert.list",
        "summary": "List raised alerts.",
        "tags": [
          "alert"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "reports:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/audit": {
      "get": {
        "operationId": "audit.list",
        "summary": "List audit rows. A CSV export is itself audited.",
        "tags": [
          "audit"
        ],
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "actorUserId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "actorTokenId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "audit:read",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "operationId": "event.list",
        "summary": "Read the event feed after a cursor. The feed has its own cursor instead of { data, nextCursor }.",
        "tags": [
          "event"
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "events:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent",
          "apiKey"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "list_events"
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "operationId": "webhook.list",
        "summary": "List org webhook endpoints.",
        "tags": [
          "webhook"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 5.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "5",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "webhook.create",
        "summary": "Add an org webhook endpoint for a list of event types.",
        "tags": [
          "webhook"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 5.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "5",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/webhooks/{id}": {
      "delete": {
        "operationId": "webhook.delete",
        "summary": "Delete an org webhook endpoint.",
        "tags": [
          "webhook"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 5.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "5",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "actor.get",
        "summary": "Describe the caller: org, user, token, client, effective role, scopes, allowlist and expiry.",
        "tags": [
          "actor"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "any",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/me/portfolio": {
      "get": {
        "operationId": "portfolio.get",
        "summary": "Savings and usage for each org where the user is owner or admin. Console session only.",
        "tags": [
          "portfolio"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "session_only",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/orgs": {
      "post": {
        "operationId": "org.create",
        "summary": "Create an org and make the caller its owner. Console session only.",
        "tags": [
          "org"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrgCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "session_only",
        "x-bandwise-min-role": "none",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/approvals": {
      "get": {
        "operationId": "approval.list",
        "summary": "List pending approvals the caller requested or may decide.",
        "tags": [
          "approval"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "any",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/approvals/{id}": {
      "get": {
        "operationId": "approval.get",
        "summary": "Read an approval request and, after execution, its result.",
        "tags": [
          "approval"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "any",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-mcp-tool": "get_approval"
      }
    },
    "/api/v1/approvals/{id}/decide": {
      "post": {
        "operationId": "approval.decide",
        "summary": "Approve or reject an agent's request. Console session only.",
        "tags": [
          "approval"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalDecideRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalGetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "session_only",
        "x-bandwise-min-role": "requested_operation",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [
          "approval.decided"
        ]
      }
    },
    "/api/v1/agent-tokens": {
      "get": {
        "operationId": "agent_token.list",
        "summary": "List agent tokens: id, name, client, owner, scopes and dates. Never the hash or the prefix.",
        "tags": [
          "agent_token"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTokenListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      },
      "post": {
        "operationId": "agent_token.create",
        "summary": "Mint an agent token for one user in one org, with scopes and a role ceiling.",
        "tags": [
          "agent_token"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentTokenCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/agent-tokens/{id}": {
      "delete": {
        "operationId": "agent_token.revoke",
        "summary": "Revoke an agent token. A token can always revoke itself. Never gated.",
        "tags": [
          "agent_token"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "safety",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/members": {
      "get": {
        "operationId": "member.list",
        "summary": "List org members.",
        "tags": [
          "member"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/invitations": {
      "post": {
        "operationId": "member.invite",
        "summary": "Invite a member.",
        "tags": [
          "member"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberInviteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/members/{userId}": {
      "patch": {
        "operationId": "member.role_change",
        "summary": "Change a member's role. Changing to or from owner needs the owner role.",
        "tags": [
          "member"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberRoleChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "delete": {
        "operationId": "member.remove",
        "summary": "Remove a member.",
        "tags": [
          "member"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/keys": {
      "get": {
        "operationId": "key.get",
        "summary": "Read the org's TypeSafe key status, last four, fingerprint and reachable models. Never the key.",
        "tags": [
          "key"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "delete": {
        "operationId": "key.revoke",
        "summary": "Revoke the org's TypeSafe key.",
        "tags": [
          "key"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/keys/rotate": {
      "post": {
        "operationId": "key.rotate",
        "summary": "Save or rotate the org's TypeSafe key after validating it. Never echoes the key.",
        "tags": [
          "key"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyRotateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/settings": {
      "get": {
        "operationId": "settings.get",
        "summary": "Read org settings.",
        "tags": [
          "settings"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "patch": {
        "operationId": "settings.update",
        "summary": "Change org settings. PII, retention and lowering agentApprovals are gated for agents.",
        "tags": [
          "settings"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "high*",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/price-book": {
      "get": {
        "operationId": "price_book.get",
        "summary": "Read the org's comparator price book.",
        "tags": [
          "price_book"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "reports:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "put": {
        "operationId": "price_book.update",
        "summary": "Replace the org's comparator price book rows.",
        "tags": [
          "price_book"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceBookUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/plugins": {
      "get": {
        "operationId": "plugin.list",
        "summary": "List installed plugins.",
        "tags": [
          "plugin"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 5.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "5",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/plugins/{id}": {
      "get": {
        "operationId": "plugin.get",
        "summary": "Read one plugin.",
        "tags": [
          "plugin"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 5.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "sets:read",
        "x-bandwise-min-role": "viewer",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "5",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "patch": {
        "operationId": "plugin.update",
        "summary": "Enable, disable or configure a plugin.",
        "tags": [
          "plugin"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 5.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "admin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "5",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/org": {
      "delete": {
        "operationId": "org.delete",
        "summary": "Delete the org. Owner only.",
        "tags": [
          "org"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "202": {
            "description": "An agent called a high-risk operation: a person must approve it before it runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalAccepted"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "admin:write",
        "x-bandwise-min-role": "owner",
        "x-bandwise-risk": "high",
        "x-bandwise-actors": [
          "user",
          "agent"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": true,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/platform/models": {
      "get": {
        "operationId": "platform_model.list",
        "summary": "List every registry row, including unreviewed models.",
        "tags": [
          "platform_model"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformModelListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "post": {
        "operationId": "platform_model.create",
        "summary": "Add a model registry row.",
        "tags": [
          "platform_model"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformModelCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/platform/models/{id}": {
      "patch": {
        "operationId": "platform_model.update",
        "summary": "Update a model registry row.",
        "tags": [
          "platform_model"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformModelUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/platform/price-book": {
      "get": {
        "operationId": "platform_price_book.get",
        "summary": "Read the platform default price book.",
        "tags": [
          "platform_price_book"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "put": {
        "operationId": "platform_price_book.update",
        "summary": "Replace platform default price rows, keyed by exact versioned model id. Alias rows are rejected.",
        "tags": [
          "platform_price_book"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformPriceBookUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/platform/settings": {
      "get": {
        "operationId": "platform_settings.get",
        "summary": "Read platform settings.",
        "tags": [
          "platform_settings"
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      },
      "patch": {
        "operationId": "platform_settings.update",
        "summary": "Change model budgets, the default comparator, the default model and alert thresholds.",
        "tags": [
          "platform_settings"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformSettingsUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": true,
          "output": true
        }
      }
    },
    "/api/v1/platform/orgs": {
      "get": {
        "operationId": "platform_org.list",
        "summary": "List every org.",
        "tags": [
          "platform_org"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformOrgListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/platform/orgs/{id}/suspend": {
      "post": {
        "operationId": "platform_org.suspend",
        "summary": "Suspend or reinstate an org. Suspension blocks its runs within 30 seconds.",
        "tags": [
          "platform_org"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformOrgSuspendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/platform/orgs/{id}/entitlements": {
      "put": {
        "operationId": "platform_org.set_entitlement",
        "summary": "Override one entitlement for an org.",
        "tags": [
          "platform_org"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformOrgSetEntitlementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shape lands in Phase 2.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    },
    "/api/v1/platform/early-access": {
      "get": {
        "operationId": "platform_early_access.list",
        "summary": "List early-access signups from www.bandwise.dev.",
        "tags": [
          "platform_early_access"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformEarlyAccessListResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/platform/early-access/remove": {
      "post": {
        "operationId": "platform_early_access.remove",
        "summary": "Delete one early-access signup by email, any case. The delete path for a privacy request.",
        "tags": [
          "platform_early_access"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Required for app and agent tokens on mutations. A replay within 24 hours returns the stored response.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformEarlyAccessRemoveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformEarlyAccessRemoveResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "normal",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "2",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": []
      }
    },
    "/api/v1/platform/reports/{name}": {
      "get": {
        "operationId": "platform_report.get",
        "summary": "Read a report across all orgs, with an org column.",
        "tags": [
          "platform_report"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "pdf"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shape lands in Phase 3.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "Error envelope (api.md).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "consoleSession": []
          }
        ],
        "x-bandwise-scope": "platform_admin",
        "x-bandwise-min-role": "superadmin",
        "x-bandwise-risk": "read",
        "x-bandwise-actors": [
          "user"
        ],
        "x-bandwise-phase": "3",
        "x-bandwise-async": false,
        "x-bandwise-destructive": false,
        "x-bandwise-emits": [],
        "x-bandwise-placeholder": {
          "input": false,
          "output": true
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgentTokenCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "AgentTokenListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "client": {
                  "type": "string",
                  "enum": [
                    "cli",
                    "mcp",
                    "extension",
                    "console"
                  ]
                },
                "userId": {
                  "type": "string",
                  "format": "uuid"
                },
                "roleCeiling": {
                  "type": "string",
                  "enum": [
                    "owner",
                    "admin",
                    "editor",
                    "reviewer",
                    "viewer"
                  ]
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "expiresAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "revokedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lastUsedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "name",
                "client",
                "userId",
                "roleCeiling",
                "scopes",
                "expiresAt",
                "revokedAt",
                "lastUsedAt",
                "createdAt"
              ]
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "AlertListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "AppCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "AppListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "AppTokenCreateRequest": {
        "type": "object",
        "properties": {
          "prefix": {
            "type": "string",
            "enum": [
              "sk_live_",
              "sk_test_",
              "pk_live_"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "scopes": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run",
                "sets:read",
                "sets:write",
                "evals:run",
                "release:staging",
                "release:production",
                "runs:read",
                "runs:write",
                "review:read",
                "review:write",
                "feedback:write",
                "usage:read",
                "reports:read",
                "audit:read",
                "events:read",
                "apps:write",
                "admin:write"
              ]
            }
          },
          "setIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "origins": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "rpmLimit": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "prefix",
          "channel",
          "scopes"
        ],
        "additionalProperties": false
      },
      "AppUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "ApprovalAccepted": {
        "type": "object",
        "properties": {
          "approval": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string",
                "const": "pending"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "status",
              "url",
              "expiresAt"
            ]
          }
        },
        "required": [
          "approval"
        ]
      },
      "ApprovalDecideRequest": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approved",
              "rejected"
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "decision"
        ],
        "additionalProperties": false
      },
      "ApprovalGetResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "opId": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "expired",
              "executed"
            ]
          },
          "reason": {
            "type": "string"
          },
          "input": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "ifMatch": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedBy": {
            "type": "object",
            "properties": {
              "userId": {
                "type": "string",
                "format": "uuid"
              },
              "tokenId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "tokenName": {
                "type": "string"
              }
            },
            "required": [
              "userId",
              "tokenId"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "decidedBy": {
            "type": "string",
            "format": "uuid"
          },
          "decidedAt": {
            "type": "string",
            "format": "date-time"
          },
          "result": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "required": [
          "id",
          "opId",
          "status",
          "reason",
          "input",
          "ifMatch",
          "requestedBy",
          "createdAt",
          "expiresAt"
        ]
      },
      "ApprovalListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalGetResponse"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "AuditListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "BindingCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "BindingListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "BrowserTokenCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "BrowserTokenCreateResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "token",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "ChannelPromoteRequest": {
        "type": "object",
        "properties": {
          "changelog": {
            "type": "string",
            "minLength": 1
          },
          "skipExperiment": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "reason"
            ],
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ChannelRollbackRequest": {
        "type": "object",
        "properties": {
          "toVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "additionalProperties": false
      },
      "ChannelRollbackResponse": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "fromVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "toVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "stage": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          }
        },
        "required": [
          "channel",
          "fromVersion",
          "toVersion",
          "stage"
        ]
      },
      "Condition": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "all": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Condition"
                }
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Condition"
                }
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/Condition"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "q": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "eq": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "q",
              "eq"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "q": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "neq": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "q",
              "neq"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "q": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "in": {
                "type": "array",
                "items": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              }
            },
            "required": [
              "q",
              "in"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "q": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "band": {
                "type": "string",
                "enum": [
                  "high",
                  "medium",
                  "low"
                ]
              }
            },
            "required": [
              "q",
              "band"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "q": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "gte": {
                "type": "number"
              },
              "lte": {
                "type": "number"
              }
            },
            "required": [
              "q"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "composite": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              },
              "gte": {
                "type": "number"
              },
              "lte": {
                "type": "number"
              }
            },
            "required": [
              "composite"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "check": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,63}$"
              }
            },
            "required": [
              "check"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "minLength": 1
              },
              "eq": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "input",
              "eq"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "minLength": 1
              },
              "neq": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "input",
              "neq"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "minLength": 1
              },
              "in": {
                "type": "array",
                "items": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              }
            },
            "required": [
              "input",
              "in"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "minLength": 1
              },
              "exists": {
                "type": "boolean"
              }
            },
            "required": [
              "input",
              "exists"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "minLength": 1
              },
              "matches": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "input",
              "matches"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "minLength": 1
              },
              "gte": {
                "type": "number"
              },
              "lte": {
                "type": "number"
              }
            },
            "required": [
              "input"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ConfidencePolicy": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "noul"
              },
              "gating": {
                "type": "boolean"
              },
              "relevantWhen": {
                "$ref": "#/components/schemas/Condition"
              },
              "noul": {
                "type": "object",
                "properties": {
                  "trueAt": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "falseAt": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "reviewMargin": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "trueAt",
                  "falseAt",
                  "reviewMargin"
                ],
                "additionalProperties": false
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "noul",
              "actions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "choice"
              },
              "gating": {
                "type": "boolean"
              },
              "relevantWhen": {
                "$ref": "#/components/schemas/Condition"
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "high": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "medium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "high",
                  "medium"
                ],
                "additionalProperties": false
              },
              "perOption": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "minLength": 1
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "high": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "medium": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "required": [
                    "high",
                    "medium"
                  ],
                  "additionalProperties": false
                }
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "thresholds",
              "actions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "score"
              },
              "gating": {
                "type": "boolean"
              },
              "relevantWhen": {
                "$ref": "#/components/schemas/Condition"
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "high": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "medium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "high",
                  "medium"
                ],
                "additionalProperties": false
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "thresholds",
              "actions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "composite"
              },
              "gating": {
                "type": "boolean"
              },
              "levelThresholds": {
                "type": "object",
                "properties": {
                  "high": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "medium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "high",
                  "medium"
                ],
                "additionalProperties": false
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "levelThresholds",
              "actions"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ConfidencePolicyInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "noul"
              },
              "gating": {
                "type": "boolean"
              },
              "relevantWhen": {
                "$ref": "#/components/schemas/Condition"
              },
              "noul": {
                "type": "object",
                "properties": {
                  "trueAt": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "falseAt": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "reviewMargin": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "trueAt",
                  "falseAt",
                  "reviewMargin"
                ],
                "additionalProperties": false
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "noul",
              "actions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "choice"
              },
              "gating": {
                "type": "boolean"
              },
              "relevantWhen": {
                "$ref": "#/components/schemas/Condition"
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "high": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "medium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "high",
                  "medium"
                ],
                "additionalProperties": false
              },
              "perOption": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "minLength": 1
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "high": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "medium": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "required": [
                    "high",
                    "medium"
                  ],
                  "additionalProperties": false
                }
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "thresholds",
              "actions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "score"
              },
              "gating": {
                "type": "boolean"
              },
              "relevantWhen": {
                "$ref": "#/components/schemas/Condition"
              },
              "thresholds": {
                "type": "object",
                "properties": {
                  "high": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "medium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "high",
                  "medium"
                ],
                "additionalProperties": false
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "escalate_to_llm"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "model": {
                                "type": "string",
                                "minLength": 1
                              },
                              "instructions": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "maxOutputTokens": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "thresholds",
              "actions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "composite"
              },
              "gating": {
                "type": "boolean"
              },
              "levelThresholds": {
                "type": "object",
                "properties": {
                  "high": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "medium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "high",
                  "medium"
                ],
                "additionalProperties": false
              },
              "actions": {
                "type": "object",
                "properties": {
                  "high": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "medium": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "low": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "auto"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {}
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "review"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fallback"
                          },
                          "handler": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "value"
                                  },
                                  "value": {
                                    "type": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "set"
                                  },
                                  "setRef": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "setRef"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "noop"
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "gating",
              "levelThresholds",
              "actions"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DatasetCasesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "DatasetCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "DatasetImportRequest": {
        "minItems": 1,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "state": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "expected": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "required": [
            "state",
            "expected"
          ],
          "additionalProperties": false
        }
      },
      "DatasetListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "DatasetSnapshotResponse": {
        "type": "object",
        "properties": {
          "snapshotId": {
            "type": "string",
            "format": "uuid"
          },
          "snapshotHash": {
            "type": "string",
            "minLength": 1
          },
          "caseCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "snapshotId",
          "snapshotHash",
          "caseCount"
        ]
      },
      "DraftUpdateResponse": {
        "type": "object",
        "properties": {
          "etag": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "etag"
        ]
      },
      "DraftValidateRequest": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "$ref": "#/components/schemas/JsonValue"
        }
      },
      "DraftValidateResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          }
        },
        "required": [
          "errors",
          "warnings"
        ]
      },
      "ErrorDetail": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "rule": {
            "type": "string",
            "minLength": 1
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "rule",
          "severity",
          "message"
        ]
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string",
                "minLength": 1
              },
              "retryable": {
                "type": "boolean"
              },
              "details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ErrorDetail"
                }
              },
              "gates": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GateResult"
                }
              },
              "requiredScope": {
                "type": "string",
                "enum": [
                  "run",
                  "sets:read",
                  "sets:write",
                  "evals:run",
                  "release:staging",
                  "release:production",
                  "runs:read",
                  "runs:write",
                  "review:read",
                  "review:write",
                  "feedback:write",
                  "usage:read",
                  "reports:read",
                  "audit:read",
                  "events:read",
                  "apps:write",
                  "admin:write"
                ]
              },
              "currentEtag": {
                "type": "string",
                "minLength": 1
              },
              "runId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "code",
              "message",
              "requestId",
              "retryable"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "EvalRunRequest": {
        "type": "object",
        "properties": {
          "setRef": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "const": "draft"
              }
            ]
          },
          "datasetId": {
            "type": "string",
            "format": "uuid"
          },
          "snapshotId": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "repeats": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "setRef",
          "version",
          "datasetId"
        ],
        "additionalProperties": false
      },
      "EventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "set.published",
              "release.rolled_back",
              "release.promoted",
              "rollout.changed",
              "rollout.auto_demoted",
              "rollout.gate_met",
              "eval.completed",
              "job.completed",
              "review.created",
              "review.sla_breached",
              "review.resolved",
              "alert.raised",
              "model.available",
              "model.alias_moved",
              "model.deprecated",
              "proposal.created",
              "experiment.started",
              "experiment.decided",
              "approval.requested",
              "approval.decided",
              "key.invalid",
              "interface.breaking_published",
              "binding.created",
              "contract.changed",
              "model.unreviewed"
            ]
          },
          "orgId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "actor": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "user",
                  "agent",
                  "app",
                  "system"
                ]
              },
              "userId": {
                "type": "string",
                "format": "uuid"
              },
              "tokenId": {
                "type": "string",
                "format": "uuid"
              },
              "client": {
                "type": "string",
                "enum": [
                  "console",
                  "api",
                  "cli",
                  "mcp",
                  "extension",
                  "job"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "subject": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "minLength": 1
              },
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "type",
              "id"
            ]
          },
          "data": {}
        },
        "required": [
          "id",
          "type",
          "orgId",
          "occurredAt",
          "actor",
          "subject",
          "data"
        ]
      },
      "EventListResponse": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventEnvelope"
            }
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "gap": {
            "type": "boolean"
          }
        },
        "required": [
          "events",
          "cursor",
          "gap"
        ]
      },
      "ExperimentPromoteRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "ExperimentStartRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "challengerVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "version",
              "model",
              "policy"
            ]
          },
          "samplePct": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1
          },
          "minRuns": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "minLabeled": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "channel",
          "challengerVersionId",
          "kind",
          "samplePct",
          "minRuns",
          "minLabeled"
        ],
        "additionalProperties": false
      },
      "ExperimentStopRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "FeedbackReport": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "externalRef": {
            "type": "string",
            "minLength": 1
          },
          "target": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "decisionId": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,63}$"
                  }
                },
                "required": [
                  "decisionId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "route": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "route"
                ],
                "additionalProperties": false
              }
            ]
          },
          "observed": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1
          },
          "failureClass": {
            "type": "string",
            "enum": [
              "missing_evidence",
              "model_error",
              "code_error",
              "service"
            ]
          }
        },
        "required": [
          "target",
          "observed",
          "observedAt",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "FeedbackReportRequest": {
        "type": "object",
        "properties": {
          "items": {
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedbackReport"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "FeedbackReportResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "created",
                    "duplicate",
                    "error"
                  ]
                },
                "feedbackId": {
                  "type": "string",
                  "format": "uuid"
                },
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 1
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              },
              "required": [
                "index",
                "status"
              ]
            }
          }
        },
        "required": [
          "results"
        ]
      },
      "GateResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "required": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "actual": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "met": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "required",
          "actual",
          "met"
        ]
      },
      "GoalCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "GoalListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "GoalUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "HealthListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetHealth"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "eval",
              "compare",
              "calibrate",
              "improve",
              "try_model",
              "policy_suggest",
              "export"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "result": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "createdAt"
        ]
      },
      "JobAccepted": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          },
          "evalRunId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "jobId"
        ]
      },
      "JsonValue": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          }
        ]
      },
      "KeyRotateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "LabelingPolicy": {
        "type": "object",
        "properties": {
          "dailyBudget": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "auditRate": {
            "type": "object",
            "properties": {
              "high": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "medium": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "low": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            "required": [
              "high",
              "medium",
              "low"
            ],
            "additionalProperties": false
          },
          "targeted": {
            "type": "object",
            "properties": {
              "nearThreshold": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "challengerDisagreement": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            "required": [
              "nearThreshold",
              "challengerDisagreement"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "dailyBudget",
          "auditRate"
        ],
        "additionalProperties": false
      },
      "Manifest": {
        "type": "object",
        "properties": {
          "setId": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "pinned",
              "draft"
            ]
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "interfaceMajor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "interfaceHash": {
            "type": "string",
            "minLength": 1
          },
          "inputSchema": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}$"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "noul",
                    "choice",
                    "score"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "levels": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "id",
                "type",
                "label"
              ]
            }
          },
          "composites": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            }
          },
          "routeOutputs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "auto",
                "review",
                "fallback",
                "escalate_to_llm"
              ]
            }
          }
        },
        "required": [
          "setId",
          "slug",
          "version",
          "versionId",
          "channel",
          "model",
          "interfaceMajor",
          "interfaceHash",
          "inputSchema",
          "questions",
          "composites",
          "routeOutputs",
          "actions"
        ]
      },
      "MemberInviteRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "MemberListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "MemberRoleChangeRequest": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "editor",
              "reviewer",
              "viewer"
            ]
          }
        },
        "required": [
          "role"
        ],
        "additionalProperties": false
      },
      "ModelListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "family": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "versioned",
              "alias"
            ]
          },
          "aliasTarget": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "unreviewed",
              "preview",
              "stable",
              "deprecated",
              "retired"
            ]
          },
          "releaseDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "retireAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "questionTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "noul",
                "choice",
                "score"
              ]
            }
          },
          "limits": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requestTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "statePlusLongestQuestionTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "rpm": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "tokensPerSec": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "requestTokens",
                  "statePlusLongestQuestionTokens",
                  "rpm",
                  "tokensPerSec"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "inputModalities": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "weaknesses": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "supersedes": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "docsUrl": {
            "type": "string",
            "format": "uri"
          },
          "jaggednessUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastReviewed": {
            "type": "string",
            "format": "date"
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "family",
          "kind",
          "aliasTarget",
          "status",
          "releaseDate",
          "retireAt",
          "questionTypes",
          "limits",
          "inputModalities",
          "weaknesses",
          "supersedes",
          "docsUrl",
          "jaggednessUrl",
          "lastReviewed",
          "isDefault"
        ],
        "additionalProperties": false
      },
      "ModelListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelListItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "ModelProfile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "family": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "versioned",
              "alias"
            ]
          },
          "aliasTarget": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "unreviewed",
              "preview",
              "stable",
              "deprecated",
              "retired"
            ]
          },
          "releaseDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "retireAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "questionTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "noul",
                "choice",
                "score"
              ]
            }
          },
          "limits": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requestTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "statePlusLongestQuestionTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "rpm": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "tokensPerSec": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "requestTokens",
                  "statePlusLongestQuestionTokens",
                  "rpm",
                  "tokensPerSec"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "inputModalities": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "weaknesses": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "supersedes": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "docsUrl": {
            "type": "string",
            "format": "uri"
          },
          "jaggednessUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastReviewed": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "id",
          "family",
          "kind",
          "aliasTarget",
          "status",
          "releaseDate",
          "retireAt",
          "questionTypes",
          "limits",
          "inputModalities",
          "weaknesses",
          "supersedes",
          "docsUrl",
          "jaggednessUrl",
          "lastReviewed"
        ],
        "additionalProperties": false
      },
      "Opportunity": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "string",
            "enum": [
              "agent",
              "console"
            ]
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "minLength": 1
                  },
                  "lines": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "file",
                  "lines"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "currentApproach": {
            "type": "string",
            "enum": [
              "regex",
              "if_else",
              "llm_call",
              "manual",
              "other"
            ]
          },
          "decisionSummary": {
            "type": "string",
            "minLength": 1
          },
          "primitiveGuess": {
            "type": "string",
            "enum": [
              "noul",
              "choice",
              "score"
            ]
          },
          "pattern": {
            "type": "string",
            "enum": [
              "fan_out",
              "confidence_routing",
              "composite_scoring",
              "intent_routing",
              "cascade",
              "top_choice",
              "keep_in_code"
            ]
          },
          "tenSecondFit": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "accepted",
              "rejected",
              "built"
            ]
          },
          "setId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "appId",
          "source",
          "location",
          "currentApproach",
          "decisionSummary",
          "primitiveGuess",
          "pattern",
          "tenSecondFit",
          "status",
          "setId"
        ],
        "additionalProperties": false
      },
      "OpportunityListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpportunityRecord"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "OpportunityRecord": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "string",
            "enum": [
              "agent",
              "console"
            ]
          },
          "location": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "minLength": 1
                  },
                  "lines": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "file",
                  "lines"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "currentApproach": {
            "type": "string",
            "enum": [
              "regex",
              "if_else",
              "llm_call",
              "manual",
              "other"
            ]
          },
          "decisionSummary": {
            "type": "string",
            "minLength": 1
          },
          "primitiveGuess": {
            "type": "string",
            "enum": [
              "noul",
              "choice",
              "score"
            ]
          },
          "pattern": {
            "type": "string",
            "enum": [
              "fan_out",
              "confidence_routing",
              "composite_scoring",
              "intent_routing",
              "cascade",
              "top_choice",
              "keep_in_code"
            ]
          },
          "tenSecondFit": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "accepted",
              "rejected",
              "built"
            ]
          },
          "setId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orgId": {
            "type": "string",
            "format": "uuid"
          },
          "createdByUserId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdByTokenId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "appId",
          "source",
          "location",
          "currentApproach",
          "decisionSummary",
          "primitiveGuess",
          "pattern",
          "tenSecondFit",
          "status",
          "setId",
          "id",
          "orgId",
          "createdByUserId",
          "createdByTokenId",
          "createdAt"
        ]
      },
      "OpportunityUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "OrgCreateRequest": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "additionalProperties": false
      },
      "PlatformEarlyAccessListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "company": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "role": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "useCase": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "sourcePage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "confirmedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unsubscribedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "email",
                "name",
                "company",
                "role",
                "useCase",
                "sourcePage",
                "createdAt",
                "confirmedAt",
                "unsubscribedAt"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "PlatformEarlyAccessRemoveRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "minLength": 3,
            "maxLength": 254
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "email",
          "reason"
        ],
        "additionalProperties": false
      },
      "PlatformEarlyAccessRemoveResponse": {
        "type": "object",
        "properties": {
          "removed": {
            "type": "boolean"
          }
        },
        "required": [
          "removed"
        ],
        "additionalProperties": false
      },
      "PlatformModelCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "PlatformModelListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "PlatformModelUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "PlatformOrgListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "PlatformOrgSetEntitlementRequest": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "value": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "key",
          "value",
          "reason"
        ],
        "additionalProperties": false
      },
      "PlatformOrgSuspendRequest": {
        "type": "object",
        "properties": {
          "suspended": {
            "type": "boolean"
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "suspended",
          "reason"
        ],
        "additionalProperties": false
      },
      "PlatformPriceBookUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "PlatformSettingsUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "PluginListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "PluginUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "PolicySuggestRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "PriceBookUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "ProjectCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "ProjectListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "ProposalListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "ProposalRejectRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "QuestionSetSpec": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 1
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "input": {
            "type": "object",
            "properties": {
              "schema": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              "adapter": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "config": {}
                },
                "required": [
                  "id",
                  "config"
                ],
                "additionalProperties": false
              },
              "redactPaths": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "maxStateTokens": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schema"
            ],
            "additionalProperties": false
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}$"
                },
                "when": {
                  "$ref": "#/components/schemas/Condition"
                }
              },
              "required": [
                "id",
                "when"
              ],
              "additionalProperties": false
            }
          },
          "stages": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "when": {
                  "$ref": "#/components/schemas/Condition"
                },
                "stateFrom": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "input"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "merge": {
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "boolean",
                              "const": true
                            },
                            "answers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_]{0,63}$"
                              }
                            },
                            "probabilities": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "input",
                            "answers"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "merge"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "questions": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,63}$"
                  },
                  "additionalProperties": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "noul"
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              },
                              {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              }
                            ]
                          },
                          "criteria": {
                            "type": "object",
                            "properties": {
                              "true": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "false": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              }
                            },
                            "additionalProperties": {
                              "$ref": "#/components/schemas/JsonValue"
                            }
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "templateId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type",
                          "instructions",
                          "meta"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "choice"
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              },
                              {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              }
                            ]
                          },
                          "criteria": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "templateId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type",
                          "instructions",
                          "criteria",
                          "meta"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "score"
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              },
                              {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              }
                            ]
                          },
                          "criteria": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "$ref": "#/components/schemas/JsonValue"
                                  }
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/components/schemas/JsonValue"
                                  }
                                }
                              ]
                            }
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "templateId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type",
                          "instructions",
                          "criteria",
                          "meta"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                }
              },
              "required": [
                "id",
                "questions"
              ],
              "additionalProperties": false
            }
          },
          "policies": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/ConfidencePolicy"
            }
          },
          "composites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}$"
                },
                "kind": {
                  "type": "string",
                  "const": "weighted"
                },
                "terms": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "q": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,63}$"
                          },
                          "weight": {
                            "type": "number",
                            "exclusiveMinimum": 0
                          },
                          "option": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "q",
                          "weight"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "check": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,63}$"
                          },
                          "weight": {
                            "type": "number",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "check",
                          "weight"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "policy": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "composite"
                    },
                    "gating": {
                      "type": "boolean"
                    },
                    "levelThresholds": {
                      "type": "object",
                      "properties": {
                        "high": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "medium": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        }
                      },
                      "required": [
                        "high",
                        "medium"
                      ],
                      "additionalProperties": false
                    },
                    "actions": {
                      "type": "object",
                      "properties": {
                        "high": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "auto"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {}
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "review"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "fallback"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "value"
                                        },
                                        "value": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set"
                                        },
                                        "setRef": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "setRef"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "noop"
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "medium": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "auto"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {}
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "review"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "fallback"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "value"
                                        },
                                        "value": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set"
                                        },
                                        "setRef": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "setRef"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "noop"
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "low": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "auto"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {}
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "review"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "fallback"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "value"
                                        },
                                        "value": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set"
                                        },
                                        "setRef": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "setRef"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "noop"
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "high",
                        "medium",
                        "low"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "type",
                    "gating",
                    "levelThresholds",
                    "actions"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "kind",
                "terms"
              ],
              "additionalProperties": false
            }
          },
          "routes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "when": {
                  "$ref": "#/components/schemas/Condition"
                },
                "output": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "when",
                "output"
              ],
              "additionalProperties": false
            }
          },
          "defaultRoute": {
            "type": "string",
            "minLength": 1
          },
          "savings": {
            "type": "object",
            "properties": {
              "comparatorModel": {
                "type": "string",
                "minLength": 1
              },
              "estOutputTokensPerQuestion": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "kind": {
                "type": "string",
                "enum": [
                  "decision",
                  "escalation_avoided",
                  "context_pruned"
                ]
              }
            },
            "additionalProperties": false
          },
          "onUnavailable": {
            "type": "string",
            "enum": [
              "fallback",
              "review",
              "escalate_to_llm"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "model",
          "input",
          "stages",
          "policies"
        ],
        "additionalProperties": false
      },
      "QuestionSetSpecInput": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 1
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "input": {
            "type": "object",
            "properties": {
              "schema": {
                "$ref": "#/components/schemas/DraftValidateRequest"
              },
              "adapter": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "config": {}
                },
                "required": [
                  "id",
                  "config"
                ],
                "additionalProperties": false
              },
              "redactPaths": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "maxStateTokens": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "schema"
            ],
            "additionalProperties": false
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}$"
                },
                "when": {
                  "$ref": "#/components/schemas/Condition"
                }
              },
              "required": [
                "id",
                "when"
              ],
              "additionalProperties": false
            }
          },
          "stages": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "when": {
                  "$ref": "#/components/schemas/Condition"
                },
                "stateFrom": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "input"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "merge": {
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "boolean",
                              "const": true
                            },
                            "answers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_]{0,63}$"
                              }
                            },
                            "probabilities": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "input",
                            "answers"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "merge"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "questions": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,63}$"
                  },
                  "additionalProperties": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "noul"
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "$ref": "#/components/schemas/DraftValidateRequest"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              }
                            ]
                          },
                          "criteria": {
                            "type": "object",
                            "properties": {
                              "true": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              },
                              "false": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "$ref": "#/components/schemas/DraftValidateRequest"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/components/schemas/JsonValue"
                                    }
                                  }
                                ]
                              }
                            },
                            "additionalProperties": {
                              "$ref": "#/components/schemas/JsonValue"
                            }
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "templateId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type",
                          "instructions",
                          "meta"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "choice"
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "$ref": "#/components/schemas/DraftValidateRequest"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              }
                            ]
                          },
                          "criteria": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1
                            },
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "$ref": "#/components/schemas/DraftValidateRequest"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "templateId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type",
                          "instructions",
                          "criteria",
                          "meta"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "score"
                          },
                          "instructions": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "$ref": "#/components/schemas/DraftValidateRequest"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/JsonValue"
                                }
                              }
                            ]
                          },
                          "criteria": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "$ref": "#/components/schemas/DraftValidateRequest"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/components/schemas/JsonValue"
                                  }
                                }
                              ]
                            }
                          },
                          "meta": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "templateId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "type",
                          "instructions",
                          "criteria",
                          "meta"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                }
              },
              "required": [
                "id",
                "questions"
              ],
              "additionalProperties": false
            }
          },
          "policies": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/ConfidencePolicyInput"
            }
          },
          "composites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,63}$"
                },
                "kind": {
                  "type": "string",
                  "const": "weighted"
                },
                "terms": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "q": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,63}$"
                          },
                          "weight": {
                            "type": "number",
                            "exclusiveMinimum": 0
                          },
                          "option": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "q",
                          "weight"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "check": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9_]{0,63}$"
                          },
                          "weight": {
                            "type": "number",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "check",
                          "weight"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "policy": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "composite"
                    },
                    "gating": {
                      "type": "boolean"
                    },
                    "levelThresholds": {
                      "type": "object",
                      "properties": {
                        "high": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "medium": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        }
                      },
                      "required": [
                        "high",
                        "medium"
                      ],
                      "additionalProperties": false
                    },
                    "actions": {
                      "type": "object",
                      "properties": {
                        "high": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "auto"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {}
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "review"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "fallback"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "value"
                                        },
                                        "value": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set"
                                        },
                                        "setRef": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "setRef"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "noop"
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "medium": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "auto"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {}
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "review"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "fallback"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "value"
                                        },
                                        "value": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set"
                                        },
                                        "setRef": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "setRef"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "noop"
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "low": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "auto"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {}
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "review"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "fallback"
                                },
                                "handler": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)+$"
                                },
                                "config": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "value"
                                        },
                                        "value": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set"
                                        },
                                        "setRef": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "setRef"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "noop"
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "high",
                        "medium",
                        "low"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "type",
                    "gating",
                    "levelThresholds",
                    "actions"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "kind",
                "terms"
              ],
              "additionalProperties": false
            }
          },
          "routes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "when": {
                  "$ref": "#/components/schemas/Condition"
                },
                "output": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "when",
                "output"
              ],
              "additionalProperties": false
            }
          },
          "defaultRoute": {
            "type": "string",
            "minLength": 1
          },
          "savings": {
            "type": "object",
            "properties": {
              "comparatorModel": {
                "type": "string",
                "minLength": 1
              },
              "estOutputTokensPerQuestion": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "kind": {
                "type": "string",
                "enum": [
                  "decision",
                  "escalation_avoided",
                  "context_pruned"
                ]
              }
            },
            "additionalProperties": false
          },
          "onUnavailable": {
            "type": "string",
            "enum": [
              "fallback",
              "review",
              "escalate_to_llm"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "model",
          "input",
          "stages",
          "policies"
        ],
        "additionalProperties": false
      },
      "ReleaseListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "ReviewAssignRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "ReviewConfirmRequest": {
        "type": "object",
        "properties": {
          "resolution": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "additionalProperties": false
      },
      "ReviewListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewResolveResponse"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "ReviewResolveRequest": {
        "type": "object",
        "properties": {
          "resolution": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "addToDataset": {
            "type": "boolean"
          },
          "failureClass": {
            "type": "string",
            "enum": [
              "missing_evidence",
              "model_error",
              "code_error",
              "service"
            ]
          }
        },
        "required": [
          "resolution"
        ],
        "additionalProperties": false
      },
      "ReviewResolveResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "setId": {
            "type": "string",
            "format": "uuid"
          },
          "decisionId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "action",
              "label"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "action",
              "audit",
              "near_threshold",
              "challenger_diff",
              "studio"
            ]
          },
          "sampleRate": {
            "type": [
              "number",
              "null"
            ]
          },
          "band": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "suggested": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JsonValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "pending_confirmation",
              "resolved",
              "dismissed"
            ]
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JsonValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolvedBy": {
            "type": "object",
            "properties": {
              "userId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tokenId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "userId",
              "tokenId"
            ]
          },
          "resolvedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "addToDataset": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "runId",
          "setId",
          "decisionId",
          "kind",
          "reason",
          "sampleRate",
          "band",
          "suggested",
          "status",
          "assigneeId",
          "resolution",
          "resolvedBy",
          "resolvedAt",
          "addToDataset",
          "createdAt"
        ]
      },
      "RolloutChangeRequest": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "stage",
          "reason"
        ],
        "additionalProperties": false
      },
      "RolloutChangeResponse": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "from": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          },
          "to": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "channel",
          "from",
          "to",
          "version"
        ]
      },
      "RolloutGetResponse": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "stage": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "gates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GateResult"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "channel",
          "stage",
          "version",
          "versionId",
          "gates",
          "warnings"
        ]
      },
      "RunDryRunResult": {
        "type": "object",
        "properties": {
          "dryRun": {
            "type": "boolean",
            "const": true
          },
          "setId": {
            "type": "string",
            "format": "uuid"
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "const": "draft"
              }
            ]
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "profileId": {
            "type": "string",
            "minLength": 1
          },
          "provider": {
            "type": "string",
            "enum": [
              "typesafe",
              "openrouter",
              "vercel"
            ]
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "skipped": {
                  "type": "boolean"
                },
                "batches": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "request": {
                        "type": "object",
                        "properties": {
                          "state": {},
                          "model": {
                            "type": "string",
                            "minLength": 1
                          },
                          "questions": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_]{0,63}$"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "noul",
                                    "choice",
                                    "score"
                                  ]
                                },
                                "instructions": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    }
                                  ]
                                },
                                "criteria": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "$ref": "#/components/schemas/JsonValue"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "instructions"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "state",
                          "model",
                          "questions"
                        ],
                        "additionalProperties": false
                      },
                      "estTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "request",
                      "estTokens"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "skipped",
                "batches"
              ],
              "additionalProperties": false
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "requestTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "statePlusLongestQuestionTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "requestTokens",
              "statePlusLongestQuestionTokens"
            ],
            "additionalProperties": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "dryRun",
          "setId",
          "versionId",
          "version",
          "model",
          "profileId",
          "provider",
          "stages",
          "limits",
          "warnings"
        ],
        "additionalProperties": false
      },
      "RunGetResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "setId": {
            "type": "string",
            "format": "uuid"
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "pinned",
              "draft"
            ]
          },
          "rollout": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "console",
              "playground",
              "api",
              "embed",
              "extension",
              "mcp",
              "eval",
              "cli",
              "ingest"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error",
              "rate_limited",
              "quota_exceeded"
            ]
          },
          "runBand": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "overallAction": {
            "type": "string",
            "enum": [
              "auto",
              "review",
              "fallback",
              "escalate_to_llm"
            ]
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "modelRequested": {
            "type": "string",
            "minLength": 1
          },
          "modelResolved": {
            "type": [
              "string",
              "null"
            ]
          },
          "latencyMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "inputTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "outputTokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "systemOneCostMicroUsd": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "counterfactualMicroUsd": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "savingsMicroUsd": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorTokenId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "actorTokenName": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "skipped": {
                  "type": "boolean"
                },
                "calls": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "modelResolved": {
                        "type": "string",
                        "minLength": 1
                      },
                      "provider": {
                        "type": "string",
                        "enum": [
                          "typesafe",
                          "openrouter",
                          "vercel"
                        ]
                      },
                      "providerCostUsd": {
                        "type": "number"
                      },
                      "typesafeRequestId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "inputTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "outputTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "latencyMs": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "modelResolved",
                      "typesafeRequestId",
                      "inputTokens",
                      "outputTokens",
                      "latencyMs"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "skipped",
                "calls"
              ]
            }
          },
          "checks": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "answers": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JsonValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "decisions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JsonValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JsonValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "reviewItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "decisionId": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "action",
                    "label"
                  ]
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "action",
                    "audit",
                    "near_threshold",
                    "challenger_diff",
                    "studio"
                  ]
                },
                "band": {
                  "type": "string",
                  "enum": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "pending_confirmation",
                    "resolved",
                    "dismissed"
                  ]
                },
                "resolution": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/JsonValue"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "resolvedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "decisionId",
                "kind",
                "reason",
                "band",
                "status",
                "resolution",
                "resolvedAt"
              ]
            }
          }
        },
        "required": [
          "id",
          "setId",
          "versionId",
          "channel",
          "rollout",
          "source",
          "status",
          "runBand",
          "overallAction",
          "route",
          "modelRequested",
          "modelResolved",
          "latencyMs",
          "inputTokens",
          "outputTokens",
          "systemOneCostMicroUsd",
          "counterfactualMicroUsd",
          "savingsMicroUsd",
          "errorCode",
          "actorTokenId",
          "actorTokenName",
          "createdAt",
          "stages",
          "checks",
          "answers",
          "decisions",
          "warnings",
          "state",
          "reviewItems"
        ]
      },
      "RunIngestRequest": {
        "type": "object",
        "properties": {
          "setRef": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "answers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/SystemOneAnswerInput"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/SystemOneUsage"
          },
          "latencyMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "stateHash": {
            "type": "string",
            "minLength": 1
          },
          "state": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "required": [
          "setRef",
          "version",
          "model",
          "answers",
          "usage",
          "latencyMs",
          "stateHash"
        ],
        "additionalProperties": false
      },
      "RunListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "setId": {
                  "type": "string",
                  "format": "uuid"
                },
                "versionId": {
                  "type": "string",
                  "format": "uuid"
                },
                "channel": {
                  "type": "string",
                  "enum": [
                    "production",
                    "staging",
                    "pinned",
                    "draft"
                  ]
                },
                "rollout": {
                  "type": "string",
                  "enum": [
                    "inactive",
                    "shadow",
                    "controlled",
                    "full",
                    "paused"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "console",
                    "playground",
                    "api",
                    "embed",
                    "extension",
                    "mcp",
                    "eval",
                    "cli",
                    "ingest"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "error",
                    "rate_limited",
                    "quota_exceeded"
                  ]
                },
                "runBand": {
                  "type": "string",
                  "enum": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "overallAction": {
                  "type": "string",
                  "enum": [
                    "auto",
                    "review",
                    "fallback",
                    "escalate_to_llm"
                  ]
                },
                "route": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "modelRequested": {
                  "type": "string",
                  "minLength": 1
                },
                "modelResolved": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "latencyMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "inputTokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "outputTokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "systemOneCostMicroUsd": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "counterfactualMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "savingsMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "errorCode": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "actorTokenId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "actorTokenName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "setId",
                "versionId",
                "channel",
                "rollout",
                "source",
                "status",
                "runBand",
                "overallAction",
                "route",
                "modelRequested",
                "modelResolved",
                "latencyMs",
                "inputTokens",
                "outputTokens",
                "systemOneCostMicroUsd",
                "counterfactualMicroUsd",
                "savingsMicroUsd",
                "errorCode",
                "actorTokenId",
                "actorTokenName",
                "createdAt"
              ]
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "RunOptions": {
        "type": "object",
        "properties": {
          "includeProbabilities": {
            "type": "boolean"
          },
          "dryRun": {
            "type": "boolean"
          },
          "externalRef": {
            "type": "string",
            "minLength": 1
          },
          "metadata": {
            "type": "object",
            "properties": {
              "tokensBefore": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tokensAfter": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "RunResult": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "setId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "interfaceMajor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "interfaceHash": {
            "type": "string",
            "minLength": 1
          },
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "pinned",
              "draft"
            ]
          },
          "rollout": {
            "type": "string",
            "enum": [
              "inactive",
              "shadow",
              "controlled",
              "full",
              "paused"
            ]
          },
          "experiment": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "arm": {
                "type": "string",
                "enum": [
                  "champion",
                  "challenger"
                ]
              }
            },
            "required": [
              "id",
              "arm"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error",
              "rate_limited",
              "quota_exceeded"
            ]
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_state",
                  "invalid_request",
                  "unauthenticated",
                  "quota_exceeded",
                  "token_budget_exceeded",
                  "insufficient_scope",
                  "not_found",
                  "already_exists",
                  "gate_not_met",
                  "interface_mismatch",
                  "set_not_live",
                  "precondition_failed",
                  "preflight_too_large",
                  "spec_invalid",
                  "idempotency_key_reused",
                  "model_unavailable",
                  "model_unpriced",
                  "precondition_required",
                  "rate_limited",
                  "system_one_rate_limited",
                  "system_one_invalid_request",
                  "system_one_invalid_response",
                  "system_one_forbidden",
                  "system_one_unavailable",
                  "system_one_overloaded",
                  "system_one_auth"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "modelRequested": {
            "type": "string",
            "minLength": 1
          },
          "modelResolved": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "typesafeRequestId": {
            "type": [
              "string",
              "null"
            ]
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "skipped": {
                  "type": "boolean"
                },
                "calls": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "modelResolved": {
                        "type": "string",
                        "minLength": 1
                      },
                      "provider": {
                        "type": "string",
                        "enum": [
                          "typesafe",
                          "openrouter",
                          "vercel"
                        ]
                      },
                      "providerCostUsd": {
                        "type": "number"
                      },
                      "typesafeRequestId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "inputTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "outputTokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "latencyMs": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "modelResolved",
                      "typesafeRequestId",
                      "inputTokens",
                      "outputTokens",
                      "latencyMs"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "skipped",
                "calls"
              ]
            }
          },
          "checks": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "answers": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/SystemOneAnswer"
            }
          },
          "decisions": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "question",
                    "composite"
                  ]
                },
                "value": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                },
                "band": {
                  "type": "string",
                  "enum": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "level": {
                  "type": "string",
                  "enum": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "relevant": {
                  "type": "boolean"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "auto",
                    "review",
                    "fallback",
                    "escalate_to_llm"
                  ]
                },
                "effectiveAction": {
                  "type": "string",
                  "enum": [
                    "auto",
                    "review",
                    "fallback",
                    "escalate_to_llm"
                  ]
                },
                "executed": {
                  "type": "boolean"
                },
                "escalation": {
                  "type": "object",
                  "properties": {
                    "model": {
                      "type": "string",
                      "minLength": 1
                    },
                    "value": {
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    },
                    "costUsd": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "failed"
                      ]
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "model",
                    "value",
                    "costUsd",
                    "status"
                  ]
                },
                "fallbackRunId": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "kind",
                "value",
                "band",
                "relevant",
                "action",
                "effectiveAction",
                "executed"
              ]
            }
          },
          "runBand": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "overallAction": {
            "type": "string",
            "enum": [
              "auto",
              "review",
              "fallback",
              "escalate_to_llm"
            ]
          },
          "policyAction": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "review",
                  "fallback",
                  "escalate_to_llm"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost": {
            "type": "object",
            "properties": {
              "systemOneInputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "systemOneOutputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "systemOneCostUsd": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "counterfactualInputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "counterfactualOutputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "counterfactualLlmCostUsd": {
                "type": "number"
              },
              "comparatorModel": {
                "type": "string",
                "minLength": 1
              },
              "counterfactualMode": {
                "type": "string",
                "enum": [
                  "one_call",
                  "per_question"
                ]
              },
              "savingsUsd": {
                "type": "number"
              },
              "savingsKind": {
                "type": "string",
                "enum": [
                  "decision",
                  "escalation_avoided",
                  "context_pruned"
                ]
              },
              "savingsSuppressed": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "shadow",
                      "eval",
                      "staging",
                      "experiment",
                      "outage"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "llmCallsAvoided": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "contextTokensPruned": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "escalationCostUsd": {
                "type": "number"
              },
              "llmCallsMade": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "estimated": {
                "type": "boolean",
                "const": true
              },
              "latencyMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "systemOneInputTokens",
              "systemOneOutputTokens",
              "systemOneCostUsd",
              "counterfactualInputTokens",
              "counterfactualOutputTokens",
              "counterfactualLlmCostUsd",
              "comparatorModel",
              "counterfactualMode",
              "savingsUsd",
              "savingsKind",
              "savingsSuppressed",
              "llmCallsAvoided",
              "escalationCostUsd",
              "llmCallsMade",
              "estimated",
              "latencyMs"
            ]
          },
          "reviewItemIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "runId",
          "setId",
          "version",
          "versionId",
          "interfaceMajor",
          "interfaceHash",
          "channel",
          "rollout",
          "status",
          "modelRequested",
          "modelResolved",
          "typesafeRequestId",
          "stages",
          "checks",
          "answers",
          "decisions",
          "runBand",
          "overallAction",
          "policyAction",
          "route",
          "cost",
          "warnings"
        ]
      },
      "SetCompareRequest": {
        "type": "object",
        "properties": {
          "from": {
            "anyOf": [
              {
                "type": "string",
                "const": "draft"
              },
              {
                "type": "string",
                "enum": [
                  "production",
                  "staging"
                ]
              },
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            ]
          },
          "to": {
            "anyOf": [
              {
                "type": "string",
                "const": "draft"
              },
              {
                "type": "string",
                "enum": [
                  "production",
                  "staging"
                ]
              },
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            ]
          },
          "states": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JsonValue"
            }
          },
          "datasetId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "additionalProperties": false
      },
      "SetCreateRequest": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "goalId": {
            "type": "string",
            "format": "uuid"
          },
          "fromTemplate": {
            "type": "string",
            "minLength": 1
          },
          "fromVersion": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "slug",
          "name",
          "goalId"
        ],
        "additionalProperties": false
      },
      "SetCreateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "goalId": {
            "type": "string",
            "format": "uuid"
          },
          "protected": {
            "type": "boolean"
          },
          "storageMode": {
            "type": "string",
            "enum": [
              "full",
              "redacted",
              "hash_only"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "draft": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "versionId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "etag": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "version",
                  "versionId",
                  "etag"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string",
                  "enum": [
                    "production",
                    "staging"
                  ]
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "versionId": {
                  "type": "string",
                  "format": "uuid"
                },
                "stage": {
                  "type": "string",
                  "enum": [
                    "inactive",
                    "shadow",
                    "controlled",
                    "full",
                    "paused"
                  ]
                },
                "interfaceMajor": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "channel",
                "version",
                "versionId",
                "stage",
                "interfaceMajor",
                "updatedAt"
              ]
            }
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "projectId",
          "goalId",
          "protected",
          "storageMode",
          "createdAt",
          "draft",
          "channels"
        ]
      },
      "SetHealth": {
        "type": "object",
        "properties": {
          "setId": {
            "type": "string",
            "format": "uuid"
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "model": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "no_truth_source",
              "drifting",
              "insufficient_data",
              "below_target",
              "ok"
            ]
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "no_truth_source",
                "drifting",
                "insufficient_data",
                "below_target",
                "ok"
              ]
            }
          },
          "target": {
            "type": "object",
            "properties": {
              "tier": {
                "type": "string",
                "enum": [
                  "low",
                  "standard",
                  "high"
                ]
              },
              "highPrecision": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "mediumPrecision": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "minCoverage": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "minLabeledHigh": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "tier",
              "highPrecision",
              "mediumPrecision",
              "minCoverage",
              "minLabeledHigh"
            ],
            "additionalProperties": false
          },
          "window": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date-time"
              },
              "to": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "set": {
            "type": "object",
            "properties": {
              "labeledN": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "precision": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "enum": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lower95": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "labeledN": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "value",
                    "lower95",
                    "labeledN"
                  ],
                  "additionalProperties": false
                },
                "required": [
                  "high",
                  "medium",
                  "low"
                ]
              },
              "coverage": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "reviewLoadPerDay": {
                "type": "number",
                "minimum": 0
              },
              "ece": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "psi": {
                "type": "object",
                "properties": {
                  "bandMix": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "answers": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "bandMix",
                  "answers"
                ],
                "additionalProperties": false
              },
              "stability": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "costPerDecisionUsd": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "labeledN",
              "precision",
              "coverage",
              "reviewLoadPerDay",
              "ece",
              "psi",
              "stability",
              "costPerDecisionUsd"
            ],
            "additionalProperties": false
          },
          "questions": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "labeledN": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "precision": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string",
                    "enum": [
                      "high",
                      "medium",
                      "low"
                    ]
                  },
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lower95": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "labeledN": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "value",
                      "lower95",
                      "labeledN"
                    ],
                    "additionalProperties": false
                  },
                  "required": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "coverage": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "reviewLoadPerDay": {
                  "type": "number",
                  "minimum": 0
                },
                "ece": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "psi": {
                  "type": "object",
                  "properties": {
                    "bandMix": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "answers": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "bandMix",
                    "answers"
                  ],
                  "additionalProperties": false
                },
                "stability": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "costPerDecisionUsd": {
                  "type": "number",
                  "minimum": 0
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "no_truth_source",
                    "drifting",
                    "insufficient_data",
                    "below_target",
                    "ok"
                  ]
                }
              },
              "required": [
                "labeledN",
                "precision",
                "coverage",
                "reviewLoadPerDay",
                "ece",
                "psi",
                "stability",
                "costPerDecisionUsd",
                "status"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "setId",
          "versionId",
          "channel",
          "model",
          "status",
          "flags",
          "target",
          "window",
          "set",
          "questions"
        ],
        "additionalProperties": false
      },
      "SetImproveRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "SetListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetCreateResponse"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "SetPublishRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ]
          },
          "changelog": {
            "type": "string",
            "minLength": 1
          },
          "requireEval": {
            "type": "boolean"
          },
          "skipExperiment": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "reason"
            ],
            "additionalProperties": false
          },
          "interfaceBump": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "reason"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "channel",
          "changelog"
        ],
        "additionalProperties": false
      },
      "SetPublishResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "experimentId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "version",
          "versionId"
        ]
      },
      "SetRunRequest": {
        "type": "object",
        "properties": {
          "state": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "options": {
            "$ref": "#/components/schemas/RunOptions"
          }
        },
        "required": [
          "state"
        ],
        "additionalProperties": false
      },
      "SetRunResponse": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/RunResult"
          },
          {
            "$ref": "#/components/schemas/RunDryRunResult"
          }
        ]
      },
      "SetTryModelRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "model"
        ],
        "additionalProperties": false
      },
      "SetUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "protected": {
            "type": "boolean"
          },
          "labeling": {
            "$ref": "#/components/schemas/LabelingPolicy"
          },
          "dispatchActionsOnStaging": {
            "type": "boolean"
          },
          "valueSettings": {
            "type": "object",
            "properties": {
              "errorCostUsd": {
                "type": "number",
                "minimum": 0
              },
              "reviewCostUsd": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "errorCostUsd",
              "reviewCostUsd"
            ],
            "additionalProperties": false
          },
          "gateMargins": {
            "type": "object",
            "properties": {
              "coverageDrop": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "reviewLoadRise": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "coverageDrop",
              "reviewLoadRise"
            ],
            "additionalProperties": false
          },
          "storageMode": {
            "type": "string",
            "enum": [
              "full",
              "redacted",
              "hash_only"
            ]
          },
          "userGenerated": {
            "type": "boolean"
          },
          "resultCacheTtlSeconds": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "SettingsUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "SpecDiff": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1
          },
          "to": {
            "type": "string",
            "minLength": 1
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "pattern": "^(\\/([^~/]|~[01])*)*$"
                },
                "op": {
                  "type": "string",
                  "enum": [
                    "add",
                    "remove",
                    "replace"
                  ]
                },
                "before": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "after": {
                  "$ref": "#/components/schemas/JsonValue"
                }
              },
              "required": [
                "path",
                "op"
              ]
            }
          },
          "interface": {
            "type": "object",
            "properties": {
              "breaking": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "additive": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "breaking",
              "additive"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "from",
          "to",
          "changes",
          "interface"
        ]
      },
      "StudioAddExamplesRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "StudioCalibrateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "StudioCreateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "StudioDecomposeRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "StudioDraftDefinitionRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "StudioListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "StudioPromoteRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "StudioRequestLabelsRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": {}
      },
      "SystemOneAnswer": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "noul"
                  },
                  "noul": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "noul"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "choice"
                  },
                  "choice": {
                    "type": "string"
                  },
                  "probabilities": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "confidence": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "choice",
                  "probabilities",
                  "confidence"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "score"
                  },
                  "score": {
                    "type": "number"
                  },
                  "legend": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "$ref": "#/components/schemas/JsonValue"
                          }
                        },
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/JsonValue"
                          }
                        }
                      ]
                    }
                  },
                  "probabilities": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "confidence": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "score",
                  "legend",
                  "probabilities",
                  "confidence"
                ],
                "additionalProperties": {}
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": {}
          }
        ]
      },
      "SystemOneAnswerInput": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "noul"
                  },
                  "noul": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "noul"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "choice"
                  },
                  "choice": {
                    "type": "string"
                  },
                  "probabilities": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "confidence": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "choice",
                  "probabilities",
                  "confidence"
                ],
                "additionalProperties": {}
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "score"
                  },
                  "score": {
                    "type": "number"
                  },
                  "legend": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "$ref": "#/components/schemas/DraftValidateRequest"
                        },
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/JsonValue"
                          }
                        }
                      ]
                    }
                  },
                  "probabilities": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "confidence": {
                    "type": "number"
                  }
                },
                "required": [
                  "type",
                  "score",
                  "legend",
                  "probabilities",
                  "confidence"
                ],
                "additionalProperties": {}
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": {}
          }
        ]
      },
      "SystemOneUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "cost": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": {}
      },
      "TemplateListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "pattern": {
                  "type": "string",
                  "minLength": 1
                },
                "parameters": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/JsonValue"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "pattern",
                "parameters"
              ]
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "UsageGetResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "token": {
            "type": [
              "string",
              "null"
            ]
          },
          "sets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "runs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "bandHigh": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "bandMedium": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "bandLow": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "wouldActControlled": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "errors": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "inputTokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "outputTokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "systemOneCostMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "counterfactualMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "savingsMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "llmCallsAvoided": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "setId": {
                  "type": "string",
                  "format": "uuid"
                },
                "slug": {
                  "type": "string"
                },
                "wouldActRoutes": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "route": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "runs": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "route",
                      "runs"
                    ]
                  }
                }
              },
              "required": [
                "runs",
                "bandHigh",
                "bandMedium",
                "bandLow",
                "wouldActControlled",
                "errors",
                "inputTokens",
                "outputTokens",
                "systemOneCostMicroUsd",
                "counterfactualMicroUsd",
                "savingsMicroUsd",
                "llmCallsAvoided",
                "setId",
                "slug",
                "wouldActRoutes"
              ]
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "runs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "bandHigh": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "bandMedium": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "bandLow": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "wouldActControlled": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "errors": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "inputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "outputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "systemOneCostMicroUsd": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "counterfactualMicroUsd": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "savingsMicroUsd": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "llmCallsAvoided": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "runs",
              "bandHigh",
              "bandMedium",
              "bandLow",
              "wouldActControlled",
              "errors",
              "inputTokens",
              "outputTokens",
              "systemOneCostMicroUsd",
              "counterfactualMicroUsd",
              "savingsMicroUsd",
              "llmCallsAvoided"
            ]
          },
          "days": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "runs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "errors": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "systemOneCostMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "counterfactualMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "savingsMicroUsd": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "llmCallsAvoided": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "day",
                "runs",
                "errors",
                "systemOneCostMicroUsd",
                "counterfactualMicroUsd",
                "savingsMicroUsd",
                "llmCallsAvoided"
              ]
            }
          }
        },
        "required": [
          "from",
          "to",
          "token",
          "sets",
          "totals",
          "days"
        ]
      },
      "VersionGetResponse": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "status": {
                "type": "string",
                "enum": [
                  "draft",
                  "published",
                  "archived"
                ]
              },
              "specHash": {
                "type": "string",
                "minLength": 1
              },
              "interfaceMajor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "interfaceHash": {
                "type": "string",
                "minLength": 1
              },
              "model": {
                "type": "string",
                "minLength": 1
              },
              "changelog": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "type": "string",
                "enum": [
                  "console",
                  "api",
                  "cli",
                  "mcp",
                  "studio",
                  "upgrade",
                  "proposal"
                ]
              },
              "publishedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "publishedBy": {
                "type": "object",
                "properties": {
                  "userId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tokenId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "userId",
                  "tokenId"
                ]
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "spec": {
                "$ref": "#/components/schemas/QuestionSetSpec"
              }
            },
            "required": [
              "id",
              "version",
              "status",
              "specHash",
              "interfaceMajor",
              "interfaceHash",
              "model",
              "changelog",
              "source",
              "publishedAt",
              "publishedBy",
              "createdAt",
              "spec"
            ]
          },
          {
            "$ref": "#/components/schemas/Manifest"
          }
        ]
      },
      "VersionListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "published",
                    "archived"
                  ]
                },
                "specHash": {
                  "type": "string",
                  "minLength": 1
                },
                "interfaceMajor": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "interfaceHash": {
                  "type": "string",
                  "minLength": 1
                },
                "model": {
                  "type": "string",
                  "minLength": 1
                },
                "changelog": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "console",
                    "api",
                    "cli",
                    "mcp",
                    "studio",
                    "upgrade",
                    "proposal"
                  ]
                },
                "publishedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "publishedBy": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tokenId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "userId",
                    "tokenId"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "version",
                "status",
                "specHash",
                "interfaceMajor",
                "interfaceHash",
                "model",
                "changelog",
                "source",
                "publishedAt",
                "publishedBy",
                "createdAt"
              ]
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "WebhookCreateRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "types": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "set.published",
                "release.rolled_back",
                "release.promoted",
                "rollout.changed",
                "rollout.auto_demoted",
                "rollout.gate_met",
                "eval.completed",
                "job.completed",
                "review.created",
                "review.sla_breached",
                "review.resolved",
                "alert.raised",
                "model.available",
                "model.alias_moved",
                "model.deprecated",
                "proposal.created",
                "experiment.started",
                "experiment.decided",
                "approval.requested",
                "approval.decided",
                "key.invalid",
                "interface.breaking_published",
                "binding.created",
                "contract.changed",
                "model.unreviewed"
              ]
            }
          }
        },
        "required": [
          "url",
          "types"
        ],
        "additionalProperties": false
      },
      "WebhookListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {}
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      }
    },
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "An app token (sk_live_, sk_test_, pk_live_), a browser token (a 5-minute ES256 JWT) or an agent token (sa_live_)."
      },
      "consoleSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "session",
        "description": "The console session cookie. Its real name comes from the auth library (ADR-002)."
      }
    }
  }
}
