{
  "openapi": "3.1.0",
  "info": {
    "title": "Deconflictor",
    "description": "Catches cross-team change collisions before rollout. Codes, not sentences: every verdict, rule, state and error is a machine value the UI translates. Live events: SSE with Last-Event-ID (`id` = `seq`, unnamed messages carry a FeedEvent; `done` and `error` end a stream with a StreamEnd).\n\nOwner browser login is opt-in via DECONFLICTOR_OWNER_ORIGIN (HTTPS). No public registration: initial setup requires a separate operator secret and closes permanently after the single owner exists. Integration routes always require Bearer.",
    "version": "0.1.0.dev0",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "paths": {
    "/api/auth/session": {
      "get": {
        "tags": [
          "Owner access"
        ],
        "summary": "Discover browser login and the current owner session",
        "description": "Public mode/setup flags; personal fields and CSRF only with a valid HttpOnly cookie.\n\nResponses are Cache-Control: no-store. Owner mode is opt-in. Login/setup/logout require the exact configured HTTPS Origin; login/setup require application/json. When owner mode is disabled only session discovery is available.",
        "operationId": "session_state_api_auth_session_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerState"
                },
                "example": {
                  "mode": "owner",
                  "setup_required": false,
                  "registration_enabled": false,
                  "user": null,
                  "csrf_token": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "cross_origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "cross_origin",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "owner_access_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "owner_access_disabled",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/setup": {
      "post": {
        "tags": [
          "Owner access"
        ],
        "summary": "Create the single owner with an operator bootstrap secret",
        "description": "Requires the bootstrap secret; a second owner receives registration_closed.\n\nResponses are Cache-Control: no-store. Owner mode is opt-in. Login/setup/logout require the exact configured HTTPS Origin; login/setup require application/json. When owner mode is disabled only session discovery is available.",
        "operationId": "setup_owner_api_auth_setup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupRequest"
              },
              "example": {
                "username": "owner.example",
                "password": "example-only long password",
                "display_name": "Private owner",
                "password_confirm": "example-only long password"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerState"
                },
                "example": {
                  "mode": "owner",
                  "setup_required": false,
                  "registration_enabled": false,
                  "user": {
                    "username": "owner.example",
                    "display_name": "Private owner"
                  },
                  "csrf_token": "returned-by-session-discovery"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "cross_origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "cross_origin",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "owner_access_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "owner_access_disabled",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "json_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "json_required",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "login_rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "login_rate_limited",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "registration_closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "registration_closed",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "OwnerBootstrap": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact DECONFLICTOR_OWNER_ORIGIN, including any non-default port.",
            "example": "https://app.example.invalid"
          }
        ]
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Owner access"
        ],
        "summary": "Sign in as the owner with a rate-limited password check",
        "description": "Rotates the browser session; wrong account names and wrong passwords have the same error.\n\nResponses are Cache-Control: no-store. Owner mode is opt-in. Login/setup/logout require the exact configured HTTPS Origin; login/setup require application/json. When owner mode is disabled only session discovery is available.",
        "operationId": "login_owner_api_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              },
              "example": {
                "username": "owner.example",
                "password": "example-only long password"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerState"
                },
                "example": {
                  "mode": "owner",
                  "setup_required": false,
                  "registration_enabled": false,
                  "user": {
                    "username": "owner.example",
                    "display_name": "Private owner"
                  },
                  "csrf_token": "returned-by-session-discovery"
                }
              }
            }
          },
          "401": {
            "description": "invalid_credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_credentials",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "cross_origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "cross_origin",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "owner_access_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "owner_access_disabled",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "415": {
            "description": "json_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "json_required",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "login_rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "login_rate_limited",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact DECONFLICTOR_OWNER_ORIGIN, including any non-default port.",
            "example": "https://app.example.invalid"
          }
        ]
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "Owner access"
        ],
        "summary": "Revoke the current owner session",
        "description": "The before-body gate requires a session, same Origin and X-CSRF-Token.\n\nResponses are Cache-Control: no-store. Owner mode is opt-in. Login/setup/logout require the exact configured HTTPS Origin; login/setup require application/json. When owner mode is disabled only session discovery is available.",
        "operationId": "logout_owner_api_auth_logout_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerState"
                },
                "example": {
                  "mode": "owner",
                  "setup_required": false,
                  "registration_enabled": false,
                  "user": null,
                  "csrf_token": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "cross_origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "cross_origin",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "owner_access_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "owner_access_disabled",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "OwnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact DECONFLICTOR_OWNER_ORIGIN, including any non-default port.",
            "example": "https://app.example.invalid"
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for cookie-authenticated mutations; read from session discovery."
          }
        ]
      }
    },
    "/api/changes": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Submit a change request; it is evaluated in the background",
        "operationId": "submit_change_api_changes_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeRequest"
              },
              "examples": {
                "request": {
                  "summary": "Example request; replace ids, surfaces and dates",
                  "value": {
                    "id": "019d68be-28a0-7000-8000-000000000001",
                    "title": "Roll out checkout v2",
                    "body": "Restart checkout replicas one at a time; writes remain available.",
                    "kind": "deploy",
                    "window": {
                      "start": "2026-10-14T08:00:00Z",
                      "end": "2026-10-14T08:30:00Z"
                    },
                    "author": "team-checkout",
                    "environment": "prod",
                    "change_class": "normal",
                    "declared_surfaces": [
                      "component:default/checkout"
                    ],
                    "links": [
                      "https://issues.example.org/releases/123"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeAccepted"
                },
                "example": {
                  "id": "019d68be-28a0-7000-8000-000000000001",
                  "evaluation": {
                    "state": "queued",
                    "since": "2026-10-14T07:00:00Z",
                    "error": null
                  },
                  "card": "/api/changes/019d68be-28a0-7000-8000-000000000001",
                  "events": "/api/changes/019d68be-28a0-7000-8000-000000000001/events"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Relative URL of the stored change card.",
                "schema": {
                  "type": "string"
                },
                "example": "/api/changes/019d68be-28a0-7000-8000-000000000001"
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "change_exists",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Conflict"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Bad Request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Content Too Large"
          }
        },
        "description": "Store a change and queue the council evaluation. 202 means accepted, never approved. Follow the Location header, card, or events link to inspect evaluation progress. Done alone is not a rollout permit. The optional client UUID is unique: repeat submissions return 409 change_exists. After a timeout, GET that id before retrying. For webhook delivery deduplication use /api/integrations/changes. Declared surfaces must be current catalog refs. All timestamps require a timezone; windows are [start, end).\n\nFor a company-operated rollout gate, read a fresh card and require status=active, evaluation.state=done, record.content_version=content_version, record.id=outcome.record_id and record.final_verdict=outcome.final_verdict=approve. Require record.chair.status=ok or carried; not_asked/skipped_standard need explicit company policy. Pending, failed or unknown Chair status never permits automatic rollout. An active human override requires the company's separate approval process and does not replace the service verdict. Read again just before rollout: the API does not lock the calendar or grant an atomic deployment permit. Use a finite timeout; errors require human follow-up. Retrying a webhook does not rerun a pending or failed Chair."
      },
      "get": {
        "tags": [
          "changes"
        ],
        "summary": "The calendar: changes whose window meets the range",
        "operationId": "list_changes_api_changes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "range start, ISO-8601 with a time zone",
              "title": "From"
            },
            "description": "Inclusive range start, ISO-8601 with timezone; omitted means unbounded.",
            "example": "2026-10-14T08:00:00Z"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "range end (exclusive)",
              "title": "To"
            },
            "description": "Exclusive range end, ISO-8601 with timezone; must be later than from.",
            "example": "2026-10-14T08:30:00Z"
          },
          {
            "name": "env",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Environment"
                },
                {
                  "type": "null"
                }
              ],
              "description": "only changes that can pair there: this environment or none given",
              "title": "Env"
            },
            "description": "Include this environment and changes with no environment.",
            "example": "prod"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "default": 500,
              "title": "Limit"
            },
            "description": "Maximum number of calendar entries. Check truncated before assuming completeness.",
            "example": 100
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeList"
                },
                "example": {
                  "items": [
                    {
                      "id": "019d68be-28a0-7000-8000-000000000001",
                      "title": "Roll out checkout v2",
                      "kind": "deploy",
                      "window": {
                        "start": "2026-10-14T08:00:00Z",
                        "end": "2026-10-14T08:30:00Z"
                      },
                      "author": "team-checkout",
                      "environment": "prod",
                      "change_class": "normal",
                      "declared_surfaces": [
                        "component:default/checkout"
                      ],
                      "links": [
                        "https://issues.example.org/releases/123"
                      ],
                      "status": "active",
                      "submitted_at": "2026-10-14T07:00:00Z",
                      "content_version": 1,
                      "surfaces": [
                        {
                          "ref": "component:default/checkout",
                          "sources": [
                            "declared"
                          ]
                        }
                      ],
                      "evaluation": {
                        "state": "queued",
                        "since": "2026-10-14T07:00:00Z",
                        "error": null
                      },
                      "outcome": null,
                      "pairs": [],
                      "override": null,
                      "suggested_window": null
                    }
                  ],
                  "truncated": false,
                  "last_seq": 42
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "description": "Return changes whose windows overlap the half-open range [from, to), sorted by window start. An omitted boundary is unbounded. env includes changes with that environment or no environment. truncated=true means narrow the range or raise limit; there is no page cursor. Connect /api/events?last_event_id=last_seq after loading the calendar so concurrent updates are not missed."
      }
    },
    "/api/changes/{change_id}": {
      "get": {
        "tags": [
          "changes"
        ],
        "summary": "The card of a change",
        "operationId": "get_change_api_changes__change_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "change_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Change Id"
            },
            "description": "Stable UUID of the calendar change.",
            "example": "019d68be-28a0-7000-8000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeCard"
                },
                "example": {
                  "id": "019d68be-28a0-7000-8000-000000000001",
                  "title": "Roll out checkout v2",
                  "kind": "deploy",
                  "window": {
                    "start": "2026-10-14T08:00:00Z",
                    "end": "2026-10-14T08:30:00Z"
                  },
                  "author": "team-checkout",
                  "environment": "prod",
                  "change_class": "normal",
                  "declared_surfaces": [
                    "component:default/checkout"
                  ],
                  "links": [
                    "https://issues.example.org/releases/123"
                  ],
                  "status": "active",
                  "submitted_at": "2026-10-14T07:00:00Z",
                  "content_version": 1,
                  "surfaces": [
                    {
                      "ref": "component:default/checkout",
                      "sources": [
                        "declared"
                      ]
                    }
                  ],
                  "evaluation": {
                    "state": "queued",
                    "since": "2026-10-14T07:00:00Z",
                    "error": null
                  },
                  "outcome": null,
                  "pairs": [],
                  "override": null,
                  "suggested_window": null,
                  "body": "Restart checkout replicas one at a time; writes remain available.",
                  "record": null,
                  "history": [],
                  "overrides": []
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "change_not_found",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Not Found"
          }
        },
        "description": "Return the request, evaluation state, newest Decision Record, pair evidence, history and human overrides. record and outcome are null while no decision exists. An evaluation can be done while the Chair explanation is pending. Check chair.status and follow events for later tightening. A human override is recorded separately; it does not replace outcome.final_verdict. Unknown UUID: 404 change_not_found.\n\nFor a company-operated rollout gate, read a fresh card and require status=active, evaluation.state=done, record.content_version=content_version, record.id=outcome.record_id and record.final_verdict=outcome.final_verdict=approve. Require record.chair.status=ok or carried; not_asked/skipped_standard need explicit company policy. Pending, failed or unknown Chair status never permits automatic rollout. An active human override requires the company's separate approval process and does not replace the service verdict. Read again just before rollout: the API does not lock the calendar or grant an atomic deployment permit. Use a finite timeout; errors require human follow-up. Retrying a webhook does not rerun a pending or failed Chair."
      }
    },
    "/api/changes/{change_id}/status": {
      "patch": {
        "tags": [
          "changes"
        ],
        "summary": "Withdraw or execute a change; its partners are recounted",
        "description": "Move an active change to withdrawn or executed. Code immediately recounts its partners; changes lists outcomes that moved. chair_pending lists explanations queued separately, which may later tighten an approval to escalation. This does not execute a deployment. A non-active change returns 409 status_not_active.",
        "operationId": "set_status_api_changes__change_id__status_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "change_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Change Id"
            },
            "description": "Stable UUID of the calendar change.",
            "example": "019d68be-28a0-7000-8000-000000000001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusChange"
              },
              "examples": {
                "request": {
                  "summary": "Example request; replace ids, surfaces and dates",
                  "value": {
                    "status": "withdrawn"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusChanged"
                },
                "example": {
                  "change_id": "019d68be-28a0-7000-8000-000000000001",
                  "status": "withdrawn",
                  "epoch_id": "019d68be-28a0-7000-8000-000000000003",
                  "changes": [],
                  "chair_pending": []
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "change_not_found",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "status_not_active",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Conflict"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Bad Request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Content Too Large"
          }
        }
      }
    },
    "/api/changes/{change_id}/override": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Override the verdict with a reason: logged, shown, never obeyed by the code",
        "description": "Record a person's disagreement with the newest decision and a mandatory reason. It is shown in the audit history but does not change the code verdict, release gate or partner recounts. Send the record_id the person reviewed. 409 codes: status_not_active, no_verdict, record_outdated, verdict_unchanged. A newer service verdict can make the override no longer in force.",
        "operationId": "override_change_api_changes__change_id__override_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "change_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Change Id"
            },
            "description": "Stable UUID of the calendar change.",
            "example": "019d68be-28a0-7000-8000-000000000001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideRequest"
              },
              "examples": {
                "request": {
                  "summary": "Example request; replace ids, surfaces and dates",
                  "value": {
                    "verdict": "escalate",
                    "reason": "The release owner requested a manual review of the rollout.",
                    "author": "release-owner",
                    "record_id": "019d68be-28a0-7000-8000-000000000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Override"
                },
                "example": {
                  "verdict": "escalate",
                  "reason": "The release owner requested a manual review of the rollout.",
                  "author": "release-owner",
                  "record_id": "019d68be-28a0-7000-8000-000000000002",
                  "id": "019d68be-28a0-7000-8000-000000000003",
                  "change_id": "019d68be-28a0-7000-8000-000000000001",
                  "over": "approve",
                  "created_at": "2026-10-14T07:10:00Z",
                  "in_force": true
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "change_not_found",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "record_outdated",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Conflict"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Bad Request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Content Too Large"
          }
        }
      }
    },
    "/api/changes/{change_id}/reschedule": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Move the change to the window code suggested; it is evaluated again",
        "description": "Accept only the free window suggested by the latest Decision Record; this endpoint does not accept an arbitrary time. The same change gets a new content_version and a new evaluation. Send record_id from the card. 409 codes: status_not_active, no_verdict, evaluation_in_progress, record_outdated, no_suggestion, window_taken. The target window is rechecked under locks before storing it.",
        "operationId": "reschedule_change_api_changes__change_id__reschedule_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "change_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Change Id"
            },
            "description": "Stable UUID of the calendar change.",
            "example": "019d68be-28a0-7000-8000-000000000001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RescheduleRequest"
              },
              "examples": {
                "request": {
                  "summary": "Example request; replace ids, surfaces and dates",
                  "value": {
                    "record_id": "019d68be-28a0-7000-8000-000000000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rescheduled"
                },
                "example": {
                  "id": "019d68be-28a0-7000-8000-000000000001",
                  "evaluation": {
                    "state": "queued",
                    "since": "2026-10-14T07:00:00Z",
                    "error": null
                  },
                  "card": "/api/changes/019d68be-28a0-7000-8000-000000000001",
                  "events": "/api/changes/019d68be-28a0-7000-8000-000000000001/events",
                  "content_version": 2,
                  "record_id": "019d68be-28a0-7000-8000-000000000002",
                  "previous": {
                    "start": "2026-10-14T08:00:00Z",
                    "end": "2026-10-14T08:30:00Z"
                  },
                  "window": {
                    "start": "2026-10-14T10:00:00Z",
                    "end": "2026-10-14T10:30:00Z"
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Relative URL of the stored change card.",
                "schema": {
                  "type": "string"
                },
                "example": "/api/changes/019d68be-28a0-7000-8000-000000000001"
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "change_not_found",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "record_outdated",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Conflict"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Bad Request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Content Too Large"
          }
        }
      }
    },
    "/api/surfaces": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The live dependency graph: surfaces and edges, and the systems they form",
        "operationId": "surfaces_api_surfaces_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurfaceCatalog"
                },
                "example": {
                  "graph_version": 1,
                  "surfaces": [
                    {
                      "ref": "component:default/checkout",
                      "kind": "component",
                      "name": "checkout",
                      "aliases": [
                        "checkout-api"
                      ],
                      "system": null
                    },
                    {
                      "ref": "resource:default/orders-db",
                      "kind": "resource",
                      "name": "orders-db",
                      "aliases": [],
                      "system": null
                    }
                  ],
                  "edges": [
                    {
                      "src": "component:default/checkout",
                      "dst": "resource:default/orders-db",
                      "type": "hard",
                      "via": null
                    }
                  ],
                  "systems": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "description": "Return the currently imported Backstage graph: canonical entity refs, aliases, systems and directed dependency edges. src depends on dst for hard and soft edges; shares_infra is undirected and names its resource in via. Use refs, not display names, in declared_surfaces. Import/update is an administrator CLI operation, not a public write endpoint. graph_version=0 and no surfaces means no catalog yet."
      }
    },
    "/api/info": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "This server: version, mode, the source of answers, auth",
        "operationId": "info_api_info_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Info"
                },
                "example": {
                  "version": "0.1.0.dev0",
                  "mode": "advisory",
                  "graph_version": 1,
                  "auth": "token",
                  "max_window_days": 31,
                  "last_seq": 42,
                  "llm": {
                    "answers": "live",
                    "adapter": "codex_cli",
                    "llm": "codex_cli",
                    "intake_model": "gpt-6-astra",
                    "intake_effort": "medium",
                    "judge_model": "gpt-6-astra",
                    "judge_effort": "medium",
                    "challenger_model": "gpt-6-astra",
                    "challenger_effort": "medium",
                    "chair_model": "gpt-6-astra",
                    "chair_effort": "medium",
                    "language": "en"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "description": "Read service version, decision mode, authorization mode, model provenance, graph version, window limit and newest event sequence. Production should report llm.answers=live and the configured adapter/models. No credentials are returned. A successful response checks database connectivity, not provider balance or login expiry."
      }
    },
    "/api/integrations/changes": {
      "post": {
        "tags": [
          "integrations"
        ],
        "summary": "Receive a normalized CI/CD or ticket webhook, with durable deduplication",
        "description": "The shared Bearer token authorizes this integration. Map vendor events to this schema. 202 stores one change and queues evaluation; it does not approve a rollout. Retry the same (source, external_id) and content after timeouts: 200 returns the same id and recovers missing initial evaluation; completed decisions are not rerun. Changed content with the same identity is 409. Use the card or event stream for the actual decision. Only active changes are evaluated.\n\nFor a company-operated rollout gate, read a fresh card and require status=active, evaluation.state=done, record.content_version=content_version, record.id=outcome.record_id and record.final_verdict=outcome.final_verdict=approve. Require record.chair.status=ok or carried; not_asked/skipped_standard need explicit company policy. Pending, failed or unknown Chair status never permits automatic rollout. An active human override requires the company's separate approval process and does not replace the service verdict. Read again just before rollout: the API does not lock the calendar or grant an atomic deployment permit. Use a finite timeout; errors require human follow-up. Retrying a webhook does not rerun a pending or failed Chair.",
        "operationId": "incoming_change_api_integrations_changes_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomingChange"
              },
              "examples": {
                "ci": {
                  "summary": "A planned CI/CD rollout; keep the rollout id unchanged on retry",
                  "value": {
                    "source": "ci-orders",
                    "external_id": "orders/deploy/8142",
                    "change": {
                      "title": "Deploy orders v2",
                      "body": "Restart orders replicas in production; requests may be retried.",
                      "kind": "deploy",
                      "author": "team-orders",
                      "environment": "prod",
                      "window": {
                        "start": "2026-10-14T08:00:00Z",
                        "end": "2026-10-14T09:00:00Z"
                      },
                      "links": [
                        "https://ci.example.test/orders/runs/8142"
                      ]
                    }
                  }
                },
                "ticket": {
                  "summary": "A change-management ticket revision mapped by a ticket automation",
                  "value": {
                    "source": "tickets-platform",
                    "external_id": "OPS-42:revision-3",
                    "change": {
                      "title": "Database maintenance",
                      "body": "Restart the primary database during the approved maintenance window.",
                      "kind": "maintenance",
                      "author": "team-platform",
                      "environment": "prod",
                      "window": {
                        "start": "2026-10-14T08:30:00Z",
                        "end": "2026-10-14T09:30:00Z"
                      },
                      "links": [
                        "https://tickets.example.test/OPS-42"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationAccepted"
                },
                "example": {
                  "source": "ci-orders",
                  "external_id": "orders/deploy/8142",
                  "id": "019d68be-28a0-7000-8000-000000000001",
                  "card": "/api/changes/019d68be-28a0-7000-8000-000000000001",
                  "events": "/api/changes/019d68be-28a0-7000-8000-000000000001/events",
                  "duplicate": false
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Relative URL of the stored change card.",
                "schema": {
                  "type": "string"
                },
                "example": "/api/changes/019d68be-28a0-7000-8000-000000000001"
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "200": {
            "description": "The identical request was already accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationAccepted"
                },
                "example": {
                  "source": "ci-orders",
                  "external_id": "orders/deploy/8142",
                  "id": "019d68be-28a0-7000-8000-000000000001",
                  "card": "/api/changes/019d68be-28a0-7000-8000-000000000001",
                  "events": "/api/changes/019d68be-28a0-7000-8000-000000000001/events",
                  "duplicate": true
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Relative URL of the stored change card.",
                "schema": {
                  "type": "string"
                },
                "example": "/api/changes/019d68be-28a0-7000-8000-000000000001"
              }
            }
          },
          "409": {
            "description": "external_identity_conflict: content changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "external_identity_conflict",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_body",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Bad Request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "body_too_large",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Content Too Large"
          }
        }
      },
      "get": {
        "tags": [
          "integrations"
        ],
        "summary": "Find an accepted change by its external integration identity",
        "description": "Use the same case-sensitive source and external_id as the original webhook.\n\nFor a company-operated rollout gate, read a fresh card and require status=active, evaluation.state=done, record.content_version=content_version, record.id=outcome.record_id and record.final_verdict=outcome.final_verdict=approve. Require record.chair.status=ok or carried; not_asked/skipped_standard need explicit company policy. Pending, failed or unknown Chair status never permits automatic rollout. An active human override requires the company's separate approval process and does not replace the service verdict. Read again just before rollout: the API does not lock the calendar or grant an atomic deployment permit. Use a finite timeout; errors require human follow-up. Retrying a webhook does not rerun a pending or failed Chair.",
        "operationId": "integration_change_api_integrations_changes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Source"
            },
            "description": "Stable integration namespace; same value as the original webhook.",
            "example": "ci-orders"
          },
          {
            "name": "external_id",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ExternalId"
            },
            "description": "Case-sensitive external rollout or ticket revision.",
            "example": "orders/deploy/8142"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationReference"
                },
                "example": {
                  "source": "ci-orders",
                  "external_id": "orders/deploy/8142",
                  "id": "019d68be-28a0-7000-8000-000000000001",
                  "card": "/api/changes/019d68be-28a0-7000-8000-000000000001",
                  "events": "/api/changes/019d68be-28a0-7000-8000-000000000001/events"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "integration_change_not_found",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Not Found"
          }
        }
      }
    },
    "/api/events": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "Every event of the service, live (SSE)",
        "operationId": "all_events_api_events_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "the token, for EventSource, which cannot send a header",
              "title": "Access Token"
            },
            "description": "the token, for EventSource, which cannot send a header"
          },
          {
            "name": "last_event_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "the same, for a client that reconnects by hand",
              "title": "Last Event Id"
            },
            "description": "Resume strictly after this sequence when Last-Event-ID is absent.",
            "example": "42"
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "seq of the last event received; the stream resumes after it",
              "title": "Last-Event-Id"
            },
            "description": "Last received sequence; header takes precedence over the query cursor.",
            "example": "42"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "text/event-stream. Unnamed messages: data = FeedEvent (JSON), id = seq. Named `done` and `error`: data = StreamEnd (JSON); the stream ends after them. See itemSchema."
                },
                "itemSchema": {
                  "oneOf": [
                    {
                      "title": "FeedMessage",
                      "description": "An event of agent_events: unnamed (onmessage), id = seq.",
                      "type": "object",
                      "required": [
                        "id",
                        "data"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string",
                          "contentMediaType": "application/json",
                          "contentSchema": {
                            "$ref": "#/components/schemas/FeedEvent"
                          }
                        }
                      }
                    },
                    {
                      "title": "StreamEndMessage",
                      "description": "done: the change's session is over; error: the run stopped or the feed failed. The server closes the stream after it.",
                      "type": "object",
                      "required": [
                        "event",
                        "data"
                      ],
                      "properties": {
                        "event": {
                          "type": "string",
                          "enum": [
                            "done",
                            "error"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string",
                          "contentMediaType": "application/json",
                          "contentSchema": {
                            "$ref": "#/components/schemas/StreamEnd"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": "id: 42\ndata: {\"seq\":42,\"event\":\"pipeline.started\",\"change_id\":null,\"epoch_id\":null,\"payload\":{},\"created_at\":\"2026-10-14T07:00:00Z\"}\n\n"
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "description": "Stream the durable global feed as text/event-stream. Without a cursor, starts after the newest event; pass last_seq from the calendar/info to avoid a gap. Last-Event-ID takes precedence over last_event_id; both mean resume strictly after that non-negative sequence. Unnamed events contain FeedEvent JSON and id=seq. Prefer a Bearer header. Browser EventSource may use access_token; suppress this query value in every reverse-proxy access log. Buffering must be disabled."
      }
    },
    "/api/changes/{change_id}/events": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "One change's council session, live (SSE); ends with done or error",
        "operationId": "change_events_api_changes__change_id__events_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "change_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Change Id"
            },
            "description": "Stable UUID of the calendar change.",
            "example": "019d68be-28a0-7000-8000-000000000001"
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "the token, for EventSource, which cannot send a header",
              "title": "Access Token"
            },
            "description": "the token, for EventSource, which cannot send a header"
          },
          {
            "name": "last_event_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "the same, for a client that reconnects by hand",
              "title": "Last Event Id"
            },
            "description": "Resume strictly after this sequence when Last-Event-ID is absent.",
            "example": "42"
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "seq of the last event received; the stream resumes after it",
              "title": "Last-Event-Id"
            },
            "description": "Last received sequence; header takes precedence over the query cursor.",
            "example": "42"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "text/event-stream. Unnamed messages: data = FeedEvent (JSON), id = seq. Named `done` and `error`: data = StreamEnd (JSON); the stream ends after them. See itemSchema."
                },
                "itemSchema": {
                  "oneOf": [
                    {
                      "title": "FeedMessage",
                      "description": "An event of agent_events: unnamed (onmessage), id = seq.",
                      "type": "object",
                      "required": [
                        "id",
                        "data"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string",
                          "contentMediaType": "application/json",
                          "contentSchema": {
                            "$ref": "#/components/schemas/FeedEvent"
                          }
                        }
                      }
                    },
                    {
                      "title": "StreamEndMessage",
                      "description": "done: the change's session is over; error: the run stopped or the feed failed. The server closes the stream after it.",
                      "type": "object",
                      "required": [
                        "event",
                        "data"
                      ],
                      "properties": {
                        "event": {
                          "type": "string",
                          "enum": [
                            "done",
                            "error"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string",
                          "contentMediaType": "application/json",
                          "contentSchema": {
                            "$ref": "#/components/schemas/StreamEnd"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": "id: 42\ndata: {\"seq\":42,\"event\":\"pipeline.started\",\"change_id\":null,\"epoch_id\":null,\"payload\":{},\"created_at\":\"2026-10-14T07:00:00Z\"}\n\n"
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "unauthorized",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "loopback_only",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "invalid_datetime",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Unprocessable Content"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "internal_error",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "database_unavailable",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "errors": [
                    {
                      "code": "change_not_found",
                      "field": null,
                      "detail": ""
                    }
                  ]
                }
              }
            },
            "description": "Not Found"
          }
        },
        "description": "Stream one change's council activity from its first event unless a cursor is given. Last-Event-ID overrides last_event_id. Unnamed events contain FeedEvent; named done and error contain StreamEnd and close the stream. done can still have chair_pending=true: follow subsequent feed events for the Chair. Invalid cursors and unknown changes return JSON errors before the stream opens. Swagger is a reference for SSE; use EventSource or curl --no-buffer for a long-lived stream."
      }
    }
  },
  "components": {
    "schemas": {
      "ApiError": {
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ErrorItem"
            },
            "type": "array",
            "title": "Errors"
          }
        },
        "type": "object",
        "required": [
          "errors"
        ],
        "title": "ApiError",
        "description": "Every error the API answers: one item per problem, all of them at once."
      },
      "Cause": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "submission",
              "status",
              "policy"
            ],
            "title": "Kind"
          },
          "change_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Id"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Status"
              },
              {
                "type": "null"
              }
            ]
          },
          "policy_ver": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Ver"
          }
        },
        "type": "object",
        "required": [
          "kind"
        ],
        "title": "Cause",
        "description": "What started the epoch that wrote a record: a submission, a status change, a policy."
      },
      "ChairNote": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "description": "ok, pending, failed, carried, not_asked or skipped_standard; pending may still tighten the verdict; pending/failed never authorizes automatic rollout."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "explanation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Explanation"
          },
          "tighten": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tighten"
          },
          "recommended_window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecommendedWindow"
              },
              {
                "type": "null"
              }
            ]
          },
          "grounding": {
            "items": {
              "$ref": "#/components/schemas/GroundingRef"
            },
            "type": "array",
            "title": "Grounding"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ChairNote",
        "description": "The Chair in the record's epoch: ``status`` ok, failed, carried, not_asked,\nskipped_standard; ``reason`` why it was asked (new_change, outcome_changed...);\n``explanation`` and the rest from its last answer (carried over when it was not asked)."
      },
      "ChangeAccepted": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "evaluation": {
            "$ref": "#/components/schemas/Evaluation"
          },
          "card": {
            "type": "string",
            "title": "Card",
            "description": "path of the card"
          },
          "events": {
            "type": "string",
            "title": "Events",
            "description": "path of the council's event stream"
          }
        },
        "type": "object",
        "required": [
          "id",
          "evaluation",
          "card",
          "events"
        ],
        "title": "ChangeAccepted",
        "description": "``202``: the change is stored and queued; its evaluation runs in the background."
      },
      "ChangeCard": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "window": {
            "$ref": "#/components/schemas/Window"
          },
          "environment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Environment"
              },
              {
                "type": "null"
              }
            ]
          },
          "change_class": {
            "$ref": "#/components/schemas/ChangeClass"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "author": {
            "type": "string",
            "title": "Author"
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time",
            "title": "Submitted At"
          },
          "content_version": {
            "type": "integer",
            "title": "Content Version"
          },
          "declared_surfaces": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Declared Surfaces"
          },
          "links": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Links"
          },
          "surfaces": {
            "items": {
              "$ref": "#/components/schemas/ChangeSurface"
            },
            "type": "array",
            "title": "Surfaces"
          },
          "evaluation": {
            "$ref": "#/components/schemas/Evaluation"
          },
          "outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Outcome"
              },
              {
                "type": "null"
              }
            ]
          },
          "pairs": {
            "items": {
              "$ref": "#/components/schemas/PairSummary"
            },
            "type": "array",
            "title": "Pairs"
          },
          "override": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Override"
              },
              {
                "type": "null"
              }
            ]
          },
          "suggested_window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Window"
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "type": "string",
            "title": "Body"
          },
          "record": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/HistoryEntry"
            },
            "type": "array",
            "title": "History"
          },
          "overrides": {
            "items": {
              "$ref": "#/components/schemas/Override"
            },
            "type": "array",
            "title": "Overrides"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "kind",
          "window",
          "environment",
          "change_class",
          "status",
          "author",
          "submitted_at",
          "content_version",
          "declared_surfaces",
          "links",
          "surfaces",
          "evaluation",
          "outcome",
          "pairs",
          "body",
          "record",
          "history"
        ],
        "title": "ChangeCard",
        "description": "The card of a change (DESIGN §10): the summary, the text, the newest Decision Record\n(``null`` while there is none), the history of its outcomes and every override, oldest\nfirst. The council's live log is ``GET /api/changes/{id}/events``."
      },
      "ChangeClass": {
        "type": "string",
        "enum": [
          "standard",
          "normal",
          "emergency"
        ],
        "title": "ChangeClass",
        "description": "Fast lane of a change (DESIGN §4); set only by the form or the API, never by Intake."
      },
      "ChangeList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChangeSummary"
            },
            "type": "array",
            "title": "Items"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated"
          },
          "last_seq": {
            "type": "integer",
            "title": "Last Seq"
          }
        },
        "type": "object",
        "required": [
          "items",
          "truncated",
          "last_seq"
        ],
        "title": "ChangeList",
        "description": "Changes whose window meets the range, by window start; ``truncated`` when ``limit`` cut\nthe list. ``last_seq`` is the feed's newest event when the list was read: open\n``/api/events`` with ``last_event_id=<last_seq>`` and no change after the read is missed."
      },
      "ChangeRequest": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Short title, 1-120 characters after trimming."
          },
          "body": {
            "type": "string",
            "title": "Body",
            "description": "Change description, 1-20,000 characters; source text for evidence quotes."
          },
          "kind": {
            "$ref": "#/components/schemas/Kind",
            "description": "Operational kind; affects deterministic priority and policy checks."
          },
          "window": {
            "$ref": "#/components/schemas/RequestWindow"
          },
          "author": {
            "type": "string",
            "title": "Author",
            "description": "Responsible team or integration identity, 1-100 characters after trimming."
          },
          "environment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Environment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target environment; null means unspecified and may pair with either."
          },
          "change_class": {
            "$ref": "#/components/schemas/ChangeClass",
            "default": "normal",
            "description": "Authorized class supplied by a person or integration; never inferred."
          },
          "declared_surfaces": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Declared Surfaces",
            "description": "Up to 20 distinct current canonical entity refs from /api/surfaces."
          },
          "links": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Links",
            "description": "Up to 10 HTTP(S) source links, each at most 2,048 characters."
          },
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id",
            "description": "Optional client UUID. Omit to generate one. A taken UUID returns 409 change_exists."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title",
          "body",
          "kind",
          "window",
          "author"
        ],
        "title": "ChangeRequest",
        "description": "A change request (DESIGN §6): the form and ``POST /api/changes`` share it.\n\nLimits: ``title`` 1-120 characters after trim, ``body`` 1-20 000, ``author`` 1-100 after\ntrim; ``declared_surfaces`` at most 20 distinct entity refs of the current graph; ``links``\nat most 10 ``http(s)`` URLs of at most 2 048 characters each; no text may hold a NUL\ncharacter or a lone surrogate (``invalid_text``). ``id`` is optional: the server makes a\nuuidv7 when it is missing; a client that needs a stable id (the demo and eval on cassettes,\nwhose prompts carry it) sends its own, and a taken one is ``409 change_exists``."
      },
      "ChangeSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "window": {
            "$ref": "#/components/schemas/Window"
          },
          "environment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Environment"
              },
              {
                "type": "null"
              }
            ]
          },
          "change_class": {
            "$ref": "#/components/schemas/ChangeClass"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "author": {
            "type": "string",
            "title": "Author"
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time",
            "title": "Submitted At"
          },
          "content_version": {
            "type": "integer",
            "title": "Content Version"
          },
          "declared_surfaces": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Declared Surfaces"
          },
          "links": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Links"
          },
          "surfaces": {
            "items": {
              "$ref": "#/components/schemas/ChangeSurface"
            },
            "type": "array",
            "title": "Surfaces"
          },
          "evaluation": {
            "$ref": "#/components/schemas/Evaluation"
          },
          "outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Outcome"
              },
              {
                "type": "null"
              }
            ]
          },
          "pairs": {
            "items": {
              "$ref": "#/components/schemas/PairSummary"
            },
            "type": "array",
            "title": "Pairs"
          },
          "override": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Override"
              },
              {
                "type": "null"
              }
            ]
          },
          "suggested_window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Window"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "kind",
          "window",
          "environment",
          "change_class",
          "status",
          "author",
          "submitted_at",
          "content_version",
          "declared_surfaces",
          "links",
          "surfaces",
          "evaluation",
          "outcome",
          "pairs"
        ],
        "title": "ChangeSummary",
        "description": "A change as the calendar shows it; ``override`` — the person's verdict in force, if\nany; ``suggested_window`` — the free window code suggests instead of the change's own, while\nthe newest record suggests one for the change as it is now (active, the same version)."
      },
      "ChangeSurface": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SurfaceSource"
            },
            "type": "array",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "sources"
        ],
        "title": "ChangeSurface",
        "description": "A surface of the change and where it came from: the form, the alias matcher, Intake."
      },
      "DecisionRecord": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "epoch_id": {
            "type": "string",
            "format": "uuid",
            "title": "Epoch Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "content_version": {
            "type": "integer",
            "title": "Content Version"
          },
          "graph_version": {
            "type": "integer",
            "title": "Graph Version"
          },
          "policy_ver": {
            "type": "string",
            "title": "Policy Ver"
          },
          "flags": {
            "items": {
              "$ref": "#/components/schemas/Flag"
            },
            "type": "array",
            "title": "Flags"
          },
          "code_verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "rule": {
            "type": "string",
            "title": "Rule"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Reason"
              },
              {
                "type": "null"
              }
            ]
          },
          "final_verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "chair_tightening": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chair Tightening"
          },
          "chair": {
            "$ref": "#/components/schemas/ChairNote"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "type": "array",
            "title": "Findings"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/PairWarning"
            },
            "type": "array",
            "title": "Warnings"
          },
          "pairs": {
            "items": {
              "$ref": "#/components/schemas/PairDetail"
            },
            "type": "array",
            "title": "Pairs"
          },
          "notes": {
            "additionalProperties": true,
            "type": "object",
            "title": "Notes",
            "description": "Stored audit data including Intake, Challenger and call provenance."
          },
          "suggested_window": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Window"
              },
              {
                "type": "null"
              }
            ]
          },
          "window_search": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WindowSearch"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "epoch_id",
          "created_at",
          "mode",
          "content_version",
          "graph_version",
          "policy_ver",
          "flags",
          "code_verdict",
          "rule",
          "reason",
          "final_verdict",
          "chair_tightening",
          "chair",
          "findings",
          "warnings",
          "pairs",
          "notes"
        ],
        "title": "DecisionRecord",
        "description": "The newest Change Decision Record (DESIGN §8): the code verdict and its rule, the Chair's\ntightening apart, the final outcome; the pairs with their grounding; ``notes`` is the whole\nrecord as stored (Intake, Challenger, calls, provenance...) for what is not typed here.\n``suggested_window`` is the nearest free window code found when the verdict is about the\nchange's window, ``window_search`` whether code searched one at all (``null``: the verdict\nis not about the window) and how far; the Chair's ``recommended_window`` is its own, older\nidea, and the code's window comes first."
      },
      "Environment": {
        "type": "string",
        "enum": [
          "prod",
          "staging"
        ],
        "title": "Environment",
        "description": "Environment from the form; ``None`` on a change means \"not specified\"."
      },
      "ErrorItem": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field"
          },
          "detail": {
            "type": "string",
            "title": "Detail",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "code"
        ],
        "title": "ErrorItem",
        "description": "One broken rule. ``code`` is what the UI translates; ``field`` is the request field it\nbelongs to (dotted, e.g. ``window.start``), ``null`` for the request as a whole; ``detail``\nis data for the message or for a developer (the offending value, the limit), never a\nsentence to show."
      },
      "Evaluation": {
        "properties": {
          "state": {
            "$ref": "#/components/schemas/EvaluationState"
          },
          "since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Since"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "state"
        ],
        "title": "Evaluation",
        "description": "Where the change's evaluation stands: ``queued`` (stored, waiting for the worker; also\nafter a server stop cut its run, until it runs again), ``running`` (the council is in\nsession), ``done`` (a verdict; the Chair's explanation may still be pending, see the\nrecord's ``chair.status``), ``failed`` (the run stopped before a verdict: a cassette miss,\na limit... it is evaluated again when the server restarts), ``skipped`` (withdrawn or\nexecuted before its verdict)."
      },
      "EvaluationState": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "done",
          "failed",
          "skipped"
        ]
      },
      "EventCode": {
        "description": "The vocabulary above as values: the API's event schema lists them (M9); a test keeps\nthis enum and the table in step.",
        "enum": [
          "change.submitted",
          "change.rescheduled",
          "pipeline.started",
          "intake.done",
          "intake.failed",
          "intake.skipped",
          "surfaces.resolved",
          "symbolic.done",
          "judge.done",
          "judge.failed",
          "judge.skipped",
          "challenger.done",
          "challenger.failed",
          "challenger.skipped",
          "candidates.recheck",
          "pair.resolved",
          "decision",
          "chair.done",
          "chair.failed",
          "window.suggested",
          "collision",
          "epoch.done",
          "notification.sent",
          "notification.failed",
          "status.changed",
          "policy.applied",
          "change.overridden",
          "evaluation.skipped",
          "pipeline.done",
          "pipeline.error"
        ],
        "title": "EventCode",
        "type": "string"
      },
      "ExternalId": {
        "type": "string",
        "maxLength": 200,
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,199}$"
      },
      "FeedEvent": {
        "description": "One row of ``agent_events`` (DESIGN §8): the ``data`` of an unnamed SSE message whose\n``id`` is ``seq``. ``seq`` grows in commit order: resume with ``Last-Event-ID``.",
        "properties": {
          "seq": {
            "title": "Seq",
            "type": "integer"
          },
          "event": {
            "$ref": "#/components/schemas/EventCode"
          },
          "change_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Id"
          },
          "epoch_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Epoch Id"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          }
        },
        "required": [
          "seq",
          "event",
          "change_id",
          "epoch_id",
          "payload",
          "created_at"
        ],
        "title": "FeedEvent",
        "type": "object"
      },
      "Finding": {
        "properties": {
          "rule": {
            "type": "string",
            "title": "Rule"
          },
          "reason": {
            "$ref": "#/components/schemas/Reason"
          },
          "partner_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Id"
          },
          "detail": {
            "type": "string",
            "title": "Detail",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "rule",
          "reason"
        ],
        "title": "Finding",
        "description": "A rule condition that held; the deciding one comes first."
      },
      "Flag": {
        "type": "string",
        "enum": [
          "unknown_surface",
          "degraded_mode",
          "too_many",
          "no_surface"
        ]
      },
      "GraphEdge": {
        "properties": {
          "src": {
            "type": "string",
            "title": "Src"
          },
          "dst": {
            "type": "string",
            "title": "Dst"
          },
          "type": {
            "type": "string",
            "enum": [
              "hard",
              "soft",
              "shares_infra"
            ],
            "title": "Type"
          },
          "via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Via"
          }
        },
        "type": "object",
        "required": [
          "src",
          "dst",
          "type"
        ],
        "title": "GraphEdge",
        "description": "``src`` depends on ``dst`` (hard, soft); ``shares_infra`` is undirected, ``via`` the\nshared Resource."
      },
      "GroundingRef": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "change",
              "edge",
              "surface"
            ],
            "title": "Kind"
          },
          "ref_id": {
            "type": "string",
            "title": "Ref Id"
          },
          "quote": {
            "type": "string",
            "title": "Quote",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "kind",
          "ref_id"
        ],
        "title": "GroundingRef",
        "description": "A reference a model gave: ``change`` (UUID, verbatim ``quote`` of its text), ``edge``\n(``edge-…``, quote ``src→dst``) or ``surface`` (its entity ref)."
      },
      "HistoryEntry": {
        "properties": {
          "record_id": {
            "type": "string",
            "format": "uuid",
            "title": "Record Id"
          },
          "epoch_id": {
            "type": "string",
            "format": "uuid",
            "title": "Epoch Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "code_verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "rule": {
            "type": "string",
            "title": "Rule"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Reason"
              },
              {
                "type": "null"
              }
            ]
          },
          "final_verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "before": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Verdict"
              },
              {
                "type": "null"
              }
            ]
          },
          "cause": {
            "$ref": "#/components/schemas/Cause"
          }
        },
        "type": "object",
        "required": [
          "record_id",
          "epoch_id",
          "created_at",
          "code_verdict",
          "rule",
          "reason",
          "final_verdict",
          "before",
          "cause"
        ],
        "title": "HistoryEntry",
        "description": "One evaluation or recount of the change, oldest first: the line «changed at 19:10\nbecause of M» of the card."
      },
      "IncomingChange": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source",
            "description": "Stable integration namespace, for example ci-orders."
          },
          "external_id": {
            "$ref": "#/components/schemas/ExternalId",
            "description": "Stable rollout or ticket revision, not a delivery attempt id. Case-sensitive."
          },
          "change": {
            "$ref": "#/components/schemas/IntegrationChange"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source",
          "external_id",
          "change"
        ],
        "title": "IncomingChange",
        "description": "An immutable external revision. Reuse this identity for every delivery retry."
      },
      "Info": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version"
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "llm": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Llm",
            "description": "Public adapter and per-role model provenance; no credentials."
          },
          "graph_version": {
            "type": "integer",
            "title": "Graph Version"
          },
          "auth": {
            "type": "string",
            "enum": [
              "token",
              "loopback"
            ],
            "title": "Auth"
          },
          "max_window_days": {
            "type": "integer",
            "title": "Max Window Days"
          },
          "last_seq": {
            "type": "integer",
            "title": "Last Seq"
          }
        },
        "type": "object",
        "required": [
          "version",
          "mode",
          "llm",
          "graph_version",
          "auth",
          "max_window_days",
          "last_seq"
        ],
        "title": "Info",
        "description": "What this server is: version, rollout mode, where the roles' answers come from\n(``llm``: an adapter, a cassette suite, or ``scripted`` stand-ins that are not model\noutput), the graph version, how requests are authorized (``token`` or ``loopback``), and\nthe feed's newest ``seq`` (a stream opened from it misses nothing after this answer)."
      },
      "IntegrationAccepted": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "external_id": {
            "type": "string",
            "title": "External Id"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "card": {
            "type": "string",
            "title": "Card"
          },
          "events": {
            "type": "string",
            "title": "Events"
          },
          "duplicate": {
            "type": "boolean",
            "title": "Duplicate",
            "description": "True for a previously accepted identical request."
          }
        },
        "type": "object",
        "required": [
          "source",
          "external_id",
          "id",
          "card",
          "events",
          "duplicate"
        ],
        "title": "IntegrationAccepted"
      },
      "IntegrationChange": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Short title, 1-120 characters after trimming."
          },
          "body": {
            "type": "string",
            "title": "Body",
            "description": "Change description, 1-20,000 characters; source text for evidence quotes."
          },
          "kind": {
            "$ref": "#/components/schemas/Kind",
            "description": "Operational kind; affects deterministic priority and policy checks."
          },
          "window": {
            "$ref": "#/components/schemas/RequestWindow"
          },
          "author": {
            "type": "string",
            "title": "Author",
            "description": "Responsible team or integration identity, 1-100 characters after trimming."
          },
          "environment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Environment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target environment; null means unspecified and may pair with either."
          },
          "change_class": {
            "$ref": "#/components/schemas/ChangeClass",
            "default": "normal",
            "description": "Authorized class supplied by a person or integration; never inferred."
          },
          "declared_surfaces": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Declared Surfaces",
            "description": "Up to 20 distinct current canonical entity refs from /api/surfaces."
          },
          "links": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Links",
            "description": "Up to 10 HTTP(S) source links, each at most 2,048 characters."
          },
          "id": {
            "type": "null",
            "title": "Id",
            "description": "Omit: the server assigns the calendar id."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title",
          "body",
          "kind",
          "window",
          "author"
        ],
        "title": "IntegrationChange",
        "description": "A normal change request whose id is assigned by the server."
      },
      "IntegrationReference": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "external_id": {
            "type": "string",
            "title": "External Id"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "card": {
            "type": "string",
            "title": "Card"
          },
          "events": {
            "type": "string",
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "source",
          "external_id",
          "id",
          "card",
          "events"
        ],
        "title": "IntegrationReference",
        "description": "The durable external identity and the calendar change it created."
      },
      "JudgeAnswer": {
        "properties": {
          "label": {
            "type": "string",
            "enum": [
              "conflict",
              "false_overlap",
              "no_conflict"
            ],
            "title": "Label"
          },
          "conflict_type": {
            "type": "string",
            "title": "Conflict Type"
          },
          "severity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Severity"
              },
              {
                "type": "null"
              }
            ]
          },
          "rationale": {
            "type": "string",
            "title": "Rationale",
            "default": ""
          },
          "grounding": {
            "items": {
              "$ref": "#/components/schemas/GroundingRef"
            },
            "type": "array",
            "title": "Grounding"
          }
        },
        "type": "object",
        "required": [
          "label",
          "conflict_type"
        ],
        "title": "JudgeAnswer"
      },
      "Kind": {
        "type": "string",
        "enum": [
          "experiment",
          "deploy",
          "migration",
          "maintenance",
          "freeze"
        ],
        "title": "Kind",
        "description": "What a change does, in ``yields`` priority order, lowest first.\n\n``freeze > maintenance > migration > deploy > experiment`` (DESIGN §6 п.4). The list is\nclosed: it is the priority order itself."
      },
      "LoginRequest": {
        "properties": {
          "username": {
            "type": "string",
            "maxLength": 64,
            "minLength": 3,
            "title": "Username"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 16,
            "format": "password",
            "title": "Password",
            "writeOnly": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "title": "LoginRequest"
      },
      "Mode": {
        "type": "string",
        "enum": [
          "shadow",
          "advisory",
          "gate"
        ],
        "title": "Mode",
        "description": "Rollout phase (DESIGN §4): shadow and advisory never block, gate does."
      },
      "Outcome": {
        "properties": {
          "record_id": {
            "type": "string",
            "format": "uuid",
            "title": "Record Id"
          },
          "epoch_id": {
            "type": "string",
            "format": "uuid",
            "title": "Epoch Id"
          },
          "decided_at": {
            "type": "string",
            "format": "date-time",
            "title": "Decided At"
          },
          "mode": {
            "$ref": "#/components/schemas/Mode"
          },
          "code_verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "rule": {
            "type": "string",
            "title": "Rule",
            "description": "R0-R11 of DESIGN §8"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Reason"
              },
              {
                "type": "null"
              }
            ]
          },
          "final_verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "tightened": {
            "type": "boolean",
            "title": "Tightened",
            "description": "the Chair's tightening is in force"
          },
          "flags": {
            "items": {
              "$ref": "#/components/schemas/Flag"
            },
            "type": "array",
            "title": "Flags"
          },
          "before": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Verdict"
              },
              {
                "type": "null"
              }
            ],
            "description": "the outcome before this epoch"
          },
          "cause": {
            "$ref": "#/components/schemas/Cause"
          },
          "retroactive": {
            "type": "boolean",
            "title": "Retroactive",
            "description": "another change's epoch moved this outcome (retroactive red or green)"
          }
        },
        "type": "object",
        "required": [
          "record_id",
          "epoch_id",
          "decided_at",
          "mode",
          "code_verdict",
          "rule",
          "reason",
          "final_verdict",
          "tightened",
          "flags",
          "before",
          "cause",
          "retroactive"
        ],
        "title": "Outcome",
        "description": "The newest Decision Record in short: what the calendar paints."
      },
      "OutcomeMove": {
        "properties": {
          "change_id": {
            "type": "string",
            "format": "uuid",
            "title": "Change Id"
          },
          "before": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Verdict"
              },
              {
                "type": "null"
              }
            ]
          },
          "after": {
            "$ref": "#/components/schemas/Verdict"
          }
        },
        "type": "object",
        "required": [
          "change_id",
          "before",
          "after"
        ],
        "title": "OutcomeMove"
      },
      "Override": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "change_id": {
            "type": "string",
            "format": "uuid",
            "title": "Change Id"
          },
          "record_id": {
            "type": "string",
            "format": "uuid",
            "title": "Record Id"
          },
          "verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "over": {
            "$ref": "#/components/schemas/Verdict"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "author": {
            "type": "string",
            "title": "Author"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "in_force": {
            "type": "boolean",
            "title": "In Force"
          }
        },
        "type": "object",
        "required": [
          "id",
          "change_id",
          "record_id",
          "verdict",
          "over",
          "reason",
          "author",
          "created_at",
          "in_force"
        ],
        "title": "Override",
        "description": "A person's verdict over the service's: ``over`` is the final verdict of ``record_id``\nwhen it was given. ``in_force``: it still stands — the newest override of the change, and\nthe service's verdict has not moved since; otherwise it lapsed (kept for the record). It\nnever changes the outcome: the calendar and ``decision()`` keep the service's verdict."
      },
      "OverrideRequest": {
        "properties": {
          "verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "author": {
            "type": "string",
            "title": "Author"
          },
          "record_id": {
            "type": "string",
            "format": "uuid",
            "title": "Record Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "verdict",
          "reason",
          "author",
          "record_id"
        ],
        "title": "OverrideRequest",
        "description": "A person's verdict over the service's, with a mandatory reason (DESIGN §4 M5).\n\n``record_id`` is the Decision Record the person saw (``ChangeCard.record.id``): the newest,\nor ``409 record_outdated``. ``verdict`` differs from that record's final verdict\n(``409 verdict_unchanged``). ``reason`` 1-2 000 characters after trim (``reason_length``),\n``author`` 1-100 (``author_length``). The override is logged and shown; it changes neither\nthe verdict nor anyone's recount."
      },
      "OwnerState": {
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "owner",
              "bearer",
              "loopback"
            ],
            "title": "Mode"
          },
          "setup_required": {
            "type": "boolean",
            "title": "Setup Required"
          },
          "registration_enabled": {
            "type": "boolean",
            "title": "Registration Enabled"
          },
          "user": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OwnerUser"
              },
              {
                "type": "null"
              }
            ]
          },
          "csrf_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Csrf Token"
          }
        },
        "type": "object",
        "required": [
          "mode",
          "setup_required",
          "registration_enabled"
        ],
        "title": "OwnerState"
      },
      "OwnerUser": {
        "properties": {
          "username": {
            "type": "string",
            "title": "Username"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          }
        },
        "type": "object",
        "required": [
          "username",
          "display_name"
        ],
        "title": "OwnerUser"
      },
      "PairDetail": {
        "properties": {
          "pair_id": {
            "type": "string",
            "title": "Pair Id"
          },
          "partner": {
            "$ref": "#/components/schemas/Partner"
          },
          "yields": {
            "type": "boolean",
            "title": "Yields",
            "description": "this change yields to the partner"
          },
          "state": {
            "type": "string",
            "title": "State",
            "description": "conflict(high), false_overlap, no_conflict, unresolved(...)"
          },
          "sym_severity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Severity"
              },
              {
                "type": "null"
              }
            ]
          },
          "route": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Route"
              },
              {
                "type": "null"
              }
            ]
          },
          "other_routes": {
            "type": "integer",
            "title": "Other Routes",
            "default": 0
          },
          "judge": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JudgeAnswer"
              },
              {
                "type": "null"
              }
            ]
          },
          "judge_status": {
            "type": "string",
            "title": "Judge Status",
            "description": "ok, cache, failed, stored, none"
          },
          "veto": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PairVeto"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "items": {
              "$ref": "#/components/schemas/PairNote"
            },
            "type": "array",
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "pair_id",
          "partner",
          "yields",
          "state",
          "sym_severity",
          "route",
          "judge_status"
        ],
        "title": "PairDetail",
        "description": "A pair in the Decision Record: the judge's answer with its grounding, the veto, notes."
      },
      "PairDispute": {
        "properties": {
          "pair_id": {
            "type": "string",
            "title": "Pair Id"
          },
          "reason": {
            "type": "string",
            "enum": [
              "window_disjoint",
              "text_scope"
            ],
            "title": "Reason"
          },
          "grounding": {
            "items": {
              "$ref": "#/components/schemas/GroundingRef"
            },
            "type": "array",
            "title": "Grounding"
          }
        },
        "type": "object",
        "required": [
          "pair_id",
          "reason",
          "grounding"
        ],
        "title": "PairDispute"
      },
      "PairNote": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "detail": {
            "type": "string",
            "title": "Detail",
            "default": ""
          },
          "dispute": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PairDispute"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "code"
        ],
        "title": "PairNote",
        "description": "How code reached the pair's state (``freeze_pair``, ``dispute_applied``...)."
      },
      "PairSummary": {
        "properties": {
          "pair_id": {
            "type": "string",
            "title": "Pair Id"
          },
          "partner": {
            "$ref": "#/components/schemas/Partner"
          },
          "yields": {
            "type": "boolean",
            "title": "Yields",
            "description": "this change yields to the partner"
          },
          "state": {
            "type": "string",
            "title": "State",
            "description": "conflict(high), false_overlap, no_conflict, unresolved(...)"
          },
          "sym_severity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Severity"
              },
              {
                "type": "null"
              }
            ]
          },
          "route": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Route"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "pair_id",
          "partner",
          "yields",
          "state",
          "sym_severity",
          "route"
        ],
        "title": "PairSummary",
        "description": "A pair of the change as of its newest record: enough for the calendar's tooltip."
      },
      "PairVeto": {
        "properties": {
          "pair_id": {
            "type": "string",
            "title": "Pair Id"
          },
          "grounding": {
            "items": {
              "$ref": "#/components/schemas/GroundingRef"
            },
            "type": "array",
            "title": "Grounding"
          }
        },
        "type": "object",
        "required": [
          "pair_id",
          "grounding"
        ],
        "title": "PairVeto"
      },
      "PairWarning": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "partner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Partner Id"
          },
          "state": {
            "type": "string",
            "title": "State"
          }
        },
        "type": "object",
        "required": [
          "code",
          "partner_id",
          "state"
        ],
        "title": "PairWarning",
        "description": "R11 warnings: ``conflict_low``, ``disputed``, ``partner_yields``."
      },
      "Partner": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "author": {
            "type": "string",
            "title": "Author"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "kind",
          "author",
          "status"
        ],
        "title": "Partner"
      },
      "Reason": {
        "type": "string",
        "enum": [
          "emergency_bypass",
          "blackout",
          "maintenance_window",
          "conflict_high",
          "disputed_high",
          "veto",
          "degraded_mode",
          "too_many",
          "unknown_surface",
          "no_surface",
          "conflict_medium",
          "unresolved"
        ],
        "title": "Reason",
        "description": "Why ``decision()`` gave its verdict: the first rule that held, in rule order."
      },
      "RecommendedWindow": {
        "properties": {
          "start": {
            "type": "string",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "title": "End"
          }
        },
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "title": "RecommendedWindow"
      },
      "RequestWindow": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "title": "End"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "title": "RequestWindow",
        "description": "``[start, end)``; both ISO-8601 with a time zone, ``start < end``, at most\n``MAX_WINDOW_DAYS`` long (31 by default), within the years 1970-2999 in UTC."
      },
      "RescheduleRequest": {
        "properties": {
          "record_id": {
            "type": "string",
            "format": "uuid",
            "title": "Record Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "record_id"
        ],
        "title": "RescheduleRequest",
        "description": "Move the change to the window its Decision Record suggests (``suggested_window``).\n\n``record_id`` is the record the person saw (``ChangeCard.record.id``): the newest, of the\nchange's current version, or ``409 record_outdated``. The change gets a new version in that\nwindow (``content_version`` + 1, the same id) and is evaluated again in the background."
      },
      "Rescheduled": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "content_version": {
            "type": "integer",
            "title": "Content Version"
          },
          "window": {
            "$ref": "#/components/schemas/Window"
          },
          "previous": {
            "$ref": "#/components/schemas/Window"
          },
          "record_id": {
            "type": "string",
            "format": "uuid",
            "title": "Record Id"
          },
          "evaluation": {
            "$ref": "#/components/schemas/Evaluation"
          },
          "card": {
            "type": "string",
            "title": "Card",
            "description": "path of the card"
          },
          "events": {
            "type": "string",
            "title": "Events",
            "description": "path of the council's event stream"
          }
        },
        "type": "object",
        "required": [
          "id",
          "content_version",
          "window",
          "previous",
          "record_id",
          "evaluation",
          "card",
          "events"
        ],
        "title": "Rescheduled",
        "description": "``202``: the change is in its new window as version ``content_version`` and queued for\nevaluation; ``previous`` is where it was, ``record_id`` the record whose window it took."
      },
      "Route": {
        "properties": {
          "link": {
            "type": "string",
            "title": "Link"
          },
          "direction": {
            "type": "string",
            "title": "Direction"
          },
          "hops": {
            "type": "integer",
            "title": "Hops"
          },
          "path": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Path"
          }
        },
        "type": "object",
        "required": [
          "link",
          "direction",
          "hops",
          "path"
        ],
        "title": "Route",
        "description": "How the pair was found: ``link`` same_surface, hard or shares_infra; ``direction`` of the\nwalk from this change; ``path`` of entity refs, from this change's surface."
      },
      "SetupRequest": {
        "properties": {
          "username": {
            "type": "string",
            "maxLength": 64,
            "minLength": 3,
            "title": "Username"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 16,
            "format": "password",
            "title": "Password",
            "writeOnly": true
          },
          "display_name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Display Name"
          },
          "password_confirm": {
            "type": "string",
            "maxLength": 128,
            "minLength": 16,
            "format": "password",
            "title": "Password Confirm",
            "writeOnly": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "username",
          "password",
          "display_name",
          "password_confirm"
        ],
        "title": "SetupRequest"
      },
      "Severity": {
        "type": "string",
        "enum": [
          "low",
          "medium",
          "high"
        ],
        "title": "Severity",
        "description": "Severity of a pair, ``low < medium < high``."
      },
      "Source": {
        "type": "string",
        "maxLength": 64,
        "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
      },
      "Status": {
        "type": "string",
        "enum": [
          "active",
          "withdrawn",
          "executed"
        ],
        "title": "Status",
        "description": "Lifecycle of a change (DESIGN §6). Set by a person or a source, never by ``decision()``."
      },
      "StatusChange": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "withdrawn",
              "executed"
            ],
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "StatusChange",
        "description": "Withdraw or execute an active change; its partners are recounted (DESIGN §9)."
      },
      "StatusChanged": {
        "properties": {
          "change_id": {
            "type": "string",
            "format": "uuid",
            "title": "Change Id"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "epoch_id": {
            "type": "string",
            "format": "uuid",
            "title": "Epoch Id"
          },
          "changes": {
            "items": {
              "$ref": "#/components/schemas/OutcomeMove"
            },
            "type": "array",
            "title": "Changes"
          },
          "chair_pending": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Chair Pending"
          }
        },
        "type": "object",
        "required": [
          "change_id",
          "status",
          "epoch_id",
          "changes"
        ],
        "title": "StatusChanged",
        "description": "The recount a status change caused: the partners whose final outcome moved, by code.\nThe Chair does not hold the answer up: ``chair_pending`` lists the changes whose Chair the\nworker asks next (their explanation, which may still tighten an approve to escalate; such\na move arrives as a ``decision`` and a ``collision`` on the feed)."
      },
      "StreamEnd": {
        "description": "The ``data`` of the named SSE events ``done`` and ``error``.\n\n``done`` ends a change's stream when its council session is over: ``code`` ``evaluated``\n(``verdict`` and ``final``; ``chair_pending`` when the Chair's explanation is still to come)\nor ``skipped`` (withdrawn or executed before its verdict; ``status`` says which). ``error``\nends a stream that cannot go on: ``pipeline_error`` (the run stopped before a verdict,\n``detail`` says why), ``interrupted`` (the server stopped during the run; it is evaluated\nagain after the restart, and a stream opened then follows the new run) or ``stream_failed``\n(the server could not read the feed; reconnect).",
        "properties": {
          "code": {
            "enum": [
              "evaluated",
              "skipped",
              "pipeline_error",
              "interrupted",
              "stream_failed"
            ],
            "title": "Code",
            "type": "string"
          },
          "change_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Change Id"
          },
          "verdict": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Verdict"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "final": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Verdict"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Status"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "chair_pending": {
            "default": false,
            "title": "Chair Pending",
            "type": "boolean"
          },
          "detail": {
            "default": "",
            "title": "Detail",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "title": "StreamEnd",
        "type": "object"
      },
      "Surface": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "kind": {
            "type": "string",
            "enum": [
              "component",
              "resource"
            ],
            "title": "Kind"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Aliases"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "kind",
          "name",
          "aliases"
        ],
        "title": "Surface",
        "description": "A live surface (DESIGN §6): a Backstage Component or Resource. ``system`` is the ``ref``\nof the system it belongs to (``spec.system``), ``null`` when the catalog gives none."
      },
      "SurfaceCatalog": {
        "properties": {
          "graph_version": {
            "type": "integer",
            "title": "Graph Version"
          },
          "surfaces": {
            "items": {
              "$ref": "#/components/schemas/Surface"
            },
            "type": "array",
            "title": "Surfaces"
          },
          "edges": {
            "items": {
              "$ref": "#/components/schemas/GraphEdge"
            },
            "type": "array",
            "title": "Edges"
          },
          "systems": {
            "items": {
              "$ref": "#/components/schemas/System"
            },
            "type": "array",
            "title": "Systems"
          }
        },
        "type": "object",
        "required": [
          "graph_version",
          "surfaces",
          "edges"
        ],
        "title": "SurfaceCatalog",
        "description": "The live graph: the calendar's rows and the paths its tooltips name. Version 0 and no\nsurfaces: no catalog imported yet. ``systems``, in the catalog's order, group the rows;\nthey are not graph, and an import that changes only them keeps ``graph_version``."
      },
      "SurfaceSource": {
        "type": "string",
        "enum": [
          "declared",
          "alias",
          "intake"
        ]
      },
      "System": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "title_ru": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title Ru"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "name",
          "title"
        ],
        "title": "System",
        "description": "A Backstage System: a product the calendar groups surfaces by (DESIGN §11). Not graph.\n``title`` is ``metadata.title`` (the name when there is none), ``title_ru`` the annotation\n``deconflictor.ru/title-ru`` (``null``: show ``title``)."
      },
      "Verdict": {
        "type": "string",
        "enum": [
          "approve",
          "escalate",
          "reject"
        ],
        "title": "Verdict",
        "description": "Verdict on a change, ``approve < escalate < reject``: ``max()`` is the stricter one."
      },
      "Window": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "title": "End"
          }
        },
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "title": "Window"
      },
      "WindowSearch": {
        "properties": {
          "horizon_days": {
            "type": "integer",
            "title": "Horizon Days"
          },
          "found": {
            "type": "boolean",
            "title": "Found"
          }
        },
        "type": "object",
        "required": [
          "horizon_days",
          "found"
        ],
        "title": "WindowSearch",
        "description": "Code searched a free window for the change (its verdict is about its window): how far\nafter the change's start it looked, and whether it found one (``suggested_window``)."
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "description": "Shared DECONFLICTOR_API_TOKEN: enter only the token, without the Bearer prefix. Required in company deployments. With no configured token, access is limited to loopback, a loopback Host and a same-origin Origin. SSE also supports access_token for browser EventSource; avoid it in other clients and redact it in proxy logs. The documentation does not persist authorization across a browser reload.",
        "scheme": "bearer"
      },
      "OwnerSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-deconflictor_session",
        "description": "Owner mode only: HttpOnly, Secure, SameSite=Strict, Path=/, no Domain. Mutations also require the exact configured Origin and X-CSRF-Token from GET /api/auth/session. It never authenticates integration webhooks."
      },
      "OwnerBootstrap": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Deconflictor-Bootstrap",
        "description": "Operator secret supplied separately from the company API token. Read from DECONFLICTOR_OWNER_BOOTSTRAP_TOKEN_FILE; never put it in a URL. Usable only before the singleton owner is created."
      }
    }
  },
  "servers": [
    {
      "url": ".",
      "description": "This Deconflictor installation"
    }
  ],
  "tags": [
    {
      "name": "changes",
      "description": "Submit, inspect and manage durable change requests."
    },
    {
      "name": "integrations",
      "description": "Normalized CI/CD and ticket webhooks with durable identity."
    },
    {
      "name": "catalog",
      "description": "Read the imported service graph and server provenance."
    },
    {
      "name": "events",
      "description": "Resume durable event streams by sequence number (SSE)."
    },
    {
      "name": "Owner access",
      "description": "Optional private browser account."
    }
  ]
}
