{
  "components": {
    "schemas": {
      "AccessOnly": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "expires_in"
        ],
        "title": "AccessOnly",
        "type": "object"
      },
      "AdvanceRequest": {
        "description": "`advance_record(entity, guid, outlet)` analog.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "outlet": {
            "description": "Outlet name (ok, error, or conditional name)",
            "title": "Outlet",
            "type": "string"
          }
        },
        "required": [
          "outlet"
        ],
        "title": "AdvanceRequest",
        "type": "object"
      },
      "AdvanceResponse": {
        "properties": {
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "entity": {
            "title": "Entity",
            "type": "string"
          },
          "from_step": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Step"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "outlet": {
            "title": "Outlet",
            "type": "string"
          },
          "to_step": {
            "title": "To Step",
            "type": "integer"
          }
        },
        "required": [
          "entity",
          "guid",
          "from_step",
          "to_step",
          "outlet"
        ],
        "title": "AdvanceResponse",
        "type": "object"
      },
      "AgentGrantSpec": {
        "properties": {
          "capabilities": {
            "items": {
              "type": "string"
            },
            "title": "Capabilities",
            "type": "array"
          },
          "salescontract": {
            "title": "Salescontract",
            "type": "integer"
          }
        },
        "required": [
          "salescontract"
        ],
        "title": "AgentGrantSpec",
        "type": "object"
      },
      "AgentTokenRequest": {
        "properties": {
          "email": {
            "default": "agent@entherium.dev",
            "title": "Email",
            "type": "string"
          },
          "expires_days": {
            "default": 90,
            "maximum": 365.0,
            "minimum": 1.0,
            "title": "Expires Days",
            "type": "integer"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "grants": {
            "items": {
              "$ref": "#/components/schemas/AgentGrantSpec"
            },
            "title": "Grants",
            "type": "array"
          },
          "revoke_prior": {
            "default": true,
            "title": "Revoke Prior",
            "type": "boolean"
          }
        },
        "required": [
          "grants"
        ],
        "title": "AgentTokenRequest",
        "type": "object"
      },
      "Alert": {
        "properties": {
          "kind": {
            "enum": [
              "zombie",
              "pool",
              "fail_rate",
              "orchestrator",
              "concurrency",
              "api_sunset"
            ],
            "title": "Kind",
            "type": "string"
          },
          "level": {
            "enum": [
              "warn",
              "critical"
            ],
            "title": "Level",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "level",
          "kind",
          "text"
        ],
        "title": "Alert",
        "type": "object"
      },
      "ArticleCostRow": {
        "description": "Per-article cost = direct spend + amortized collect share (SPEC-107 §3.6).",
        "properties": {
          "amortized_collect_micro_usd": {
            "title": "Amortized Collect Micro Usd",
            "type": "integer"
          },
          "cost_micro_usd": {
            "title": "Cost Micro Usd",
            "type": "integer"
          },
          "direct_micro_usd": {
            "title": "Direct Micro Usd",
            "type": "integer"
          },
          "generated_article_id": {
            "title": "Generated Article Id",
            "type": "integer"
          }
        },
        "required": [
          "generated_article_id",
          "direct_micro_usd",
          "amortized_collect_micro_usd",
          "cost_micro_usd"
        ],
        "title": "ArticleCostRow",
        "type": "object"
      },
      "ArticleMissingImages": {
        "description": "An article whose image plan is not fully realized (SPEC-095 §3.4).\n\n``planned`` = items in the step_13 plan, ``generated`` = items that got an\n``image_url`` — the visible trail of imagegen quota failures.",
        "properties": {
          "article_guid": {
            "title": "Article Guid",
            "type": "integer"
          },
          "generated": {
            "title": "Generated",
            "type": "integer"
          },
          "planned": {
            "title": "Planned",
            "type": "integer"
          },
          "sc_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sc Id"
          }
        },
        "required": [
          "article_guid",
          "planned",
          "generated"
        ],
        "title": "ArticleMissingImages",
        "type": "object"
      },
      "AuditEvent": {
        "description": "One audit-trail entry, projected from lifecycle_log (SPEC-014 §3.1.6).",
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "actor": {
            "title": "Actor",
            "type": "string"
          },
          "field_changed": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field Changed"
          },
          "lcstep": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lcstep"
          },
          "new_value": {
            "title": "New Value"
          },
          "old_value": {
            "title": "Old Value"
          },
          "timestamp": {
            "format": "date-time",
            "title": "Timestamp",
            "type": "string"
          }
        },
        "required": [
          "timestamp",
          "action",
          "actor"
        ],
        "title": "AuditEvent",
        "type": "object"
      },
      "AuthoritySnapshotRead": {
        "description": "SPEC-086 — latest authority signal (Ahrefs DR / OPR) for a domain.\n\nExposes `seo_authority_snapshot` (collected weekly) through the dashboard so\nthe weekly report's Authority section is assemblable via the API. `raw_json`\nand `niche` are intentionally omitted (internal / not report fields).",
        "properties": {
          "domain": {
            "title": "Domain",
            "type": "string"
          },
          "dr": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dr"
          },
          "opr": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opr"
          },
          "opr_rank": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opr Rank"
          },
          "ref_domains": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ref Domains"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "snapshot_date": {
            "format": "date",
            "title": "Snapshot Date",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "domain",
          "role",
          "source",
          "snapshot_date"
        ],
        "title": "AuthoritySnapshotRead",
        "type": "object"
      },
      "BackupArtifact": {
        "description": "Freshness of one DR backup artifact (SPEC-072 §8.2).\n\n``newest_at`` = update time of the newest object under the artifact's GCS\nprefix (None if empty/unreadable). ``age_h`` = its age in whole hours.\n``tone`` flips on the same ceiling the DR monitor uses (``BACKUP_MAX_AGE_H``):\nfresh -> good, 1-2x ceiling -> attention, older/missing -> critical.",
        "properties": {
          "age_h": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Age H"
          },
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "newest_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Newest At"
          },
          "tone": {
            "enum": [
              "good",
              "attention",
              "critical"
            ],
            "title": "Tone",
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "tone",
          "detail"
        ],
        "title": "BackupArtifact",
        "type": "object"
      },
      "BackupStatus": {
        "description": "All DR backup artifacts' freshness in one snapshot — the Mini App board.\n\nSource = newest-object timestamps in GCS (`/tma/backups`), the same artifacts\n`infra/dr/monitor.sh` checks. Read-only; ``overall_tone`` is the worst tone.",
        "properties": {
          "artifacts": {
            "items": {
              "$ref": "#/components/schemas/BackupArtifact"
            },
            "title": "Artifacts",
            "type": "array"
          },
          "generated_at": {
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "max_age_h": {
            "title": "Max Age H",
            "type": "integer"
          },
          "overall_tone": {
            "enum": [
              "good",
              "attention",
              "critical"
            ],
            "title": "Overall Tone",
            "type": "string"
          }
        },
        "required": [
          "generated_at",
          "max_age_h",
          "overall_tone",
          "artifacts"
        ],
        "title": "BackupStatus",
        "type": "object"
      },
      "Body_login_api_v1_auth_login_post": {
        "properties": {
          "client_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "client_secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "format": "password",
            "title": "Client Secret"
          },
          "grant_type": {
            "anyOf": [
              {
                "pattern": "^password$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grant Type"
          },
          "password": {
            "format": "password",
            "title": "Password",
            "type": "string"
          },
          "scope": {
            "default": "",
            "title": "Scope",
            "type": "string"
          },
          "username": {
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "username",
          "password"
        ],
        "title": "Body_login_api_v1_auth_login_post",
        "type": "object"
      },
      "BulkBlockedItem": {
        "description": "A row a bulk operation could not touch, with the reason.",
        "properties": {
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "reason"
        ],
        "title": "BulkBlockedItem",
        "type": "object"
      },
      "BulkDeleteRequest": {
        "description": "Body for POST /entities/{name}/bulk-delete (SPEC-014 §3.2.7).",
        "properties": {
          "guids": {
            "items": {
              "type": "integer"
            },
            "title": "Guids",
            "type": "array"
          }
        },
        "required": [
          "guids"
        ],
        "title": "BulkDeleteRequest",
        "type": "object"
      },
      "BulkDeleteResponse": {
        "description": "Result of a bulk-delete — deleted count plus blocked rows (§3.2.7).",
        "properties": {
          "blocked": {
            "items": {
              "$ref": "#/components/schemas/BulkBlockedItem"
            },
            "title": "Blocked",
            "type": "array"
          },
          "deleted": {
            "title": "Deleted",
            "type": "integer"
          }
        },
        "required": [
          "deleted",
          "blocked"
        ],
        "title": "BulkDeleteResponse",
        "type": "object"
      },
      "BulkExportRequest": {
        "description": "Body for POST /entities/{name}/bulk-export (SPEC-014 §3.2.8).\n\n`format` is kept in the schema for forward compatibility; the MVP\naccepts only \"json\" (§11.4).",
        "properties": {
          "format": {
            "const": "json",
            "default": "json",
            "title": "Format",
            "type": "string"
          },
          "guids": {
            "items": {
              "type": "integer"
            },
            "title": "Guids",
            "type": "array"
          }
        },
        "required": [
          "guids"
        ],
        "title": "BulkExportRequest",
        "type": "object"
      },
      "CapabilityChangelog": {
        "description": "The agent read-surface changelog (SPEC-106 Territory B) — single-sourced from app.discovery.",
        "properties": {
          "capability_version": {
            "title": "Capability Version",
            "type": "string"
          },
          "entries": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Entries",
            "type": "array"
          }
        },
        "required": [
          "capability_version",
          "entries"
        ],
        "title": "CapabilityChangelog",
        "type": "object"
      },
      "CatalogEdge": {
        "description": "SPEC-002 §3.1.4 — auto-derived edge from depends_on.",
        "properties": {
          "critical": {
            "default": false,
            "title": "Critical",
            "type": "boolean"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "target": {
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "source",
          "target"
        ],
        "title": "CatalogEdge",
        "type": "object"
      },
      "CatalogEntity": {
        "description": "SPEC-002 §3.1.1 — one node on the architecture map.",
        "properties": {
          "depends_on": {
            "items": {
              "type": "string"
            },
            "title": "Depends On",
            "type": "array"
          },
          "description": {
            "default": "",
            "title": "Description",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "exposes": {
            "items": {
              "$ref": "#/components/schemas/ExposedItem"
            },
            "title": "Exposes",
            "type": "array"
          },
          "health_check": {
            "$ref": "#/components/schemas/HealthCheckConfig"
          },
          "id": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "enum": [
              "context",
              "external",
              "future-service"
            ],
            "title": "Kind",
            "type": "string"
          },
          "links": {
            "$ref": "#/components/schemas/CatalogLinks"
          },
          "owner": {
            "default": "ilya",
            "title": "Owner",
            "type": "string"
          },
          "status": {
            "enum": [
              "implemented",
              "planned",
              "extracted-service"
            ],
            "title": "Status",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "id",
          "display_name",
          "kind",
          "status"
        ],
        "title": "CatalogEntity",
        "type": "object"
      },
      "CatalogLinks": {
        "description": "SPEC-002 §3.1.3 — outbound references.",
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "docs": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Docs"
          },
          "homepage": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Homepage"
          },
          "spec": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec"
          }
        },
        "title": "CatalogLinks",
        "type": "object"
      },
      "CatalogResponse": {
        "description": "SPEC-002 §3.2.1 — payload of GET /architecture/catalog.",
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/CatalogEdge"
            },
            "title": "Edges",
            "type": "array"
          },
          "entities": {
            "items": {
              "$ref": "#/components/schemas/CatalogEntity"
            },
            "title": "Entities",
            "type": "array"
          },
          "system": {
            "$ref": "#/components/schemas/SystemMeta"
          }
        },
        "required": [
          "system",
          "entities",
          "edges"
        ],
        "title": "CatalogResponse",
        "type": "object"
      },
      "ChatMessageListResponse": {
        "description": "Страница переписки.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChatMessageRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "default": 50,
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "default": 0,
            "minimum": 0.0,
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "ChatMessageListResponse",
        "type": "object"
      },
      "ChatMessageRead": {
        "description": "Реплика для чтения — контекст к задаче/дефекту (SPEC-114 §3.5).",
        "properties": {
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author"
          },
          "chat_id": {
            "title": "Chat Id",
            "type": "string"
          },
          "chat_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Name"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "is_full": {
            "title": "Is Full",
            "type": "boolean"
          },
          "redacted": {
            "title": "Redacted",
            "type": "boolean"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "title": "Sent At",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "chat_id",
          "chat_name",
          "author",
          "role",
          "sent_at",
          "text",
          "is_full",
          "redacted"
        ],
        "title": "ChatMessageRead",
        "type": "object"
      },
      "CockpitResponse": {
        "properties": {
          "contract": {
            "$ref": "#/components/schemas/ContractInfo"
          },
          "pipelines": {
            "items": {
              "$ref": "#/components/schemas/PipelineCard"
            },
            "title": "Pipelines",
            "type": "array"
          }
        },
        "required": [
          "contract",
          "pipelines"
        ],
        "title": "CockpitResponse",
        "type": "object"
      },
      "CollectTrigger": {
        "description": "POST /analytics/collect body.",
        "properties": {
          "collect": {
            "default": true,
            "title": "Collect",
            "type": "boolean"
          },
          "date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "with_psi": {
            "default": false,
            "title": "With Psi",
            "type": "boolean"
          }
        },
        "title": "CollectTrigger",
        "type": "object"
      },
      "CollectionRunRead": {
        "properties": {
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "instances_n": {
            "title": "Instances N",
            "type": "integer"
          },
          "run_date": {
            "format": "date",
            "title": "Run Date",
            "type": "string"
          },
          "sources": {
            "additionalProperties": true,
            "title": "Sources",
            "type": "object"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "trigger": {
            "title": "Trigger",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "run_date",
          "started_at",
          "status",
          "trigger",
          "instances_n"
        ],
        "title": "CollectionRunRead",
        "type": "object"
      },
      "ColumnMeta": {
        "description": "Presentation metadata for a single entity column (SPEC-014 §3.1.3).",
        "properties": {
          "editable": {
            "default": true,
            "title": "Editable",
            "type": "boolean"
          },
          "enum_values": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enum Values"
          },
          "fk_display_field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Display Field"
          },
          "fk_target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Target"
          },
          "is_fk": {
            "default": false,
            "title": "Is Fk",
            "type": "boolean"
          },
          "is_pk": {
            "default": false,
            "title": "Is Pk",
            "type": "boolean"
          },
          "json_size_warn": {
            "default": false,
            "title": "Json Size Warn",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "nullable": {
            "title": "Nullable",
            "type": "boolean"
          },
          "type": {
            "enum": [
              "string",
              "integer",
              "bigint",
              "boolean",
              "timestamp",
              "date",
              "json",
              "text",
              "enum",
              "fk"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "nullable"
        ],
        "title": "ColumnMeta",
        "type": "object"
      },
      "CommentCreate": {
        "properties": {
          "body_markdown": {
            "title": "Body Markdown",
            "type": "string"
          },
          "target_guid": {
            "title": "Target Guid",
            "type": "integer"
          },
          "target_kind": {
            "maxLength": 32,
            "title": "Target Kind",
            "type": "string"
          }
        },
        "required": [
          "target_kind",
          "target_guid",
          "body_markdown"
        ],
        "title": "CommentCreate",
        "type": "object"
      },
      "CommentList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CommentRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "CommentList",
        "type": "object"
      },
      "CommentRead": {
        "properties": {
          "author_id": {
            "title": "Author Id",
            "type": "integer"
          },
          "body_markdown": {
            "title": "Body Markdown",
            "type": "string"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "deleted": {
            "title": "Deleted",
            "type": "boolean"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "mentions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Mentions",
            "type": "array"
          },
          "target_guid": {
            "title": "Target Guid",
            "type": "integer"
          },
          "target_kind": {
            "maxLength": 32,
            "title": "Target Kind",
            "type": "string"
          },
          "updatetime": {
            "format": "date-time",
            "title": "Updatetime",
            "type": "string"
          }
        },
        "required": [
          "target_kind",
          "target_guid",
          "body_markdown",
          "guid",
          "author_id",
          "mentions",
          "deleted",
          "createtime",
          "updatetime"
        ],
        "title": "CommentRead",
        "type": "object"
      },
      "CommentUpdate": {
        "properties": {
          "body_markdown": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Markdown"
          }
        },
        "title": "CommentUpdate",
        "type": "object"
      },
      "ConcurrencyGauge": {
        "description": "Native-run concurrency from Redis (``native:cc:*``) vs configured caps.",
        "properties": {
          "by_tenant": {
            "items": {
              "$ref": "#/components/schemas/TenantSlot"
            },
            "title": "By Tenant",
            "type": "array"
          },
          "global_cap": {
            "title": "Global Cap",
            "type": "integer"
          },
          "global_in_use": {
            "title": "Global In Use",
            "type": "integer"
          },
          "per_tenant_cap": {
            "title": "Per Tenant Cap",
            "type": "integer"
          }
        },
        "required": [
          "global_in_use",
          "global_cap",
          "per_tenant_cap",
          "by_tenant"
        ],
        "title": "ConcurrencyGauge",
        "type": "object"
      },
      "ConnectionStatus": {
        "description": "A connection's current status — SPEC-015 §3.5.4.",
        "properties": {
          "credential_status": {
            "title": "Credential Status",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "health": {
            "title": "Health",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "last_checked_at": {
            "title": "Last Checked At",
            "type": "string"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          }
        },
        "required": [
          "id",
          "kind",
          "enabled",
          "credential_status",
          "health",
          "last_checked_at"
        ],
        "title": "ConnectionStatus",
        "type": "object"
      },
      "ContractBatch": {
        "description": "Per-contract generation-batch progress (the SSH+SQL view, served live).",
        "properties": {
          "bodied": {
            "description": "Rows whose article body is generated (len > 200 chars). Native runs never flip status off 'pending', so body length is the done-signal.",
            "title": "Bodied",
            "type": "integer"
          },
          "brand": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand"
          },
          "collect_age_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Age in seconds of the active collect run (None when not collecting).",
            "title": "Collect Age S"
          },
          "collecting": {
            "default": false,
            "description": "A link_ranker (Collect) run is active for this contract right now (entity_guid == sc_guid). False = collect not running (idle or already done).",
            "title": "Collecting",
            "type": "boolean"
          },
          "current_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current step name of the contract's newest ACTIVE generate run (None when nothing is generating for it right now).",
            "title": "Current Step"
          },
          "eta_min": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eta Min"
          },
          "failed": {
            "default": 0,
            "description": "Generate runs for this contract that failed in the last 24h.",
            "title": "Failed",
            "type": "integer"
          },
          "guid": {
            "title": "Guid",
            "type": "string"
          },
          "in_flight": {
            "title": "In Flight",
            "type": "integer"
          },
          "instance": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance"
          },
          "instance_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Public site URL of the attached Hugo instance (base_url), for a direct 'open site' link on the Live-monitor row; None if not attached/known.",
            "title": "Instance Url"
          },
          "live": {
            "description": "Rows with a verified external (published) URL.",
            "title": "Live",
            "type": "integer"
          },
          "pct": {
            "title": "Pct",
            "type": "number"
          },
          "pool": {
            "description": "Total GeneratedArticle rows for this contract.",
            "title": "Pool",
            "type": "integer"
          },
          "remaining": {
            "description": "Generate candidates: rows that have a source URL but no body yet (len <= 200). Drained by the daily run at a per-day cap — NOT blocked on an embeddings/RAG backfill (research is fail-open and never gates generation or publish).",
            "title": "Remaining",
            "type": "integer"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "today": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContractToday"
              },
              {
                "type": "null"
              }
            ],
            "description": "This contract's slice of today's run (None only on pre-#758 servers; the FE falls back to lifetime-only rendering)."
          },
          "velocity_per_min": {
            "title": "Velocity Per Min",
            "type": "number"
          }
        },
        "required": [
          "guid",
          "title",
          "pool",
          "bodied",
          "remaining",
          "live",
          "pct",
          "in_flight",
          "velocity_per_min"
        ],
        "title": "ContractBatch",
        "type": "object"
      },
      "ContractCostRow": {
        "description": "Per-contract cost rollup.",
        "properties": {
          "brave_calls": {
            "title": "Brave Calls",
            "type": "integer"
          },
          "cost_micro_usd": {
            "title": "Cost Micro Usd",
            "type": "integer"
          },
          "runs": {
            "title": "Runs",
            "type": "integer"
          },
          "salescontracts_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Salescontracts Id"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "salescontracts_id",
          "cost_micro_usd",
          "total_tokens",
          "brave_calls",
          "runs"
        ],
        "title": "ContractCostRow",
        "type": "object"
      },
      "ContractInfo": {
        "properties": {
          "env": {
            "enum": [
              "DEV",
              "PROD"
            ],
            "title": "Env",
            "type": "string"
          },
          "guid": {
            "title": "Guid",
            "type": "string"
          },
          "health": {
            "$ref": "#/components/schemas/Health"
          },
          "instance": {
            "title": "Instance",
            "type": "string"
          },
          "lcstep": {
            "title": "Lcstep",
            "type": "integer"
          },
          "paused": {
            "title": "Paused",
            "type": "boolean"
          },
          "refid": {
            "title": "Refid",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "refid",
          "title",
          "instance",
          "env",
          "lcstep",
          "paused",
          "health"
        ],
        "title": "ContractInfo",
        "type": "object"
      },
      "ContractToday": {
        "description": "This contract's slice of TODAY's run (runs created since UTC midnight).\n\nThe Live-monitor row leads with these numbers so a first-time viewer sees\nwhat the CURRENT daily run did for the site — the lifetime cumulative\n(``pool``/``bodied``/``live``) reads as chaos mid-run when it stands alone\n(owner feedback 2026-07-02, Issue #758).",
        "properties": {
          "collect_active": {
            "default": 0,
            "title": "Collect Active",
            "type": "integer"
          },
          "collect_fail": {
            "default": 0,
            "title": "Collect Fail",
            "type": "integer"
          },
          "collect_ok": {
            "default": 0,
            "title": "Collect Ok",
            "type": "integer"
          },
          "failed": {
            "default": 0,
            "description": "Generate runs failed today.",
            "title": "Failed",
            "type": "integer"
          },
          "published_today": {
            "default": 0,
            "description": "Articles that went live today — heuristic: url_external set AND row updated since UTC midnight (publish stamps url_external, bumping updatetime; native publish keeps no dedicated timestamp).",
            "title": "Published Today",
            "type": "integer"
          },
          "queued": {
            "default": 0,
            "description": "Generate runs waiting in queue.",
            "title": "Queued",
            "type": "integer"
          },
          "scheduled": {
            "description": "The contract has at least one run today — i.e. the daily run included it. False rows render in a separate 'not scheduled today' group.",
            "title": "Scheduled",
            "type": "boolean"
          },
          "writing": {
            "default": 0,
            "description": "Generate runs running right now.",
            "title": "Writing",
            "type": "integer"
          },
          "written": {
            "default": 0,
            "description": "Generate runs succeeded today.",
            "title": "Written",
            "type": "integer"
          }
        },
        "required": [
          "scheduled"
        ],
        "title": "ContractToday",
        "type": "object"
      },
      "CostSummaryRow": {
        "description": "One aggregation bucket (by day or contract).",
        "properties": {
          "brave_calls": {
            "title": "Brave Calls",
            "type": "integer"
          },
          "cost_micro_usd": {
            "title": "Cost Micro Usd",
            "type": "integer"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "runs": {
            "title": "Runs",
            "type": "integer"
          },
          "total_tokens": {
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "cost_micro_usd",
          "total_tokens",
          "brave_calls",
          "runs"
        ],
        "title": "CostSummaryRow",
        "type": "object"
      },
      "CronStatus": {
        "properties": {
          "last_run_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run At"
          },
          "last_run_label": {
            "title": "Last Run Label",
            "type": "string"
          },
          "last_run_status": {
            "enum": [
              "ok",
              "warn",
              "fail",
              "unknown"
            ],
            "title": "Last Run Status",
            "type": "string"
          },
          "next_run_at": {
            "format": "date-time",
            "title": "Next Run At",
            "type": "string"
          },
          "next_run_in_seconds": {
            "title": "Next Run In Seconds",
            "type": "integer"
          },
          "paused_sc_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Paused Sc Ids",
            "type": "array"
          },
          "schedule": {
            "title": "Schedule",
            "type": "string"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string"
          }
        },
        "required": [
          "schedule",
          "timezone",
          "next_run_at",
          "next_run_in_seconds",
          "last_run_at",
          "last_run_status",
          "last_run_label",
          "paused_sc_ids"
        ],
        "title": "CronStatus",
        "type": "object"
      },
      "CycleDay": {
        "properties": {
          "collected": {
            "title": "Collected",
            "type": "integer"
          },
          "date": {
            "title": "Date",
            "type": "string"
          },
          "fed": {
            "title": "Fed",
            "type": "integer"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "published": {
            "title": "Published",
            "type": "integer"
          },
          "status": {
            "enum": [
              "ok",
              "warn",
              "fail"
            ],
            "title": "Status",
            "type": "string"
          },
          "verified": {
            "title": "Verified",
            "type": "integer"
          }
        },
        "required": [
          "date",
          "status",
          "collected",
          "fed",
          "published",
          "verified"
        ],
        "title": "CycleDay",
        "type": "object"
      },
      "DagStep": {
        "description": "One node in a pipeline's step DAG — SPEC-062.\n\n`state` is derived backend-side from the active running run's\n`current_step` / `steps_done`, so the cockpit shows the REAL current\nstep instead of a hardcoded middle node. `count` is an optional pool/\nprogress hint shown next to the node (nullable; required key for the\ncontract).",
        "properties": {
          "count": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Count"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "http_requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Requests"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "llm_calls": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Calls"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "state": {
            "enum": [
              "idle",
              "running",
              "done"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "name",
          "label",
          "state"
        ],
        "title": "DagStep",
        "type": "object"
      },
      "DbHealth": {
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "fail"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "detail"
        ],
        "title": "DbHealth",
        "type": "object"
      },
      "Delta": {
        "properties": {
          "dir": {
            "enum": [
              "up",
              "down",
              "flat"
            ],
            "title": "Dir",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "dir",
          "text"
        ],
        "title": "Delta",
        "type": "object"
      },
      "DeployRequest": {
        "properties": {
          "full_rebuild": {
            "default": false,
            "title": "Full Rebuild",
            "type": "boolean"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "DeployRequest",
        "type": "object"
      },
      "DocFile": {
        "properties": {
          "body": {
            "title": "Body",
            "type": "string"
          },
          "frontmatter": {
            "additionalProperties": true,
            "title": "Frontmatter",
            "type": "object"
          },
          "links": {
            "items": {
              "$ref": "#/components/schemas/WikiLink"
            },
            "title": "Links",
            "type": "array"
          },
          "path": {
            "title": "Path",
            "type": "string"
          }
        },
        "required": [
          "path",
          "frontmatter",
          "body",
          "links"
        ],
        "title": "DocFile",
        "type": "object"
      },
      "EntityCountResponse": {
        "description": "Cached row count for entity-picker badges (§3.2.4).",
        "properties": {
          "cached_at": {
            "format": "date-time",
            "title": "Cached At",
            "type": "string"
          },
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "ttl_seconds": {
            "default": 30,
            "title": "Ttl Seconds",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "cached_at"
        ],
        "title": "EntityCountResponse",
        "type": "object"
      },
      "EntityInfo": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "softshell": {
            "title": "Softshell",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "softshell"
        ],
        "title": "EntityInfo",
        "type": "object"
      },
      "EntityListResponse": {
        "description": "Paginated list response for the entity browser (§3.1.1).",
        "properties": {
          "items": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "meta": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EntityMeta"
              },
              {
                "type": "null"
              }
            ]
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "EntityListResponse",
        "type": "object"
      },
      "EntityMeta": {
        "description": "Runtime schema for an entity, served with ?include_meta=true (§3.1.2).",
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnMeta"
            },
            "title": "Columns",
            "type": "array"
          },
          "default_sort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Sort"
          },
          "default_visible": {
            "items": {
              "type": "string"
            },
            "title": "Default Visible",
            "type": "array"
          },
          "lcid_protected": {
            "default": [
              25,
              31,
              37
            ],
            "items": {
              "type": "integer"
            },
            "title": "Lcid Protected",
            "type": "array"
          }
        },
        "required": [
          "columns",
          "default_visible"
        ],
        "title": "EntityMeta",
        "type": "object"
      },
      "EntityStatus": {
        "additionalProperties": false,
        "description": "SPEC-002 §3.1.5 — runtime enrichment per entity.",
        "properties": {
          "current_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Version"
          },
          "health": {
            "enum": [
              "ok",
              "degraded",
              "fail",
              "unknown"
            ],
            "title": "Health",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_checked": {
            "format": "date-time",
            "title": "Last Checked",
            "type": "string"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "response_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Time Ms"
          }
        },
        "required": [
          "id",
          "health",
          "last_checked"
        ],
        "title": "EntityStatus",
        "type": "object"
      },
      "ErrorEventRead": {
        "description": "One captured runtime exception — the SPEC-060 §1.2 durable sink row.",
        "properties": {
          "context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "error": {
            "title": "Error",
            "type": "string"
          },
          "exc_type": {
            "title": "Exc Type",
            "type": "string"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "operation": {
            "title": "Operation",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "source",
          "operation",
          "exc_type",
          "error",
          "createtime"
        ],
        "title": "ErrorEventRead",
        "type": "object"
      },
      "EvidenceItem": {
        "description": "One evidence item — a link / quote / screenshot(URL) / log / sample (SPEC-004 §3.6).\n\nScreenshots are URL locators, not inline blobs, in v1 (SPEC-004 §7·2).",
        "properties": {
          "caption": {
            "anyOf": [
              {
                "maxLength": 300,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Caption"
          },
          "type": {
            "maxLength": 16,
            "title": "Type",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "value": {
            "anyOf": [
              {
                "maxLength": 8000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "required": [
          "type"
        ],
        "title": "EvidenceItem",
        "type": "object"
      },
      "ExposedItem": {
        "description": "SPEC-002 §3.1.2 — an API/event/UI/cli exposed by a catalog entity.",
        "properties": {
          "path": {
            "title": "Path",
            "type": "string"
          },
          "since": {
            "title": "Since",
            "type": "string"
          },
          "type": {
            "enum": [
              "api",
              "event",
              "ui",
              "cli"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "path",
          "since"
        ],
        "title": "ExposedItem",
        "type": "object"
      },
      "FieldResponse": {
        "description": "One field's full, untruncated value — lazy JSON load (§3.1.5).",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "type": {
            "title": "Type",
            "type": "string"
          },
          "value": {
            "title": "Value"
          }
        },
        "required": [
          "name",
          "type",
          "value",
          "size_bytes"
        ],
        "title": "FieldResponse",
        "type": "object"
      },
      "FunnelBySc": {
        "properties": {
          "eligible": {
            "title": "Eligible",
            "type": "integer"
          },
          "fed": {
            "title": "Fed",
            "type": "integer"
          },
          "generated": {
            "title": "Generated",
            "type": "integer"
          },
          "published": {
            "title": "Published",
            "type": "integer"
          },
          "pulled": {
            "title": "Pulled",
            "type": "integer"
          },
          "ranked": {
            "title": "Ranked",
            "type": "integer"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "sc": {
            "title": "Sc",
            "type": "string"
          },
          "sc_id": {
            "title": "Sc Id",
            "type": "integer"
          },
          "verified": {
            "title": "Verified",
            "type": "integer"
          }
        },
        "required": [
          "sc_id",
          "sc",
          "pulled",
          "ranked",
          "eligible",
          "fed",
          "generated",
          "published",
          "verified"
        ],
        "title": "FunnelBySc",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "Health": {
        "properties": {
          "sla_24h": {
            "title": "Sla 24H",
            "type": "number"
          },
          "throughput_pct": {
            "title": "Throughput Pct",
            "type": "number"
          }
        },
        "required": [
          "sla_24h",
          "throughput_pct"
        ],
        "title": "Health",
        "type": "object"
      },
      "HealthCheckConfig": {
        "description": "Per-entity hint for HealthAggregator (SPEC-002 §3.3.3).",
        "properties": {
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "type": {
            "default": "self",
            "enum": [
              "postgres",
              "redis",
              "self",
              "http_head",
              "nebius",
              "gemini",
              "anthropic",
              "cloudflare",
              "gcs",
              "hatchet"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "title": "HealthCheckConfig",
        "type": "object"
      },
      "HealthFlag": {
        "description": "A derived health signal raised by the analytics service.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "flag": {
            "title": "Flag",
            "type": "string"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          }
        },
        "required": [
          "flag",
          "severity",
          "detail"
        ],
        "title": "HealthFlag",
        "type": "object"
      },
      "HealthStatus": {
        "properties": {
          "app": {
            "title": "App",
            "type": "string"
          },
          "env": {
            "title": "Env",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "degraded",
              "fail"
            ],
            "title": "Status",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "status",
          "app",
          "version",
          "env"
        ],
        "title": "HealthStatus",
        "type": "object"
      },
      "HugoInstanceCreate": {
        "properties": {
          "attached_sc": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attached Sc"
          },
          "backend": {
            "default": "gcs",
            "enum": [
              "gcs",
              "local-fs",
              "wp"
            ],
            "title": "Backend",
            "type": "string"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "caption": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Caption"
          },
          "gcs_bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gcs Bucket"
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "registry": {
            "additionalProperties": true,
            "title": "Registry",
            "type": "object"
          },
          "template_dir": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Dir"
          },
          "theme_repo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Repo"
          },
          "theme_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Sha"
          },
          "tier": {
            "default": "dev",
            "enum": [
              "prod",
              "dev",
              "test",
              "staging"
            ],
            "title": "Tier",
            "type": "string"
          },
          "vps_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vps Ip"
          },
          "vps_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vps Port"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "HugoInstanceCreate",
        "type": "object"
      },
      "HugoInstanceRead": {
        "properties": {
          "attached_sc": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attached Sc"
          },
          "backend": {
            "default": "gcs",
            "enum": [
              "gcs",
              "local-fs",
              "wp"
            ],
            "title": "Backend",
            "type": "string"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "caption": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Caption"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "gcs_bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gcs Bucket"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "last_build_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Build At"
          },
          "last_publish_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Publish At"
          },
          "owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner"
          },
          "posts_count": {
            "title": "Posts Count",
            "type": "integer"
          },
          "registry": {
            "additionalProperties": true,
            "title": "Registry",
            "type": "object"
          },
          "rsid": {
            "title": "Rsid",
            "type": "integer"
          },
          "template_dir": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Dir"
          },
          "theme_repo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Repo"
          },
          "theme_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Sha"
          },
          "tier": {
            "default": "dev",
            "enum": [
              "prod",
              "dev",
              "test",
              "staging"
            ],
            "title": "Tier",
            "type": "string"
          },
          "updatedby": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updatedby"
          },
          "updatetime": {
            "format": "date-time",
            "title": "Updatetime",
            "type": "string"
          },
          "vps_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vps Ip"
          },
          "vps_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vps Port"
          },
          "warmup_state": {
            "enum": [
              "cold",
              "warming",
              "warm"
            ],
            "title": "Warmup State",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "rsid",
          "createtime",
          "updatetime",
          "instance_id",
          "posts_count",
          "last_build_at",
          "last_publish_at",
          "warmup_state"
        ],
        "title": "HugoInstanceRead",
        "type": "object"
      },
      "HugoInstanceUpdate": {
        "properties": {
          "attached_sc": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attached Sc"
          },
          "backend": {
            "anyOf": [
              {
                "enum": [
                  "gcs",
                  "local-fs",
                  "wp"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backend"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "caption": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Caption"
          },
          "gcs_bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gcs Bucket"
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "registry": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registry"
          },
          "template_dir": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Dir"
          },
          "theme_repo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Repo"
          },
          "theme_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Sha"
          },
          "tier": {
            "anyOf": [
              {
                "enum": [
                  "prod",
                  "dev",
                  "test",
                  "staging"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "vps_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vps Ip"
          },
          "vps_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vps Port"
          }
        },
        "title": "HugoInstanceUpdate",
        "type": "object"
      },
      "ImageReference": {
        "description": "One image URL an article references (SPEC-095 §3.4).\n\nFeed for the imagegen usage-reconcile: url as stored in ``pic_data``/\n``featured_image``; ``instance_domain`` derived from ``url_external``\n(None until the article is published).",
        "properties": {
          "article_guid": {
            "title": "Article Guid",
            "type": "integer"
          },
          "instance_domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Domain"
          },
          "published": {
            "title": "Published",
            "type": "boolean"
          },
          "sc_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sc Id"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "article_guid",
          "published"
        ],
        "title": "ImageReference",
        "type": "object"
      },
      "ImageReferencesPage": {
        "description": "One page of the platform's image-reference snapshot (SPEC-095 §3.4).",
        "properties": {
          "articles_scanned": {
            "title": "Articles Scanned",
            "type": "integer"
          },
          "generated_at": {
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "has_next": {
            "title": "Has Next",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ImageReference"
            },
            "title": "Items",
            "type": "array"
          },
          "missing_images": {
            "items": {
              "$ref": "#/components/schemas/ArticleMissingImages"
            },
            "title": "Missing Images",
            "type": "array"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          }
        },
        "required": [
          "generated_at",
          "page",
          "page_size",
          "articles_scanned",
          "has_next",
          "items",
          "missing_images"
        ],
        "title": "ImageReferencesPage",
        "type": "object"
      },
      "IndexCheckRead": {
        "properties": {
          "checked_date": {
            "format": "date",
            "title": "Checked Date",
            "type": "string"
          },
          "engine": {
            "title": "Engine",
            "type": "string"
          },
          "indexed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Indexed"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rank"
          },
          "target": {
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "engine",
          "target",
          "checked_date"
        ],
        "title": "IndexCheckRead",
        "type": "object"
      },
      "InstanceDashboard": {
        "description": "Everything one per-instance analytics panel needs in a single call.",
        "properties": {
          "authority": {
            "items": {
              "$ref": "#/components/schemas/AuthoritySnapshotRead"
            },
            "title": "Authority",
            "type": "array"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "health_flags": {
            "items": {
              "$ref": "#/components/schemas/HealthFlag"
            },
            "title": "Health Flags",
            "type": "array"
          },
          "indexation": {
            "items": {
              "$ref": "#/components/schemas/IndexCheckRead"
            },
            "title": "Indexation",
            "type": "array"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "latest": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InstanceSnapshotRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "top_pages": {
            "items": {
              "$ref": "#/components/schemas/PageStatRead"
            },
            "title": "Top Pages",
            "type": "array"
          },
          "top_queries": {
            "items": {
              "$ref": "#/components/schemas/QueryStatRead"
            },
            "title": "Top Queries",
            "type": "array"
          },
          "trends": {
            "items": {
              "$ref": "#/components/schemas/TrendSeries"
            },
            "title": "Trends",
            "type": "array"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "InstanceDashboard",
        "type": "object"
      },
      "InstanceOverview": {
        "description": "One card on the /overview grid.",
        "properties": {
          "cf_uniques": {
            "default": 0,
            "title": "Cf Uniques",
            "type": "integer"
          },
          "contract_guid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Guid"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "gsc_clicks": {
            "default": 0,
            "title": "Gsc Clicks",
            "type": "integer"
          },
          "gsc_impressions": {
            "default": 0,
            "title": "Gsc Impressions",
            "type": "integer"
          },
          "gsc_indexed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gsc Indexed"
          },
          "health_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Health Score"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "latest_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Date"
          },
          "pages_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages Total"
          },
          "requests_trend": {
            "items": {
              "type": "number"
            },
            "title": "Requests Trend",
            "type": "array"
          },
          "top_flags": {
            "items": {
              "$ref": "#/components/schemas/HealthFlag"
            },
            "title": "Top Flags",
            "type": "array"
          }
        },
        "required": [
          "instance_id"
        ],
        "title": "InstanceOverview",
        "type": "object"
      },
      "InstanceSnapshotRead": {
        "description": "One daily per-instance rollup row.",
        "properties": {
          "ai_bot_hits": {
            "title": "Ai Bot Hits",
            "type": "integer"
          },
          "avg_internal_links": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Internal Links"
          },
          "avg_words": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Words"
          },
          "bing_clicks": {
            "title": "Bing Clicks",
            "type": "integer"
          },
          "bing_impressions": {
            "title": "Bing Impressions",
            "type": "integer"
          },
          "bing_in_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bing In Index"
          },
          "bingbot_hits": {
            "title": "Bingbot Hits",
            "type": "integer"
          },
          "brave_indexed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brave Indexed"
          },
          "cf_cache_hit": {
            "title": "Cf Cache Hit",
            "type": "number"
          },
          "cf_pageviews": {
            "title": "Cf Pageviews",
            "type": "integer"
          },
          "cf_pct_200": {
            "title": "Cf Pct 200",
            "type": "number"
          },
          "cf_pct_301": {
            "title": "Cf Pct 301",
            "type": "number"
          },
          "cf_pct_404": {
            "title": "Cf Pct 404",
            "type": "number"
          },
          "cf_pct_5xx": {
            "title": "Cf Pct 5Xx",
            "type": "number"
          },
          "cf_requests": {
            "title": "Cf Requests",
            "type": "integer"
          },
          "cf_threats": {
            "title": "Cf Threats",
            "type": "integer"
          },
          "cf_top_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cf Top Country"
          },
          "cf_uniques": {
            "title": "Cf Uniques",
            "type": "integer"
          },
          "data_state": {
            "title": "Data State",
            "type": "string"
          },
          "google_indexed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Google Indexed"
          },
          "googlebot_hits": {
            "title": "Googlebot Hits",
            "type": "integer"
          },
          "gsc_clicks": {
            "title": "Gsc Clicks",
            "type": "integer"
          },
          "gsc_ctr": {
            "title": "Gsc Ctr",
            "type": "number"
          },
          "gsc_impressions": {
            "title": "Gsc Impressions",
            "type": "integer"
          },
          "gsc_indexed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gsc Indexed"
          },
          "gsc_position": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gsc Position"
          },
          "health_flags": {
            "items": {
              "$ref": "#/components/schemas/HealthFlag"
            },
            "title": "Health Flags",
            "type": "array"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "jsonld_ok_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Jsonld Ok Pct"
          },
          "open_page_rank": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Page Rank"
          },
          "pages_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages Total"
          },
          "seo_health_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seo Health Score"
          },
          "snapshot_date": {
            "format": "date",
            "title": "Snapshot Date",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "snapshot_date",
          "data_state",
          "cf_requests",
          "cf_uniques",
          "cf_pageviews",
          "cf_threats",
          "cf_pct_200",
          "cf_pct_301",
          "cf_pct_404",
          "cf_pct_5xx",
          "cf_cache_hit",
          "googlebot_hits",
          "bingbot_hits",
          "ai_bot_hits",
          "gsc_impressions",
          "gsc_clicks",
          "gsc_ctr",
          "bing_impressions",
          "bing_clicks"
        ],
        "title": "InstanceSnapshotRead",
        "type": "object"
      },
      "InstanceSummary": {
        "description": "Public, polled by webui every 1.5-3s.",
        "properties": {
          "active_tasks": {
            "default": 0,
            "title": "Active Tasks",
            "type": "integer"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "last_build_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Build At"
          },
          "last_publish_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Publish At"
          },
          "posts_count": {
            "title": "Posts Count",
            "type": "integer"
          },
          "warmup_state": {
            "title": "Warmup State",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "posts_count",
          "last_build_at",
          "last_publish_at",
          "warmup_state",
          "is_active",
          "base_url"
        ],
        "title": "InstanceSummary",
        "type": "object"
      },
      "KpiCard": {
        "properties": {
          "delta": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Delta"
              },
              {
                "type": "null"
              }
            ]
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "sub": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sub"
          },
          "tone": {
            "default": "neutral",
            "enum": [
              "neutral",
              "good",
              "attention"
            ],
            "title": "Tone",
            "type": "string"
          },
          "trend": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trend"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "value"
        ],
        "title": "KpiCard",
        "type": "object"
      },
      "Last24h": {
        "properties": {
          "avg_ms": {
            "default": 0,
            "title": "Avg Ms",
            "type": "integer"
          },
          "failed": {
            "default": 0,
            "title": "Failed",
            "type": "integer"
          },
          "ok": {
            "default": 0,
            "title": "Ok",
            "type": "integer"
          }
        },
        "title": "Last24h",
        "type": "object"
      },
      "LifecycleLogRead": {
        "properties": {
          "actor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "entity_guid": {
            "title": "Entity Guid",
            "type": "integer"
          },
          "entityname": {
            "title": "Entityname",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "from_step": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Step"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "lcid": {
            "title": "Lcid",
            "type": "integer"
          },
          "outlet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outlet"
          },
          "to_step": {
            "title": "To Step",
            "type": "integer"
          }
        },
        "required": [
          "guid",
          "entityname",
          "entity_guid",
          "lcid",
          "from_step",
          "to_step",
          "outlet",
          "actor",
          "detail",
          "error",
          "createtime"
        ],
        "title": "LifecycleLogRead",
        "type": "object"
      },
      "LifecycleStateResponse": {
        "properties": {
          "available_outlets": {
            "items": {
              "$ref": "#/components/schemas/OutletDef"
            },
            "title": "Available Outlets",
            "type": "array"
          },
          "current_step": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StepDef"
              },
              {
                "type": "null"
              }
            ]
          },
          "entity": {
            "title": "Entity",
            "type": "string"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "is_terminal": {
            "default": false,
            "title": "Is Terminal",
            "type": "boolean"
          },
          "last_log": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LifecycleLogRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "lcid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lcid"
          },
          "lcstep": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lcstep"
          },
          "locked_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locked By"
          },
          "permitted_manual_steps": {
            "items": {
              "$ref": "#/components/schemas/StepDef"
            },
            "title": "Permitted Manual Steps",
            "type": "array"
          }
        },
        "required": [
          "entity",
          "guid",
          "lcid",
          "lcstep"
        ],
        "title": "LifecycleStateResponse",
        "type": "object"
      },
      "LiveRun": {
        "properties": {
          "age_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Age S"
          },
          "current_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Step"
          },
          "entity_guid": {
            "title": "Entity Guid",
            "type": "integer"
          },
          "entity_name": {
            "title": "Entity Name",
            "type": "string"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "run_guid": {
            "title": "Run Guid",
            "type": "string"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "steps_done": {
            "title": "Steps Done",
            "type": "integer"
          },
          "steps_total": {
            "title": "Steps Total",
            "type": "integer"
          },
          "zombie": {
            "default": false,
            "title": "Zombie",
            "type": "boolean"
          }
        },
        "required": [
          "run_guid",
          "pipeline_id",
          "entity_name",
          "entity_guid",
          "status",
          "steps_done",
          "steps_total"
        ],
        "title": "LiveRun",
        "type": "object"
      },
      "LocalizationRead": {
        "description": "One (article, language) localization row — SPEC-109 §3.1.",
        "properties": {
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "generated_article_id": {
            "title": "Generated Article Id",
            "type": "integer"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "judge_scores": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Judge Scores"
          },
          "language": {
            "title": "Language",
            "type": "string"
          },
          "master_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Master Hash"
          },
          "published_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Url"
          },
          "salescontracts": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Salescontracts"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "updatetime": {
            "format": "date-time",
            "title": "Updatetime",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "generated_article_id",
          "language",
          "status",
          "createtime",
          "updatetime"
        ],
        "title": "LocalizationRead",
        "type": "object"
      },
      "MeResponse": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_superuser": {
            "title": "Is Superuser",
            "type": "boolean"
          },
          "is_team": {
            "default": false,
            "title": "Is Team",
            "type": "boolean"
          },
          "last_login": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login"
          }
        },
        "required": [
          "guid",
          "email",
          "full_name",
          "is_active",
          "is_superuser",
          "last_login"
        ],
        "title": "MeResponse",
        "type": "object"
      },
      "MetamodelDetail": {
        "description": "SPEC-013 §3.1.4 — full schema of one entity.",
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/MetamodelEdge"
            },
            "title": "Edges",
            "type": "array"
          },
          "entity": {
            "$ref": "#/components/schemas/MetamodelEntity"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/MetamodelField"
            },
            "title": "Fields",
            "type": "array"
          },
          "lcid_protected": {
            "items": {
              "type": "integer"
            },
            "title": "Lcid Protected",
            "type": "array"
          }
        },
        "required": [
          "entity",
          "fields",
          "edges",
          "lcid_protected"
        ],
        "title": "MetamodelDetail",
        "type": "object"
      },
      "MetamodelEdge": {
        "description": "SPEC-013 §3.1.2 — an FK relation, derived from entity_meta.FK_COLUMNS.",
        "properties": {
          "display_field": {
            "title": "Display Field",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "target": {
            "title": "Target",
            "type": "string"
          },
          "via_field": {
            "title": "Via Field",
            "type": "string"
          }
        },
        "required": [
          "source",
          "target",
          "via_field",
          "display_field"
        ],
        "title": "MetamodelEdge",
        "type": "object"
      },
      "MetamodelEntity": {
        "description": "SPEC-013 §3.1.3 — catalog summary for one business entity.",
        "properties": {
          "field_count": {
            "title": "Field Count",
            "type": "integer"
          },
          "group_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Group Counts",
            "type": "object"
          },
          "model_ref": {
            "title": "Model Ref",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "softshell": {
            "title": "Softshell",
            "type": "boolean"
          },
          "spec_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "table_name": {
            "title": "Table Name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "table_name",
          "softshell",
          "field_count",
          "group_counts",
          "model_ref"
        ],
        "title": "MetamodelEntity",
        "type": "object"
      },
      "MetamodelField": {
        "description": "SPEC-013 §3.1.1 — an entity column enriched for the schema explorer.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "editable": {
            "default": true,
            "title": "Editable",
            "type": "boolean"
          },
          "enum_values": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enum Values"
          },
          "fk_display_field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Display Field"
          },
          "fk_target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Target"
          },
          "group": {
            "enum": [
              "system",
              "lifecycle",
              "business"
            ],
            "title": "Group",
            "type": "string"
          },
          "is_fk": {
            "default": false,
            "title": "Is Fk",
            "type": "boolean"
          },
          "is_pk": {
            "default": false,
            "title": "Is Pk",
            "type": "boolean"
          },
          "json_size_warn": {
            "default": false,
            "title": "Json Size Warn",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "nullable": {
            "title": "Nullable",
            "type": "boolean"
          },
          "type": {
            "enum": [
              "string",
              "integer",
              "bigint",
              "boolean",
              "timestamp",
              "date",
              "json",
              "text",
              "enum",
              "fk"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "nullable",
          "group"
        ],
        "title": "MetamodelField",
        "type": "object"
      },
      "MetamodelResponse": {
        "description": "SPEC-013 §3.1.6 — payload of GET /api/v1/metamodel.",
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/MetamodelEdge"
            },
            "title": "Edges",
            "type": "array"
          },
          "entities": {
            "items": {
              "$ref": "#/components/schemas/MetamodelEntity"
            },
            "title": "Entities",
            "type": "array"
          },
          "generated_at": {
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "type_legend": {
            "items": {
              "$ref": "#/components/schemas/TypeLegendItem"
            },
            "title": "Type Legend",
            "type": "array"
          }
        },
        "required": [
          "entities",
          "edges",
          "type_legend",
          "generated_at"
        ],
        "title": "MetamodelResponse",
        "type": "object"
      },
      "OpsOverview": {
        "properties": {
          "alerts": {
            "items": {
              "$ref": "#/components/schemas/Alert"
            },
            "title": "Alerts",
            "type": "array"
          },
          "contracts": {
            "items": {
              "$ref": "#/components/schemas/ContractBatch"
            },
            "title": "Contracts",
            "type": "array"
          },
          "generated_at": {
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "live_runs": {
            "items": {
              "$ref": "#/components/schemas/LiveRun"
            },
            "title": "Live Runs",
            "type": "array"
          },
          "orchestrator": {
            "$ref": "#/components/schemas/OrchestratorStatus"
          },
          "recent_events": {
            "description": "Last finished runs, newest first (#762) — the live-activity feed.",
            "items": {
              "$ref": "#/components/schemas/RecentEvent"
            },
            "title": "Recent Events",
            "type": "array"
          },
          "run_session": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunSession"
              },
              {
                "type": "null"
              }
            ],
            "description": "Today's daily run folded into one object (None only on pre-#758 servers). Drives the Live-monitor banner: launched? since when? doing what?"
          },
          "runs_by_status": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Runs By Status",
            "type": "object"
          },
          "system": {
            "$ref": "#/components/schemas/SystemHealth"
          }
        },
        "required": [
          "generated_at",
          "system",
          "orchestrator",
          "runs_by_status",
          "contracts",
          "live_runs",
          "alerts"
        ],
        "title": "OpsOverview",
        "type": "object"
      },
      "OrchestratorHeartbeatIn": {
        "description": "Body the gen-orchestrator posts to ``POST /ops/orchestrator/heartbeat``.",
        "properties": {
          "active": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "targets": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Targets"
          },
          "tick_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tick S"
          }
        },
        "title": "OrchestratorHeartbeatIn",
        "type": "object"
      },
      "OrchestratorStatus": {
        "description": "Liveness of the standalone gen-orchestrator, derived from its Redis heartbeat.\n\nEXECUTION-MODEL CONTEXT (read before alerting on this):\nOn PROD the platform does NOT run a persistent orchestrator daemon — content is\ndriven by a once-daily systemd timer (``entherium-daily-run``, surfaced by the\n``cycles`` domain). That timer launches runs but posts no heartbeat, so the\nsteady state on prod is ``present=False, alive=False`` — this is NORMAL, not an\noutage. Treat it as a real problem only when ``present=True`` and\n``alive=False`` (a heartbeat was seen but went stale). For the actual daily\ncollect->generate->publish funnel, look at the ``cycles`` domain.",
        "properties": {
          "active": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "age_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Age S"
          },
          "alive": {
            "description": "Heartbeat is fresh (age within tick budget). Only present=True AND alive=False is worth investigating.",
            "title": "Alive",
            "type": "boolean"
          },
          "last_tick_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Tick At"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "present": {
            "description": "A heartbeat key exists in Redis. False on daily-run prod (no persistent orchestrator) — normal, not an error.",
            "title": "Present",
            "type": "boolean"
          },
          "targets": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Targets"
          }
        },
        "required": [
          "present",
          "alive"
        ],
        "title": "OrchestratorStatus",
        "type": "object"
      },
      "OutletDef": {
        "additionalProperties": true,
        "properties": {
          "condition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Condition"
          },
          "name": {
            "description": "ok | error | conditional name | confirm",
            "title": "Name",
            "type": "string"
          },
          "to": {
            "description": "target step id",
            "title": "To",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "to"
        ],
        "title": "OutletDef",
        "type": "object"
      },
      "OverviewResponse": {
        "properties": {
          "generated_at": {
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "instances": {
            "items": {
              "$ref": "#/components/schemas/InstanceOverview"
            },
            "title": "Instances",
            "type": "array"
          }
        },
        "required": [
          "generated_at",
          "instances"
        ],
        "title": "OverviewResponse",
        "type": "object"
      },
      "PageStatRead": {
        "properties": {
          "cf_hits": {
            "title": "Cf Hits",
            "type": "integer"
          },
          "clicks": {
            "title": "Clicks",
            "type": "integer"
          },
          "ctr": {
            "title": "Ctr",
            "type": "number"
          },
          "engine": {
            "title": "Engine",
            "type": "string"
          },
          "impressions": {
            "title": "Impressions",
            "type": "integer"
          },
          "position": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "engine",
          "url",
          "clicks",
          "impressions",
          "ctr",
          "cf_hits"
        ],
        "title": "PageStatRead",
        "type": "object"
      },
      "PipelineCard": {
        "properties": {
          "dag": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/DagStep"
            },
            "title": "Dag",
            "type": "array"
          },
          "id": {
            "enum": [
              "collect",
              "generate",
              "publish"
            ],
            "title": "Id",
            "type": "string"
          },
          "in_flight": {
            "title": "In Flight",
            "type": "integer"
          },
          "kpis": {
            "items": {
              "$ref": "#/components/schemas/KpiCard"
            },
            "title": "Kpis",
            "type": "array"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "last_24h": {
            "$ref": "#/components/schemas/Last24h"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "state": {
            "enum": [
              "idle",
              "live",
              "paused",
              "failed"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "pipeline_id",
          "state",
          "in_flight",
          "kpis",
          "last_24h"
        ],
        "title": "PipelineCard",
        "type": "object"
      },
      "PipelineDefRead": {
        "description": "A pipeline definition from the registry — SPEC-007 §3.2.3.",
        "properties": {
          "default_steps": {
            "items": {
              "type": "string"
            },
            "title": "Default Steps",
            "type": "array"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "entity": {
            "title": "Entity",
            "type": "string"
          },
          "harness": {
            "title": "Harness",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/PipelineStepRead"
            },
            "title": "Steps",
            "type": "array"
          },
          "vendor_stamp": {
            "title": "Vendor Stamp",
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_name",
          "entity",
          "harness",
          "vendor_stamp",
          "steps",
          "default_steps"
        ],
        "title": "PipelineDefRead",
        "type": "object"
      },
      "PipelineRef": {
        "description": "SPEC-007 §13.2.2 / §16.2 — points an `automated`-class pipeline step at\na registered SPEC-007 pipeline. The engine's pipeline-bridge (§16) spawns\na `pipeline_run` instead of invoking a Python autorun handler.",
        "properties": {
          "mode": {
            "default": "live",
            "enum": [
              "live",
              "mock",
              "replay"
            ],
            "title": "Mode",
            "type": "string"
          },
          "pipeline_id": {
            "description": "id in SPEC-007 §3.4 pipeline registry",
            "title": "Pipeline Id",
            "type": "string"
          },
          "steps": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          }
        },
        "required": [
          "pipeline_id"
        ],
        "title": "PipelineRef",
        "type": "object"
      },
      "PipelineRunRead": {
        "description": "A run record — SPEC-007 §3.2.2.",
        "properties": {
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "current_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Step"
          },
          "entity_guid": {
            "title": "Entity Guid",
            "type": "integer"
          },
          "entity_name": {
            "title": "Entity Name",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "error_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Step"
          },
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "metrics": {
            "additionalProperties": true,
            "title": "Metrics",
            "type": "object"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "started_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started By"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "steps_done": {
            "title": "Steps Done",
            "type": "integer"
          },
          "steps_total": {
            "title": "Steps Total",
            "type": "integer"
          },
          "trigger": {
            "title": "Trigger",
            "type": "string"
          },
          "updatetime": {
            "format": "date-time",
            "title": "Updatetime",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "pipeline_id",
          "entity_name",
          "entity_guid",
          "status",
          "trigger",
          "mode",
          "steps_total",
          "steps_done",
          "createtime",
          "updatetime"
        ],
        "title": "PipelineRunRead",
        "type": "object"
      },
      "PipelineStepRead": {
        "description": "A pipeline step definition — SPEC-007 §3.2.3 (`PipelineStepDef`).",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "caption": {
            "title": "Caption",
            "type": "string"
          },
          "http": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http"
          },
          "in_fields": {
            "items": {
              "type": "string"
            },
            "title": "In Fields",
            "type": "array"
          },
          "llm": {
            "title": "Llm",
            "type": "boolean"
          },
          "module_file": {
            "title": "Module File",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "out_fields": {
            "items": {
              "type": "string"
            },
            "title": "Out Fields",
            "type": "array"
          }
        },
        "required": [
          "name",
          "caption",
          "module_file",
          "available",
          "llm",
          "in_fields",
          "out_fields"
        ],
        "title": "PipelineStepRead",
        "type": "object"
      },
      "PoolGauge": {
        "description": "SQLAlchemy connection-pool utilisation for this api replica.\n\n``in_use`` ≈ active native runs (+1 for the request) on a single-replica\nbox — the empirical hard ceiling (``max`` = pool_size + max_overflow, 30 on\nPROD). ``C > max`` makes new runs block on connection acquire → silent\nthroughput collapse (SPEC-067 / throughput study).",
        "properties": {
          "in_use": {
            "title": "In Use",
            "type": "integer"
          },
          "max": {
            "title": "Max",
            "type": "integer"
          },
          "pct": {
            "title": "Pct",
            "type": "number"
          },
          "size": {
            "title": "Size",
            "type": "integer"
          },
          "tone": {
            "enum": [
              "good",
              "attention",
              "critical"
            ],
            "title": "Tone",
            "type": "string"
          }
        },
        "required": [
          "in_use",
          "size",
          "max",
          "pct",
          "tone"
        ],
        "title": "PoolGauge",
        "type": "object"
      },
      "PostMessageRequest": {
        "properties": {
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "message": {
            "maxLength": 4000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "PostMessageRequest",
        "type": "object"
      },
      "ProcessEventRequest": {
        "properties": {
          "event": {
            "default": "tick",
            "description": "outlet name on automated steps",
            "title": "Event",
            "type": "string"
          },
          "filter": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter"
          },
          "lcid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lcid"
          },
          "max": {
            "default": 100,
            "description": "hard upper bound per call",
            "maximum": 500.0,
            "title": "Max",
            "type": "integer"
          }
        },
        "title": "ProcessEventRequest",
        "type": "object"
      },
      "ProcessEventResponse": {
        "properties": {
          "advanced": {
            "title": "Advanced",
            "type": "integer"
          },
          "errors": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Errors",
            "type": "array"
          },
          "processed": {
            "title": "Processed",
            "type": "integer"
          }
        },
        "required": [
          "processed",
          "advanced",
          "errors"
        ],
        "title": "ProcessEventResponse",
        "type": "object"
      },
      "ProgressAnchor": {
        "properties": {
          "anchor": {
            "title": "Anchor",
            "type": "string"
          },
          "covered": {
            "title": "Covered",
            "type": "boolean"
          },
          "label": {
            "title": "Label",
            "type": "string"
          }
        },
        "required": [
          "anchor",
          "label",
          "covered"
        ],
        "title": "ProgressAnchor",
        "type": "object"
      },
      "ProgressSection": {
        "properties": {
          "anchors": {
            "items": {
              "$ref": "#/components/schemas/ProgressAnchor"
            },
            "title": "Anchors",
            "type": "array"
          },
          "done": {
            "title": "Done",
            "type": "integer"
          },
          "section": {
            "title": "Section",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "section",
          "title",
          "done",
          "total",
          "anchors"
        ],
        "title": "ProgressSection",
        "type": "object"
      },
      "PublishArticleRequest": {
        "properties": {
          "article_guid": {
            "title": "Article Guid",
            "type": "integer"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "article_guid"
        ],
        "title": "PublishArticleRequest",
        "type": "object"
      },
      "PublishBatchRequest": {
        "properties": {
          "article_guids": {
            "items": {
              "type": "integer"
            },
            "title": "Article Guids",
            "type": "array"
          },
          "instance_id": {
            "title": "Instance Id",
            "type": "string"
          }
        },
        "required": [
          "instance_id",
          "article_guids"
        ],
        "title": "PublishBatchRequest",
        "type": "object"
      },
      "PublishedArticle": {
        "description": "One published article for a contract — the Live-monitor drill-down list.\n\nOnly rows with a live public URL are returned. `word_count` is computed on the\nfly from the article body (there is no stored column).",
        "properties": {
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "url_external": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url External"
          },
          "word_count": {
            "default": 0,
            "title": "Word Count",
            "type": "integer"
          }
        },
        "required": [
          "guid"
        ],
        "title": "PublishedArticle",
        "type": "object"
      },
      "QueryStatRead": {
        "properties": {
          "clicks": {
            "title": "Clicks",
            "type": "integer"
          },
          "ctr": {
            "title": "Ctr",
            "type": "number"
          },
          "engine": {
            "title": "Engine",
            "type": "string"
          },
          "impressions": {
            "title": "Impressions",
            "type": "integer"
          },
          "position": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position"
          },
          "query": {
            "title": "Query",
            "type": "string"
          }
        },
        "required": [
          "engine",
          "query",
          "clicks",
          "impressions",
          "ctr"
        ],
        "title": "QueryStatRead",
        "type": "object"
      },
      "ReadinessReport": {
        "properties": {
          "db": {
            "title": "Db",
            "type": "string"
          },
          "redis": {
            "title": "Redis",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "degraded",
              "fail"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "db",
          "redis"
        ],
        "title": "ReadinessReport",
        "type": "object"
      },
      "RecentEvent": {
        "description": "One finished run as a feed line — the dashboard's steady liveness signal.\n\nA first-time viewer trusts a system they can see breathing: the feed shows\nthe last completions in plain terms (\"wirez.top — article written\"), which a\nrow of counters cannot. ``sc_guid`` links the event to a contract row (the FE\nresolves the display name from ``contracts[]``); None when unresolvable.",
        "properties": {
          "at": {
            "format": "date-time",
            "title": "At",
            "type": "string"
          },
          "error_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The step a failed run died at (None for successes).",
            "title": "Error Step"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "sc_guid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sc Guid"
          },
          "status": {
            "enum": [
              "succeeded",
              "failed"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "at",
          "pipeline_id",
          "status"
        ],
        "title": "RecentEvent",
        "type": "object"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          }
        },
        "required": [
          "refresh_token"
        ],
        "title": "RefreshRequest",
        "type": "object"
      },
      "RowResponse": {
        "description": "A single full entity row for the row drawer (SPEC-014 §3.1.4).\n\n`data` carries untruncated values — JSON columns are not previewed here.",
        "properties": {
          "data": {
            "additionalProperties": true,
            "title": "Data",
            "type": "object"
          },
          "deleted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          },
          "lcid_locked": {
            "title": "Lcid Locked",
            "type": "boolean"
          },
          "meta": {
            "$ref": "#/components/schemas/EntityMeta"
          }
        },
        "required": [
          "data",
          "meta",
          "lcid_locked"
        ],
        "title": "RowResponse",
        "type": "object"
      },
      "RunCostRow": {
        "description": "Per-run cost row.",
        "properties": {
          "ai_company": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Company"
          },
          "brave_calls": {
            "title": "Brave Calls",
            "type": "integer"
          },
          "cost_micro_usd": {
            "title": "Cost Micro Usd",
            "type": "integer"
          },
          "generated_article_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generated Article Id"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "run_guid": {
            "title": "Run Guid",
            "type": "integer"
          },
          "salescontracts_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Salescontracts Id"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          }
        },
        "required": [
          "run_guid",
          "pipeline_id",
          "ai_company",
          "salescontracts_id",
          "generated_article_id",
          "cost_micro_usd",
          "total_tokens",
          "brave_calls"
        ],
        "title": "RunCostRow",
        "type": "object"
      },
      "RunDetailResponse": {
        "description": "`GET /api/v1/runs/{run_guid}` — SPEC-007 §3.2.2.",
        "properties": {
          "pipeline": {
            "$ref": "#/components/schemas/PipelineDefRead"
          },
          "run": {
            "$ref": "#/components/schemas/PipelineRunRead"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/RunStepRead"
            },
            "title": "Steps",
            "type": "array"
          },
          "target": {
            "additionalProperties": true,
            "title": "Target",
            "type": "object"
          }
        },
        "required": [
          "run",
          "steps",
          "target",
          "pipeline"
        ],
        "title": "RunDetailResponse",
        "type": "object"
      },
      "RunLaunchRequest": {
        "description": "Body of `POST /api/v1/runs` — SPEC-007 §3.2.1.\n\n`params` carries field overrides for the fixture; it never carries\nsecrets (§2.3.3).\n\nSPEC-054 §3.4 — `pipeline_variant` + `pipeline_version` are optional;\nwhen omitted the platform resolves defaults (`variant='prod'`,\n`version=catalog.latest_for(pipeline_id, variant)`). When supplied\nthey are validated against `pipelines/catalog.yaml`; an unknown\ntriple yields 404 before the run is created.",
        "properties": {
          "allow_regenerate": {
            "default": false,
            "title": "Allow Regenerate",
            "type": "boolean"
          },
          "entity": {
            "title": "Entity",
            "type": "string"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "mode": {
            "default": "live",
            "enum": [
              "live",
              "mock",
              "replay"
            ],
            "title": "Mode",
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "title": "Params",
            "type": "object"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "pipeline_variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pipeline Variant"
          },
          "pipeline_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pipeline Version"
          },
          "steps": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          }
        },
        "required": [
          "pipeline_id",
          "entity",
          "guid"
        ],
        "title": "RunLaunchRequest",
        "type": "object"
      },
      "RunListResponse": {
        "description": "`GET /api/v1/runs` — SPEC-007 §3.2.2 (paginated run list).",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PipelineRunRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "default": 50,
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "default": 0,
            "minimum": 0.0,
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "RunListResponse",
        "type": "object"
      },
      "RunLogLine": {
        "description": "One assembled log line — SPEC-007 §3.3.5.\n\nAll sensitive values are already redacted upstream by the runner\n(§5.11.5); the API never un-masks.",
        "properties": {
          "level": {
            "default": "info",
            "title": "Level",
            "type": "string"
          },
          "source": {
            "default": "module",
            "title": "Source",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "ts": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ts"
          }
        },
        "required": [
          "text"
        ],
        "title": "RunLogLine",
        "type": "object"
      },
      "RunLogResponse": {
        "description": "`GET /api/v1/runs/{run_guid}/log` — SPEC-007 §3.3.5.",
        "properties": {
          "lines": {
            "items": {
              "$ref": "#/components/schemas/RunLogLine"
            },
            "title": "Lines",
            "type": "array"
          }
        },
        "required": [
          "lines"
        ],
        "title": "RunLogResponse",
        "type": "object"
      },
      "RunRetryRequest": {
        "description": "Body of `POST /api/v1/runs/{run_guid}/retry` — SPEC-007 §3.3.7.\n\n`from_step` resumes from that step, seeding the fixture from the\npreceding step's snapshot; omit it to retry from the pipeline start.",
        "properties": {
          "from_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Step"
          }
        },
        "title": "RunRetryRequest",
        "type": "object"
      },
      "RunScheduleCreate": {
        "properties": {
          "cron": {
            "title": "Cron",
            "type": "string"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "entity": {
            "title": "Entity",
            "type": "string"
          },
          "max_targets_per_fire": {
            "default": 25,
            "title": "Max Targets Per Fire",
            "type": "integer"
          },
          "mode": {
            "default": "live",
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "title": "Params",
            "type": "object"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "selector": {
            "additionalProperties": true,
            "title": "Selector",
            "type": "object"
          },
          "steps": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          }
        },
        "required": [
          "name",
          "pipeline_id",
          "entity",
          "selector",
          "cron"
        ],
        "title": "RunScheduleCreate",
        "type": "object"
      },
      "RunScheduleRead": {
        "properties": {
          "cron": {
            "title": "Cron",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "entity": {
            "title": "Entity",
            "type": "string"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "last_fire_summary": {
            "additionalProperties": true,
            "title": "Last Fire Summary",
            "type": "object"
          },
          "last_fired_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Fired At"
          },
          "max_targets_per_fire": {
            "title": "Max Targets Per Fire",
            "type": "integer"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "next_fire_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Fire At"
          },
          "params": {
            "additionalProperties": true,
            "title": "Params",
            "type": "object"
          },
          "pipeline_id": {
            "title": "Pipeline Id",
            "type": "string"
          },
          "selector": {
            "additionalProperties": true,
            "title": "Selector",
            "type": "object"
          },
          "steps": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          }
        },
        "required": [
          "guid",
          "name",
          "pipeline_id",
          "entity",
          "selector",
          "cron",
          "mode",
          "steps",
          "params",
          "max_targets_per_fire",
          "enabled",
          "last_fired_at",
          "next_fire_at",
          "last_fire_summary"
        ],
        "title": "RunScheduleRead",
        "type": "object"
      },
      "RunScheduleUpdate": {
        "properties": {
          "cron": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cron"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "max_targets_per_fire": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Targets Per Fire"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mode"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "selector": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Selector"
          },
          "steps": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          }
        },
        "title": "RunScheduleUpdate",
        "type": "object"
      },
      "RunSession": {
        "description": "The daily run as a first-class object, inferred from today's runs (UTC day).\n\nThere is no persistent orchestrator on prod (see ``OrchestratorStatus``), so\nthe 'was the daily run launched?' question is answered by folding today's\nPipelineRun rows: first createtime = start, any active run = still going.\nDrives the Live-monitor banner — the one line a first-time viewer reads.",
        "properties": {
          "elapsed_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "running → seconds since started_at; done → run duration; idle → None.",
            "title": "Elapsed S"
          },
          "failed": {
            "default": 0,
            "title": "Failed",
            "type": "integer"
          },
          "published_today": {
            "default": 0,
            "title": "Published Today",
            "type": "integer"
          },
          "queued": {
            "default": 0,
            "title": "Queued",
            "type": "integer"
          },
          "sites_collecting": {
            "default": 0,
            "title": "Sites Collecting",
            "type": "integer"
          },
          "sites_done": {
            "default": 0,
            "title": "Sites Done",
            "type": "integer"
          },
          "sites_total": {
            "default": 0,
            "description": "Contracts with at least one run today.",
            "title": "Sites Total",
            "type": "integer"
          },
          "sites_writing": {
            "default": 0,
            "title": "Sites Writing",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "state": {
            "enum": [
              "idle",
              "running",
              "done"
            ],
            "title": "State",
            "type": "string"
          },
          "writing": {
            "default": 0,
            "title": "Writing",
            "type": "integer"
          },
          "written": {
            "default": 0,
            "description": "Generate runs succeeded today (all sites).",
            "title": "Written",
            "type": "integer"
          }
        },
        "required": [
          "state"
        ],
        "title": "RunSession",
        "type": "object"
      },
      "RunStepRead": {
        "description": "A step execution row — SPEC-007 §3.2.2.\n\n`log` is intentionally excluded — it loads via `GET /{run}/log`.",
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "fields_written": {
            "items": {
              "type": "string"
            },
            "title": "Fields Written",
            "type": "array"
          },
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "http_requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Requests"
          },
          "llm_calls": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Calls"
          },
          "module_file": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Module File"
          },
          "run_guid": {
            "title": "Run Guid",
            "type": "integer"
          },
          "score": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "seq": {
            "title": "Seq",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "step_caption": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Step Caption"
          },
          "step_name": {
            "title": "Step Name",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "run_guid",
          "seq",
          "step_name",
          "status",
          "attempt"
        ],
        "title": "RunStepRead",
        "type": "object"
      },
      "ScheduleFireResult": {
        "properties": {
          "errors": {
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          },
          "fired": {
            "title": "Fired",
            "type": "integer"
          },
          "run_guids": {
            "items": {
              "type": "integer"
            },
            "title": "Run Guids",
            "type": "array"
          },
          "schedule_id": {
            "title": "Schedule Id",
            "type": "integer"
          },
          "skipped": {
            "title": "Skipped",
            "type": "integer"
          }
        },
        "required": [
          "schedule_id",
          "fired",
          "skipped",
          "errors",
          "run_guids"
        ],
        "title": "ScheduleFireResult",
        "type": "object"
      },
      "SectionAnchor": {
        "properties": {
          "anchor": {
            "title": "Anchor",
            "type": "string"
          },
          "level": {
            "title": "Level",
            "type": "integer"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "anchor",
          "title",
          "level"
        ],
        "title": "SectionAnchor",
        "type": "object"
      },
      "ServiceTokenRequest": {
        "properties": {
          "email": {
            "default": "readonly-agent@entherium.dev",
            "title": "Email",
            "type": "string"
          },
          "expires_days": {
            "default": 90,
            "maximum": 365.0,
            "minimum": 1.0,
            "title": "Expires Days",
            "type": "integer"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "revoke_prior": {
            "default": true,
            "title": "Revoke Prior",
            "type": "boolean"
          }
        },
        "title": "ServiceTokenRequest",
        "type": "object"
      },
      "ServiceTokenResponse": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "api_scope": {
            "title": "Api Scope",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          },
          "user_guid": {
            "title": "User Guid",
            "type": "integer"
          }
        },
        "required": [
          "access_token",
          "expires_in",
          "user_guid",
          "email",
          "api_scope"
        ],
        "title": "ServiceTokenResponse",
        "type": "object"
      },
      "SpecDetailResponse": {
        "properties": {
          "body_markdown": {
            "title": "Body Markdown",
            "type": "string"
          },
          "frontmatter": {
            "additionalProperties": true,
            "title": "Frontmatter",
            "type": "object"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/SectionAnchor"
            },
            "title": "Sections",
            "type": "array"
          },
          "tests_status": {
            "items": {
              "$ref": "#/components/schemas/TestStatus"
            },
            "title": "Tests Status",
            "type": "array"
          }
        },
        "required": [
          "id",
          "frontmatter",
          "body_markdown",
          "sections",
          "tests_status"
        ],
        "title": "SpecDetailResponse",
        "type": "object"
      },
      "SpecListItem": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "string"
          },
          "feature": {
            "title": "Feature",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_modified": {
            "title": "Last Modified",
            "type": "string"
          },
          "progress_done": {
            "title": "Progress Done",
            "type": "integer"
          },
          "progress_total": {
            "title": "Progress Total",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tests_count": {
            "title": "Tests Count",
            "type": "integer"
          },
          "tests_passing": {
            "title": "Tests Passing",
            "type": "integer"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "feature",
          "status",
          "created",
          "tests_count",
          "tests_passing",
          "progress_done",
          "progress_total",
          "last_modified"
        ],
        "title": "SpecListItem",
        "type": "object"
      },
      "SpecListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SpecListItem"
            },
            "title": "Items",
            "type": "array"
          },
          "test_run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TestRunInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "SpecListResponse",
        "type": "object"
      },
      "SpecTestCase": {
        "properties": {
          "description": {
            "title": "Description",
            "type": "string"
          },
          "group": {
            "title": "Group",
            "type": "string"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "group",
          "name",
          "description",
          "status"
        ],
        "title": "SpecTestCase",
        "type": "object"
      },
      "StatusPatch": {
        "properties": {
          "status": {
            "description": "One of draft/review/accepted/implemented/obsolete",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "StatusPatch",
        "type": "object"
      },
      "StatusResponse": {
        "properties": {
          "aggregated_at": {
            "format": "date-time",
            "title": "Aggregated At",
            "type": "string"
          },
          "entities": {
            "items": {
              "$ref": "#/components/schemas/EntityStatus"
            },
            "title": "Entities",
            "type": "array"
          }
        },
        "required": [
          "entities",
          "aggregated_at"
        ],
        "title": "StatusResponse",
        "type": "object"
      },
      "StepDef": {
        "additionalProperties": true,
        "properties": {
          "caption": {
            "title": "Caption",
            "type": "string"
          },
          "handler": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Handler"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "start",
              "automated",
              "routing",
              "manual",
              "pipeline",
              "finish"
            ],
            "title": "Kind",
            "type": "string"
          },
          "outlets": {
            "items": {
              "$ref": "#/components/schemas/OutletDef"
            },
            "title": "Outlets",
            "type": "array"
          },
          "pipeline_ref": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PipelineRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "id",
          "kind",
          "caption"
        ],
        "title": "StepDef",
        "type": "object"
      },
      "StepToRequest": {
        "properties": {
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "to_step": {
            "description": "target step id from LC definition",
            "title": "To Step",
            "type": "integer"
          }
        },
        "required": [
          "to_step"
        ],
        "title": "StepToRequest",
        "type": "object"
      },
      "SystemHealth": {
        "properties": {
          "concurrency": {
            "$ref": "#/components/schemas/ConcurrencyGauge"
          },
          "db": {
            "enum": [
              "ok",
              "fail"
            ],
            "title": "Db",
            "type": "string"
          },
          "in_flight_runs": {
            "title": "In Flight Runs",
            "type": "integer"
          },
          "pool": {
            "$ref": "#/components/schemas/PoolGauge"
          },
          "redis": {
            "enum": [
              "ok",
              "fail"
            ],
            "title": "Redis",
            "type": "string"
          }
        },
        "required": [
          "db",
          "redis",
          "pool",
          "concurrency",
          "in_flight_runs"
        ],
        "title": "SystemHealth",
        "type": "object"
      },
      "SystemMeta": {
        "description": "Global metadata from system.yaml.",
        "properties": {
          "description": {
            "default": "",
            "title": "Description",
            "type": "string"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Links",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner": {
            "title": "Owner",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "name",
          "version",
          "owner"
        ],
        "title": "SystemMeta",
        "type": "object"
      },
      "TaskAccepted": {
        "properties": {
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "status": {
            "default": "accepted",
            "title": "Status",
            "type": "string"
          },
          "task_id": {
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "task_id"
        ],
        "title": "TaskAccepted",
        "type": "object"
      },
      "TaskActivityItem": {
        "description": "One entry in a task's change-log (SPEC-112 §3.4): a field change (from an\nAgentAction) or a note (from a comment), merged by time on the board drawer.",
        "properties": {
          "actor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Id"
          },
          "actor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Name"
          },
          "at": {
            "format": "date-time",
            "title": "At",
            "type": "string"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field"
          },
          "kind": {
            "enum": [
              "change",
              "note"
            ],
            "title": "Kind",
            "type": "string"
          },
          "new": {
            "title": "New"
          },
          "old": {
            "title": "Old"
          },
          "verb": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verb"
          }
        },
        "required": [
          "kind",
          "at"
        ],
        "title": "TaskActivityItem",
        "type": "object"
      },
      "TaskCreate": {
        "description": "Create a task. `assignee_id` is validated to an active human at the service seam.",
        "properties": {
          "area": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 20000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "spec_ref": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "title": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "TaskCreate",
        "type": "object"
      },
      "TaskDetailRead": {
        "description": "A task (with resolved assignee_name) + its merged, time-ordered change-log.",
        "properties": {
          "activity": {
            "items": {
              "$ref": "#/components/schemas/TaskActivityItem"
            },
            "title": "Activity",
            "type": "array"
          },
          "area": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "assignee_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Name"
          },
          "closed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner"
          },
          "spec_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updatetime": {
            "format": "date-time",
            "title": "Updatetime",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "title",
          "description",
          "status",
          "assignee_id",
          "closed_at",
          "owner",
          "createtime",
          "updatetime"
        ],
        "title": "TaskDetailRead",
        "type": "object"
      },
      "TaskListResponse": {
        "description": "Paginated task list for the board (SPEC-112 §3.7).",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TaskRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "default": 50,
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "default": 0,
            "minimum": 0.0,
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "TaskListResponse",
        "type": "object"
      },
      "TaskNoteIn": {
        "description": "A free-text note appended to a task's change-log (stored as a comment).",
        "properties": {
          "body_markdown": {
            "maxLength": 20000,
            "minLength": 1,
            "title": "Body Markdown",
            "type": "string"
          }
        },
        "required": [
          "body_markdown"
        ],
        "title": "TaskNoteIn",
        "type": "object"
      },
      "TaskPatch": {
        "description": "Partial update — only fields explicitly sent are applied (``exclude_unset``).\n\n`status` is the open/closed vocab (SPEC-112 §3.5); `owner`/`closed_at`/`guid`\nare NOT here (service / state-machine set them).",
        "properties": {
          "area": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 20000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "spec_ref": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "open",
                  "closed"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "TaskPatch",
        "type": "object"
      },
      "TaskRead": {
        "description": "A task row for the read-only board (SPEC-112 §3.7).",
        "properties": {
          "area": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "assignee_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Id"
          },
          "assignee_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee Name"
          },
          "closed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner"
          },
          "spec_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updatetime": {
            "format": "date-time",
            "title": "Updatetime",
            "type": "string"
          }
        },
        "required": [
          "guid",
          "title",
          "description",
          "status",
          "assignee_id",
          "closed_at",
          "owner",
          "createtime",
          "updatetime"
        ],
        "title": "TaskRead",
        "type": "object"
      },
      "TenantSlot": {
        "properties": {
          "company": {
            "title": "Company",
            "type": "string"
          },
          "in_use": {
            "title": "In Use",
            "type": "integer"
          }
        },
        "required": [
          "company",
          "in_use"
        ],
        "title": "TenantSlot",
        "type": "object"
      },
      "TestRunInfo": {
        "properties": {
          "duration_s": {
            "title": "Duration S",
            "type": "number"
          },
          "errors": {
            "title": "Errors",
            "type": "integer"
          },
          "failures": {
            "title": "Failures",
            "type": "integer"
          },
          "tests": {
            "title": "Tests",
            "type": "integer"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "required": [
          "duration_s",
          "timestamp",
          "tests",
          "failures",
          "errors"
        ],
        "title": "TestRunInfo",
        "type": "object"
      },
      "TestStatus": {
        "properties": {
          "anchor": {
            "title": "Anchor",
            "type": "string"
          },
          "last_run": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run"
          },
          "status": {
            "default": "missing",
            "title": "Status",
            "type": "string"
          },
          "test_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Test Path"
          }
        },
        "required": [
          "anchor"
        ],
        "title": "TestStatus",
        "type": "object"
      },
      "TicketPatch": {
        "description": "Owner transition on a ticket (SPEC-004 §3.5/§3.9): resolve / dismiss / promote / target /\nreopen / edit.\n\n``resolution`` applies to ``dismiss`` (duplicate/not_real/wont_fix);\n``promoted_to`` applies to ``promote`` (the SPEC the ticket became); ``spec_ref``\napplies to ``target`` — point an OPEN or closed defect at a SPEC-NNN's context\nwithout changing resolution (SPEC-113 §3.4.2). ``target`` with ``spec_ref=null`` clears it.\n``reopen`` flips a CLOSED ticket back to open (clears resolution + closed_at) so a wrong\nclose can be undone without an out-of-band DB UPDATE (T#28). ``edit`` re-scopes a defect —\nupdates ``severity`` / ``title`` / ``description`` (whichever are provided) on ANY status,\nso a ticket whose root cause was named wrong can be corrected in place instead of only in a\npaired task (T#28).",
        "properties": {
          "action": {
            "enum": [
              "resolve",
              "dismiss",
              "promote",
              "target",
              "reopen",
              "edit"
            ],
            "title": "Action",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 20000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "promoted_to": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promoted To"
          },
          "resolution": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "severity": {
            "anyOf": [
              {
                "enum": [
                  "sev1",
                  "sev2",
                  "sev3",
                  "sev4"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "spec_ref": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "action"
        ],
        "title": "TicketPatch",
        "type": "object"
      },
      "TicketRead": {
        "description": "A curated ticket for the owner board / suggestion backlog (SPEC-004 §3.9).",
        "properties": {
          "area": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "closed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "component": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Component"
          },
          "contract_guid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Guid"
          },
          "createtime": {
            "format": "date-time",
            "title": "Createtime",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "duplicate_of": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duplicate Of"
          },
          "evidence": {
            "title": "Evidence"
          },
          "fingerprint": {
            "title": "Fingerprint",
            "type": "string"
          },
          "first_seen": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen"
          },
          "guid": {
            "title": "Guid",
            "type": "integer"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "last_seen": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen"
          },
          "occurrence_count": {
            "title": "Occurrence Count",
            "type": "integer"
          },
          "promoted_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promoted To"
          },
          "reporter": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reporter"
          },
          "repro": {
            "title": "Repro"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "severity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "spec_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "vote_count": {
            "title": "Vote Count",
            "type": "integer"
          }
        },
        "required": [
          "guid",
          "fingerprint",
          "kind",
          "title",
          "status",
          "occurrence_count",
          "vote_count",
          "createtime"
        ],
        "title": "TicketRead",
        "type": "object"
      },
      "TicketReportIn": {
        "description": "Write-only intake body (SPEC-004 §3.6). Only ``title`` is required; the QA\nfields carry the reproduction/proposal detail and classification is a hint.",
        "properties": {
          "actual": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actual"
          },
          "alternatives": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alternatives"
          },
          "area": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "behavior_cases": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Behavior Cases"
          },
          "body": {
            "anyOf": [
              {
                "maxLength": 20000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "component": {
            "anyOf": [
              {
                "maxLength": 160,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Component"
          },
          "contract_guid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Guid"
          },
          "environment": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          },
          "evidence": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/EvidenceItem"
                },
                "maxItems": 50,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence"
          },
          "expected": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected"
          },
          "expected_benefit": {
            "anyOf": [
              {
                "maxLength": 8000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Benefit"
          },
          "fingerprint": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fingerprint"
          },
          "kind": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload"
          },
          "problem": {
            "anyOf": [
              {
                "maxLength": 8000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Problem"
          },
          "proposed_change": {
            "anyOf": [
              {
                "maxLength": 8000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proposed Change"
          },
          "run_guid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Guid"
          },
          "severity": {
            "anyOf": [
              {
                "maxLength": 8,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "spec_ref": {
            "anyOf": [
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spec Ref"
          },
          "steps_to_reproduce": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps To Reproduce"
          },
          "title": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "TicketReportIn",
        "type": "object"
      },
      "TimelineEvent": {
        "properties": {
          "duration_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration S"
          },
          "event": {
            "title": "Event",
            "type": "string"
          },
          "failure": {
            "default": false,
            "title": "Failure",
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "collect",
              "generate",
              "publish",
              "verify"
            ],
            "title": "Kind",
            "type": "string"
          },
          "sc_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sc Id"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "ts": {
            "format": "date-time",
            "title": "Ts",
            "type": "string"
          }
        },
        "required": [
          "ts",
          "kind",
          "sc_id",
          "event",
          "text"
        ],
        "title": "TimelineEvent",
        "type": "object"
      },
      "TodayFunnel": {
        "properties": {
          "by_sc": {
            "items": {
              "$ref": "#/components/schemas/FunnelBySc"
            },
            "title": "By Sc",
            "type": "array"
          },
          "collected": {
            "title": "Collected",
            "type": "integer"
          },
          "date": {
            "title": "Date",
            "type": "string"
          },
          "eligible": {
            "title": "Eligible",
            "type": "integer"
          },
          "failed_step": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Failed Step",
            "type": "object"
          },
          "fed": {
            "title": "Fed",
            "type": "integer"
          },
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "generated": {
            "title": "Generated",
            "type": "integer"
          },
          "published": {
            "title": "Published",
            "type": "integer"
          },
          "ranked": {
            "title": "Ranked",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "verified": {
            "title": "Verified",
            "type": "integer"
          }
        },
        "required": [
          "date",
          "started_at",
          "finished_at",
          "collected",
          "ranked",
          "eligible",
          "fed",
          "generated",
          "published",
          "verified",
          "failed_step",
          "by_sc"
        ],
        "title": "TodayFunnel",
        "type": "object"
      },
      "TokenPair": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          },
          "token_type": {
            "const": "bearer",
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "refresh_token",
          "expires_in"
        ],
        "title": "TokenPair",
        "type": "object"
      },
      "TreeNode": {
        "properties": {
          "children": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/TreeNode"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Children"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "type": {
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "path"
        ],
        "title": "TreeNode",
        "type": "object"
      },
      "TrendPoint": {
        "properties": {
          "date": {
            "format": "date",
            "title": "Date",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "number"
          }
        },
        "required": [
          "date",
          "value"
        ],
        "title": "TrendPoint",
        "type": "object"
      },
      "TrendSeries": {
        "properties": {
          "metric": {
            "title": "Metric",
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/TrendPoint"
            },
            "title": "Points",
            "type": "array"
          }
        },
        "required": [
          "metric",
          "points"
        ],
        "title": "TrendSeries",
        "type": "object"
      },
      "TypeLegendItem": {
        "description": "SPEC-013 §3.1.5 — one row of the column-type legend.",
        "properties": {
          "description": {
            "title": "Description",
            "type": "string"
          },
          "eller_origin": {
            "title": "Eller Origin",
            "type": "string"
          },
          "type": {
            "enum": [
              "string",
              "integer",
              "bigint",
              "boolean",
              "timestamp",
              "date",
              "json",
              "text",
              "enum",
              "fk"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "description",
          "eller_origin"
        ],
        "title": "TypeLegendItem",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WikiLink": {
        "properties": {
          "broken": {
            "default": false,
            "title": "Broken",
            "type": "boolean"
          },
          "resolved_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved Path"
          },
          "target": {
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "target"
        ],
        "title": "WikiLink",
        "type": "object"
      }
    },
    "securitySchemes": {
      "OAuth2PasswordBearer": {
        "flows": {
          "password": {
            "scopes": {},
            "tokenUrl": "/api/v1/auth/login"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "Entherium — FastAPI rebuild of the lost previous Java no-code platform. Combines entity store, lifecycle engine, wp_admin operations and integrations.",
    "title": "Entherium",
    "version": "0.3.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/agent/pool": {
      "get": {
        "description": "SPEC-084 §2.5 (A) — per-contract digest of the agent's pool: in-flight runs,\nlast run, article status counts. One call instead of N cockpit calls.",
        "operationId": "agent_pool_api_v1_agent_pool_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response Agent Pool Api V1 Agent Pool Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Agent Pool",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/v1/agent/quota": {
      "get": {
        "description": "SPEC-084 §2.5 (C) / §2.6 — the agent's concurrency budget: cap, in-flight, remaining.",
        "operationId": "agent_quota_api_v1_agent_quota_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Agent Quota Api V1 Agent Quota Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Agent Quota",
        "tags": [
          "agent"
        ]
      }
    },
    "/api/v1/analytics/collect": {
      "post": {
        "description": "Trigger a collection run (idempotent; safe to re-run).\n\n`collect=false` — СИНХРОННЫЙ дешёвый режим (SPEC-125): внешние коллекторы не дёргаются,\nотрабатывает ingest уже лежащих файлов + скоринг тем, и вызывающий получает РЕЗУЛЬТАТ, а не\n«принято». Ночной прогон обязан знать, посчиталась ли петля: фоновая задача, о судьбе которой\nникто не узнаёт, — это тот самый сторож, который всегда зелёный.",
        "operationId": "collect_api_v1_analytics_collect_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectTrigger"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Collect Api V1 Analytics Collect Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Collect",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/v1/analytics/instances/{instance_id}": {
      "get": {
        "description": "Everything one per-instance analytics panel needs (snapshot + trends + queries + pages + index).",
        "operationId": "instance_dashboard_api_v1_analytics_instances__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceDashboard"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Instance Dashboard",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/v1/analytics/overview": {
      "get": {
        "description": "Cross-instance grid: latest snapshot KPIs + health per instance.",
        "operationId": "overview_api_v1_analytics_overview_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Overview",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/v1/analytics/runs": {
      "get": {
        "description": "Recent collection-run manifests.",
        "operationId": "runs_api_v1_analytics_runs_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CollectionRunRead"
                  },
                  "title": "Response Runs Api V1 Analytics Runs Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Runs",
        "tags": [
          "analytics"
        ]
      }
    },
    "/api/v1/architecture/catalog": {
      "get": {
        "description": "SPEC-002 §3.2.1: return YAML-loaded catalog (cached in app.state).",
        "operationId": "get_catalog_api_v1_architecture_catalog_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Catalog",
        "tags": [
          "architecture"
        ]
      }
    },
    "/api/v1/architecture/status": {
      "get": {
        "description": "SPEC-002 §3.2.2: parallel health checks with 10s TTL cache.",
        "operationId": "get_status_api_v1_architecture_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Status",
        "tags": [
          "architecture"
        ]
      }
    },
    "/api/v1/auth/agent-token": {
      "post": {
        "description": "SPEC-084 §2.7 — mint (or rotate) a scoped AGENT token + its contract grants.\n\nSuperuser-only. Creates/serves a ``role=\"agent\", api_scope=\"agent\"`` user and\nREPLACES its `agent_contract_grant` rows with `body.grants` (default-deny — a\ncontract not listed is inaccessible). Changing the pool/capabilities later is\na grant-row edit, no re-mint needed. `publish` is granted only when listed\nexplicitly (SPEC-084 §2.1: withhold on prod contracts by default).",
        "operationId": "mint_agent_token_api_v1_auth_agent_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Mint Agent Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "description": "OAuth2 password flow. `username` field is the user's email.",
        "operationId": "login_api_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_login_api_v1_auth_login_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPair"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "operationId": "me_api_v1_auth_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Me",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "description": "Exchange a refresh token for a new access token.",
        "operationId": "refresh_api_v1_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessOnly"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/service-token": {
      "post": {
        "description": "Mint (or rotate) a long-lived READ-ONLY access token for an external agent.\n\nSuperuser-only. The endpoint can only create/serve users with\n`role=\"agent\", api_scope=\"read\"` — it is structurally unable to hand out\nfull-access tokens. Re-minting reactivates a previously revoked user.",
        "operationId": "mint_service_token_api_v1_auth_service_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Mint Service Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/service-token/{guid}": {
      "delete": {
        "description": "Revoke a read-only service user: deactivate + kill all minted tokens.\n\nEffective immediately — auth re-reads the user row on every request.\nOnly `role=\"agent\", api_scope=\"read\"` users are addressable here (404 otherwise),\nso a typo'd guid can never lock out a human/admin account.",
        "operationId": "revoke_service_token_api_v1_auth_service_token__guid__delete",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Revoke Service Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/chat/messages": {
      "get": {
        "description": "Переписка рабочего чата — контекст к задаче/дефекту (SPEC-114 §3.5.1).\n\n`is_full=false` в ответе означает, что текст реплики ОБРУБЛЕН (склейка лога и state.db\nне удалась) — такую строку нельзя цитировать как дословную (§3.1.2).",
        "operationId": "list_messages_api_v1_chat_messages_get",
        "parameters": [
          {
            "description": "алиас `work` (рабочий чат Enterium.ai) / `agents`, либо сырой chat_id",
            "in": "query",
            "name": "chat",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "алиас `work` (рабочий чат Enterium.ai) / `agents`, либо сырой chat_id",
              "title": "Chat"
            }
          },
          {
            "description": "подстрока имени: Pavel / Ilya",
            "in": "query",
            "name": "author",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "подстрока имени: Pavel / Ilya",
              "title": "Author"
            }
          },
          {
            "description": "за последние N дней",
            "in": "query",
            "name": "since_days",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 365,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "за последние N дней",
              "title": "Since Days"
            }
          },
          {
            "description": "подстрока в тексте реплики",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "подстрока в тексте реплики",
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatMessageListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Messages",
        "tags": [
          "chat"
        ]
      }
    },
    "/api/v1/cloudflare/health/{domain}": {
      "get": {
        "operationId": "cf_health_api_v1_cloudflare_health__domain__get",
        "parameters": [
          {
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "title": "Domain",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cf Health Api V1 Cloudflare Health  Domain  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cf Health",
        "tags": [
          "cloudflare"
        ]
      }
    },
    "/api/v1/cloudflare/verify": {
      "get": {
        "operationId": "cf_verify_api_v1_cloudflare_verify_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cf Verify Api V1 Cloudflare Verify Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cf Verify",
        "tags": [
          "cloudflare"
        ]
      }
    },
    "/api/v1/cloudflare/zones": {
      "get": {
        "operationId": "cf_list_zones_api_v1_cloudflare_zones_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response Cf List Zones Api V1 Cloudflare Zones Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cf List Zones",
        "tags": [
          "cloudflare"
        ]
      }
    },
    "/api/v1/cloudflare/zones/{domain}": {
      "get": {
        "operationId": "cf_zone_api_v1_cloudflare_zones__domain__get",
        "parameters": [
          {
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "title": "Domain",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cf Zone Api V1 Cloudflare Zones  Domain  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cf Zone",
        "tags": [
          "cloudflare"
        ]
      }
    },
    "/api/v1/cloudflare/zones/{domain}/dns": {
      "get": {
        "operationId": "cf_dns_api_v1_cloudflare_zones__domain__dns_get",
        "parameters": [
          {
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "title": "Domain",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response Cf Dns Api V1 Cloudflare Zones  Domain  Dns Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cf Dns",
        "tags": [
          "cloudflare"
        ]
      }
    },
    "/api/v1/cloudflare/zones/{domain}/ssl": {
      "get": {
        "operationId": "cf_ssl_api_v1_cloudflare_zones__domain__ssl_get",
        "parameters": [
          {
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "title": "Domain",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cf Ssl Api V1 Cloudflare Zones  Domain  Ssl Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cf Ssl",
        "tags": [
          "cloudflare"
        ]
      }
    },
    "/api/v1/comments": {
      "get": {
        "description": "SPEC-001 §6.4.4: list filtered by target.",
        "operationId": "list_comments_api_v1_comments_get",
        "parameters": [
          {
            "in": "query",
            "name": "target_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Kind"
            }
          },
          {
            "in": "query",
            "name": "target_guid",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Guid"
            }
          },
          {
            "in": "query",
            "name": "include_deleted",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Deleted",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentList"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Comments",
        "tags": [
          "comments"
        ]
      },
      "post": {
        "description": "SPEC-001 §6.4.4: create comment, parse mentions, log @claude as agent_action.",
        "operationId": "create_comment_api_v1_comments_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Create Comment",
        "tags": [
          "comments"
        ]
      }
    },
    "/api/v1/comments/{guid}": {
      "delete": {
        "description": "SPEC-001 §6.4.4: soft-delete.",
        "operationId": "delete_comment_api_v1_comments__guid__delete",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Delete Comment Api V1 Comments  Guid  Delete",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Delete Comment",
        "tags": [
          "comments"
        ]
      },
      "get": {
        "operationId": "get_comment_api_v1_comments__guid__get",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Comment",
        "tags": [
          "comments"
        ]
      },
      "patch": {
        "description": "SPEC-001 §6.4.4: PATCH only by author (or superuser).",
        "operationId": "patch_comment_api_v1_comments__guid__patch",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Patch Comment",
        "tags": [
          "comments"
        ]
      }
    },
    "/api/v1/contracts/{guid}/cockpit": {
      "get": {
        "description": "Live cockpit snapshot for a SalesContract (empty contract → all zeros).",
        "operationId": "get_cockpit_api_v1_contracts__guid__cockpit_get",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CockpitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Cockpit",
        "tags": [
          "cockpit"
        ]
      }
    },
    "/api/v1/contracts/{guid}/heatmap": {
      "get": {
        "description": "Generate per-step distribution from the SC's in-flight generate run_steps.",
        "operationId": "get_heatmap_api_v1_contracts__guid__heatmap_get",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Heatmap Api V1 Contracts  Guid  Heatmap Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Heatmap",
        "tags": [
          "cockpit"
        ]
      }
    },
    "/api/v1/contracts/{guid}/published-articles": {
      "get": {
        "description": "Published articles (live URL set) for a contract — title, link, word count.",
        "operationId": "get_published_articles_api_v1_contracts__guid__published_articles_get",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PublishedArticle"
                  },
                  "title": "Response Get Published Articles Api V1 Contracts  Guid  Published Articles Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Published Articles",
        "tags": [
          "cockpit"
        ]
      }
    },
    "/api/v1/contracts/{guid}/timeline": {
      "get": {
        "description": "24h per-pipeline Gantt strip from the SC's last-24h pipeline_run rows.",
        "operationId": "get_timeline_api_v1_contracts__guid__timeline_get",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "window",
            "required": false,
            "schema": {
              "default": "24h",
              "title": "Window",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Timeline Api V1 Contracts  Guid  Timeline Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Timeline",
        "tags": [
          "cockpit"
        ]
      }
    },
    "/api/v1/cycles/history": {
      "get": {
        "description": "N-day cycle history. Derived from `pipeline_run` and `lifecycle_log`.",
        "operationId": "cycle_history_api_v1_cycles_history_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 7,
              "maximum": 30,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CycleDay"
                  },
                  "title": "Response Cycle History Api V1 Cycles History Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cycle History",
        "tags": [
          "cycles"
        ]
      }
    },
    "/api/v1/cycles/status": {
      "get": {
        "description": "Cron + last/next run summary. Settings-derived; future Cron service\nSPEC will replace with real cron state from a `cron_runs` table.",
        "operationId": "cron_status_api_v1_cycles_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cron Status",
        "tags": [
          "cycles"
        ]
      }
    },
    "/api/v1/cycles/timeline": {
      "get": {
        "description": "Per-day timeline of auto-chain events. Derived from `lifecycle_log` and\n`pipeline_run` ordered by timestamp.",
        "operationId": "cycle_timeline_api_v1_cycles_timeline_get",
        "parameters": [
          {
            "in": "query",
            "name": "date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TimelineEvent"
                  },
                  "title": "Response Cycle Timeline Api V1 Cycles Timeline Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cycle Timeline",
        "tags": [
          "cycles"
        ]
      }
    },
    "/api/v1/cycles/today": {
      "get": {
        "description": "Funnel summary for today's auto-cycle, plus per-SC breakdown.\n\nDerived from:\n  - `pipeline_run` rows created today (≈ runs started)\n  - `generated_articles` count by status (pending / ready / live)\n  - `salescontracts` for per-SC grouping",
        "operationId": "today_funnel_api_v1_cycles_today_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TodayFunnel"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Today Funnel",
        "tags": [
          "cycles"
        ]
      }
    },
    "/api/v1/docs/changelog": {
      "get": {
        "description": "Capability changelog of the agent-facing READ surface (SPEC-106 Territory B, layer C).\n\nAn external read-API agent (which sees the ``X-Capability-Version`` echo header) diffs these\nentries from its last-seen version to learn which endpoints/fields/semantics changed BEFORE it\nacts on stale assumptions. Mirrors the MCP ``changelog://entherium`` resource — one source\n(``app.discovery.CAPABILITY_CHANGELOG``), so the two surfaces cannot drift.",
        "operationId": "get_changelog_api_v1_docs_changelog_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilityChangelog"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Changelog",
        "tags": [
          "docs"
        ]
      }
    },
    "/api/v1/docs/file": {
      "get": {
        "description": "SPEC-001 §3.2.2: markdown content + frontmatter + resolved wikilinks.",
        "operationId": "get_file_api_v1_docs_file_get",
        "parameters": [
          {
            "description": "Relative path within vault",
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "Relative path within vault",
              "title": "Path",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocFile"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Requested path is not a .md file"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "403": {
            "description": "Path escapes the docs vault"
          },
          "404": {
            "description": "File not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get File",
        "tags": [
          "docs"
        ]
      }
    },
    "/api/v1/docs/tree": {
      "get": {
        "description": "SPEC-001 §3.2.1: recursive tree of .md files + dirs.",
        "operationId": "get_tree_api_v1_docs_tree_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TreeNode"
                  },
                  "title": "Response Get Tree Api V1 Docs Tree Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Tree",
        "tags": [
          "docs"
        ]
      }
    },
    "/api/v1/entities": {
      "get": {
        "operationId": "list_entity_types_api_v1_entities_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EntityInfo"
                  },
                  "title": "Response List Entity Types Api V1 Entities Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Entity Types",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}": {
      "get": {
        "description": "List entity records — paginated, sortable, filterable (SPEC-014 §3.2.1).\n\nAny query param that is not a control param (`limit`/`offset`/`sort`/\n`include_meta`) is read as a column filter: `col` (equals), `col_like`\n(ILIKE), `col_from`/`col_to` (range). Large JSON/text columns are\ntruncated to a preview stub; `?include_meta=true` adds the runtime schema.",
        "operationId": "list_records_api_v1_entities__name__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Sort"
            }
          },
          {
            "in": "query",
            "name": "include_meta",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Meta",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "include_deleted",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Deleted",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Records",
        "tags": [
          "entities"
        ]
      },
      "post": {
        "operationId": "create_record_api_v1_entities__name__post",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Payload",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Create Record Api V1 Entities  Name  Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Create Record",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/bulk-delete": {
      "post": {
        "description": "Delete many rows — PROD rows without approval are blocked (SPEC-014 §3.2.7).",
        "operationId": "bulk_delete_api_v1_entities__name__bulk_delete_post",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-prod-approval",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Prod-Approval"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Bulk Delete",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/bulk-export": {
      "post": {
        "description": "Export selected rows as a downloadable JSON file (SPEC-014 §3.2.8).",
        "operationId": "bulk_export_api_v1_entities__name__bulk_export_post",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Bulk Export",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/count": {
      "get": {
        "description": "Row count for an entity, cached in-process for 30s (SPEC-014 §3.2.4).",
        "operationId": "count_records_api_v1_entities__name__count_get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityCountResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Count Records",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/{guid}": {
      "delete": {
        "description": "Delete a row — soft (deleted_at) for soft-deletable entities (SPEC-014 §3.2.6).",
        "operationId": "delete_record_api_v1_entities__name___guid__delete",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "x-prod-approval",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Prod-Approval"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Delete Record",
        "tags": [
          "entities"
        ]
      },
      "get": {
        "description": "Read one full row + runtime schema for the row drawer (SPEC-014 §3.2.2).",
        "operationId": "read_record_api_v1_entities__name___guid__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RowResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Read Record",
        "tags": [
          "entities"
        ]
      },
      "patch": {
        "description": "Partial update — PROD-guarded and audit-logged (SPEC-014 §3.2.5).",
        "operationId": "update_record_api_v1_entities__name___guid__patch",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "x-prod-approval",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Prod-Approval"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Payload",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Update Record Api V1 Entities  Name   Guid  Patch"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Update Record",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/{guid}/audit": {
      "get": {
        "description": "Audit trail for one row, projected from lifecycle_log (SPEC-014 §3.2.9).\n\nLatest first. A multi-field edit is expanded into one event per field.",
        "operationId": "read_audit_api_v1_entities__name___guid__audit_get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AuditEvent"
                  },
                  "title": "Response Read Audit Api V1 Entities  Name   Guid  Audit Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Read Audit",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/{guid}/field/{field}": {
      "get": {
        "description": "Read one field's full, untruncated value — lazy JSON load (SPEC-014 §3.2.3).",
        "operationId": "read_field_api_v1_entities__name___guid__field__field__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "field",
            "required": true,
            "schema": {
              "title": "Field",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Read Field",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/entities/{name}/{guid}/restore": {
      "post": {
        "description": "Restore a soft-deleted row — clears deleted_at (SPEC-014 §3.2.6a).",
        "operationId": "restore_record_api_v1_entities__name___guid__restore_post",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "x-prod-approval",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Prod-Approval"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Restore Record Api V1 Entities  Name   Guid  Restore Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Restore Record",
        "tags": [
          "entities"
        ]
      }
    },
    "/api/v1/errors": {
      "get": {
        "description": "Recent captured runtime errors, newest first (SPEC-060 §1.2 / §4 PR-5).\n\nLets an operator answer \"what just broke\" without trawling the JSON log\nstream — the durable counterpart to the structlog ``error_captured`` event.",
        "operationId": "list_errors_api_v1_errors_get",
        "parameters": [
          {
            "description": "filter by capture source",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter by capture source",
              "title": "Source"
            }
          },
          {
            "description": "filter by stable operation label",
            "in": "query",
            "name": "operation",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter by stable operation label",
              "title": "Operation"
            }
          },
          {
            "description": "only errors captured at/after this UTC time",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "only errors captured at/after this UTC time",
              "title": "Since"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ErrorEventRead"
                  },
                  "title": "Response List Errors Api V1 Errors Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Errors",
        "tags": [
          "errors"
        ]
      }
    },
    "/api/v1/health": {
      "get": {
        "description": "Always returns 200 if the process is up. No external dependencies.",
        "operationId": "liveness_api_v1_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Liveness",
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/health/db": {
      "get": {
        "description": "Verifies that the DB connection is alive (`SELECT 1`).",
        "operationId": "db_health_api_v1_health_db_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DbHealth"
                }
              }
            },
            "description": "Successful Response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DbHealth"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Db Health",
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/health/ready": {
      "get": {
        "description": "K8s-style /readyz — green only if both DB and Redis respond.",
        "operationId": "readiness_api_v1_health_ready_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessReport"
                }
              }
            },
            "description": "Successful Response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessReport"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Readiness",
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/instances": {
      "get": {
        "operationId": "list_instances_api_v1_instances_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/HugoInstanceRead"
                  },
                  "title": "Response List Instances Api V1 Instances Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Instances",
        "tags": [
          "instances"
        ]
      },
      "post": {
        "operationId": "create_instance_api_v1_instances_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HugoInstanceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HugoInstanceRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Create Instance",
        "tags": [
          "instances"
        ]
      }
    },
    "/api/v1/instances/{instance_id}": {
      "delete": {
        "operationId": "delete_instance_api_v1_instances__instance_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Delete Instance",
        "tags": [
          "instances"
        ]
      },
      "get": {
        "operationId": "read_instance_api_v1_instances__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HugoInstanceRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Read Instance",
        "tags": [
          "instances"
        ]
      },
      "patch": {
        "operationId": "update_instance_api_v1_instances__instance_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HugoInstanceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HugoInstanceRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Update Instance",
        "tags": [
          "instances"
        ]
      }
    },
    "/api/v1/instances/{instance_id}/published": {
      "get": {
        "description": "SPEC-084 §2.5 (H) — published-article links on an instance (from `published_url`).\n\nLive link = `url_external` ∥ `base_url + '/' + slug`; plus source_url, title,\ntimestamps, index_status. Pool-scoped: an agent reaches only its instances\n(`instance.attached_sc` ∈ pool) — both convenience and a read-BOLA boundary.",
        "operationId": "instance_published_api_v1_instances__instance_id__published_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "in": "query",
            "name": "active_only",
            "required": false,
            "schema": {
              "default": true,
              "title": "Active Only",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response Instance Published Api V1 Instances  Instance Id  Published Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Instance Published",
        "tags": [
          "instances"
        ]
      }
    },
    "/api/v1/instances/{instance_id}/summary": {
      "get": {
        "description": "Public polling endpoint (1.5-3s tick on the webui).",
        "operationId": "instance_summary_api_v1_instances__instance_id__summary_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "refresh",
            "required": false,
            "schema": {
              "default": false,
              "title": "Refresh",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Instance Summary",
        "tags": [
          "instances"
        ]
      }
    },
    "/api/v1/instances/{instance_id}/warmup": {
      "post": {
        "description": "Mark instance as warming. Real workflow lands in Phase 5 (Hatchet).",
        "operationId": "warmup_instance_api_v1_instances__instance_id__warmup_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Warmup Instance Api V1 Instances  Instance Id  Warmup Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Warmup Instance",
        "tags": [
          "instances"
        ]
      }
    },
    "/api/v1/integrations": {
      "get": {
        "description": "Every external connection with its cached status (SPEC-015 §3.4.1).",
        "operationId": "list_integrations_api_v1_integrations_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ConnectionStatus"
                  },
                  "title": "Response List Integrations Api V1 Integrations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Integrations",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/integrations/{connection_id}": {
      "get": {
        "description": "One connection's freshly recomputed status (SPEC-015 §3.4.2).",
        "operationId": "get_integration_api_v1_integrations__connection_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Integration",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/integrations/{connection_id}/health": {
      "post": {
        "description": "Force an immediate re-probe of one connection (SPEC-015 §3.4.3).",
        "operationId": "recheck_integration_api_v1_integrations__connection_id__health_post",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Recheck Integration",
        "tags": [
          "integrations"
        ]
      }
    },
    "/api/v1/lifecycles/{entity_name}/processEvent": {
      "post": {
        "operationId": "process_event_api_v1_lifecycles__entity_name__processEvent_post",
        "parameters": [
          {
            "in": "path",
            "name": "entity_name",
            "required": true,
            "schema": {
              "title": "Entity Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessEventResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Process Event",
        "tags": [
          "lifecycles"
        ]
      }
    },
    "/api/v1/lifecycles/{entity_name}/{guid}/advance": {
      "post": {
        "description": "Advance a record via an outlet (analog of Entherium's `advance_record`).",
        "operationId": "advance_api_v1_lifecycles__entity_name___guid__advance_post",
        "parameters": [
          {
            "in": "path",
            "name": "entity_name",
            "required": true,
            "schema": {
              "title": "Entity Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Advance",
        "tags": [
          "lifecycles"
        ]
      }
    },
    "/api/v1/lifecycles/{entity_name}/{guid}/log": {
      "get": {
        "operationId": "read_log_api_v1_lifecycles__entity_name___guid__log_get",
        "parameters": [
          {
            "in": "path",
            "name": "entity_name",
            "required": true,
            "schema": {
              "title": "Entity Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LifecycleLogRead"
                  },
                  "title": "Response Read Log Api V1 Lifecycles  Entity Name   Guid  Log Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Read Log",
        "tags": [
          "lifecycles"
        ]
      }
    },
    "/api/v1/lifecycles/{entity_name}/{guid}/postMessage": {
      "post": {
        "operationId": "post_message_api_v1_lifecycles__entity_name___guid__postMessage_post",
        "parameters": [
          {
            "in": "path",
            "name": "entity_name",
            "required": true,
            "schema": {
              "title": "Entity Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostMessageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleLogRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Post Message",
        "tags": [
          "lifecycles"
        ]
      }
    },
    "/api/v1/lifecycles/{entity_name}/{guid}/state": {
      "get": {
        "operationId": "get_state_api_v1_lifecycles__entity_name___guid__state_get",
        "parameters": [
          {
            "in": "path",
            "name": "entity_name",
            "required": true,
            "schema": {
              "title": "Entity Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleStateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get State",
        "tags": [
          "lifecycles"
        ]
      }
    },
    "/api/v1/lifecycles/{entity_name}/{guid}/stepTo": {
      "post": {
        "operationId": "step_to_api_v1_lifecycles__entity_name___guid__stepTo_post",
        "parameters": [
          {
            "in": "path",
            "name": "entity_name",
            "required": true,
            "schema": {
              "title": "Entity Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepToRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Step To",
        "tags": [
          "lifecycles"
        ]
      }
    },
    "/api/v1/localizations": {
      "get": {
        "description": "List localization rows, newest first (SPEC-109 §3.4).",
        "operationId": "list_localizations_api_v1_localizations_get",
        "parameters": [
          {
            "description": "filter by owning salescontract guid",
            "in": "query",
            "name": "salescontract",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter by owning salescontract guid",
              "title": "Salescontract"
            }
          },
          {
            "description": "filter by generated_articles guid",
            "in": "query",
            "name": "article",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter by generated_articles guid",
              "title": "Article"
            }
          },
          {
            "description": "filter by BCP-47 language",
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter by BCP-47 language",
              "title": "Language"
            }
          },
          {
            "description": "filter by state-machine status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "filter by state-machine status",
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LocalizationRead"
                  },
                  "title": "Response List Localizations Api V1 Localizations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Localizations",
        "tags": [
          "localizations"
        ]
      }
    },
    "/api/v1/metamodel": {
      "get": {
        "description": "SPEC-013 §3.3.1 — catalog of business entities + FK edges + type legend.",
        "operationId": "get_metamodel_api_v1_metamodel_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetamodelResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Metamodel",
        "tags": [
          "metamodel"
        ]
      }
    },
    "/api/v1/metamodel/{entity}": {
      "get": {
        "description": "SPEC-013 §3.3.2 — full schema of one business entity.",
        "operationId": "get_metamodel_entity_api_v1_metamodel__entity__get",
        "parameters": [
          {
            "in": "path",
            "name": "entity",
            "required": true,
            "schema": {
              "title": "Entity",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetamodelDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Metamodel Entity",
        "tags": [
          "metamodel"
        ]
      }
    },
    "/api/v1/metering/costs/by-article": {
      "get": {
        "description": "Per-article cost for a contract: direct spend + amortized collect share.\n\n``direct`` = sum over the article's own runs (generate/publish, where\n``generated_article_id`` is set). ``amortized_collect`` = the contract's\ncontract-level cost (its collect runs, where ``generated_article_id`` IS\nNULL) divided by the number of articles in the window — SPEC-107 §3.6 (owner\ndecision: amortize by period, not per collect-run, since collect feeds the\nreused RAG corpus). imagegen is a deliberately separate ledger and NOT added.",
        "operationId": "costs_by_article_api_v1_metering_costs_by_article_get",
        "parameters": [
          {
            "in": "query",
            "name": "salescontracts_id",
            "required": true,
            "schema": {
              "title": "Salescontracts Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ArticleCostRow"
                  },
                  "title": "Response Costs By Article Api V1 Metering Costs By Article Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Costs By Article",
        "tags": [
          "metering"
        ]
      }
    },
    "/api/v1/metering/costs/by-contract": {
      "get": {
        "description": "Per-contract cost rollup (sum over each salescontracts_id).",
        "operationId": "costs_by_contract_api_v1_metering_costs_by_contract_get",
        "parameters": [
          {
            "in": "query",
            "name": "ai_company_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ai Company Id"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ContractCostRow"
                  },
                  "title": "Response Costs By Contract Api V1 Metering Costs By Contract Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Costs By Contract",
        "tags": [
          "metering"
        ]
      }
    },
    "/api/v1/metering/costs/by-pipeline-run": {
      "get": {
        "description": "Per-run cost rows, newest first.",
        "operationId": "costs_by_pipeline_run_api_v1_metering_costs_by_pipeline_run_get",
        "parameters": [
          {
            "in": "query",
            "name": "ai_company_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ai Company Id"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RunCostRow"
                  },
                  "title": "Response Costs By Pipeline Run Api V1 Metering Costs By Pipeline Run Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Costs By Pipeline Run",
        "tags": [
          "metering"
        ]
      }
    },
    "/api/v1/metering/costs/summary": {
      "get": {
        "description": "Cost + tokens + brave aggregated by day / contract / model / provider.",
        "operationId": "costs_summary_api_v1_metering_costs_summary_get",
        "parameters": [
          {
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "default": "day",
              "enum": [
                "day",
                "contract",
                "model",
                "provider"
              ],
              "title": "Group By",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ai_company_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ai Company Id"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CostSummaryRow"
                  },
                  "title": "Response Costs Summary Api V1 Metering Costs Summary Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Costs Summary",
        "tags": [
          "metering"
        ]
      }
    },
    "/api/v1/ops/image-references": {
      "get": {
        "description": "Image URLs referenced by articles + plan-vs-generated gaps (SPEC-095 §3.4).\n\nFeed for the imagegen usage-reconciler (tools/image_registry/reconcile.py).",
        "operationId": "get_image_references_api_v1_ops_image_references_get",
        "parameters": [
          {
            "in": "query",
            "name": "sc_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Sc Id"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 1000,
              "maximum": 5000,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageReferencesPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Image References",
        "tags": [
          "ops"
        ]
      }
    },
    "/api/v1/ops/orchestrator/heartbeat": {
      "post": {
        "description": "Record the gen-orchestrator's per-tick heartbeat (targets/active/note).",
        "operationId": "post_orchestrator_heartbeat_api_v1_ops_orchestrator_heartbeat_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrchestratorHeartbeatIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Post Orchestrator Heartbeat",
        "tags": [
          "ops"
        ]
      }
    },
    "/api/v1/ops/overview": {
      "get": {
        "description": "Live platform ops snapshot — poll this (3-5s) to watch the whole platform.",
        "operationId": "get_overview_api_v1_ops_overview_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsOverview"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Overview",
        "tags": [
          "ops"
        ]
      }
    },
    "/api/v1/publish/article": {
      "post": {
        "description": "Publish one article to its Hugo instance (real wp-admin flow, async).\n\n404s if the article/instance is unknown; 400 if the instance has no\nwp-admin config (so a publish that can never succeed isn't accepted).",
        "operationId": "publish_article_api_v1_publish_article_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishArticleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskAccepted"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Publish Article",
        "tags": [
          "publish"
        ]
      }
    },
    "/api/v1/publish/batch": {
      "post": {
        "operationId": "publish_batch_api_v1_publish_batch_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskAccepted"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Publish Batch",
        "tags": [
          "publish"
        ]
      }
    },
    "/api/v1/publish/deploy": {
      "post": {
        "operationId": "deploy_api_v1_publish_deploy_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskAccepted"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Deploy",
        "tags": [
          "publish"
        ]
      }
    },
    "/api/v1/runs": {
      "get": {
        "description": "§3.3.1 — filtered, paginated run list (default sort createtime:desc).",
        "operationId": "list_runs_api_v1_runs_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "pipeline_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pipeline Id"
            }
          },
          {
            "in": "query",
            "name": "entity",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Entity"
            }
          },
          {
            "in": "query",
            "name": "contract",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Contract"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "createtime:desc",
              "title": "Sort",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Runs",
        "tags": [
          "runs"
        ]
      },
      "post": {
        "description": "§3.3.2 — validate, create a queued run, stage the fixture, enqueue the job.",
        "operationId": "launch_run_api_v1_runs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunLaunchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineRunRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Launch Run",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/pipelines": {
      "get": {
        "description": "§3.3.8 — every registered pipeline definition.",
        "operationId": "list_pipelines_api_v1_runs_pipelines_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PipelineDefRead"
                  },
                  "title": "Response List Pipelines Api V1 Runs Pipelines Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Pipelines",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/pipelines/{pipeline_id}": {
      "get": {
        "description": "§3.3.9 — a single pipeline definition.",
        "operationId": "get_pipeline_def_api_v1_runs_pipelines__pipeline_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "pipeline_id",
            "required": true,
            "schema": {
              "title": "Pipeline Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineDefRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Pipeline Def",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/preflight": {
      "get": {
        "description": "SPEC-084 §2.5 (B) — can this run launch? Returns can_launch + blocking reasons\nWITHOUT creating a run (saves wasted launches / Nebius budget). Declared before\n``/{run_guid}`` so the static path wins over the int converter.",
        "operationId": "run_preflight_api_v1_runs_preflight_get",
        "parameters": [
          {
            "in": "query",
            "name": "pipeline_id",
            "required": true,
            "schema": {
              "title": "Pipeline Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "entity",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Entity"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Run Preflight Api V1 Runs Preflight Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Run Preflight",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/schedules": {
      "get": {
        "description": "§3.3.1 — every schedule, newest first.",
        "operationId": "list_schedules_api_v1_runs_schedules_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RunScheduleRead"
                  },
                  "title": "Response List Schedules Api V1 Runs Schedules Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Schedules",
        "tags": [
          "runs"
        ]
      },
      "post": {
        "description": "§3.3.2 — create a schedule (validates pipeline + cron; computes next_fire_at).",
        "operationId": "create_schedule_api_v1_runs_schedules_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunScheduleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunScheduleRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Create Schedule",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/schedules/{schedule_id}": {
      "delete": {
        "description": "§3.3.5 — delete a schedule (idempotent).",
        "operationId": "delete_schedule_api_v1_runs_schedules__schedule_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "title": "Schedule Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Delete Schedule",
        "tags": [
          "runs"
        ]
      },
      "get": {
        "description": "§3.3.3 — a single schedule.",
        "operationId": "get_schedule_api_v1_runs_schedules__schedule_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "title": "Schedule Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunScheduleRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Schedule",
        "tags": [
          "runs"
        ]
      },
      "patch": {
        "description": "§3.3.4 — partial update; a changed cron recomputes next_fire_at.",
        "operationId": "update_schedule_api_v1_runs_schedules__schedule_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "title": "Schedule Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunScheduleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunScheduleRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Update Schedule",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/schedules/{schedule_id}/fire": {
      "post": {
        "description": "§3.3.6 — fire now (same seam as the tick-loop / an external Cloud Scheduler).",
        "operationId": "fire_now_api_v1_runs_schedules__schedule_id__fire_post",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "title": "Schedule Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleFireResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Fire Now",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/schedules/{schedule_id}/runs": {
      "get": {
        "description": "§3.3.7 — guids of the runs this schedule produced (params.schedule_id).",
        "operationId": "schedule_runs_api_v1_runs_schedules__schedule_id__runs_get",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "title": "Schedule Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "integer"
                  },
                  "title": "Response Schedule Runs Api V1 Runs Schedules  Schedule Id  Runs Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Schedule Runs",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/{run_guid}": {
      "get": {
        "description": "§3.3.3 — run record + its steps + target card + pipeline def.",
        "operationId": "get_run_api_v1_runs__run_guid__get",
        "parameters": [
          {
            "in": "path",
            "name": "run_guid",
            "required": true,
            "schema": {
              "title": "Run Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDetailResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Run",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/{run_guid}/cancel": {
      "post": {
        "description": "§3.3.6 — cancel a queued or running run; idempotent (terminal → 409).",
        "operationId": "cancel_run_api_v1_runs__run_guid__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "run_guid",
            "required": true,
            "schema": {
              "title": "Run Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineRunRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Cancel Run",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/{run_guid}/log": {
      "get": {
        "description": "§3.3.5 — assembled log; `step` filters to one step, `tail` keeps last N.",
        "operationId": "get_run_log_api_v1_runs__run_guid__log_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_guid",
            "required": true,
            "schema": {
              "title": "Run Guid",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "step",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Step"
            }
          },
          {
            "in": "query",
            "name": "tail",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tail"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunLogResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Run Log",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/{run_guid}/retry": {
      "post": {
        "description": "§3.3.7 — create a new run; `from_step` resumes from a step snapshot.",
        "operationId": "retry_run_api_v1_runs__run_guid__retry_post",
        "parameters": [
          {
            "in": "path",
            "name": "run_guid",
            "required": true,
            "schema": {
              "title": "Run Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunRetryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineRunRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Retry Run",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/runs/{run_guid}/steps": {
      "get": {
        "description": "§3.3.4 — the step rows of a run, ordered by seq/attempt.",
        "operationId": "get_run_steps_api_v1_runs__run_guid__steps_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_guid",
            "required": true,
            "schema": {
              "title": "Run Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RunStepRead"
                  },
                  "title": "Response Get Run Steps Api V1 Runs  Run Guid  Steps Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Run Steps",
        "tags": [
          "runs"
        ]
      }
    },
    "/api/v1/specs": {
      "get": {
        "description": "SPEC-001 §3.1.1: list all specs sorted by id descending.",
        "operationId": "list_specs_api_v1_specs_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Specs",
        "tags": [
          "specs"
        ]
      }
    },
    "/api/v1/specs/{spec_id}": {
      "get": {
        "description": "SPEC-001 §3.1.2: detail with frontmatter, body, sections, tests_status.",
        "operationId": "get_spec_api_v1_specs__spec_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "spec_id",
            "required": true,
            "schema": {
              "title": "Spec Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecDetailResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Malformed spec id (expected SPEC-NNN)"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "404": {
            "description": "Spec not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Spec",
        "tags": [
          "specs"
        ]
      }
    },
    "/api/v1/specs/{spec_id}/history": {
      "get": {
        "description": "SPEC-001 §3.1.3: git log per file. Empty if .git not mounted.",
        "operationId": "get_spec_history_api_v1_specs__spec_id__history_get",
        "parameters": [
          {
            "in": "path",
            "name": "spec_id",
            "required": true,
            "schema": {
              "title": "Spec Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "title": "Response Get Spec History Api V1 Specs  Spec Id  History Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Malformed spec id (expected SPEC-NNN)"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "404": {
            "description": "Spec not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Spec History",
        "tags": [
          "specs"
        ]
      }
    },
    "/api/v1/specs/{spec_id}/progress": {
      "get": {
        "description": "Implementation progress grouped by spec section — each leaf §-anchor\nwith its label and whether a test covers it (`SPEC-NNN §X.Y` citation).",
        "operationId": "get_spec_progress_api_v1_specs__spec_id__progress_get",
        "parameters": [
          {
            "in": "path",
            "name": "spec_id",
            "required": true,
            "schema": {
              "title": "Spec Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProgressSection"
                  },
                  "title": "Response Get Spec Progress Api V1 Specs  Spec Id  Progress Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Malformed spec id (expected SPEC-NNN)"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "404": {
            "description": "Spec not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Spec Progress",
        "tags": [
          "specs"
        ]
      }
    },
    "/api/v1/specs/{spec_id}/status": {
      "patch": {
        "description": "SPEC-001 §3.1.5: status transition with validation.",
        "operationId": "patch_spec_status_api_v1_specs__spec_id__status_patch",
        "parameters": [
          {
            "in": "path",
            "name": "spec_id",
            "required": true,
            "schema": {
              "title": "Spec Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Patch Spec Status Api V1 Specs  Spec Id  Status Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Patch Spec Status",
        "tags": [
          "specs"
        ]
      }
    },
    "/api/v1/specs/{spec_id}/tests": {
      "get": {
        "description": "Return individual pytest test-cases for this spec from junit.xml.",
        "operationId": "get_spec_tests_api_v1_specs__spec_id__tests_get",
        "parameters": [
          {
            "in": "path",
            "name": "spec_id",
            "required": true,
            "schema": {
              "title": "Spec Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SpecTestCase"
                  },
                  "title": "Response Get Spec Tests Api V1 Specs  Spec Id  Tests Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Malformed spec id (expected SPEC-NNN)"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "404": {
            "description": "Spec not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Spec Tests",
        "tags": [
          "specs"
        ]
      }
    },
    "/api/v1/sse/all": {
      "get": {
        "description": "Subscribe to every event channel.",
        "operationId": "sse_all_api_v1_sse_all_get",
        "parameters": [
          {
            "in": "query",
            "name": "access_token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Sse All",
        "tags": [
          "sse"
        ]
      }
    },
    "/api/v1/sse/integrations": {
      "get": {
        "description": "SPEC-015 §3.5 — connection status-change events.\n\nThe integrations health-checker emits `integration.status` whenever a\nconnection's credential or health status changes.",
        "operationId": "sse_integrations_api_v1_sse_integrations_get",
        "parameters": [
          {
            "in": "query",
            "name": "access_token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Sse Integrations",
        "tags": [
          "sse"
        ]
      }
    },
    "/api/v1/sse/lifecycle": {
      "get": {
        "description": "SPEC-007 §14.1 / §14.2 — lifecycle SSE channel.\n\nEmits: lifecycle.transitioned, lifecycle.autorun.completed,\nlifecycle.message, lifecycle.batch.completed. Source of truth —\nLifecycleEngine, which publishes only after session.commit() (SPEC-007 §14.3).\nMulti-worker note: in-memory bus is MVP; Redis-backed migration is\nSPEC-007 §14.4 (same pattern as runs:sse §5.8.3).",
        "operationId": "sse_lifecycle_api_v1_sse_lifecycle_get",
        "parameters": [
          {
            "in": "query",
            "name": "access_token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Sse Lifecycle",
        "tags": [
          "sse"
        ]
      }
    },
    "/api/v1/sse/publish": {
      "get": {
        "description": "Subscribe to publish/deploy progress events.",
        "operationId": "sse_publish_api_v1_sse_publish_get",
        "parameters": [
          {
            "in": "query",
            "name": "access_token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Sse Publish",
        "tags": [
          "sse"
        ]
      }
    },
    "/api/v1/sse/runs": {
      "get": {
        "description": "Subscribe to pipeline-run events — Redis-backed, multi-worker (§5.8.3).",
        "operationId": "sse_runs_api_v1_sse_runs_get",
        "parameters": [
          {
            "in": "query",
            "name": "access_token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Sse Runs",
        "tags": [
          "sse"
        ]
      }
    },
    "/api/v1/sse/workspace": {
      "get": {
        "description": "SPEC-001 §7.3 — Workspace channel.\n\nEmits: spec.*, issue.*, defect.*, comment.*, agent_action.* events.",
        "operationId": "sse_workspace_api_v1_sse_workspace_get",
        "parameters": [
          {
            "in": "query",
            "name": "access_token",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Sse Workspace",
        "tags": [
          "sse"
        ]
      }
    },
    "/api/v1/tasks": {
      "get": {
        "description": "The read-only task board — paginated, filterable by assignee / status / area.\nTeam-only (owner + team members); an agent or non-team token gets 403.",
        "operationId": "list_tasks_endpoint_api_v1_tasks_get",
        "parameters": [
          {
            "in": "query",
            "name": "assignee_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Assignee Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "description": "platform|pipelines|instances|other",
            "in": "query",
            "name": "area",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "platform|pipelines|instances|other",
              "title": "Area"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Tasks Endpoint",
        "tags": [
          "tasks"
        ]
      },
      "post": {
        "description": "Create a task (agent needs ``manage_task``; owner/humans no-op the gate).",
        "operationId": "create_api_v1_tasks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Create",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tasks/{guid}": {
      "get": {
        "description": "One task + its merged change-log (AgentAction ⊕ notes, SPEC-112 §3.4). Team-only; 404 if absent.",
        "operationId": "get_task_endpoint_api_v1_tasks__guid__get",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Get Task Endpoint",
        "tags": [
          "tasks"
        ]
      },
      "patch": {
        "description": "Change status (open↔closed) / reassign / edit; logs each field change.",
        "operationId": "patch_api_v1_tasks__guid__patch",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Patch",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tasks/{guid}/notes": {
      "post": {
        "description": "Append a free-text note to the task's log (stored as a comment).",
        "operationId": "add_task_note_api_v1_tasks__guid__notes_post",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskNoteIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Add Task Note",
        "tags": [
          "tasks"
        ]
      }
    },
    "/api/v1/tickets": {
      "get": {
        "description": "The owner board — defects/incidents by default, or a vote-ranked suggestion\nbacklog with ``?kind=suggestion`` (SPEC-004 §3.9). Team-readable (owner + team,\nSPEC-112 §3.3) — the defect section of the tasks board; agents still get 403.",
        "operationId": "list_board_api_v1_tickets_get",
        "parameters": [
          {
            "description": "defect|incident|suggestion (default: the defect/incident board)",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "defect|incident|suggestion (default: the defect/incident board)",
              "title": "Kind"
            }
          },
          {
            "description": "open|closed",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "open|closed",
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "component",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Component"
            }
          },
          {
            "description": "platform|pipelines|instances|other",
            "in": "query",
            "name": "area",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "platform|pipelines|instances|other",
              "title": "Area"
            }
          },
          {
            "in": "query",
            "name": "severity",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Severity"
            }
          },
          {
            "description": "tickets created at/after this UTC time",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "tickets created at/after this UTC time",
              "title": "Since"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TicketRead"
                  },
                  "title": "Response List Board Api V1 Tickets Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "List Board",
        "tags": [
          "tickets"
        ]
      },
      "post": {
        "description": "Intake one report; return a bare 202 (SPEC-004 §1.5 / §3.3).\n\nWrite-only fire-and-forget: no ticket id, no dedup verdict — a hostile or\nlooping reporter gets nothing back to react to. Over the flood cap → 429;\nan oversized body → 413.",
        "operationId": "file_ticket_api_v1_tickets_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketReportIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "File Ticket",
        "tags": [
          "tickets"
        ]
      }
    },
    "/api/v1/tickets/{guid}": {
      "patch": {
        "description": "Resolve / dismiss / promote a ticket, state-machine-guarded (SPEC-004 §3.5).\n\nOwner-only. An illegal transition (e.g. closing an already-closed ticket) → 409.",
        "operationId": "transition_ticket_api_v1_tickets__guid__patch",
        "parameters": [
          {
            "in": "path",
            "name": "guid",
            "required": true,
            "schema": {
              "title": "Guid",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid authentication credentials"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "summary": "Transition Ticket",
        "tags": [
          "tickets"
        ]
      }
    },
    "/api/v1/tma/backups": {
      "get": {
        "description": "DR backup freshness board for the Mini App (SPEC-072 §8.2).\n\nPer artifact (pgBackRest WAL x2 boxes, logical dump, restic x2, Hugo snapshot):\nnewest GCS object age + tone, the owner's #1 ask — \"all backup statuses with\ntheir update date\". Delegates to ``ops.build_backup_status`` (Redis-cached;\nno DB session needed — the data is GCS object metadata).",
        "operationId": "get_tma_backups_api_v1_tma_backups_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid Telegram initData"
          },
          "403": {
            "description": "Authenticated Telegram user is not the owner"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tma Backups",
        "tags": [
          "tma"
        ]
      }
    },
    "/api/v1/tma/overview": {
      "get": {
        "description": "Live ops snapshot for the Mini App — delegates to ``ops.build_overview``.\n\nSPEC-072 §2.3: identical payload to ``GET /api/v1/ops/overview`` (same builder,\nnot a copy), only the auth differs (owner initData vs JWT).",
        "operationId": "get_tma_overview_api_v1_tma_overview_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsOverview"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid Telegram initData"
          },
          "403": {
            "description": "Authenticated Telegram user is not the owner"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tma Overview",
        "tags": [
          "tma"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "prod (box)",
      "url": "https://entherium.duckdns.org:8443"
    },
    {
      "description": "dev (local)",
      "url": "http://localhost:8000"
    }
  ],
  "tags": [
    {
      "description": "Scoped-agent resource pool — instances the agent may operate (/pool) and per-agent run quota (/quota).",
      "name": "agent"
    },
    {
      "description": "Liveness, DB connectivity and readiness probes (/, /db, /ready).",
      "name": "health"
    },
    {
      "description": "OAuth2 password login + JWT refresh; issues and revokes access/refresh tokens.",
      "name": "auth"
    },
    {
      "description": "Generic CRUD over the core entity types (SalesContract, Config, GeneratedArticle, Author, ...) plus audit and user.",
      "name": "entities"
    },
    {
      "description": "Lifecycle state-machine definitions and transitions (advance / stepTo).",
      "name": "lifecycles"
    },
    {
      "description": "Hugo-site instance management — list, snapshot, dashboard, attach/detach from a contract.",
      "name": "instances"
    },
    {
      "description": "Two-phase bulk publish — stage articles to wp-admin, build+deploy Hugo, verify live URLs.",
      "name": "publish"
    },
    {
      "description": "Read-only Cloudflare zone/DNS/SSL mirror for cockpit health panels.",
      "name": "cloudflare"
    },
    {
      "description": "Server-sent event streams; channels: all, runs, publish, workspace.",
      "name": "sse"
    },
    {
      "description": "SPEC entity store — CRUD over SPEC-NNN records, status transitions, coverage linkage.",
      "name": "specs"
    },
    {
      "description": "Read-only vault mirror — serves the docs/ tree as markdown for in-app agent reference (/tree, /{path}).",
      "name": "docs"
    },
    {
      "description": "Polymorphic comment threads with @claude / #SPEC-NNN / #D-NNN mention resolution.",
      "name": "comments"
    },
    {
      "description": "Architecture catalog — pipeline/context catalog (/catalog) and deployment-topology status (/status).",
      "name": "architecture"
    },
    {
      "description": "Cron-based run schedules — CRUD, manual fire (/fire), schedule->runs history.",
      "name": "runs"
    },
    {
      "description": "Introspective entity graph — entity schema, field types and relationship edges as a machine-readable map.",
      "name": "metamodel"
    },
    {
      "description": "External connection registry — list and health-check named integrations (GCS, wp-admin, Cloudflare, Brave, LLM keys).",
      "name": "integrations"
    },
    {
      "description": "Daily content-cycle dashboard — cron status, today's collect->generate->publish funnel, history, timeline.",
      "name": "cycles"
    },
    {
      "description": "Per-contract cockpit — step heatmap, publish timeline, run DAG for a SalesContract (OpenAPI tag: cockpit).",
      "name": "cockpit"
    },
    {
      "description": "SEO analytics ingest + read — GSC/CrUX/PSI collection trigger, per-instance dashboard, collection history.",
      "name": "analytics"
    },
    {
      "description": "Operational overview + orchestrator heartbeat — run/publish counts, per-contract progress, alerts. NOTE: prod runs on a daily timer (no persistent orchestrator), so orchestrator.present=false is normal, not an outage; the real execution funnel is the `cycles` domain.",
      "name": "ops"
    },
    {
      "description": "Durable error sink (SPEC-060) — recent captured runtime exceptions (source/operation/exc_type/error, newest first, filterable by source/operation/since). The read surface for 'what just broke' and WHY a run failed — read this instead of inferring failure causes from run counts.",
      "name": "errors"
    },
    {
      "description": "Cost metering read API (SPEC-107) — usage_event aggregations: costs summary (by day/contract/model/provider), per-contract rollup, per-article cost (direct + amortized collect share), per-run rows.",
      "name": "metering"
    },
    {
      "description": "Localization status board (SPEC-109) — one row per (article, language) with state-machine status, QA verdict and live URL; read-only, filterable by contract/article/language/status.",
      "name": "localizations"
    },
    {
      "description": "Incident/defect/suggestion intake (SPEC-004) — file a defect (MCP tool `entherium_report_defect`) or an improvement (`entherium_propose_improvement`) with full QA detail: steps_to_reproduce/expected/actual/evidence for a defect; problem/proposed_change/benefit for a suggestion. POST returns a bare 202, nothing comes back; low-detail reports are quarantined, not tracked. READ the defect board with `entherium_list_defects` (needs `manage_task`) to avoid filing a duplicate; resolving a defect stays owner-only (the web board PATCH is human-only).",
      "name": "tickets"
    },
    {
      "description": "Work-chat archive (SPEC-114) — the team's Telegram work chat, synced daily. Search it to gather CONTEXT for a task/defect: who asked, verbatim, when. Read-only; `is_full=false` means the text is truncated and must not be quoted as verbatim.",
      "name": "chat"
    },
    {
      "description": "Team task tracking (SPEC-112) — create / assign / close TASKS for team members via the MCP tools `entherium_create_task` (returns the task_id), `entherium_update_task_status`, `entherium_reassign_task`, `entherium_log_task_note`. Needs the `manage_task` capability; give `assignee` as a person's NAME (resolved to that user; unknown/ambiguous is rejected). READ the board too: `entherium_list_tasks` (statuses) + `entherium_get_task` (full task + its update log) — call before creating, to avoid duplicates. (The web board GET is human-only; the agent reads via these tools.)",
      "name": "tasks"
    },
    {
      "description": "Telegram Mini App surface (SPEC-072) — owner-gated initData auth; ops overview + DR status for the bot UI.",
      "name": "tma"
    }
  ]
}
