{
  "components": {
    "schemas": {
      "AIModelsRequest": {
        "properties": {
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "binary_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Binary Path"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "header_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Prefix"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "purpose": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Purpose"
          }
        },
        "required": [
          "provider"
        ],
        "title": "AIModelsRequest",
        "type": "object"
      },
      "ActiveRuns": {
        "additionalProperties": true,
        "description": "``GET /api/executions/active``: the runs this backend is running now.",
        "properties": {
          "active_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Active Ids",
            "type": "array"
          }
        },
        "required": [
          "active_ids"
        ],
        "title": "ActiveRuns",
        "type": "object"
      },
      "AdminConfirmBody": {
        "properties": {
          "confirm": {
            "default": "",
            "title": "Confirm",
            "type": "string"
          }
        },
        "title": "AdminConfirmBody",
        "type": "object"
      },
      "AiCliProbe": {
        "additionalProperties": true,
        "description": "One agent CLI, and where resmon looked for it.\n\n``found`` is detection, never a login check — the endpoint does not run the\nbinary — and ``login_checked`` is the field that says so out loud. It is\nalways ``false`` today, and it is in the body rather than in the\ndocumentation because a client that reads ``found`` as \"ready\" is making a\nclaim resmon has not checked.\n\n``path`` and ``how`` are ``None`` on a machine where the CLI is absent,\nwhich is most CI runners; ``tried`` is the candidate list, and it is here\nbecause \"not found\" alone does not tell a user that resmon looked in the\nwrong place.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "found": {
            "title": "Found",
            "type": "boolean"
          },
          "how": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "How"
          },
          "login_checked": {
            "title": "Login Checked",
            "type": "boolean"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "tried": {
            "items": {
              "type": "string"
            },
            "title": "Tried",
            "type": "array"
          }
        },
        "required": [
          "provider",
          "path",
          "how",
          "found",
          "tried",
          "detail",
          "login_checked"
        ],
        "title": "AiCliProbe",
        "type": "object"
      },
      "AiCliSignIn": {
        "additionalProperties": true,
        "description": "``GET /api/ai/cli/sign-in``: what the command said about its own sign-in.\n\n``state`` is ``signed_in`` or ``signed_out`` only when the command said so,\n``expired`` when its words say the sign-in it had expired, ``unknown`` when\nit answered without saying (``said`` then holds its own words), ``missing``\nwhen resmon did not find the command, and ``failed`` when it could not be\nrun. ``email``, ``plan`` and ``method`` are present only when the command\nreported them. ``message`` is one sentence for a person. ``command`` is the\nstatus command as it would be typed. Nothing in this answer is stored.",
        "properties": {
          "checked_at_utc": {
            "title": "Checked At Utc",
            "type": "string"
          },
          "command": {
            "title": "Command",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "plan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plan"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "said": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Said"
          },
          "state": {
            "enum": [
              "signed_in",
              "signed_out",
              "expired",
              "unknown",
              "missing",
              "failed"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "state",
          "message",
          "email",
          "plan",
          "method",
          "said",
          "command",
          "path",
          "checked_at_utc"
        ],
        "title": "AiCliSignIn",
        "type": "object"
      },
      "AiCliSignInBody": {
        "additionalProperties": false,
        "properties": {
          "binary_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Binary Path"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "purpose": {
            "default": "summaries",
            "title": "Purpose",
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "title": "AiCliSignInBody",
        "type": "object"
      },
      "AiCliSignInOpened": {
        "additionalProperties": true,
        "description": "``POST /api/ai/cli/sign-in``: whether the command's own login was opened.\n\n``how`` is ``terminal`` when a Terminal window was asked to run it,\n``copy`` when the person runs ``command`` themselves, and ``none`` when\nthere is no command to run. ``message`` says which, in a sentence.",
        "properties": {
          "command": {
            "title": "Command",
            "type": "string"
          },
          "how": {
            "enum": [
              "terminal",
              "copy",
              "none"
            ],
            "title": "How",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "opened": {
            "title": "Opened",
            "type": "boolean"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "opened",
          "how",
          "command",
          "path",
          "message"
        ],
        "title": "AiCliSignInOpened",
        "type": "object"
      },
      "AiCliStatus": {
        "additionalProperties": true,
        "description": "``GET /api/settings/ai/cli-status``.",
        "properties": {
          "providers": {
            "items": {
              "$ref": "#/components/schemas/AiCliProbe"
            },
            "title": "Providers",
            "type": "array"
          }
        },
        "required": [
          "providers"
        ],
        "title": "AiCliStatus",
        "type": "object"
      },
      "AiKeysErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-ai-keys``: every AI provider key slot cleared.\n\n``ai_keys_removed`` is the number of AI provider keys that were stored and\nare now gone, the legacy ``ai_api_key`` slot included. A name that held no\nkey is not counted, so with none stored it is 0. This route takes no\n``confirm``.",
        "properties": {
          "ai_keys_removed": {
            "title": "Ai Keys Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "ai_keys_removed"
        ],
        "title": "AiKeysErased",
        "type": "object"
      },
      "AiLastAnswered": {
        "additionalProperties": true,
        "description": "``GET /api/ai/last-answered``: one entry per command and requested model.",
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/AiLastAnsweredEntry"
            },
            "title": "Entries",
            "type": "array"
          }
        },
        "required": [
          "entries"
        ],
        "title": "AiLastAnswered",
        "type": "object"
      },
      "AiLastAnsweredEntry": {
        "additionalProperties": true,
        "description": "The model that last answered one requested model on one command.\n\n``requested`` is the alias or id that was asked for, ``\"\"`` where the\ncommand chose. ``model`` is what the answer reported, ``name`` the same in\na person's words. ``where`` is ``ask`` or ``summaries``.",
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "observed_at_utc": {
            "title": "Observed At Utc",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "requested": {
            "title": "Requested",
            "type": "string"
          },
          "where": {
            "enum": [
              "ask",
              "summaries"
            ],
            "title": "Where",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "requested",
          "model",
          "name",
          "where",
          "observed_at_utc"
        ],
        "title": "AiLastAnsweredEntry",
        "type": "object"
      },
      "AiSettings": {
        "additionalProperties": true,
        "description": "``GET /api/settings/ai`` — the AI lane, as sixteen stored strings.\n\n``ai_chain`` and ``ai_default_models`` are JSON *documents* stored as text,\nand they are declared ``str`` here because that is what the endpoint\nanswers: the renderer parses them. Declaring them as objects would be this\ncontract describing a shape the route does not send.",
        "properties": {
          "ai_chain": {
            "title": "Ai Chain",
            "type": "string"
          },
          "ai_cli_path": {
            "title": "Ai Cli Path",
            "type": "string"
          },
          "ai_custom_base_url": {
            "title": "Ai Custom Base Url",
            "type": "string"
          },
          "ai_custom_header_prefix": {
            "title": "Ai Custom Header Prefix",
            "type": "string"
          },
          "ai_default_models": {
            "title": "Ai Default Models",
            "type": "string"
          },
          "ai_effort": {
            "title": "Ai Effort",
            "type": "string"
          },
          "ai_extraction_goals": {
            "title": "Ai Extraction Goals",
            "type": "string"
          },
          "ai_local_endpoint": {
            "title": "Ai Local Endpoint",
            "type": "string"
          },
          "ai_local_model": {
            "title": "Ai Local Model",
            "type": "string"
          },
          "ai_model": {
            "title": "Ai Model",
            "type": "string"
          },
          "ai_provider": {
            "title": "Ai Provider",
            "type": "string"
          },
          "ai_show_audit_prefix": {
            "title": "Ai Show Audit Prefix",
            "type": "string"
          },
          "ai_subscription_doc_cap": {
            "title": "Ai Subscription Doc Cap",
            "type": "string"
          },
          "ai_summary_length": {
            "title": "Ai Summary Length",
            "type": "string"
          },
          "ai_temperature": {
            "title": "Ai Temperature",
            "type": "string"
          },
          "ai_tone": {
            "title": "Ai Tone",
            "type": "string"
          }
        },
        "required": [
          "ai_provider",
          "ai_model",
          "ai_local_model",
          "ai_summary_length",
          "ai_tone",
          "ai_extraction_goals",
          "ai_temperature",
          "ai_show_audit_prefix",
          "ai_custom_base_url",
          "ai_custom_header_prefix",
          "ai_default_models",
          "ai_chain",
          "ai_local_endpoint",
          "ai_cli_path",
          "ai_subscription_doc_cap",
          "ai_effort"
        ],
        "title": "AiSettings",
        "type": "object"
      },
      "AnalyticsOverview": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/overview``: the five views in one round trip.",
        "properties": {
          "discovery_lag": {
            "$ref": "#/components/schemas/DiscoveryLag"
          },
          "publication_volume": {
            "$ref": "#/components/schemas/PublicationVolume"
          },
          "routine_health": {
            "$ref": "#/components/schemas/RoutineHealth"
          },
          "source_contribution": {
            "$ref": "#/components/schemas/SourceContribution"
          },
          "summary": {
            "$ref": "#/components/schemas/CorpusSummary"
          }
        },
        "required": [
          "summary",
          "source_contribution",
          "discovery_lag",
          "routine_health",
          "publication_volume"
        ],
        "title": "AnalyticsOverview",
        "type": "object"
      },
      "AppDataErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-app-data``: papers, configurations, runs, and every AI and repository key.\n\nSettings, the SMTP password and the Library's files are kept. The key\ncounts are of keys found and removed, as ``AiKeysErased`` and\n``RepositoryKeysErased`` count them.",
        "properties": {
          "ai_keys_removed": {
            "title": "Ai Keys Removed",
            "type": "integer"
          },
          "configs_removed": {
            "title": "Configs Removed",
            "type": "integer"
          },
          "documents_removed": {
            "title": "Documents Removed",
            "type": "integer"
          },
          "executions_removed": {
            "title": "Executions Removed",
            "type": "integer"
          },
          "repo_keys_removed": {
            "title": "Repo Keys Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "configs_removed",
          "executions_removed",
          "documents_removed",
          "ai_keys_removed",
          "repo_keys_removed"
        ],
        "title": "AppDataErased",
        "type": "object"
      },
      "Appearance": {
        "additionalProperties": true,
        "description": "``GET`` and ``PUT /api/appearance``: the theme and the accent chosen.\n\n``accent`` is a lowercase ``#rrggbb``, or null when none has been chosen and\nthe interface draws its own default. The PUT answers what it stored, so a\ncaller can see the lowercasing rather than assume it.",
        "properties": {
          "accent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent"
          },
          "theme": {
            "enum": [
              "system",
              "light",
              "dark"
            ],
            "title": "Theme",
            "type": "string"
          }
        },
        "required": [
          "theme",
          "accent"
        ],
        "title": "Appearance",
        "type": "object"
      },
      "AppearanceBody": {
        "description": "The whole appearance, every time: a PUT replaces both values.",
        "properties": {
          "accent": {
            "anyOf": [
              {
                "pattern": "^#[0-9a-fA-F]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent"
          },
          "theme": {
            "enum": [
              "system",
              "light",
              "dark"
            ],
            "title": "Theme",
            "type": "string"
          }
        },
        "required": [
          "theme",
          "accent"
        ],
        "title": "AppearanceBody",
        "type": "object"
      },
      "AssistantActivity": {
        "additionalProperties": true,
        "description": "What this process saw of a conversation when the request arrived.\n\nObserved separately from the transcript and not atomic with it, which\n``basis`` says. ``turn_claimed`` is whether a turn holds the\nconversation's event bus, and ``cli_running`` whether a CLI process is\nalive for it. Both are this process's memory and say nothing about\nanother process.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "cli_running": {
            "title": "Cli Running",
            "type": "boolean"
          },
          "observed_at_utc": {
            "title": "Observed At Utc",
            "type": "string"
          },
          "turn_claimed": {
            "title": "Turn Claimed",
            "type": "boolean"
          }
        },
        "required": [
          "observed_at_utc",
          "turn_claimed",
          "cli_running",
          "basis"
        ],
        "title": "AssistantActivity",
        "type": "object"
      },
      "AssistantAnsweredBy": {
        "additionalProperties": true,
        "description": "Which reported model answered a turn, chosen from its reports.\n\n``source`` is the report it was taken from: ``claude_result_model_usage``\n(the models the turn was billed for) first, the provider's reply next, and\nthe model the CLI announced as it started last. ``name`` is ``model`` in a\nperson's words, or ``model`` itself where its shape is not recognized.",
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "model",
          "name",
          "source"
        ],
        "title": "AssistantAnsweredBy",
        "type": "object"
      },
      "AssistantChoices": {
        "additionalProperties": true,
        "description": "A conversation's saved choices: the request every turn makes, and when it was fixed.",
        "properties": {
          "binding_basis": {
            "title": "Binding Basis",
            "type": "string"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "effort_basis": {
            "title": "Effort Basis",
            "type": "string"
          },
          "model_basis": {
            "title": "Model Basis",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "requested_effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Effort"
          },
          "requested_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Model"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "runtime",
          "provider",
          "requested_model",
          "requested_effort",
          "model_basis",
          "effort_basis",
          "binding_basis",
          "created_at_utc"
        ],
        "title": "AssistantChoices",
        "type": "object"
      },
      "AssistantComposerChoices": {
        "additionalProperties": true,
        "description": "What the composer may ask for: connections, Claude model aliases and effort levels.\n\n``default_request`` is ``None``, and ``default_error`` says why, when the\nstored settings do not make a valid choice. The aliases are suggestions:\nthe CLI decides at use time whether it accepts one, and ``limitations``\nsays so in the words the composer shows.",
        "properties": {
          "claude_aliases": {
            "items": {
              "type": "string"
            },
            "title": "Claude Aliases",
            "type": "array"
          },
          "claude_efforts": {
            "items": {
              "type": "string"
            },
            "title": "Claude Efforts",
            "type": "array"
          },
          "connections": {
            "items": {
              "$ref": "#/components/schemas/AssistantConnection"
            },
            "title": "Connections",
            "type": "array"
          },
          "default_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Error"
          },
          "default_request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantDefaultRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "limitations": {
            "title": "Limitations",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "default_request",
          "default_error",
          "connections",
          "claude_aliases",
          "claude_efforts",
          "limitations"
        ],
        "title": "AssistantComposerChoices",
        "type": "object"
      },
      "AssistantConnection": {
        "additionalProperties": true,
        "description": "One connection the composer can offer.\n\n``runtime`` is ``None``, and ``implemented`` false, for a provider resmon\nlists but has no assistant for (Ollama). ``family`` is the request\nshape resmon's own loop builds and is present only on API-key\nconnections. ``available`` checks local prerequisites only, an executable\nfound or a key stored, never sign-in or whether a model is accepted.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "effort_supported": {
            "title": "Effort Supported",
            "type": "boolean"
          },
          "family": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Family"
          },
          "implemented": {
            "title": "Implemented",
            "type": "boolean"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "runtime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runtime"
          }
        },
        "required": [
          "runtime",
          "provider",
          "label",
          "implemented",
          "available",
          "reason",
          "effort_supported"
        ],
        "title": "AssistantConnection",
        "type": "object"
      },
      "AssistantDefaultRequest": {
        "additionalProperties": true,
        "description": "The choice a new conversation gets from Settings when it names none.\n\n``model`` and ``effort`` are ``None`` when Settings leaves them to the\nruntime, whose own default resmon does not know.",
        "properties": {
          "effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effort"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "runtime",
          "provider",
          "model",
          "effort"
        ],
        "title": "AssistantDefaultRequest",
        "type": "object"
      },
      "AssistantExport": {
        "additionalProperties": true,
        "description": "``GET /api/assistant/sessions/{session_id}/export``: a saved conversation as a file's text.\n\n``format`` is ``json`` or ``markdown``. ``text`` is the whole file, at most\n8 MiB, and carries its own limitations: persisted messages only, and\ncompletion unknown. ``filename`` and ``content_type`` are for saving it;\nthe backend writes no file. ``snapshot`` is the read it was taken from.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "session_id": {
            "title": "Session Id",
            "type": "integer"
          },
          "snapshot": {
            "$ref": "#/components/schemas/AssistantSnapshot"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "format",
          "filename",
          "content_type",
          "text",
          "snapshot"
        ],
        "title": "AssistantExport",
        "type": "object"
      },
      "AssistantMessage": {
        "additionalProperties": true,
        "description": "One stored message: ``user``, ``assistant``, or ``system`` for a notice shown during a turn.\n\n``tool_calls`` and ``tool_results`` are the JSON stored with an assistant\nmessage, parsed and otherwise untouched: a list, ``None`` when the turn\nused no tool, or ``{\"unreadable\": true}`` when the stored text does not\nparse. They are ``Any`` rather than a list of models because the column\nholds whatever a runtime returned, in the shape the version that wrote it\nused, and a typed list would turn such a row into a 500 where it is a\ntranscript today. An ``Any`` value is written by pydantic's serializer,\nnot ``jsonable_encoder``; for parsed JSON the two agree, and the parse\nrefuses ``NaN`` and ``Infinity``, so the module docstring's non-finite\ncase is reachable only through an out-of-range literal such as ``1e999``\nin a hand-edited row. Tool data can hold sensitive text and is returned\nas stored.\n\nThe tokens and ``cost_usd`` are what the runtime reported for the turn,\n``None`` where it reported nothing. A reported cost does not establish\nwhat was billed.",
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "tool_calls": {
            "title": "Tool Calls"
          },
          "tool_results": {
            "title": "Tool Results"
          }
        },
        "required": [
          "id",
          "role",
          "content",
          "tool_calls",
          "tool_results",
          "input_tokens",
          "output_tokens",
          "cost_usd",
          "created_at"
        ],
        "title": "AssistantMessage",
        "type": "object"
      },
      "AssistantMessageBody": {
        "additionalProperties": false,
        "properties": {
          "legacy_adoption": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Legacy Adoption"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "AssistantMessageBody",
        "type": "object"
      },
      "AssistantModelReport": {
        "additionalProperties": true,
        "description": "A model name a runtime reported during a turn, where it reported it, and when.\n\n``source`` names the field it came from, such as\n``claude_system_init_model``. It is what the runtime said, kept beside the\nrequest and never merged with it. No runtime reports effort.",
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "observed_at_utc": {
            "title": "Observed At Utc",
            "type": "string"
          },
          "sequence": {
            "title": "Sequence",
            "type": "integer"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "sequence",
          "model",
          "source",
          "observed_at_utc",
          "name"
        ],
        "title": "AssistantModelReport",
        "type": "object"
      },
      "AssistantOtherRuntime": {
        "additionalProperties": true,
        "description": "A runtime Settings does not select, listed with its reason rather than left out.\n\nThe first entry is the other of resmon's two runtimes and the second is\nthe Codex CLI, which is never available. ``installed`` is not a finding\nto rely on in either. On the first it is always true, whatever was found.\nOn the Codex entry it is whether an executable sits where Codex is looked\nfor, and when an agent-CLI path is configured that path is the only place\nlooked, so a configured Claude CLI makes Codex read as installed.\n``available`` and ``reason`` are the fields to read.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "installed": {
            "title": "Installed",
            "type": "boolean"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "installed",
          "available",
          "reason"
        ],
        "title": "AssistantOtherRuntime",
        "type": "object"
      },
      "AssistantPermissionAnswer": {
        "properties": {
          "allow": {
            "title": "Allow",
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "allow"
        ],
        "title": "AssistantPermissionAnswer",
        "type": "object"
      },
      "AssistantPermissionAnswered": {
        "additionalProperties": true,
        "description": "``POST /api/assistant/permissions/{request_id}``: the panel's Allow or Deny, recorded once.\n\nA second answer to the same request is a 409, so ``decision`` is the one\nthat stands.",
        "properties": {
          "decision": {
            "title": "Decision",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "decision"
        ],
        "title": "AssistantPermissionAnswered",
        "type": "object"
      },
      "AssistantPermissionDecision": {
        "additionalProperties": true,
        "description": "``POST /api/assistant/permissions``: the answer the permission server hands the CLI.\n\nCalled by ``assistant_permission_server.py``, not the renderer, and held\nopen until the person answers or five minutes pass. ``decision`` is\n``allow`` or ``deny``; a timeout, a panel that was not open to ask, and a\ncancelled conversation all deny, and ``message`` says which.",
        "properties": {
          "decision": {
            "title": "Decision",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "request_id": {
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "decision",
          "message",
          "request_id"
        ],
        "title": "AssistantPermissionDecision",
        "type": "object"
      },
      "AssistantPermissionOpen": {
        "properties": {
          "input": {
            "additionalProperties": true,
            "default": {},
            "title": "Input",
            "type": "object"
          },
          "session_id": {
            "title": "Session Id",
            "type": "integer"
          },
          "tool_name": {
            "title": "Tool Name",
            "type": "string"
          },
          "tool_use_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Use Id"
          }
        },
        "required": [
          "session_id",
          "tool_name"
        ],
        "title": "AssistantPermissionOpen",
        "type": "object"
      },
      "AssistantRequested": {
        "additionalProperties": true,
        "description": "What a turn asked a runtime for, which is not what the runtime used.\n\n``requested_model`` and ``requested_effort`` are ``None`` when the request\nleft the choice to the runtime. Each ``*_basis`` says where a choice came\nfrom: ``explicit``, ``settings_default``, ``runtime_default``, or, for\neffort on an API key, ``not_supported``. ``binding_basis`` is ``new``, or\n``legacy_confirmed`` for a conversation saved before choices were, whose\nnext turn the person confirmed.",
        "properties": {
          "binding_basis": {
            "title": "Binding Basis",
            "type": "string"
          },
          "effort_basis": {
            "title": "Effort Basis",
            "type": "string"
          },
          "model_basis": {
            "title": "Model Basis",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "requested_effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Effort"
          },
          "requested_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Model"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "runtime",
          "provider",
          "requested_model",
          "requested_effort",
          "model_basis",
          "effort_basis",
          "binding_basis"
        ],
        "title": "AssistantRequested",
        "type": "object"
      },
      "AssistantRuntimeStatus": {
        "additionalProperties": true,
        "description": "Whether the runtime Settings selects can take a turn, and why or why not, in one sentence.\n\n``path`` is where the Claude CLI executable was found and ``how`` how it\nwas found (``configured``, ``known-location``, ``path``); an available\nAPI-key runtime has no path and says ``api_key``. Both are ``None`` when\nthe runtime is not available. A found executable is not a sign-in and a\nstored key is not an accepted one: ``available`` says a turn can be\nattempted, not that it will be answered.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "how": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "How"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "available",
          "reason",
          "path",
          "how"
        ],
        "title": "AssistantRuntimeStatus",
        "type": "object"
      },
      "AssistantSession": {
        "additionalProperties": true,
        "description": "``POST /api/assistant/sessions`` (201): one conversation.\n\n``cli_session_id`` is the id resmon hands the Claude CLI to resume, and\n``None`` on the API-key runtime, which keeps no session of its own.\n``model`` is the model the conversation asked for, ``None`` for the\nruntime's default. ``title`` is the one given at creation, else the\nfirst message's opening words, else ``New conversation``. ``choices`` is\n``None`` for a conversation saved before choices were (schema 15), which\ncannot send again until the person confirms new ones.",
        "properties": {
          "choices": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantChoices"
              },
              {
                "$ref": "#/components/schemas/AssistantUnreadable"
              },
              {
                "type": "null"
              }
            ],
            "title": "Choices"
          },
          "cli_session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cli Session Id"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "runtime",
          "cli_session_id",
          "model",
          "title",
          "created_at",
          "updated_at",
          "choices"
        ],
        "title": "AssistantSession",
        "type": "object"
      },
      "AssistantSessionBrowsed": {
        "additionalProperties": true,
        "description": "One conversation in a browse page.\n\nNot an ``AssistantSession``: a browse row carries no ``cli_session_id``\nand orders its keys differently, and one model cannot keep both orders.",
        "properties": {
          "choices": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantChoices"
              },
              {
                "$ref": "#/components/schemas/AssistantUnreadable"
              },
              {
                "type": "null"
              }
            ],
            "title": "Choices"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "message_count": {
            "title": "Message Count",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "runtime",
          "model",
          "created_at",
          "updated_at",
          "message_count",
          "title",
          "choices"
        ],
        "title": "AssistantSessionBrowsed",
        "type": "object"
      },
      "AssistantSessionCreate": {
        "additionalProperties": false,
        "properties": {
          "choices": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Choices"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "AssistantSessionCreate",
        "type": "object"
      },
      "AssistantSessionDeleted": {
        "additionalProperties": true,
        "description": "``DELETE /api/assistant/sessions/{session_id}``: the conversation, its messages and its choices are gone.",
        "properties": {
          "deleted": {
            "title": "Deleted",
            "type": "integer"
          }
        },
        "required": [
          "deleted"
        ],
        "title": "AssistantSessionDeleted",
        "type": "object"
      },
      "AssistantSessionListed": {
        "additionalProperties": true,
        "description": "One conversation in ``GET /api/assistant/sessions``.\n\n``cost_usd`` is the sum of the costs its runtime reported, ``None`` when\nno turn reported one. Turns that reported nothing add nothing to the sum,\nso it can be a partial total; the conversation's own ``totals`` says how\nmany turns it covers.",
        "properties": {
          "choices": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantChoices"
              },
              {
                "$ref": "#/components/schemas/AssistantUnreadable"
              },
              {
                "type": "null"
              }
            ],
            "title": "Choices"
          },
          "cli_session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cli Session Id"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "message_count": {
            "title": "Message Count",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "runtime",
          "cli_session_id",
          "model",
          "title",
          "created_at",
          "updated_at",
          "choices",
          "message_count",
          "cost_usd"
        ],
        "title": "AssistantSessionListed",
        "type": "object"
      },
      "AssistantSessionPage": {
        "additionalProperties": true,
        "description": "``GET /api/assistant/sessions/browse``: conversations newest created first, a page at a time.\n\n``through_id`` fixes which conversations the paging covers, so one created\nwhile paging does not shift the pages; it fixes the ids, not what the rows\nsay. ``next_before_id`` is the next page's cursor, ``None`` on the last.",
        "properties": {
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_before_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Before Id"
          },
          "sessions": {
            "items": {
              "$ref": "#/components/schemas/AssistantSessionBrowsed"
            },
            "title": "Sessions",
            "type": "array"
          },
          "through_id": {
            "title": "Through Id",
            "type": "integer"
          }
        },
        "required": [
          "sessions",
          "through_id",
          "next_before_id",
          "has_more"
        ],
        "title": "AssistantSessionPage",
        "type": "object"
      },
      "AssistantSessions": {
        "additionalProperties": true,
        "description": "``GET /api/assistant/sessions``: at most ``limit`` conversations, most recently active first.",
        "properties": {
          "sessions": {
            "items": {
              "$ref": "#/components/schemas/AssistantSessionListed"
            },
            "title": "Sessions",
            "type": "array"
          }
        },
        "required": [
          "sessions"
        ],
        "title": "AssistantSessions",
        "type": "object"
      },
      "AssistantSettings": {
        "additionalProperties": true,
        "description": "``GET /api/settings/assistant``.",
        "properties": {
          "assistant_effort": {
            "title": "Assistant Effort",
            "type": "string"
          },
          "assistant_model": {
            "title": "Assistant Model",
            "type": "string"
          },
          "assistant_provider": {
            "title": "Assistant Provider",
            "type": "string"
          },
          "assistant_runtime": {
            "title": "Assistant Runtime",
            "type": "string"
          }
        },
        "required": [
          "assistant_runtime",
          "assistant_provider",
          "assistant_model",
          "assistant_effort"
        ],
        "title": "AssistantSettings",
        "type": "object"
      },
      "AssistantSnapshot": {
        "additionalProperties": true,
        "description": "The SQLite read a transcript or an export was taken from.\n\n``basis`` is ``persisted_messages_only``: a turn still streaming is not in\nit. ``last_message_id`` is ``None`` for a conversation with no messages.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "captured_at_utc": {
            "title": "Captured At Utc",
            "type": "string"
          },
          "last_message_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Message Id"
          },
          "message_count": {
            "title": "Message Count",
            "type": "integer"
          }
        },
        "required": [
          "captured_at_utc",
          "basis",
          "message_count",
          "last_message_id"
        ],
        "title": "AssistantSnapshot",
        "type": "object"
      },
      "AssistantStatus": {
        "additionalProperties": true,
        "description": "``GET /api/assistant/status``: whether the assistant can run, and every runtime it considered.\n\n``runtime`` is the one Settings selects, and ``available`` and ``reason``\nrepeat its own. ``others`` lists the rest with their reasons, Codex\nincluded, because a runtime left out reads as one resmon never noticed.\n``model`` and ``effort`` are what Settings asks for, not what a runtime\nuses; ``None`` or empty means none is set, and an API-key runtime has no\neffort at all. ``contract_version`` is the MCP contract's version, or\n``unknown`` when the server module cannot be imported.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "composer_choices": {
            "$ref": "#/components/schemas/AssistantComposerChoices"
          },
          "contract_version": {
            "title": "Contract Version",
            "type": "string"
          },
          "effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effort"
          },
          "kinds": {
            "items": {
              "type": "string"
            },
            "title": "Kinds",
            "type": "array"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "others": {
            "items": {
              "$ref": "#/components/schemas/AssistantOtherRuntime"
            },
            "title": "Others",
            "type": "array"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "provider_source": {
            "title": "Provider Source",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "runtime": {
            "$ref": "#/components/schemas/AssistantRuntimeStatus"
          },
          "tool_calling": {
            "$ref": "#/components/schemas/AssistantToolCalling"
          }
        },
        "required": [
          "runtime",
          "available",
          "reason",
          "model",
          "effort",
          "kinds",
          "provider",
          "provider_source",
          "tool_calling",
          "others",
          "composer_choices",
          "contract_version"
        ],
        "title": "AssistantStatus",
        "type": "object"
      },
      "AssistantToolCalling": {
        "additionalProperties": true,
        "description": "The selected provider's tool calling, as two separate facts.\n\n``state`` is about the provider's own API (``yes``, ``no`` or\n``unknown``); ``assistant`` is whether resmon's assistant drives it\n(``api_key_runtime``, ``cli_runtime`` or ``no``). A provider can support\ntool calling that resmon does not use, so the two are never merged.",
        "properties": {
          "assistant": {
            "title": "Assistant",
            "type": "string"
          },
          "assistant_reason": {
            "title": "Assistant Reason",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "state",
          "reason",
          "assistant",
          "assistant_reason"
        ],
        "title": "AssistantToolCalling",
        "type": "object"
      },
      "AssistantTotals": {
        "additionalProperties": true,
        "description": "What a conversation's assistant turns reported, summed.\n\n``reported_turns`` counts the ``turns`` that reported a cost, and is what\nsays whether ``cost_usd`` is a total or a partial one. Each sum is\n``None`` when no turn reported that figure.",
        "properties": {
          "cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          },
          "reported_turns": {
            "title": "Reported Turns",
            "type": "integer"
          },
          "turns": {
            "title": "Turns",
            "type": "integer"
          }
        },
        "required": [
          "turns",
          "reported_turns",
          "input_tokens",
          "output_tokens",
          "cost_usd"
        ],
        "title": "AssistantTotals",
        "type": "object"
      },
      "AssistantTranscript": {
        "additionalProperties": true,
        "description": "``GET /api/assistant/sessions/{session_id}``: a conversation as one SQLite read, and what is running now.\n\n``session`` through ``turn_choices`` come from one read snapshot;\n``running`` and ``activity_observation`` are observed afterwards and are\nnot atomic with it. ``running`` is ``activity_observation.cli_running``.",
        "properties": {
          "activity_observation": {
            "$ref": "#/components/schemas/AssistantActivity"
          },
          "choices_version": {
            "title": "Choices Version",
            "type": "integer"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/AssistantMessage"
            },
            "title": "Messages",
            "type": "array"
          },
          "running": {
            "title": "Running",
            "type": "boolean"
          },
          "session": {
            "$ref": "#/components/schemas/AssistantSession"
          },
          "snapshot": {
            "$ref": "#/components/schemas/AssistantSnapshot"
          },
          "totals": {
            "$ref": "#/components/schemas/AssistantTotals"
          },
          "turn_choices": {
            "items": {
              "$ref": "#/components/schemas/AssistantTurnChoices"
            },
            "title": "Turn Choices",
            "type": "array"
          }
        },
        "required": [
          "session",
          "messages",
          "totals",
          "snapshot",
          "choices_version",
          "turn_choices",
          "running",
          "activity_observation"
        ],
        "title": "AssistantTranscript",
        "type": "object"
      },
      "AssistantTurnCancelled": {
        "additionalProperties": true,
        "description": "``POST /api/assistant/sessions/{session_id}/cancel``. Idempotent, and it says which happened.\n\n``cancelled`` is true only when a Claude CLI process running for the\nconversation was killed. An API-key turn runs no such process, so the\nanswer is false whether or not one is running. ``permissions_denied``\ncounts the approval cards still waiting for the conversation, now denied.",
        "properties": {
          "cancelled": {
            "title": "Cancelled",
            "type": "boolean"
          },
          "permissions_denied": {
            "title": "Permissions Denied",
            "type": "integer"
          }
        },
        "required": [
          "cancelled",
          "permissions_denied"
        ],
        "title": "AssistantTurnCancelled",
        "type": "object"
      },
      "AssistantTurnChoices": {
        "additionalProperties": true,
        "description": "One turn's request, and the reports its runtime made, kept apart.\n\n``assistant_message_id`` is ``None`` until an answer is stored, and stays\nso for a turn that never got one; ``failure`` then says why, where the turn\nended in a failure resmon recorded. ``answered_by`` is the model the\nreports say answered, for a turn that has an answer, and ``None``\notherwise. ``requested`` and ``reported`` are each\n``AssistantUnreadable`` when their stored JSON fails validation, and both\nare, with ``assistant_message_id`` cleared, when the row points at\nmessages outside this conversation.",
        "properties": {
          "answered_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantAnsweredBy"
              },
              {
                "type": "null"
              }
            ]
          },
          "assistant_message_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assistant Message Id"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "failure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantTurnFailure"
              },
              {
                "type": "null"
              }
            ]
          },
          "reported": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AssistantModelReport"
                },
                "type": "array"
              },
              {
                "$ref": "#/components/schemas/AssistantUnreadable"
              }
            ],
            "title": "Reported"
          },
          "requested": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistantRequested"
              },
              {
                "$ref": "#/components/schemas/AssistantUnreadable"
              }
            ],
            "title": "Requested"
          },
          "user_message_id": {
            "title": "User Message Id",
            "type": "integer"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "user_message_id",
          "assistant_message_id",
          "version",
          "created_at_utc",
          "requested",
          "reported",
          "answered_by",
          "failure"
        ],
        "title": "AssistantTurnChoices",
        "type": "object"
      },
      "AssistantTurnFailure": {
        "additionalProperties": true,
        "description": "A turn that produced no answer, kept as a failure and never as one.\n\n``code`` is ``cli_auth`` when the command said it is not signed in or its\nsign-in expired, ``stopped`` when the turn was stopped, and ``failed``\notherwise. ``message`` is the sentence the panel showed. ``partial_text``,\n``tool_calls`` and ``tool_results`` are what the turn wrote and called\nbefore it ended. ``cost_usd`` is present only when the runtime reported a\ncost above zero for it.",
        "properties": {
          "code": {
            "enum": [
              "cli_auth",
              "stopped",
              "failed"
            ],
            "title": "Code",
            "type": "string"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "failed_at_utc": {
            "title": "Failed At Utc",
            "type": "string"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          },
          "partial_text": {
            "title": "Partial Text",
            "type": "string"
          },
          "tool_calls": {
            "title": "Tool Calls"
          },
          "tool_results": {
            "title": "Tool Results"
          }
        },
        "required": [
          "code",
          "message",
          "detail",
          "partial_text",
          "tool_calls",
          "tool_results",
          "input_tokens",
          "output_tokens",
          "cost_usd",
          "failed_at_utc"
        ],
        "title": "AssistantTurnFailure",
        "type": "object"
      },
      "AssistantUnreadable": {
        "additionalProperties": true,
        "description": "A stored value resmon could not read, said so rather than dropped or guessed.\n\nIt stands in for a conversation's choices, a turn's request, or a turn's\nreports when the stored row fails validation on the way out: a row a\nfuture version wrote, or a hand-edited database. The rest of the\nconversation still reads; only that part is withheld. It is its own model,\nin a union with the readable one, so a typed client has to tell the two\napart before it reads a field, and ``unreadable`` is the only key it has.",
        "properties": {
          "unreadable": {
            "const": true,
            "title": "Unreadable",
            "type": "boolean"
          }
        },
        "required": [
          "unreadable"
        ],
        "title": "AssistantUnreadable",
        "type": "object"
      },
      "BackupExclusions": {
        "additionalProperties": true,
        "description": "What a bundle deliberately does not carry.\n\n``credentials`` names the keyring entries this machine held when the\nbackup ran, names only and never a value; a restore cannot bring them\nback. A name the keyring would not answer for is left out, so the list can\nbe short. ``process_state`` names files that exist only while a backend\nruns. ``state_dir`` is the state directory the backup ran with, or\n``None``.",
        "properties": {
          "credentials": {
            "items": {
              "type": "string"
            },
            "title": "Credentials",
            "type": "array"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "process_state": {
            "items": {
              "type": "string"
            },
            "title": "Process State",
            "type": "array"
          },
          "state_dir": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State Dir"
          }
        },
        "required": [
          "credentials",
          "process_state",
          "state_dir",
          "note"
        ],
        "title": "BackupExclusions",
        "type": "object"
      },
      "BackupFile": {
        "additionalProperties": true,
        "description": "One file a bundle carries: its path inside the bundle, its size in bytes, and its SHA-256.",
        "properties": {
          "path": {
            "title": "Path",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "size": {
            "title": "Size",
            "type": "integer"
          }
        },
        "required": [
          "path",
          "size",
          "sha256"
        ],
        "title": "BackupFile",
        "type": "object"
      },
      "BackupLast": {
        "additionalProperties": true,
        "description": "``GET /api/backup/last``: the last bundle, a staged restore, the last restore's record, and the undo copies.\n\n``last_backup`` is ``None`` when no backup is recorded, or when the\nrecorded bundle's manifest is gone or unreadable;\n``last_backup_path_recorded`` is the recorded path either way, ``None``\nwhen there is none. ``pending_restore`` is the staged pointer, its\nunreadable form, or ``None``; ``pending_restore_runs_when`` is the sentence\non what will apply it, ``None`` when nothing is staged, and\n``pending_restore_runs_on`` the same answer as a code: ``app_restart``\n(this window's own backend applies it when resmon next starts),\n``service_restart`` (the background service this window uses holds the\ndatabase, so it applies when that service restarts) or ``service_stopped``\n(another live service holds the database, and nothing restores until it is\nstopped); ``None`` when nothing is staged. ``last_restore``\nis the record of the last restore a start acted on, applied or refused,\nand ``None`` when there is none or its file is not a JSON object.\n``undo_copies`` lists the folders restores set aside, sorted by name,\nwhich is the UTC time each was made. ``drive_upload_retired`` is true\nwhile this database still has the removed upload to Google Drive after\neach run switched on, until ``POST\n/api/backup/drive-upload-notice/acknowledge``; nothing uploads either way.\n\nA pointer or record edited by hand into a shape no resmon wrote matches\nneither model of its union, and this route then answers 500 rather than a\nbody.",
        "properties": {
          "drive_upload_retired": {
            "title": "Drive Upload Retired",
            "type": "boolean"
          },
          "last_backup": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BackupSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_backup_path_recorded": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Backup Path Recorded"
          },
          "last_restore": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestoreSucceeded"
              },
              {
                "$ref": "#/components/schemas/RestoreFailed"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Restore"
          },
          "pending_restore": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestorePointer"
              },
              {
                "$ref": "#/components/schemas/RestorePointerUnreadable"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Restore"
          },
          "pending_restore_runs_on": {
            "anyOf": [
              {
                "enum": [
                  "app_restart",
                  "service_restart",
                  "service_stopped"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Restore Runs On"
          },
          "pending_restore_runs_when": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Restore Runs When"
          },
          "undo_copies": {
            "items": {
              "type": "string"
            },
            "title": "Undo Copies",
            "type": "array"
          }
        },
        "required": [
          "last_backup",
          "last_backup_path_recorded",
          "pending_restore",
          "pending_restore_runs_when",
          "pending_restore_runs_on",
          "last_restore",
          "undo_copies",
          "drive_upload_retired"
        ],
        "title": "BackupLast",
        "type": "object"
      },
      "BackupManifest": {
        "additionalProperties": true,
        "description": "A bundle's manifest as ``POST /api/backup`` returns it: what was written.\n\nEverything up to ``elapsed_seconds`` is what ``manifest.json`` in the\nbundle holds; the file stores it with its keys sorted. ``path``,\n``manifest_sha256`` and ``fk_violations_message`` are added after the\nfile is written. The table counts and the foreign-key findings are read\nfrom the bundle's own snapshot of the database, not the live one. A\nmanifest records what was written and the hashes taken as it was written;\nit does not show that a restore will succeed.\n``POST /api/backup/verify`` recomputes the hashes, and a restore runs its\nown checks when it applies.\n\n``vault_id`` is ``None`` when no Library vault is configured, and the\nbundle then carries no vault. ``includes_reports`` is whether reports were\nasked for; a reports folder that is missing or empty adds no files and\nstill reads true. ``table_counts`` maps each application table to its row\ncount; a table that could not be counted is left out, and\n``table_count_denominator`` is how many were counted. ``fk_violations``\nlists at most 100 references, ``fk_violations_total`` counts all of them,\nand ``fk_violations_rows`` counts the distinct rows SQLite identified them\nby. ``fk_violations_message`` is ``\"\"`` when there are none.\n``elapsed_seconds`` is how long the backup took, to the millisecond.",
        "properties": {
          "app_version": {
            "title": "App Version",
            "type": "string"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "elapsed_seconds": {
            "title": "Elapsed Seconds",
            "type": "number"
          },
          "excluded": {
            "$ref": "#/components/schemas/BackupExclusions"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/BackupFile"
            },
            "title": "Files",
            "type": "array"
          },
          "fk_violations": {
            "items": {
              "$ref": "#/components/schemas/ForeignKeyViolation"
            },
            "title": "Fk Violations",
            "type": "array"
          },
          "fk_violations_message": {
            "title": "Fk Violations Message",
            "type": "string"
          },
          "fk_violations_rows": {
            "title": "Fk Violations Rows",
            "type": "integer"
          },
          "fk_violations_total": {
            "title": "Fk Violations Total",
            "type": "integer"
          },
          "includes_reports": {
            "title": "Includes Reports",
            "type": "boolean"
          },
          "manifest_sha256": {
            "title": "Manifest Sha256",
            "type": "string"
          },
          "manifest_version": {
            "title": "Manifest Version",
            "type": "integer"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "schema_version": {
            "title": "Schema Version",
            "type": "integer"
          },
          "table_count_denominator": {
            "title": "Table Count Denominator",
            "type": "integer"
          },
          "table_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Table Counts",
            "type": "object"
          },
          "vault_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vault Id"
          }
        },
        "required": [
          "manifest_version",
          "app_version",
          "schema_version",
          "created_at_utc",
          "vault_id",
          "includes_reports",
          "table_counts",
          "table_count_denominator",
          "files",
          "fk_violations",
          "fk_violations_total",
          "fk_violations_rows",
          "excluded",
          "elapsed_seconds",
          "path",
          "manifest_sha256",
          "fk_violations_message"
        ],
        "title": "BackupManifest",
        "type": "object"
      },
      "BackupRequest": {
        "properties": {
          "confirm": {
            "default": "",
            "title": "Confirm",
            "type": "string"
          },
          "include_reports": {
            "default": true,
            "title": "Include Reports",
            "type": "boolean"
          }
        },
        "title": "BackupRequest",
        "type": "object"
      },
      "BackupSummary": {
        "additionalProperties": true,
        "description": "The last bundle this resmon recorded writing, read from that bundle's manifest during the request.\n\n``files`` is the number of files the manifest lists. Nothing is re-hashed\nhere, so a bundle damaged since it was written reads the same; only\n``POST /api/backup/verify`` checks the bytes. The other fields are the\nmanifest's own values, ``None`` where it records none.\n``fk_violations_total`` is ``0`` when the manifest records none, and\n``fk_violations_rows`` is ``None`` for a bundle written before resmon\ncounted rows.",
        "properties": {
          "app_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "App Version"
          },
          "created_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At Utc"
          },
          "files": {
            "title": "Files",
            "type": "integer"
          },
          "fk_violations_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Violations Rows"
          },
          "fk_violations_total": {
            "title": "Fk Violations Total",
            "type": "integer"
          },
          "includes_reports": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Includes Reports"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "schema_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema Version"
          },
          "vault_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vault Id"
          }
        },
        "required": [
          "path",
          "created_at_utc",
          "app_version",
          "schema_version",
          "vault_id",
          "files",
          "includes_reports",
          "fk_violations_total",
          "fk_violations_rows"
        ],
        "title": "BackupSummary",
        "type": "object"
      },
      "BackupWritten": {
        "additionalProperties": true,
        "description": "``POST /api/backup``: one bundle written, and its manifest.\n\n``path`` is the bundle's folder, ``resmon-backup-<UTC stamp>``, inside the\nexport directory Settings names, or inside the operating system's\ntemporary folder when Settings names none. It is also recorded as the last\nbackup.",
        "properties": {
          "manifest": {
            "$ref": "#/components/schemas/BackupManifest"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "path",
          "manifest"
        ],
        "title": "BackupWritten",
        "type": "object"
      },
      "Body_import_configurations_api_configurations_import_post": {
        "properties": {
          "files": {
            "items": {
              "contentMediaType": "application/octet-stream",
              "type": "string"
            },
            "title": "Files",
            "type": "array"
          }
        },
        "required": [
          "files"
        ],
        "title": "Body_import_configurations_api_configurations_import_post",
        "type": "object"
      },
      "BundleBody": {
        "properties": {
          "path": {
            "default": "",
            "title": "Path",
            "type": "string"
          }
        },
        "title": "BundleBody",
        "type": "object"
      },
      "BundleReport": {
        "additionalProperties": true,
        "description": "``POST /api/backup/verify``: every hash in a bundle recomputed, and what a restore would and would not do.\n\nIt changes nothing. ``ok`` is true when ``problems`` is empty: every file\nthe manifest names is present at its recorded size and hash, the layout is\na version this resmon reads, and the schema is not newer than this\nresmon's. That is the bundle agreeing with its own manifest; it is not a\nrestore that has succeeded, and the restore verifies again and runs its own\nchecks when a start applies it.\n\n``manifest`` is the bundle's ``manifest.json`` exactly as read, keys\nsorted as the file stores them. It is declared ``dict`` because its shape\nis whatever the file holds: this route reads a folder the person chose,\nwhich need not hold a bundle this resmon wrote, and reports what is wrong\nwith it rather than failing. For a bundle this version wrote it holds\n``BackupManifest``'s fields except the three added after the file was\nwritten, and one written without ``fk_violations_rows`` has none.\nPython's JSON parser accepts ``NaN`` and ``Infinity``, so one written\ninto a manifest by hand, where the handler only copies it, is answered\nhere as ``null`` where the route answered 500 before it was modeled.\n``manifest_sha256`` is the hash of the file itself.\n\n``files_checked`` counts the files that matched and ``files_in_manifest``\nthe files listed. ``schema_relation`` compares the bundle's schema with\nthis resmon's: ``same``, ``older``, ``newer`` (a problem) or ``unknown``\n(a problem). ``vault_relation`` compares the bundle's vault with the one\nconfigured here: ``same``, ``different``, ``none_configured`` or\n``none_in_backup``.\n\nThe foreign-key fields come from the manifest: ``fk_violations`` as listed\nthere, hence ``Any``; ``fk_violations_total`` as an integer;\n``fk_violations_rows`` ``None`` for a bundle written before resmon counted\nrows. Orphan rows never make ``ok`` false; ``needs_fk_acceptance`` says a\nrestore must be told to accept them. ``vault_destination`` is ``None``\nwhen the bundle carries no vault or its database records no vault path.",
        "properties": {
          "files_checked": {
            "title": "Files Checked",
            "type": "integer"
          },
          "files_in_manifest": {
            "title": "Files In Manifest",
            "type": "integer"
          },
          "fk_violations": {
            "items": {},
            "title": "Fk Violations",
            "type": "array"
          },
          "fk_violations_message": {
            "title": "Fk Violations Message",
            "type": "string"
          },
          "fk_violations_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Violations Rows"
          },
          "fk_violations_total": {
            "title": "Fk Violations Total",
            "type": "integer"
          },
          "manifest": {
            "additionalProperties": true,
            "title": "Manifest",
            "type": "object"
          },
          "manifest_sha256": {
            "title": "Manifest Sha256",
            "type": "string"
          },
          "needs_fk_acceptance": {
            "title": "Needs Fk Acceptance",
            "type": "boolean"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "problems": {
            "items": {
              "type": "string"
            },
            "title": "Problems",
            "type": "array"
          },
          "schema_relation": {
            "title": "Schema Relation",
            "type": "string"
          },
          "vault_destination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BundleVaultDestination"
              },
              {
                "type": "null"
              }
            ]
          },
          "vault_relation": {
            "title": "Vault Relation",
            "type": "string"
          },
          "will_not_restore": {
            "$ref": "#/components/schemas/BundleWillNotRestore"
          }
        },
        "required": [
          "path",
          "manifest",
          "manifest_sha256",
          "files_checked",
          "files_in_manifest",
          "schema_relation",
          "vault_relation",
          "problems",
          "fk_violations",
          "fk_violations_total",
          "fk_violations_rows",
          "fk_violations_message",
          "needs_fk_acceptance",
          "vault_destination",
          "ok",
          "will_not_restore"
        ],
        "title": "BundleReport",
        "type": "object"
      },
      "BundleVaultDestination": {
        "additionalProperties": true,
        "description": "Where a restore would put the bundle's vault on this machine by default, and whether that folder is usable.\n\n``root_path`` is the vault path the bundle's own database records,\n``parent`` the folder that would hold it and ``name`` its folder name.\n``parent_exists`` and ``parent_writable`` are checked on this machine\nduring the request. A missing parent is the ordinary case for a bundle\nfrom another machine and is not a problem: a restore can be given another\nparent.",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "parent": {
            "title": "Parent",
            "type": "string"
          },
          "parent_exists": {
            "title": "Parent Exists",
            "type": "boolean"
          },
          "parent_writable": {
            "title": "Parent Writable",
            "type": "boolean"
          },
          "root_path": {
            "title": "Root Path",
            "type": "string"
          }
        },
        "required": [
          "root_path",
          "parent",
          "name",
          "parent_exists",
          "parent_writable"
        ],
        "title": "BundleVaultDestination",
        "type": "object"
      },
      "BundleWillNotRestore": {
        "additionalProperties": true,
        "description": "What a restore of this bundle will not bring back.\n\n``credentials`` and ``process_state`` are copied from the bundle's\nmanifest as the handler finds them, which is why they are ``Any``: for a\nbundle resmon wrote, both are lists of names. ``note`` is fixed text about\nruns that were running and deliveries that were being sent.",
        "properties": {
          "credentials": {
            "items": {},
            "title": "Credentials",
            "type": "array"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "process_state": {
            "items": {},
            "title": "Process State",
            "type": "array"
          }
        },
        "required": [
          "credentials",
          "process_state",
          "note"
        ],
        "title": "BundleWillNotRestore",
        "type": "object"
      },
      "CalendarEvent": {
        "additionalProperties": true,
        "description": "One event of ``GET /api/calendar/events``: a run that happened, or a fire\na routine's schedule promises.\n\nA run's ``id`` is its execution id; a promised fire's is a string naming\nthe routine and the time (``routine-3-2026-10-29T09:00:00-04:00``) and its\n``status`` is ``scheduled``. Promised fires are expanded only for active\nroutines, from now to a year ahead, in the machine's own timezone.\n``saved_configuration_id`` and ``saved_configuration_name`` are present on\nruns only.",
        "properties": {
          "allDay": {
            "title": "Allday",
            "type": "boolean"
          },
          "color": {
            "title": "Color",
            "type": "string"
          },
          "end": {
            "title": "End",
            "type": "string"
          },
          "execution_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Id"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "title": "Id"
          },
          "new_results": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Results"
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "routine_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routine Id"
          },
          "saved_configuration_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Id"
          },
          "saved_configuration_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Name"
          },
          "start": {
            "title": "Start",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "total_results": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Results"
          },
          "type": {
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "start",
          "end",
          "allDay",
          "color",
          "execution_id",
          "routine_id",
          "type",
          "status",
          "query",
          "total_results",
          "new_results"
        ],
        "title": "CalendarEvent",
        "type": "object"
      },
      "CollapsePreview": {
        "additionalProperties": true,
        "description": "``POST /api/links/collapse-preview``: which rows a per-view fold would\nkeep, and which it would fold into each kept one. It hides nothing itself.",
        "properties": {
          "folded": {
            "additionalProperties": {
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            "title": "Folded",
            "type": "object"
          },
          "keep": {
            "items": {
              "type": "integer"
            },
            "title": "Keep",
            "type": "array"
          }
        },
        "required": [
          "keep",
          "folded"
        ],
        "title": "CollapsePreview",
        "type": "object"
      },
      "CollectionMap": {
        "additionalProperties": true,
        "description": "``GET /api/map``: where every paper sits, and on what basis.\n\n``basis`` says what nearness means on this map: ``embeddings`` (the set\nmodel's vectors) or ``words`` (word statistics computed on this machine).\nIt describes the points served, which during a refit can differ from the\nbasis the next map will have.",
        "properties": {
          "basis": {
            "anyOf": [
              {
                "enum": [
                  "embeddings",
                  "words"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis"
          },
          "embedding_coverage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmbeddingCoverage"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "fitted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fitted At"
          },
          "fitted_count": {
            "title": "Fitted Count",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "placed_since_fit": {
            "title": "Placed Since Fit",
            "type": "integer"
          },
          "points": {
            "$ref": "#/components/schemas/MapPoints"
          },
          "refitting": {
            "title": "Refitting",
            "type": "boolean"
          },
          "regions": {
            "items": {
              "$ref": "#/components/schemas/MapRegion"
            },
            "title": "Regions",
            "type": "array"
          },
          "state": {
            "enum": [
              "empty",
              "fitting",
              "failed",
              "ready"
            ],
            "title": "State",
            "type": "string"
          },
          "unplaced": {
            "$ref": "#/components/schemas/MapUnplaced"
          }
        },
        "required": [
          "state",
          "basis",
          "model",
          "fitted_at",
          "fitted_count",
          "placed_since_fit",
          "refitting",
          "error",
          "embedding_coverage",
          "unplaced",
          "regions",
          "points"
        ],
        "title": "CollectionMap",
        "type": "object"
      },
      "ConfigCreate": {
        "properties": {
          "config_type": {
            "title": "Config Type",
            "type": "string"
          },
          "link_to_execution_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link To Execution Id"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "parameters": {
            "additionalProperties": true,
            "title": "Parameters",
            "type": "object"
          }
        },
        "required": [
          "name",
          "config_type",
          "parameters"
        ],
        "title": "ConfigCreate",
        "type": "object"
      },
      "ConfigExport": {
        "properties": {
          "ids": {
            "items": {
              "type": "integer"
            },
            "title": "Ids",
            "type": "array"
          }
        },
        "required": [
          "ids"
        ],
        "title": "ConfigExport",
        "type": "object"
      },
      "ConfigUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "parameters": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          }
        },
        "title": "ConfigUpdate",
        "type": "object"
      },
      "ConfigurationCreated": {
        "additionalProperties": true,
        "description": "``POST /api/configurations`` — 201, with the id the caller needs next.",
        "properties": {
          "config_type": {
            "title": "Config Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "config_type"
        ],
        "title": "ConfigurationCreated",
        "type": "object"
      },
      "ConfigurationDeleted": {
        "additionalProperties": true,
        "description": "``DELETE /api/configurations/{config_id}``.\n\nDeleting a routine configuration deletes its linked routine too, and the\nbody says nothing about that. It is recorded here rather than in the model\nbecause adding a field would be inventing one the handler does not send.",
        "properties": {
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "title": "ConfigurationDeleted",
        "type": "object"
      },
      "ConfigurationExport": {
        "additionalProperties": true,
        "description": "``POST /api/configurations/export`` — where the zip was written.\n\nA local filesystem path, which is a desktop app's honest answer: the\nrenderer reveals it in the Finder. It is the user's configured export\ndirectory when they have one and a temporary file when they do not.",
        "properties": {
          "path": {
            "title": "Path",
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "title": "ConfigurationExport",
        "type": "object"
      },
      "ConfigurationImportResult": {
        "additionalProperties": true,
        "description": "``POST /api/configurations/import``.\n\n``routines_created`` is separate from ``imported`` because a routine\nconfiguration arrives as one file and lands as two rows, and a count that\nfolded them together would tell a user they had imported twice what they\ndid. ``errors`` carries the files that could not be read, so a bad entry\nreports itself rather than failing the batch.",
        "properties": {
          "errors": {
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          },
          "imported": {
            "title": "Imported",
            "type": "integer"
          },
          "routines_created": {
            "title": "Routines Created",
            "type": "integer"
          }
        },
        "required": [
          "imported",
          "routines_created",
          "errors"
        ],
        "title": "ConfigurationImportResult",
        "type": "object"
      },
      "ConfigurationUpdated": {
        "additionalProperties": true,
        "description": "``PUT /api/configurations/{config_id}``.\n\n**The body assembled from whichever fields the caller sent.** The handler\nbuilds ``{\"id\": ..., **updates}``, where ``updates`` holds only the fields\nthe request carried, so a rename answers two keys and a rename-plus-rewrite\nanswers three. ``response_model_exclude_unset=True`` is what keeps the\nfirst case two keys instead of three-with-a-null.\n\n``parameters`` is a ``str`` because that is what the handler echoes: it\nstored ``json.dumps(...)`` and puts the stored text back. The list route\nanswers the parsed object instead.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "parameters": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          }
        },
        "required": [
          "id"
        ],
        "title": "ConfigurationUpdated",
        "type": "object"
      },
      "ConfigurationsErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-configs``: every saved configuration deleted.\n\nA routine configuration takes the routine it is linked to with it.\n``configs_removed`` counts configurations; the routines deleted with them\nare not counted.",
        "properties": {
          "configs_removed": {
            "title": "Configs Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "configs_removed"
        ],
        "title": "ConfigurationsErased",
        "type": "object"
      },
      "CorpusErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-corpus``: every collected paper deleted, with what hangs off each.\n\nRuns, configurations, keys and the Library's files are kept.\n``documents_removed`` counts papers.",
        "properties": {
          "documents_removed": {
            "title": "Documents Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "documents_removed"
        ],
        "title": "CorpusErased",
        "type": "object"
      },
      "CorpusSummary": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/summary``. ``doi_coverage`` is ``None`` over no papers: a share of nothing.",
        "properties": {
          "completed_executions": {
            "title": "Completed Executions",
            "type": "integer"
          },
          "distinct_authors": {
            "title": "Distinct Authors",
            "type": "integer"
          },
          "documents": {
            "title": "Documents",
            "type": "integer"
          },
          "doi_coverage": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi Coverage"
          },
          "first_seen": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen"
          },
          "last_seen": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "sources": {
            "title": "Sources",
            "type": "integer"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          },
          "unique_papers": {
            "title": "Unique Papers",
            "type": "integer"
          }
        },
        "required": [
          "documents",
          "unique_papers",
          "distinct_authors",
          "sources",
          "completed_executions",
          "first_seen",
          "last_seen",
          "doi_coverage",
          "sample_size",
          "sufficient"
        ],
        "title": "CorpusSummary",
        "type": "object"
      },
      "CoverageDistribution": {
        "additionalProperties": true,
        "description": "How far this routine's own results sit from its intent.",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "max": {
            "title": "Max",
            "type": "number"
          },
          "median": {
            "title": "Median",
            "type": "number"
          },
          "min": {
            "title": "Min",
            "type": "number"
          },
          "p75_cutoff": {
            "title": "P75 Cutoff",
            "type": "number"
          }
        },
        "required": [
          "count",
          "min",
          "median",
          "p75_cutoff",
          "max"
        ],
        "title": "CoverageDistribution",
        "type": "object"
      },
      "CoveragePaper": {
        "additionalProperties": true,
        "description": "One paper in a coverage list, and its distance from the intent: what was\nmeasured, not a verdict on whether it belongs.",
        "properties": {
          "distance": {
            "title": "Distance",
            "type": "number"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "id",
          "distance",
          "title",
          "source_repository",
          "publication_date",
          "doi",
          "url"
        ],
        "title": "CoveragePaper",
        "type": "object"
      },
      "CredentialChanged": {
        "additionalProperties": true,
        "description": "``PUT`` and ``DELETE /api/credentials/{key_name}``: ``{\"success\": true}``.\n\nNever the value. A ``PUT`` names its slot in the path and carries the\nvalue in the body; the answer says only that the keyring took it.",
        "properties": {
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "title": "CredentialChanged",
        "type": "object"
      },
      "CredentialPresence": {
        "additionalProperties": true,
        "description": "Whether one credential is there, never what it is.\n\n``status`` is ``present``, ``absent`` or ``unreadable``, and the third is\nthe one that matters: an unsigned macOS build is denied access to keychain\nitems a signed build stored, and reporting that as absent tells a user\ntheir keys are gone when they are merely unreachable. ``present`` is the\nplain boolean, kept beside it for callers that need only that.",
        "properties": {
          "present": {
            "title": "Present",
            "type": "boolean"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "present",
          "status"
        ],
        "title": "CredentialPresence",
        "type": "object"
      },
      "CredentialStore": {
        "properties": {
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "title": "CredentialStore",
        "type": "object"
      },
      "CredentialValidate": {
        "properties": {
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "title": "CredentialValidate",
        "type": "object"
      },
      "CredentialsPresence": {
        "additionalProperties": true,
        "description": "``GET /api/credentials``.\n\n``keyring_responsive`` is false once a read has timed out, so the interface\ncan say so once at the top rather than fifteen times over. The map is keyed\nby credential name — the union of the catalog's slots, the AI slots and the\nSMTP slot — and never holds a value.",
        "properties": {
          "credentials": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialPresence"
            },
            "title": "Credentials",
            "type": "object"
          },
          "keyring_responsive": {
            "title": "Keyring Responsive",
            "type": "boolean"
          }
        },
        "required": [
          "keyring_responsive",
          "credentials"
        ],
        "title": "CredentialsPresence",
        "type": "object"
      },
      "DaemonStatus": {
        "additionalProperties": true,
        "description": "``GET /api/service/daemon-status`` — the lock file, and what answered.\n\n``running`` is true only when a lock names a port and that port's health\nanswered 200; ``pid``, ``port``, ``version`` and ``started_at`` are the\nprobe's, and the ``lock_*`` fields are the file's own, which may name a\nprocess that has died. ``error`` says why a lock that is present did not\nanswer. ``is_self`` is present only on a probe that answered, and is true\nwhen the answer came from the process serving this request: a window\nattached to the service rather than beside it.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "is_self": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Self"
          },
          "lock_pid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lock Pid"
          },
          "lock_port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lock Port"
          },
          "lock_present": {
            "title": "Lock Present",
            "type": "boolean"
          },
          "lock_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lock Version"
          },
          "pid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pid"
          },
          "port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Port"
          },
          "running": {
            "title": "Running",
            "type": "boolean"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "lock_present",
          "running",
          "pid",
          "port",
          "version",
          "started_at",
          "lock_pid",
          "lock_port",
          "lock_version",
          "error"
        ],
        "title": "DaemonStatus",
        "type": "object"
      },
      "DateWindowComputed": {
        "additionalProperties": true,
        "description": "The dates a moving window asked for, or would ask for now, and how.\n\n``mode`` is the watch's choice (``date_window`` in its parameters):\n``since_previous_run`` or ``last_days``. ``basis`` is how the start was\nreached: ``previous_run`` (that run's start, less ``overlap_days``),\n``no_previous_run`` (no earlier run in which a source answered, so the last\n``default_days``) or ``last_days`` (``days`` before the run). ``date_to`` is\nalways ``None``: the window has no end. ``sentence`` says all of it, dates\nincluded, in the words a run's record and a watch's page show.",
        "properties": {
          "basis": {
            "enum": [
              "previous_run",
              "no_previous_run",
              "last_days"
            ],
            "title": "Basis",
            "type": "string"
          },
          "computed_at": {
            "title": "Computed At",
            "type": "string"
          },
          "date_from": {
            "title": "Date From",
            "type": "string"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days"
          },
          "default_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Days"
          },
          "mode": {
            "enum": [
              "since_previous_run",
              "last_days"
            ],
            "title": "Mode",
            "type": "string"
          },
          "overlap_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overlap Days"
          },
          "previous_execution_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Execution Id"
          },
          "previous_start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Start Time"
          },
          "sentence": {
            "title": "Sentence",
            "type": "string"
          }
        },
        "required": [
          "mode",
          "basis",
          "date_from",
          "date_to",
          "days",
          "previous_execution_id",
          "previous_start_time",
          "overlap_days",
          "default_days",
          "computed_at",
          "sentence"
        ],
        "title": "DateWindowComputed",
        "type": "object"
      },
      "Delivery": {
        "additionalProperties": true,
        "description": "One report's journey to one destination, as recorded.\n\n``state`` is the drain's own word: ``queued``, ``awaiting_review``,\n``delivering``, ``delivered``, ``failed`` or ``skipped``. ``target_snapshot``\nis where it was sent at the time, which survives the destination being\nremoved. Each field is stored, none inferred: \"delivered\" is never read\noff the absence of an error.",
        "properties": {
          "artifact_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Artifact Sha256"
          },
          "attempts": {
            "title": "Attempts",
            "type": "integer"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "delivered_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At Utc"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "next_attempt_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Attempt At Utc"
          },
          "owner_pid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Pid"
          },
          "owner_runtime_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Runtime Id"
          },
          "queued_at_utc": {
            "title": "Queued At Utc",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "target_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Id"
          },
          "target_snapshot": {
            "title": "Target Snapshot",
            "type": "string"
          }
        },
        "required": [
          "id",
          "execution_id",
          "target_id",
          "channel",
          "target_snapshot",
          "state",
          "attempts",
          "next_attempt_at_utc",
          "last_error",
          "artifact_sha256",
          "owner_pid",
          "owner_runtime_id",
          "queued_at_utc",
          "delivered_at_utc"
        ],
        "title": "Delivery",
        "type": "object"
      },
      "DeliveryActed": {
        "additionalProperties": true,
        "description": "``POST /api/deliveries/{delivery_id}/deliver``, ``/skip`` and ``/retry``:\nthe state the person's decision left it in. ``attempts`` is present only on\na retry, which starts the count again.",
        "properties": {
          "attempts": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempts"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "state"
        ],
        "title": "DeliveryActed",
        "type": "object"
      },
      "DeliverySummary": {
        "additionalProperties": true,
        "description": "Enabled destinations by channel, how many deliveries wait for a person,\nand the latest one, or ``None`` where there has been none.",
        "properties": {
          "awaiting_review": {
            "title": "Awaiting Review",
            "type": "integer"
          },
          "enabled_target_count": {
            "title": "Enabled Target Count",
            "type": "integer"
          },
          "last": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeliverySummaryLast"
              },
              {
                "type": "null"
              }
            ]
          },
          "targets": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Targets",
            "type": "object"
          }
        },
        "required": [
          "targets",
          "enabled_target_count",
          "awaiting_review",
          "last"
        ],
        "title": "DeliverySummary",
        "type": "object"
      },
      "DeliverySummaryLast": {
        "additionalProperties": true,
        "description": "The most recent delivery of a routine, in brief.",
        "properties": {
          "attempts": {
            "title": "Attempts",
            "type": "integer"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "delivered_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At Utc"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "execution_id",
          "channel",
          "state",
          "attempts",
          "last_error",
          "delivered_at_utc"
        ],
        "title": "DeliverySummaryLast",
        "type": "object"
      },
      "DeliveryTarget": {
        "additionalProperties": true,
        "description": "A destination a routine's reports go to. ``enabled`` is stored ``0`` or\n``1``; ``mode`` is ``automatic`` or ``review`` (each delivery waits for a\nperson).",
        "properties": {
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "target": {
            "title": "Target",
            "type": "string"
          },
          "updated_at_utc": {
            "title": "Updated At Utc",
            "type": "string"
          }
        },
        "required": [
          "id",
          "routine_id",
          "channel",
          "target",
          "enabled",
          "mode",
          "created_at_utc",
          "updated_at_utc"
        ],
        "title": "DeliveryTarget",
        "type": "object"
      },
      "DeliveryTargetAdded": {
        "additionalProperties": true,
        "description": "``POST /api/routines/{routine_id}/delivery-targets``.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "routine_id"
        ],
        "title": "DeliveryTargetAdded",
        "type": "object"
      },
      "DeliveryTargetCreate": {
        "description": "One destination for a routine's report.\n\n``target`` is the address for ``email`` and the directory for ``folder``.\nAn empty email target means \"the recipient configured under Settings ->\nEmail\", which is where the address came from before schema 21 and still\ndoes for every routine the migration seeded.",
        "properties": {
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "mode": {
            "default": "automatic",
            "title": "Mode",
            "type": "string"
          },
          "target": {
            "default": "",
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "channel"
        ],
        "title": "DeliveryTargetCreate",
        "type": "object"
      },
      "DeliveryTargetUpdate": {
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mode"
          },
          "target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target"
          }
        },
        "title": "DeliveryTargetUpdate",
        "type": "object"
      },
      "DeliveryTargets": {
        "additionalProperties": true,
        "description": "``GET /api/routines/{routine_id}/delivery-targets``, and the channels\nresmon can act on today, so a screen offers exactly those.",
        "properties": {
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "shipped_channels": {
            "items": {
              "type": "string"
            },
            "title": "Shipped Channels",
            "type": "array"
          },
          "targets": {
            "items": {
              "$ref": "#/components/schemas/DeliveryTarget"
            },
            "title": "Targets",
            "type": "array"
          }
        },
        "required": [
          "routine_id",
          "targets",
          "shipped_channels"
        ],
        "title": "DeliveryTargets",
        "type": "object"
      },
      "DiscoveryLag": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/discovery-lag``.",
        "properties": {
          "insufficient_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insufficient Reason"
          },
          "minimum_sample": {
            "title": "Minimum Sample",
            "type": "integer"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/DiscoveryLagRow"
            },
            "title": "Sources",
            "type": "array"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "sources",
          "sample_size",
          "sufficient",
          "minimum_sample",
          "insufficient_reason"
        ],
        "title": "DiscoveryLag",
        "type": "object"
      },
      "DiscoveryLagRow": {
        "additionalProperties": true,
        "description": "One source's lag, in days. ``None`` below the minimum sample, rather than a median of three.",
        "properties": {
          "fastest_days": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fastest Days"
          },
          "median_days": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Median Days"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "slowest_days": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slowest Days"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "source",
          "sample_size",
          "sufficient",
          "median_days",
          "fastest_days",
          "slowest_days"
        ],
        "title": "DiscoveryLagRow",
        "type": "object"
      },
      "DiveRequest": {
        "properties": {
          "ai_enabled": {
            "default": false,
            "title": "Ai Enabled",
            "type": "boolean"
          },
          "ai_settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "ephemeral_credentials": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ephemeral Credentials"
          },
          "keywords": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keywords"
          },
          "max_results": {
            "default": 100,
            "title": "Max Results",
            "type": "integer"
          },
          "query": {
            "title": "Query",
            "type": "string"
          },
          "repository": {
            "title": "Repository",
            "type": "string"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "saved_configuration_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Id"
          }
        },
        "required": [
          "repository",
          "query"
        ],
        "title": "DiveRequest",
        "type": "object"
      },
      "DocumentBrief": {
        "additionalProperties": true,
        "description": "``POST /api/documents/briefs``: one line about a paper, for a hover.",
        "properties": {
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "first_seen_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen At"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "authors",
          "source",
          "publication_date",
          "first_seen_at"
        ],
        "title": "DocumentBrief",
        "type": "object"
      },
      "DocumentBriefsBody": {
        "properties": {
          "ids": {
            "items": {
              "type": "integer"
            },
            "maxItems": 200,
            "title": "Ids",
            "type": "array"
          }
        },
        "required": [
          "ids"
        ],
        "title": "DocumentBriefsBody",
        "type": "object"
      },
      "DocumentIdsBody": {
        "properties": {
          "document_ids": {
            "default": [],
            "items": {
              "type": "integer"
            },
            "title": "Document Ids",
            "type": "array"
          }
        },
        "title": "DocumentIdsBody",
        "type": "object"
      },
      "DriveUploadNoticeAcknowledged": {
        "additionalProperties": true,
        "description": "``POST /api/backup/drive-upload-notice/acknowledge``: the notice that the upload to Google Drive is gone, dismissed.\n\nThe removed upload's two settings are deleted, so ``GET\n/api/backup/last`` answers ``drive_upload_retired: false`` from then on.\n``acknowledged`` is whether the upload was switched on when this was\nasked; ``success`` is true either way.",
        "properties": {
          "acknowledged": {
            "title": "Acknowledged",
            "type": "boolean"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "acknowledged"
        ],
        "title": "DriveUploadNoticeAcknowledged",
        "type": "object"
      },
      "EmailSettings": {
        "additionalProperties": true,
        "description": "``GET /api/settings/email`` — the SMTP destination, never the password.\n\nThe password lives in the keyring and is reported by ``/api/credentials``\nas present or absent. No field here has ever held a credential value and\nnone may.",
        "properties": {
          "smtp_from": {
            "title": "Smtp From",
            "type": "string"
          },
          "smtp_port": {
            "title": "Smtp Port",
            "type": "string"
          },
          "smtp_server": {
            "title": "Smtp Server",
            "type": "string"
          },
          "smtp_to": {
            "title": "Smtp To",
            "type": "string"
          },
          "smtp_username": {
            "title": "Smtp Username",
            "type": "string"
          }
        },
        "required": [
          "smtp_server",
          "smtp_port",
          "smtp_username",
          "smtp_from",
          "smtp_to"
        ],
        "title": "EmailSettings",
        "type": "object"
      },
      "EmbeddingCapability": {
        "additionalProperties": true,
        "description": "Whether this backend can rank by similarity at all, and what by.\n\n``available`` needs both a loadable extension and rows in the index; either\nmissing means the sort option and the similar-papers panel are *absent*\nrather than present and empty. ``reason`` is the sentence the Settings page\nshows instead, and it is the field this model exists to keep.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "extension": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extension"
          },
          "indexed": {
            "title": "Indexed",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "available",
          "extension",
          "reason",
          "model",
          "indexed"
        ],
        "title": "EmbeddingCapability",
        "type": "object"
      },
      "EmbeddingCoverage": {
        "additionalProperties": true,
        "description": "How much of the corpus is embedded, read from the database not a counter.\n\nFrom the database so the numbers are right after a restart, after a cancel,\nand for a corpus somebody else's run embedded.",
        "properties": {
          "embedded": {
            "title": "Embedded",
            "type": "integer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "embedded",
          "total",
          "model"
        ],
        "title": "EmbeddingCoverage",
        "type": "object"
      },
      "EmbeddingIndexState": {
        "additionalProperties": true,
        "description": "What the vector index currently holds.",
        "properties": {
          "dims": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dims"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "rows": {
            "title": "Rows",
            "type": "integer"
          }
        },
        "required": [
          "model",
          "dims",
          "rows"
        ],
        "title": "EmbeddingIndexState",
        "type": "object"
      },
      "EmbeddingJobRun": {
        "additionalProperties": true,
        "description": "The backfill job's own state, running or not.\n\n``skipped_no_text`` is separate from ``processed`` on purpose: a document\nwith nothing to embed is not a failure and is not progress, and folding the\ntwo together would make a corpus of metadata-only records look embedded.",
        "properties": {
          "cancelled": {
            "title": "Cancelled",
            "type": "boolean"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "processed": {
            "title": "Processed",
            "type": "integer"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "running": {
            "title": "Running",
            "type": "boolean"
          },
          "skipped_no_text": {
            "title": "Skipped No Text",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "running",
          "model",
          "processed",
          "total",
          "skipped_no_text",
          "started_at",
          "finished_at",
          "cancelled",
          "reason"
        ],
        "title": "EmbeddingJobRun",
        "type": "object"
      },
      "EmbeddingJobStatus": {
        "additionalProperties": true,
        "description": "``run``, ``coverage``, ``extension`` and ``index`` together.",
        "properties": {
          "coverage": {
            "$ref": "#/components/schemas/EmbeddingCoverage"
          },
          "extension": {
            "$ref": "#/components/schemas/VectorExtensionStatus"
          },
          "index": {
            "$ref": "#/components/schemas/EmbeddingIndexState"
          },
          "run": {
            "$ref": "#/components/schemas/EmbeddingJobRun"
          }
        },
        "required": [
          "run",
          "coverage",
          "extension",
          "index"
        ],
        "title": "EmbeddingJobStatus",
        "type": "object"
      },
      "EmbeddingLaneView": {
        "additionalProperties": true,
        "description": "The configured lane. ``null`` on the route above means the feature is off.\n\n``credential_alias`` is a keyring slot *name*. No field here holds a key\nvalue, in the same way ``EmbeddingLane`` itself does not.",
        "properties": {
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "batch_size": {
            "title": "Batch Size",
            "type": "integer"
          },
          "credential_alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Alias"
          },
          "dims": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dims"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "input_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Limit"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "provider",
          "model",
          "endpoint",
          "base_url",
          "credential_alias",
          "batch_size",
          "dims",
          "input_limit"
        ],
        "title": "EmbeddingLaneView",
        "type": "object"
      },
      "EmbeddingProbeBody": {
        "description": "An unsaved lane to probe, so a user can test before committing to it.",
        "properties": {
          "settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settings"
          }
        },
        "title": "EmbeddingProbeBody",
        "type": "object"
      },
      "EmbeddingProviderAnswer": {
        "additionalProperties": true,
        "description": "Whether one provider can embed at all, and what that rests on.\n\nEvery provider resmon lists appears here, including the ones that cannot\nembed, because the interface states the limitation rather than omitting the\noption. ``evidence`` is the observation behind ``state`` — a dated request\nand its status — and it is a field a model written from the UI's needs\nwould have dropped, which would have left \"Anthropic does not offer an\nembeddings API\" as an assertion with nothing behind it.",
        "properties": {
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "evidence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence"
          },
          "offered": {
            "title": "Offered",
            "type": "boolean"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "suggested_models": {
            "items": {
              "type": "string"
            },
            "title": "Suggested Models",
            "type": "array"
          }
        },
        "required": [
          "provider",
          "state",
          "reason",
          "evidence",
          "offered",
          "default_model",
          "suggested_models"
        ],
        "title": "EmbeddingProviderAnswer",
        "type": "object"
      },
      "EmbeddingSettingsPage": {
        "additionalProperties": true,
        "description": "``GET /api/settings/embeddings`` — the stored keys plus everything the\ntab needs in order to render honestly.",
        "properties": {
          "capability": {
            "$ref": "#/components/schemas/EmbeddingCapability"
          },
          "lane": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmbeddingLaneView"
              },
              {
                "type": "null"
              }
            ]
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/EmbeddingProviderAnswer"
            },
            "title": "Providers",
            "type": "array"
          },
          "settings": {
            "$ref": "#/components/schemas/EmbeddingSettingsValues"
          },
          "status": {
            "$ref": "#/components/schemas/EmbeddingJobStatus"
          }
        },
        "required": [
          "settings",
          "providers",
          "lane",
          "capability",
          "status"
        ],
        "title": "EmbeddingSettingsPage",
        "type": "object"
      },
      "EmbeddingSettingsSaved": {
        "additionalProperties": true,
        "description": "``PUT /api/settings/embeddings`` — the ack, and what the lane can now do.\n\nThe capability rides on the write because a model change rebuilds the\nindex, and a client that had to re-read the page to learn that would render\na stale answer in between.",
        "properties": {
          "capability": {
            "$ref": "#/components/schemas/EmbeddingCapability"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "capability"
        ],
        "title": "EmbeddingSettingsSaved",
        "type": "object"
      },
      "EmbeddingSettingsValues": {
        "additionalProperties": true,
        "description": "The stored ``embedding_*`` keys, owned by ``EMBEDDING_SETTING_KEYS``.",
        "properties": {
          "embedding_base_url": {
            "title": "Embedding Base Url",
            "type": "string"
          },
          "embedding_batch_size": {
            "title": "Embedding Batch Size",
            "type": "string"
          },
          "embedding_dims": {
            "title": "Embedding Dims",
            "type": "string"
          },
          "embedding_enabled": {
            "title": "Embedding Enabled",
            "type": "string"
          },
          "embedding_endpoint": {
            "title": "Embedding Endpoint",
            "type": "string"
          },
          "embedding_input_limit": {
            "title": "Embedding Input Limit",
            "type": "string"
          },
          "embedding_model": {
            "title": "Embedding Model",
            "type": "string"
          },
          "embedding_provider": {
            "title": "Embedding Provider",
            "type": "string"
          }
        },
        "required": [
          "embedding_enabled",
          "embedding_provider",
          "embedding_model",
          "embedding_endpoint",
          "embedding_base_url",
          "embedding_batch_size",
          "embedding_dims",
          "embedding_input_limit"
        ],
        "title": "EmbeddingSettingsValues",
        "type": "object"
      },
      "EmbeddingStatus": {
        "additionalProperties": true,
        "description": "``GET /api/embeddings/status``: the backfill, the coverage, the vector\nextension and index, the configured lane, and whether ranking by meaning\nis available now (and if not, why).",
        "properties": {
          "capability": {
            "$ref": "#/components/schemas/EmbeddingCapability"
          },
          "coverage": {
            "$ref": "#/components/schemas/EmbeddingCoverage"
          },
          "extension": {
            "$ref": "#/components/schemas/VectorExtensionStatus"
          },
          "index": {
            "$ref": "#/components/schemas/EmbeddingIndexState"
          },
          "lane": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmbeddingLaneView"
              },
              {
                "type": "null"
              }
            ]
          },
          "run": {
            "$ref": "#/components/schemas/EmbeddingJobRun"
          }
        },
        "required": [
          "run",
          "coverage",
          "extension",
          "index",
          "lane",
          "capability"
        ],
        "title": "EmbeddingStatus",
        "type": "object"
      },
      "EvidenceFileRecord": {
        "additionalProperties": true,
        "description": "The exact Library file and version a membership or a note is pinned to.",
        "properties": {
          "byte_size": {
            "title": "Byte Size",
            "type": "integer"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "media_type": {
            "title": "Media Type",
            "type": "string"
          },
          "original_name": {
            "title": "Original Name",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "file_id",
          "version_id",
          "vault_id",
          "sha256",
          "byte_size",
          "media_type",
          "original_name",
          "created_at_utc"
        ],
        "title": "EvidenceFileRecord",
        "type": "object"
      },
      "EvidenceMember": {
        "additionalProperties": true,
        "description": "A membership with its file's record, as a list shows it.",
        "properties": {
          "added_at_utc": {
            "title": "Added At Utc",
            "type": "string"
          },
          "availability": {
            "title": "Availability",
            "type": "string"
          },
          "file": {
            "$ref": "#/components/schemas/EvidenceFileRecord"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "file_id",
          "version_id",
          "added_at_utc",
          "file",
          "availability"
        ],
        "title": "EvidenceMember",
        "type": "object"
      },
      "EvidenceMemberAdded": {
        "additionalProperties": true,
        "description": "``POST .../{project_id}/files``: ``added`` is false when the file was already a member.",
        "properties": {
          "added": {
            "title": "Added",
            "type": "boolean"
          },
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "membership": {
            "$ref": "#/components/schemas/EvidenceMembership"
          },
          "project": {
            "$ref": "#/components/schemas/EvidenceProject"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "project",
          "membership",
          "added"
        ],
        "title": "EvidenceMemberAdded",
        "type": "object"
      },
      "EvidenceMemberRemoved": {
        "additionalProperties": true,
        "description": "``DELETE .../{project_id}/files/{file_id}``: membership only; the file and its notes stay.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "project": {
            "$ref": "#/components/schemas/EvidenceProject"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "removed": {
            "title": "Removed",
            "type": "boolean"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "project",
          "removed"
        ],
        "title": "EvidenceMemberRemoved",
        "type": "object"
      },
      "EvidenceMembers": {
        "additionalProperties": true,
        "description": "``GET .../{project_id}/files``, at the project's current revision.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "count_basis": {
            "title": "Count Basis",
            "type": "string"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/EvidenceMember"
            },
            "title": "Files",
            "type": "array"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_after_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next After Id"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "through_id": {
            "title": "Through Id",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "revision",
          "files",
          "through_id",
          "next_after_id",
          "has_more",
          "total",
          "count_basis"
        ],
        "title": "EvidenceMembers",
        "type": "object"
      },
      "EvidenceMembership": {
        "additionalProperties": true,
        "properties": {
          "added_at_utc": {
            "title": "Added At Utc",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "file_id",
          "version_id",
          "added_at_utc"
        ],
        "title": "EvidenceMembership",
        "type": "object"
      },
      "EvidenceNote": {
        "additionalProperties": true,
        "description": "A plain note, or a passage pinned to a page, an extraction contract,\nthe page text's hash and exact codepoint offsets. The anchor fields are\n``None`` on a plain note. ``membership_state`` says whether its file is\nstill in the project.",
        "properties": {
          "body": {
            "title": "Body",
            "type": "string"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "end_codepoint": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Codepoint"
          },
          "extraction_contract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extraction Contract"
          },
          "file": {
            "$ref": "#/components/schemas/EvidenceFileRecord"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "membership_state": {
            "title": "Membership State",
            "type": "string"
          },
          "note_id": {
            "title": "Note Id",
            "type": "string"
          },
          "page_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Number"
          },
          "page_text_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Text Sha256"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "quote": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quote"
          },
          "resolution": {
            "title": "Resolution",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "start_codepoint": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Codepoint"
          },
          "updated_at_utc": {
            "title": "Updated At Utc",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "note_id",
          "project_id",
          "file_id",
          "version_id",
          "kind",
          "body",
          "page_number",
          "extraction_contract",
          "page_text_sha256",
          "start_codepoint",
          "end_codepoint",
          "quote",
          "revision",
          "created_at_utc",
          "updated_at_utc",
          "file",
          "membership_state",
          "resolution"
        ],
        "title": "EvidenceNote",
        "type": "object"
      },
      "EvidenceNoteSaved": {
        "additionalProperties": true,
        "description": "``POST .../{project_id}/notes`` and ``PATCH .../notes/{note_id}``.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "note": {
            "$ref": "#/components/schemas/EvidenceNote"
          },
          "project": {
            "$ref": "#/components/schemas/EvidenceProject"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "project",
          "note"
        ],
        "title": "EvidenceNoteSaved",
        "type": "object"
      },
      "EvidenceNotes": {
        "additionalProperties": true,
        "description": "``GET .../{project_id}/notes``.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "count_basis": {
            "title": "Count Basis",
            "type": "string"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_after_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next After Id"
          },
          "notes": {
            "items": {
              "$ref": "#/components/schemas/EvidenceNote"
            },
            "title": "Notes",
            "type": "array"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "through_id": {
            "title": "Through Id",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "revision",
          "notes",
          "through_id",
          "next_after_id",
          "has_more",
          "total",
          "count_basis"
        ],
        "title": "EvidenceNotes",
        "type": "object"
      },
      "EvidencePageText": {
        "additionalProperties": true,
        "description": "``GET .../{project_id}/reader/{file_id}?representation=text``: one page's canonical text.\n\n``status`` is ``extracted``, ``no_text``, ``unsupported``, ``malformed``,\n``limit_exceeded``, ``timeout`` or ``unavailable``, and only ``extracted``\ncarries a ``page_text_sha256`` a passage can be pinned to. ``examined_pages``\nnames the page read; every other page is ``not_examined``. ``coverage`` is\nthe sentence a reader shows: canonical text may omit or reshape a page.\n``representation=pdf`` answers with the verified bytes instead, outside\nthis model.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "coverage": {
            "title": "Coverage",
            "type": "string"
          },
          "examined_pages": {
            "items": {
              "type": "integer"
            },
            "title": "Examined Pages",
            "type": "array"
          },
          "extraction_contract": {
            "title": "Extraction Contract",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "media_type": {
            "title": "Media Type",
            "type": "string"
          },
          "page_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Count"
          },
          "page_number": {
            "title": "Page Number",
            "type": "integer"
          },
          "page_text_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Text Sha256"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "remaining_pages": {
            "title": "Remaining Pages",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "file_id",
          "version_id",
          "sha256",
          "media_type",
          "status",
          "page_number",
          "page_count",
          "text",
          "extraction_contract",
          "page_text_sha256",
          "examined_pages",
          "remaining_pages",
          "coverage"
        ],
        "title": "EvidencePageText",
        "type": "object"
      },
      "EvidenceProject": {
        "additionalProperties": true,
        "description": "A project row as stored, with its current counts.",
        "properties": {
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "file_count": {
            "title": "File Count",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "note_count": {
            "title": "Note Count",
            "type": "integer"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "updated_at_utc": {
            "title": "Updated At Utc",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "vault_id",
          "name",
          "revision",
          "created_at_utc",
          "updated_at_utc",
          "file_count",
          "note_count"
        ],
        "title": "EvidenceProject",
        "type": "object"
      },
      "EvidenceProjectDetail": {
        "additionalProperties": true,
        "description": "``POST /api/evidence/projects``, ``GET`` and ``PATCH .../{project_id}``.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "project": {
            "$ref": "#/components/schemas/EvidenceProject"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "project"
        ],
        "title": "EvidenceProjectDetail",
        "type": "object"
      },
      "EvidenceProjects": {
        "additionalProperties": true,
        "description": "``GET /api/evidence/projects``.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "count_basis": {
            "title": "Count Basis",
            "type": "string"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_after_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next After Id"
          },
          "projects": {
            "items": {
              "$ref": "#/components/schemas/EvidenceProject"
            },
            "title": "Projects",
            "type": "array"
          },
          "through_id": {
            "title": "Through Id",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "projects",
          "through_id",
          "next_after_id",
          "has_more",
          "total",
          "count_basis"
        ],
        "title": "EvidenceProjects",
        "type": "object"
      },
      "ExecutionDataErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-execution-data``: every saved configuration and every run record deleted.\n\nThe counts are as ``ConfigurationsErased`` and ``ExecutionsErased`` count\nthem. Settings, keys and papers are kept.",
        "properties": {
          "configs_removed": {
            "title": "Configs Removed",
            "type": "integer"
          },
          "executions_removed": {
            "title": "Executions Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "configs_removed",
          "executions_removed"
        ],
        "title": "ExecutionDataErased",
        "type": "object"
      },
      "ExecutionExport": {
        "properties": {
          "ids": {
            "items": {
              "type": "integer"
            },
            "title": "Ids",
            "type": "array"
          }
        },
        "required": [
          "ids"
        ],
        "title": "ExecutionExport",
        "type": "object"
      },
      "ExecutionSettings": {
        "additionalProperties": true,
        "description": "``GET /api/settings/execution`` — two integers, parsed and bounded.",
        "properties": {
          "max_concurrent_executions": {
            "title": "Max Concurrent Executions",
            "type": "integer"
          },
          "routine_fire_queue_limit": {
            "title": "Routine Fire Queue Limit",
            "type": "integer"
          }
        },
        "required": [
          "max_concurrent_executions",
          "routine_fire_queue_limit"
        ],
        "title": "ExecutionSettings",
        "type": "object"
      },
      "ExecutionSettingsBody": {
        "properties": {
          "max_concurrent_executions": {
            "title": "Max Concurrent Executions",
            "type": "integer"
          },
          "routine_fire_queue_limit": {
            "title": "Routine Fire Queue Limit",
            "type": "integer"
          }
        },
        "required": [
          "max_concurrent_executions",
          "routine_fire_queue_limit"
        ],
        "title": "ExecutionSettingsBody",
        "type": "object"
      },
      "ExecutionSettingsSaved": {
        "additionalProperties": true,
        "description": "``PUT /api/settings/execution`` echoes what it stored.\n\nThe echo is the point: the handler clamps nothing and refuses out-of-range\nvalues with a 400, so a caller comparing what came back with what it sent\ncan tell a stored value from an ignored one.",
        "properties": {
          "max_concurrent_executions": {
            "title": "Max Concurrent Executions",
            "type": "integer"
          },
          "routine_fire_queue_limit": {
            "title": "Routine Fire Queue Limit",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "max_concurrent_executions",
          "routine_fire_queue_limit"
        ],
        "title": "ExecutionSettingsSaved",
        "type": "object"
      },
      "ExecutionsErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-executions``: every run record deleted, with the run's links to its papers.\n\nThe papers stay, and so do report files on disk. ``executions_removed``\ncounts runs.",
        "properties": {
          "executions_removed": {
            "title": "Executions Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "executions_removed"
        ],
        "title": "ExecutionsErased",
        "type": "object"
      },
      "ExplorerExportBody": {
        "properties": {
          "authors": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Authors",
            "type": "array"
          },
          "categories": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Categories",
            "type": "array"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "format": {
            "default": "bibtex",
            "title": "Format",
            "type": "string"
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "sources": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "title": "ExplorerExportBody",
        "type": "object"
      },
      "ExplorerFilters": {
        "properties": {
          "authors": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Authors",
            "type": "array"
          },
          "categories": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Categories",
            "type": "array"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "sources": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "title": "ExplorerFilters",
        "type": "object"
      },
      "ExplorerPage": {
        "additionalProperties": true,
        "description": "``POST /api/explorer/search``.\n\n``total`` is the count of every match, capped at ``count_cap`` when\n``total_is_capped``. Under ``sort == \"similarity\"`` the phrase ranks the\nfiltered set rather than filtering it, and ``ranked_count``,\n``unranked_count`` and ``model`` say how; ``similarity_unavailable`` says\nwhy a requested ranking was refused and the page fell back to newest.\nEach of those four is absent when it does not apply.\n\n``links``, ``matches`` and ``lifecycle`` are present only when the request's\n``include`` named them: what ``/api/links/for-documents``,\n``/api/profiles/matches/for-documents`` and ``/api/lifecycle/for-documents``\nanswer for this page's papers, so a page and its marks arrive together.",
        "properties": {
          "count_cap": {
            "title": "Count Cap",
            "type": "integer"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "lifecycle": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LifecycleForDocuments"
              },
              {
                "type": "null"
              }
            ]
          },
          "links": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaperLinks"
              },
              {
                "type": "null"
              }
            ]
          },
          "matches": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WatchProfileMatchesByDocument"
              },
              {
                "type": "null"
              }
            ]
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "next_cursor": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          },
          "ranked_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ranked Count"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ExplorerPaper"
            },
            "title": "Results",
            "type": "array"
          },
          "similarity_unavailable": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Similarity Unavailable"
          },
          "sort": {
            "title": "Sort",
            "type": "string"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "total_is_capped": {
            "title": "Total Is Capped",
            "type": "boolean"
          },
          "unranked_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unranked Count"
          },
          "used_full_text_index": {
            "title": "Used Full Text Index",
            "type": "boolean"
          }
        },
        "required": [
          "results",
          "next_cursor",
          "has_more",
          "total",
          "total_is_capped",
          "count_cap",
          "used_full_text_index",
          "page_size",
          "sort"
        ],
        "title": "ExplorerPage",
        "type": "object"
      },
      "ExplorerPaper": {
        "additionalProperties": true,
        "description": "One row of an Explorer page. ``distance`` is present only under the\nsimilarity sort, and ``None`` for a paper with no vector yet, which is\nlisted after every ranked one rather than dropped.",
        "properties": {
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "categories": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Categories"
          },
          "distance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "metadata_hash": {
            "title": "Metadata Hash",
            "type": "string"
          },
          "pub_sort": {
            "title": "Pub Sort",
            "type": "string"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "id",
          "source_repository",
          "external_id",
          "doi",
          "title",
          "authors",
          "abstract",
          "publication_date",
          "url",
          "categories",
          "metadata_hash",
          "first_seen_at",
          "pub_sort"
        ],
        "title": "ExplorerPaper",
        "type": "object"
      },
      "ExplorerSearchBody": {
        "properties": {
          "authors": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Authors",
            "type": "array"
          },
          "categories": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Categories",
            "type": "array"
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cursor"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "include": {
            "items": {
              "enum": [
                "links",
                "matches",
                "lifecycle"
              ],
              "type": "string"
            },
            "maxItems": 3,
            "title": "Include",
            "type": "array"
          },
          "limit": {
            "default": 50,
            "title": "Limit",
            "type": "integer"
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "sort": {
            "default": "newest",
            "title": "Sort",
            "type": "string"
          },
          "sources": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "title": "ExplorerSearchBody",
        "type": "object"
      },
      "FactoryReset": {
        "additionalProperties": true,
        "description": "``POST /api/admin/factory-reset``: papers, configurations, runs, settings, and AI, repository and SMTP keys.\n\nThe counts are as the single-purpose routes and ``SettingsReset`` count\nthem, so the key counts are of keys found and removed. It does not clear a\nGoogle Drive sign-in stored by the removed upload or a delivery target's\nwebhook secret, and it does not touch the Library's files, report files on\ndisk, or a restore's undo copies.",
        "properties": {
          "ai_keys_removed": {
            "title": "Ai Keys Removed",
            "type": "integer"
          },
          "configs_removed": {
            "title": "Configs Removed",
            "type": "integer"
          },
          "documents_removed": {
            "title": "Documents Removed",
            "type": "integer"
          },
          "executions_removed": {
            "title": "Executions Removed",
            "type": "integer"
          },
          "repo_keys_removed": {
            "title": "Repo Keys Removed",
            "type": "integer"
          },
          "settings_cleared": {
            "title": "Settings Cleared",
            "type": "integer"
          },
          "smtp_credentials_removed": {
            "title": "Smtp Credentials Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "configs_removed",
          "executions_removed",
          "documents_removed",
          "settings_cleared",
          "ai_keys_removed",
          "repo_keys_removed",
          "smtp_credentials_removed"
        ],
        "title": "FactoryReset",
        "type": "object"
      },
      "ForeignKeyViolation": {
        "additionalProperties": true,
        "description": "One reference ``PRAGMA foreign_key_check`` found to a parent row that is not there.\n\n``rowid`` is ``None`` for a table without rowids, where two references\ncannot be told apart. ``fkid`` is the foreign key's index on its table, as\nSQLite numbers it.",
        "properties": {
          "fkid": {
            "title": "Fkid",
            "type": "integer"
          },
          "parent": {
            "title": "Parent",
            "type": "string"
          },
          "rowid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rowid"
          },
          "table": {
            "title": "Table",
            "type": "string"
          }
        },
        "required": [
          "table",
          "rowid",
          "parent",
          "fkid"
        ],
        "title": "ForeignKeyViolation",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "Health": {
        "additionalProperties": true,
        "description": "``GET /api/health``.\n\n``embeddings`` is attempted against a real connection on every call rather\nthan read from a cached probe: it is a ``dlopen`` of a 165 KB library, and\na health endpoint answering from memory would keep reporting a capability\nthe process had lost.",
        "properties": {
          "embeddings": {
            "$ref": "#/components/schemas/VectorExtensionStatus"
          },
          "identity": {
            "$ref": "#/components/schemas/RuntimeIdentity"
          },
          "pid": {
            "title": "Pid",
            "type": "integer"
          },
          "started_at": {
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "status",
          "identity",
          "pid",
          "started_at",
          "version",
          "embeddings"
        ],
        "title": "Health",
        "type": "object"
      },
      "KeywordContribution": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/keyword-contribution``. Not part of the overview: it reads every paper once.",
        "properties": {
          "documents_considered": {
            "title": "Documents Considered",
            "type": "integer"
          },
          "documents_matched": {
            "title": "Documents Matched",
            "type": "integer"
          },
          "documents_unexplained": {
            "title": "Documents Unexplained",
            "type": "integer"
          },
          "fields_checked": {
            "items": {
              "type": "string"
            },
            "title": "Fields Checked",
            "type": "array"
          },
          "insufficient_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insufficient Reason"
          },
          "keywords": {
            "items": {
              "$ref": "#/components/schemas/KeywordContributionRow"
            },
            "title": "Keywords",
            "type": "array"
          },
          "minimum_sample_for_share": {
            "title": "Minimum Sample For Share",
            "type": "integer"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "scope": {
            "$ref": "#/components/schemas/KeywordScope"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "scope",
          "keywords",
          "documents_considered",
          "documents_matched",
          "documents_unexplained",
          "sample_size",
          "minimum_sample_for_share",
          "sufficient",
          "insufficient_reason",
          "fields_checked"
        ],
        "title": "KeywordContribution",
        "type": "object"
      },
      "KeywordContributionRow": {
        "additionalProperties": true,
        "description": "One keyword: papers it matched, and how many no other keyword did.\n\n``unique_share`` is ``None`` below ``minimum_sample_for_share`` matches.",
        "properties": {
          "contains_operators": {
            "title": "Contains Operators",
            "type": "boolean"
          },
          "keyword": {
            "title": "Keyword",
            "type": "string"
          },
          "matched": {
            "title": "Matched",
            "type": "integer"
          },
          "shared": {
            "title": "Shared",
            "type": "integer"
          },
          "unique": {
            "title": "Unique",
            "type": "integer"
          },
          "unique_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unique Share"
          }
        },
        "required": [
          "keyword",
          "matched",
          "unique",
          "shared",
          "contains_operators",
          "unique_share"
        ],
        "title": "KeywordContributionRow",
        "type": "object"
      },
      "KeywordScope": {
        "additionalProperties": true,
        "description": "``corpus``, or ``execution`` with the run's id.",
        "properties": {
          "execution_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Id"
          },
          "type": {
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "KeywordScope",
        "type": "object"
      },
      "LibraryCounts": {
        "additionalProperties": true,
        "description": "What the database records the vault holding; ``basis`` says it was not re-measured.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "items": {
            "title": "Items",
            "type": "integer"
          },
          "retained_bytes": {
            "title": "Retained Bytes",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "retained_bytes",
          "basis"
        ],
        "title": "LibraryCounts",
        "type": "object"
      },
      "LibraryFile": {
        "additionalProperties": true,
        "properties": {
          "availability": {
            "title": "Availability",
            "type": "string"
          },
          "byte_size": {
            "title": "Byte Size",
            "type": "integer"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "media_type": {
            "title": "Media Type",
            "type": "string"
          },
          "original_name": {
            "title": "Original Name",
            "type": "string"
          },
          "paper_links": {
            "items": {
              "$ref": "#/components/schemas/LibraryPaperLink"
            },
            "title": "Paper Links",
            "type": "array"
          },
          "relative_path": {
            "title": "Relative Path",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "file_id",
          "version_id",
          "vault_id",
          "sha256",
          "byte_size",
          "media_type",
          "original_name",
          "relative_path",
          "created_at_utc",
          "paper_links",
          "availability"
        ],
        "title": "LibraryFile",
        "type": "object"
      },
      "LibraryFileDetail": {
        "additionalProperties": true,
        "properties": {
          "file": {
            "$ref": "#/components/schemas/LibraryFile"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "vault_id",
          "file"
        ],
        "title": "LibraryFileDetail",
        "type": "object"
      },
      "LibraryFiles": {
        "additionalProperties": true,
        "description": "``GET /api/library/files``: a descending page under a fixed ceiling, ``through_id``.",
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/LibraryFile"
            },
            "title": "Files",
            "type": "array"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_before_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Before Id"
          },
          "through_id": {
            "title": "Through Id",
            "type": "integer"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "vault_id",
          "files",
          "through_id",
          "next_before_id",
          "has_more"
        ],
        "title": "LibraryFiles",
        "type": "object"
      },
      "LibraryImported": {
        "additionalProperties": true,
        "description": "``POST /api/library/files``: 201 for a new copy, 200 for the same bytes already kept.",
        "properties": {
          "created": {
            "title": "Created",
            "type": "boolean"
          },
          "duplicate": {
            "title": "Duplicate",
            "type": "boolean"
          },
          "file": {
            "$ref": "#/components/schemas/LibraryFile"
          },
          "linked_document_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Linked Document Ids",
            "type": "array"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "vault_id",
          "file",
          "created",
          "duplicate",
          "linked_document_ids"
        ],
        "title": "LibraryImported",
        "type": "object"
      },
      "LibraryInventory": {
        "additionalProperties": true,
        "description": "``GET /api/library/export``: the inventory as a JSON document in ``text``, and its file name.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "vault_id",
          "format",
          "filename",
          "content_type",
          "text"
        ],
        "title": "LibraryInventory",
        "type": "object"
      },
      "LibraryLimits": {
        "additionalProperties": true,
        "properties": {
          "batch_files": {
            "title": "Batch Files",
            "type": "integer"
          },
          "file_bytes": {
            "title": "File Bytes",
            "type": "integer"
          },
          "items": {
            "title": "Items",
            "type": "integer"
          },
          "vault_bytes": {
            "title": "Vault Bytes",
            "type": "integer"
          }
        },
        "required": [
          "file_bytes",
          "batch_files",
          "vault_bytes",
          "items"
        ],
        "title": "LibraryLimits",
        "type": "object"
      },
      "LibraryLinkBody": {
        "additionalProperties": false,
        "properties": {
          "document_id": {
            "exclusiveMinimum": 0.0,
            "title": "Document Id",
            "type": "integer"
          },
          "expected_vault_id": {
            "title": "Expected Vault Id",
            "type": "string"
          }
        },
        "required": [
          "expected_vault_id",
          "document_id"
        ],
        "title": "LibraryLinkBody",
        "type": "object"
      },
      "LibraryLinked": {
        "additionalProperties": true,
        "properties": {
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "paper_links": {
            "items": {
              "$ref": "#/components/schemas/LibraryPaperLink"
            },
            "title": "Paper Links",
            "type": "array"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version",
          "vault_id",
          "file_id",
          "version_id",
          "document_id",
          "paper_links"
        ],
        "title": "LibraryLinked",
        "type": "object"
      },
      "LibraryOpenBody": {
        "additionalProperties": false,
        "properties": {
          "expected_vault_id": {
            "title": "Expected Vault Id",
            "type": "string"
          },
          "expected_version_id": {
            "title": "Expected Version Id",
            "type": "string"
          }
        },
        "required": [
          "expected_vault_id",
          "expected_version_id"
        ],
        "title": "LibraryOpenBody",
        "type": "object"
      },
      "LibraryOpened": {
        "additionalProperties": true,
        "description": "``POST /api/library/files/{file_id}/open``: the verified path, for the desktop's opener only.",
        "properties": {
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version",
          "vault_id",
          "file_id",
          "version_id",
          "path"
        ],
        "title": "LibraryOpened",
        "type": "object"
      },
      "LibraryPaperLink": {
        "additionalProperties": true,
        "description": "A paper the user associated a file with: an association, not an identification.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "identity_scope": {
            "title": "Identity Scope",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "document_id",
          "title",
          "identity_scope",
          "basis"
        ],
        "title": "LibraryPaperLink",
        "type": "object"
      },
      "LibraryStatus": {
        "additionalProperties": true,
        "description": "``GET /api/library`` and ``POST /api/library/vault``.\n\n``status`` is ``unconfigured``, ``ready``, ``busy``, ``mismatch``,\n``needs_attention`` or ``unavailable``; ``reason`` is present only for the\ntwo that came from a refusal.",
        "properties": {
          "counts": {
            "$ref": "#/components/schemas/LibraryCounts"
          },
          "limits": {
            "$ref": "#/components/schemas/LibraryLimits"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "vault": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LibraryVault"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "vault",
          "status",
          "counts",
          "limits"
        ],
        "title": "LibraryStatus",
        "type": "object"
      },
      "LibraryText": {
        "additionalProperties": true,
        "description": "``GET /api/library/files/{file_id}/text``: a retained TXT or MD file's bytes as literal text.",
        "properties": {
          "byte_size": {
            "title": "Byte Size",
            "type": "integer"
          },
          "encoding": {
            "title": "Encoding",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "line_count": {
            "title": "Line Count",
            "type": "integer"
          },
          "media_type": {
            "title": "Media Type",
            "type": "string"
          },
          "normalization": {
            "title": "Normalization",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version",
          "kind",
          "vault_id",
          "file_id",
          "version_id",
          "sha256",
          "media_type",
          "encoding",
          "normalization",
          "byte_size",
          "line_count",
          "text"
        ],
        "title": "LibraryText",
        "type": "object"
      },
      "LibraryVault": {
        "additionalProperties": true,
        "description": "The vault by its id and folder name: never its absolute root.",
        "properties": {
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "vault_id",
          "label",
          "created_at_utc"
        ],
        "title": "LibraryVault",
        "type": "object"
      },
      "LibraryVaultBody": {
        "additionalProperties": false,
        "properties": {
          "parent_directory": {
            "maxLength": 4096,
            "minLength": 1,
            "title": "Parent Directory",
            "type": "string"
          }
        },
        "required": [
          "parent_directory"
        ],
        "title": "LibraryVaultBody",
        "type": "object"
      },
      "LifecycleCheckError": {
        "additionalProperties": true,
        "description": "A paper a service failed on part-way, recorded as errored.",
        "properties": {
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "document_id",
          "title",
          "error"
        ],
        "title": "LifecycleCheckError",
        "type": "object"
      },
      "LifecycleCheckRequest": {
        "properties": {
          "limit": {
            "default": 1000,
            "maximum": 5000.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "run_until_done": {
            "default": false,
            "title": "Run Until Done",
            "type": "boolean"
          }
        },
        "title": "LifecycleCheckRequest",
        "type": "object"
      },
      "LifecycleCheckStarted": {
        "additionalProperties": true,
        "description": "``POST /api/lifecycle/check``: the check was started in the background.",
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "run_until_done": {
            "title": "Run Until Done",
            "type": "boolean"
          },
          "status": {
            "const": "started",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "limit",
          "run_until_done"
        ],
        "title": "LifecycleCheckStarted",
        "type": "object"
      },
      "LifecycleCheckState": {
        "additionalProperties": true,
        "description": "When a paper was last checked, and how that check ended.",
        "properties": {
          "checked_at": {
            "title": "Checked At",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "no_identifier",
              "error"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "checked_at",
          "status"
        ],
        "title": "LifecycleCheckState",
        "type": "object"
      },
      "LifecycleCounts": {
        "additionalProperties": true,
        "description": "Recorded events by severity, over the whole corpus.",
        "properties": {
          "caution": {
            "title": "Caution",
            "type": "integer"
          },
          "critical": {
            "title": "Critical",
            "type": "integer"
          },
          "informational": {
            "title": "Informational",
            "type": "integer"
          }
        },
        "required": [
          "critical",
          "caution",
          "informational"
        ],
        "title": "LifecycleCounts",
        "type": "object"
      },
      "LifecycleCoverage": {
        "additionalProperties": true,
        "description": "How much of the corpus the recorded events cover.\n\nThe four counts partition ``corpus``. ``no_identifier`` papers were never\nlooked at, because nothing could be asked about them; ``errored`` papers\nwere asked about and a service failed on them; ``unchecked`` papers have\nnot been asked about yet.",
        "properties": {
          "checked": {
            "title": "Checked",
            "type": "integer"
          },
          "corpus": {
            "title": "Corpus",
            "type": "integer"
          },
          "errored": {
            "title": "Errored",
            "type": "integer"
          },
          "last_checked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Checked At"
          },
          "no_identifier": {
            "title": "No Identifier",
            "type": "integer"
          },
          "recheck_after_days": {
            "title": "Recheck After Days",
            "type": "integer"
          },
          "unchecked": {
            "title": "Unchecked",
            "type": "integer"
          }
        },
        "required": [
          "corpus",
          "checked",
          "no_identifier",
          "errored",
          "unchecked",
          "last_checked_at",
          "recheck_after_days"
        ],
        "title": "LifecycleCoverage",
        "type": "object"
      },
      "LifecycleEvent": {
        "additionalProperties": true,
        "description": "One recorded event on a paper: a row of ``document_lifecycle``.\n\n``label`` is the upstream's own wording, verbatim; ``provider_source`` is\nwho registered the notice where Crossref says (``retraction-watch`` or\n``publisher``).",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "notice_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notice Date"
          },
          "notice_doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notice Doi"
          },
          "notice_key": {
            "title": "Notice Key",
            "type": "string"
          },
          "notice_url": {
            "title": "Notice Url",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "provider_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Source"
          },
          "severity": {
            "enum": [
              "critical",
              "caution",
              "informational"
            ],
            "title": "Severity",
            "type": "string"
          }
        },
        "required": [
          "document_id",
          "kind",
          "severity",
          "notice_key",
          "label",
          "notice_doi",
          "notice_url",
          "notice_date",
          "detail",
          "provider",
          "provider_source",
          "first_seen_at"
        ],
        "title": "LifecycleEvent",
        "type": "object"
      },
      "LifecycleFinding": {
        "additionalProperties": true,
        "description": "An event in the corpus report, with the paper it is on.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "document_doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Doi"
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "document_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Url"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "notice_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notice Date"
          },
          "notice_doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notice Doi"
          },
          "notice_key": {
            "title": "Notice Key",
            "type": "string"
          },
          "notice_url": {
            "title": "Notice Url",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "provider_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Source"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "severity": {
            "enum": [
              "critical",
              "caution",
              "informational"
            ],
            "title": "Severity",
            "type": "string"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "document_id",
          "kind",
          "severity",
          "notice_key",
          "label",
          "notice_doi",
          "notice_url",
          "notice_date",
          "detail",
          "provider",
          "provider_source",
          "first_seen_at",
          "title",
          "document_doi",
          "source_repository",
          "document_url",
          "publication_date"
        ],
        "title": "LifecycleFinding",
        "type": "object"
      },
      "LifecycleForDocuments": {
        "additionalProperties": true,
        "description": "``POST /api/lifecycle/for-documents``: events and check state for a page.\n\nBoth maps are keyed by the paper's id as a string. A paper absent from\n``events`` has nothing recorded against it; absent from ``checked`` as\nwell, it has never been checked, which is the different fact.",
        "properties": {
          "checked": {
            "additionalProperties": {
              "$ref": "#/components/schemas/LifecycleCheckState"
            },
            "title": "Checked",
            "type": "object"
          },
          "events": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/LifecycleEvent"
              },
              "type": "array"
            },
            "title": "Events",
            "type": "object"
          }
        },
        "required": [
          "events",
          "checked"
        ],
        "title": "LifecycleForDocuments",
        "type": "object"
      },
      "LifecycleForDocumentsRequest": {
        "properties": {
          "document_ids": {
            "items": {
              "type": "integer"
            },
            "maxItems": 500,
            "title": "Document Ids",
            "type": "array"
          }
        },
        "title": "LifecycleForDocumentsRequest",
        "type": "object"
      },
      "LifecycleReport": {
        "additionalProperties": true,
        "description": "``GET /api/lifecycle``: every recorded event, the coverage, and the run.\n\n``sufficient`` is false until at least one paper has been checked: an empty\n``findings`` on an unchecked corpus is not \"nothing has been retracted\".",
        "properties": {
          "counts": {
            "$ref": "#/components/schemas/LifecycleCounts"
          },
          "coverage": {
            "$ref": "#/components/schemas/LifecycleCoverage"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/LifecycleFinding"
            },
            "title": "Findings",
            "type": "array"
          },
          "run": {
            "$ref": "#/components/schemas/LifecycleRunState"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "findings",
          "counts",
          "coverage",
          "sufficient",
          "run"
        ],
        "title": "LifecycleReport",
        "type": "object"
      },
      "LifecycleRunOutcomes": {
        "additionalProperties": true,
        "description": "How each check a run recorded ended, by ``document_lifecycle_checks.status``.",
        "properties": {
          "error": {
            "title": "Error",
            "type": "integer"
          },
          "no_identifier": {
            "title": "No Identifier",
            "type": "integer"
          },
          "ok": {
            "title": "Ok",
            "type": "integer"
          }
        },
        "required": [
          "ok",
          "no_identifier",
          "error"
        ],
        "title": "LifecycleRunOutcomes",
        "type": "object"
      },
      "LifecycleRunResult": {
        "additionalProperties": true,
        "description": "The account of the most recent run to finish, in this engine.\n\n``checked_now`` counts every paper the run recorded, and ``outcomes``\ndivides it: only ``ok`` papers were looked at. ``stopped`` is true when the\nrun was stopped before it had asked about everything it selected, and\n``not_asked`` is how many papers it never asked about as a result.",
        "properties": {
          "checked_at": {
            "title": "Checked At",
            "type": "string"
          },
          "checked_now": {
            "title": "Checked Now",
            "type": "integer"
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/LifecycleCheckError"
            },
            "title": "Errors",
            "type": "array"
          },
          "not_asked": {
            "title": "Not Asked",
            "type": "integer"
          },
          "outcomes": {
            "$ref": "#/components/schemas/LifecycleRunOutcomes"
          },
          "remaining": {
            "title": "Remaining",
            "type": "integer"
          },
          "stopped": {
            "title": "Stopped",
            "type": "boolean"
          },
          "unanswered": {
            "items": {
              "$ref": "#/components/schemas/LifecycleUnanswered"
            },
            "title": "Unanswered",
            "type": "array"
          }
        },
        "required": [
          "checked_now",
          "outcomes",
          "remaining",
          "errors",
          "unanswered",
          "stopped",
          "not_asked",
          "checked_at"
        ],
        "title": "LifecycleRunResult",
        "type": "object"
      },
      "LifecycleRunState": {
        "additionalProperties": true,
        "description": "Whether a check is running in this engine, and how the last one ended.\n\nHeld in the engine's memory: an engine started since the last check has\n``last`` null, and the recorded coverage is then the whole account.\n``error`` is a run that failed outright, with nothing to report.",
        "properties": {
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "last": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LifecycleRunResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "running": {
            "title": "Running",
            "type": "boolean"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "stop_requested": {
            "title": "Stop Requested",
            "type": "boolean"
          }
        },
        "required": [
          "running",
          "started_at",
          "last",
          "error",
          "stop_requested"
        ],
        "title": "LifecycleRunState",
        "type": "object"
      },
      "LifecycleStopAnswer": {
        "additionalProperties": true,
        "description": "``POST /api/lifecycle/stop``: asked to stop, or nothing was running.",
        "properties": {
          "status": {
            "enum": [
              "idle",
              "stopping"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "LifecycleStopAnswer",
        "type": "object"
      },
      "LifecycleUnanswered": {
        "additionalProperties": true,
        "description": "A service that did not answer, and the papers that left unchecked.\n\nThose papers are not recorded at all and are asked about again on the next\nrun, so they count among ``coverage.unchecked``, never among the clear.",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "papers": {
            "title": "Papers",
            "type": "integer"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "service": {
            "title": "Service",
            "type": "string"
          }
        },
        "required": [
          "service",
          "name",
          "papers",
          "reason"
        ],
        "title": "LifecycleUnanswered",
        "type": "object"
      },
      "MapFacetWatch": {
        "additionalProperties": true,
        "description": "A watch, and every paper its runs have ever returned.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "members": {
            "items": {
              "type": "integer"
            },
            "title": "Members",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "is_active",
          "members"
        ],
        "title": "MapFacetWatch",
        "type": "object"
      },
      "MapFacets": {
        "additionalProperties": true,
        "description": "``GET /api/map/facets``: what the map's filters and colors read, per paper.\n\nColumns in id order, one entry per paper in ``ids``. ``source`` indexes\n``sources`` (slugs). ``published_day`` is days since 1970-01-01 of the first\nday the stored publication date names (a year alone counts from January 1),\nor null where it is not a date. ``found_at`` is when resmon first collected\nthe paper, in Unix seconds. ``saved`` and ``read`` are the reading queue's\npapers by status; ``new`` the papers first collected after ``since``, which\nis Today's window (``window`` as Today words it).",
        "properties": {
          "found_at": {
            "items": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "title": "Found At",
            "type": "array"
          },
          "ids": {
            "items": {
              "type": "integer"
            },
            "title": "Ids",
            "type": "array"
          },
          "new": {
            "items": {
              "type": "integer"
            },
            "title": "New",
            "type": "array"
          },
          "published_day": {
            "items": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "title": "Published Day",
            "type": "array"
          },
          "read": {
            "items": {
              "type": "integer"
            },
            "title": "Read",
            "type": "array"
          },
          "saved": {
            "items": {
              "type": "integer"
            },
            "title": "Saved",
            "type": "array"
          },
          "since": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Since"
          },
          "source": {
            "items": {
              "type": "integer"
            },
            "title": "Source",
            "type": "array"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "title": "Sources",
            "type": "array"
          },
          "watches": {
            "items": {
              "$ref": "#/components/schemas/MapFacetWatch"
            },
            "title": "Watches",
            "type": "array"
          },
          "window": {
            "enum": [
              "since_last_look",
              "first_look"
            ],
            "title": "Window",
            "type": "string"
          }
        },
        "required": [
          "ids",
          "source",
          "sources",
          "published_day",
          "found_at",
          "saved",
          "read",
          "since",
          "window",
          "new",
          "watches"
        ],
        "title": "MapFacets",
        "type": "object"
      },
      "MapFind": {
        "additionalProperties": true,
        "description": "``GET /api/map/find``: the papers whose title or authors contain the query, newest first.",
        "properties": {
          "ids": {
            "items": {
              "type": "integer"
            },
            "title": "Ids",
            "type": "array"
          },
          "query": {
            "title": "Query",
            "type": "string"
          }
        },
        "required": [
          "query",
          "ids"
        ],
        "title": "MapFind",
        "type": "object"
      },
      "MapPoints": {
        "additionalProperties": true,
        "description": "Every paper on the plate, one entry per paper in each list, in id order.\n\nColumns rather than one object per paper: at 100,000 papers this is the\ndifference between a few megabytes and a few dozen.",
        "properties": {
          "id": {
            "items": {
              "type": "integer"
            },
            "title": "Id",
            "type": "array"
          },
          "region": {
            "items": {
              "type": "integer"
            },
            "title": "Region",
            "type": "array"
          },
          "seen_day": {
            "items": {
              "type": "integer"
            },
            "title": "Seen Day",
            "type": "array"
          },
          "x": {
            "items": {
              "type": "number"
            },
            "title": "X",
            "type": "array"
          },
          "y": {
            "items": {
              "type": "number"
            },
            "title": "Y",
            "type": "array"
          }
        },
        "required": [
          "id",
          "x",
          "y",
          "region",
          "seen_day"
        ],
        "title": "MapPoints",
        "type": "object"
      },
      "MapRegion": {
        "additionalProperties": true,
        "description": "One region of the collection map: a disc on the plate, and its name.\n\n``label`` and ``terms`` are the words most distinctive of the region's\npapers, so they are always lexical, whatever basis placed the papers.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "r": {
            "title": "R",
            "type": "number"
          },
          "size": {
            "title": "Size",
            "type": "integer"
          },
          "terms": {
            "items": {
              "type": "string"
            },
            "title": "Terms",
            "type": "array"
          },
          "x": {
            "title": "X",
            "type": "number"
          },
          "y": {
            "title": "Y",
            "type": "number"
          }
        },
        "required": [
          "id",
          "label",
          "terms",
          "x",
          "y",
          "r",
          "size"
        ],
        "title": "MapRegion",
        "type": "object"
      },
      "MapUnplaced": {
        "additionalProperties": true,
        "description": "Papers in the collection that are not on the plate, and why.",
        "properties": {
          "no_text": {
            "title": "No Text",
            "type": "integer"
          },
          "not_embedded": {
            "title": "Not Embedded",
            "type": "integer"
          }
        },
        "required": [
          "no_text",
          "not_embedded"
        ],
        "title": "MapUnplaced",
        "type": "object"
      },
      "MapView": {
        "additionalProperties": true,
        "description": "``GET`` and ``PUT /api/map/views/{name}``: a map's remembered filters and colors.\n\nEmpty ``watches`` or ``sources`` filter nothing. ``dates`` says which date\n``date_from`` and ``date_to`` (inclusive, ``YYYY-MM-DD``, either may be\nnull) are read against. ``list_by`` is how the list beside Today's map is\ngrouped; a run's map has no list. The PUT answers what it stored, after\nanything it did not recognize fell back to the default.",
        "properties": {
          "color": {
            "enum": [
              "region",
              "watch",
              "source",
              "age"
            ],
            "title": "Color",
            "type": "string"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "dates": {
            "enum": [
              "found",
              "published"
            ],
            "title": "Dates",
            "type": "string"
          },
          "list_by": {
            "enum": [
              "watch",
              "region"
            ],
            "title": "List By",
            "type": "string"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "title": "Sources",
            "type": "array"
          },
          "state": {
            "enum": [
              "any",
              "saved",
              "to_read",
              "read",
              "new"
            ],
            "title": "State",
            "type": "string"
          },
          "watches": {
            "items": {
              "type": "integer"
            },
            "title": "Watches",
            "type": "array"
          }
        },
        "required": [
          "color",
          "watches",
          "sources",
          "dates",
          "date_from",
          "date_to",
          "state",
          "list_by"
        ],
        "title": "MapView",
        "type": "object"
      },
      "MapViewBody": {
        "description": "A map's whole view, every time: a PUT replaces it.",
        "properties": {
          "color": {
            "enum": [
              "region",
              "watch",
              "source",
              "age"
            ],
            "title": "Color",
            "type": "string"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "dates": {
            "default": "found",
            "enum": [
              "found",
              "published"
            ],
            "title": "Dates",
            "type": "string"
          },
          "list_by": {
            "default": "watch",
            "enum": [
              "watch",
              "region"
            ],
            "title": "List By",
            "type": "string"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "maxItems": 200,
            "title": "Sources",
            "type": "array"
          },
          "state": {
            "default": "any",
            "enum": [
              "any",
              "saved",
              "to_read",
              "read",
              "new"
            ],
            "title": "State",
            "type": "string"
          },
          "watches": {
            "items": {
              "type": "integer"
            },
            "maxItems": 500,
            "title": "Watches",
            "type": "array"
          }
        },
        "required": [
          "color"
        ],
        "title": "MapViewBody",
        "type": "object"
      },
      "MissedFire": {
        "additionalProperties": true,
        "description": "One fire that came due and did not run, and what became of it since.",
        "properties": {
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition"
          },
          "due_at_utc": {
            "title": "Due At Utc",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "observed_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed At Utc"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "routine_id",
          "due_at_utc",
          "observed_at_utc",
          "disposition"
        ],
        "title": "MissedFire",
        "type": "object"
      },
      "MissedFires": {
        "additionalProperties": true,
        "description": "Fires that did not run, counted in pairs with the time beside each count.\n\n``count`` is every recorded miss. ``overlap_skipped`` is the subset refused\nbecause the routine's previous run was still going; the rest came due while\nresmon was not running, and ``last_closed_miss_due_at_utc`` is the latest of\nthose. A routine that has missed none answers with zeros, not an absent key.",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "last_closed_miss_due_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Closed Miss Due At Utc"
          },
          "last_due_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Due At Utc"
          },
          "last_overlap_skipped_due_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Overlap Skipped Due At Utc"
          },
          "overlap_skipped": {
            "title": "Overlap Skipped",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "last_due_at_utc",
          "overlap_skipped",
          "last_overlap_skipped_due_at_utc",
          "last_closed_miss_due_at_utc"
        ],
        "title": "MissedFires",
        "type": "object"
      },
      "NotificationSettings": {
        "additionalProperties": true,
        "description": "``GET /api/settings/notifications`` — the one group that is not strings.\n\nThe handler reads the same stored text as every other group and then\n*answers* a bool and a three-valued mode, defaulting ``notify_manual`` to\ntrue on a first load. So this model is ``bool`` and ``str`` where its\nsiblings are ``str`` and ``str``, and a model copied from one of them would\nhave turned ``true`` into ``\"true\"`` without dropping anything.",
        "properties": {
          "notify_automatic_mode": {
            "title": "Notify Automatic Mode",
            "type": "string"
          },
          "notify_manual": {
            "title": "Notify Manual",
            "type": "boolean"
          }
        },
        "required": [
          "notify_manual",
          "notify_automatic_mode"
        ],
        "title": "NotificationSettings",
        "type": "object"
      },
      "OnboardingCounts": {
        "additionalProperties": true,
        "description": "What the install already has. All three zero is what ``show`` keys on.",
        "properties": {
          "documents": {
            "title": "Documents",
            "type": "integer"
          },
          "executions": {
            "title": "Executions",
            "type": "integer"
          },
          "routines": {
            "title": "Routines",
            "type": "integer"
          }
        },
        "required": [
          "documents",
          "executions",
          "routines"
        ],
        "title": "OnboardingCounts",
        "type": "object"
      },
      "OnboardingDismissed": {
        "additionalProperties": true,
        "description": "``POST /api/onboarding/dismiss``.",
        "properties": {
          "dismissed": {
            "title": "Dismissed",
            "type": "boolean"
          }
        },
        "required": [
          "dismissed"
        ],
        "title": "OnboardingDismissed",
        "type": "object"
      },
      "OnboardingState": {
        "additionalProperties": true,
        "description": "``GET /api/onboarding``.",
        "properties": {
          "counts": {
            "$ref": "#/components/schemas/OnboardingCounts"
          },
          "dismissed": {
            "title": "Dismissed",
            "type": "boolean"
          },
          "show": {
            "title": "Show",
            "type": "boolean"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/OnboardingStep"
            },
            "title": "Steps",
            "type": "array"
          }
        },
        "required": [
          "show",
          "dismissed",
          "counts",
          "steps"
        ],
        "title": "OnboardingState",
        "type": "object"
      },
      "OnboardingStep": {
        "additionalProperties": true,
        "description": "One first-run step, as a fact rather than as prose.\n\n``done`` is **three-valued**, and declaring it ``bool`` is a real mistake\nthat ``test_onboarding.py`` catches: the two credential\nsteps call ``_credential_present``, which answers ``None`` when the keyring\nwill not say. An unsigned macOS build is denied the items a signed build\nstored, and \"no key\" there would tell somebody to add a key they already\nhave — so the backend declines to answer, and the model has to be able to\ncarry that. ``done: bool`` did not merely mis-describe it; it turned a 200\ninto a ``ResponseValidationError``, which is a 500.\n\n``detail`` says which machine it looked on, and for the agent-CLI step it\nis detection and not a login check. The card renders it verbatim; it is not\na key a client may synthesize.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "done": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Done"
          },
          "id": {
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "done",
          "detail"
        ],
        "title": "OnboardingStep",
        "type": "object"
      },
      "Paper": {
        "additionalProperties": true,
        "description": "``GET /api/documents/{doc_id}``: one paper as stored, and its place in the\nreading queue (``to_read``, ``read``, or ``None`` when it is not saved).",
        "properties": {
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "categories": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Categories"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "metadata_hash": {
            "title": "Metadata Hash",
            "type": "string"
          },
          "pub_sort": {
            "title": "Pub Sort",
            "type": "string"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "queue_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Status"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "id",
          "source_repository",
          "external_id",
          "doi",
          "title",
          "authors",
          "abstract",
          "publication_date",
          "url",
          "categories",
          "metadata_hash",
          "first_seen_at",
          "pub_sort",
          "queue_status"
        ],
        "title": "Paper",
        "type": "object"
      },
      "PaperLink": {
        "additionalProperties": true,
        "description": "Another record that looks like the same work, and why: ``method`` is\n``shared_doi`` or ``vector+title``; ``label`` is the sentence a person reads.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "method": {
            "title": "Method",
            "type": "string"
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "source_repository",
          "kind",
          "score",
          "method",
          "label"
        ],
        "title": "PaperLink",
        "type": "object"
      },
      "PaperLinks": {
        "additionalProperties": true,
        "description": "``POST /api/links/for-documents``: the links of each asked-for paper,\nkeyed by its id as a string. A paper with none is absent.",
        "properties": {
          "links": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/PaperLink"
              },
              "type": "array"
            },
            "title": "Links",
            "type": "object"
          }
        },
        "required": [
          "links"
        ],
        "title": "PaperLinks",
        "type": "object"
      },
      "PaperWhy": {
        "additionalProperties": true,
        "description": "``GET /api/documents/{doc_id}/why``: what resmon can say about why a\npaper is in the corpus, and ``what_resmon_cannot_see`` -- the limits of\nthat account, stated rather than implied.",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/PaperWhyDocument"
          },
          "fields_checked": {
            "items": {
              "type": "string"
            },
            "title": "Fields Checked",
            "type": "array"
          },
          "headline": {
            "title": "Headline",
            "type": "string"
          },
          "keyword_count": {
            "title": "Keyword Count",
            "type": "integer"
          },
          "keywords": {
            "items": {
              "$ref": "#/components/schemas/PaperWhyKeyword"
            },
            "title": "Keywords",
            "type": "array"
          },
          "matched_count": {
            "title": "Matched Count",
            "type": "integer"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/PaperWhyRun"
            },
            "title": "Runs",
            "type": "array"
          },
          "source": {
            "$ref": "#/components/schemas/PaperWhySource"
          },
          "verdict": {
            "title": "Verdict",
            "type": "string"
          },
          "what_resmon_cannot_see": {
            "items": {
              "type": "string"
            },
            "title": "What Resmon Cannot See",
            "type": "array"
          }
        },
        "required": [
          "document",
          "source",
          "runs",
          "keywords",
          "matched_count",
          "keyword_count",
          "verdict",
          "headline",
          "what_resmon_cannot_see",
          "fields_checked"
        ],
        "title": "PaperWhy",
        "type": "object"
      },
      "PaperWhyDocument": {
        "additionalProperties": true,
        "properties": {
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "first_seen_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen At"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "source_repository",
          "doi",
          "publication_date",
          "first_seen_at"
        ],
        "title": "PaperWhyDocument",
        "type": "object"
      },
      "PaperWhyKeyword": {
        "additionalProperties": true,
        "description": "One requested keyword: whether it is in the fields resmon holds, which\nones, and those named in words (``where``).",
        "properties": {
          "contains_operators": {
            "title": "Contains Operators",
            "type": "boolean"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "title": "Fields",
            "type": "array"
          },
          "keyword": {
            "title": "Keyword",
            "type": "string"
          },
          "matched": {
            "title": "Matched",
            "type": "boolean"
          },
          "where": {
            "title": "Where",
            "type": "string"
          }
        },
        "required": [
          "keyword",
          "matched",
          "fields",
          "where",
          "contains_operators"
        ],
        "title": "PaperWhyKeyword",
        "type": "object"
      },
      "PaperWhyRun": {
        "additionalProperties": true,
        "properties": {
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "execution_type": {
            "title": "Execution Type",
            "type": "string"
          },
          "keywords": {
            "items": {
              "type": "string"
            },
            "title": "Keywords",
            "type": "array"
          },
          "routine_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routine Name"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          }
        },
        "required": [
          "execution_id",
          "execution_type",
          "start_time",
          "routine_name",
          "keywords"
        ],
        "title": "PaperWhyRun",
        "type": "object"
      },
      "PaperWhySource": {
        "additionalProperties": true,
        "description": "The source the paper came from, and whether resmon or the source decided\nthe match: ``resmon_filtered_locally`` is false for a relevance-ranked\nupstream, which resmon cannot speak about with certainty.",
        "properties": {
          "keyword_combination": {
            "title": "Keyword Combination",
            "type": "string"
          },
          "keyword_combination_notes": {
            "title": "Keyword Combination Notes",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "resmon_filtered_locally": {
            "title": "Resmon Filtered Locally",
            "type": "boolean"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name",
          "keyword_combination",
          "keyword_combination_notes",
          "resmon_filtered_locally"
        ],
        "title": "PaperWhySource",
        "type": "object"
      },
      "ProfileImportBody": {
        "description": "One exported profile, or a list of them.",
        "properties": {
          "profiles": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Profiles",
            "type": "array"
          }
        },
        "title": "ProfileImportBody",
        "type": "object"
      },
      "ProfileMatchesForDocumentsBody": {
        "properties": {
          "document_ids": {
            "default": [],
            "items": {
              "type": "integer"
            },
            "title": "Document Ids",
            "type": "array"
          }
        },
        "title": "ProfileMatchesForDocumentsBody",
        "type": "object"
      },
      "PublicationVolume": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/publication-volume``, by ``source`` or ``category``.",
        "properties": {
          "group_by": {
            "title": "Group By",
            "type": "string"
          },
          "groups": {
            "items": {
              "type": "string"
            },
            "title": "Groups",
            "type": "array"
          },
          "insufficient_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insufficient Reason"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/PublicationVolumeMonth"
            },
            "title": "Series",
            "type": "array"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "group_by",
          "groups",
          "series",
          "sample_size",
          "sufficient",
          "insufficient_reason"
        ],
        "title": "PublicationVolume",
        "type": "object"
      },
      "PublicationVolumeMonth": {
        "additionalProperties": true,
        "description": "One month: its total and each group's count; groups outside the top eight are ``other``.",
        "properties": {
          "groups": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Groups",
            "type": "object"
          },
          "month": {
            "title": "Month",
            "type": "string"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "month",
          "total",
          "groups"
        ],
        "title": "PublicationVolumeMonth",
        "type": "object"
      },
      "ReadingQueueCounts": {
        "additionalProperties": true,
        "description": "How many are in each state, over the whole queue and not this page.",
        "properties": {
          "all": {
            "title": "All",
            "type": "integer"
          },
          "read": {
            "title": "Read",
            "type": "integer"
          },
          "to_read": {
            "title": "To Read",
            "type": "integer"
          }
        },
        "required": [
          "to_read",
          "read",
          "all"
        ],
        "title": "ReadingQueueCounts",
        "type": "object"
      },
      "ReadingQueueDocument": {
        "additionalProperties": true,
        "description": "The stored paper a queue entry points at.\n\n``authors`` is the raw column, a JSON array stored as text; the renderer\nparses it. Every other nullable column of ``documents`` is optional here\nbecause it is nullable there.",
        "properties": {
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "categories": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Categories"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "id",
          "source_repository",
          "external_id",
          "doi",
          "title",
          "authors",
          "abstract",
          "publication_date",
          "url",
          "categories",
          "first_seen_at"
        ],
        "title": "ReadingQueueDocument",
        "type": "object"
      },
      "ReadingQueueEntry": {
        "additionalProperties": true,
        "description": "One saved paper. ``read_at`` is ``None`` until it is marked read.\n\n``document`` is absent from the entry a write returns and present in the\nentry a page lists, which is why it is optional: the writes answer with the\nqueue row alone and the caller already has the paper it just saved.",
        "properties": {
          "document": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReadingQueueDocument"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "read_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read At"
          },
          "saved_at": {
            "title": "Saved At",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "document_id",
          "status",
          "saved_at",
          "updated_at",
          "read_at"
        ],
        "title": "ReadingQueueEntry",
        "type": "object"
      },
      "ReadingQueuePage": {
        "additionalProperties": true,
        "description": "``GET /api/reading-queue``.\n\n``status`` echoes the filter that produced the page and is ``None`` when\nthe caller asked for both, so a client can tell \"everything\" from\n\"everything that happens to be unread\".",
        "properties": {
          "counts": {
            "$ref": "#/components/schemas/ReadingQueueCounts"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/ReadingQueueEntry"
            },
            "title": "Entries",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "entries",
          "total",
          "limit",
          "offset",
          "status",
          "counts"
        ],
        "title": "ReadingQueuePage",
        "type": "object"
      },
      "ReadingQueueRemoval": {
        "additionalProperties": true,
        "description": "``DELETE /api/reading-queue/{document_id}``. The paper is not touched.",
        "properties": {
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "removed": {
            "title": "Removed",
            "type": "boolean"
          }
        },
        "required": [
          "removed",
          "document_id"
        ],
        "title": "ReadingQueueRemoval",
        "type": "object"
      },
      "ReadingQueueSaveBody": {
        "properties": {
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          }
        },
        "required": [
          "document_id"
        ],
        "title": "ReadingQueueSaveBody",
        "type": "object"
      },
      "ReadingQueueStatusBody": {
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "ReadingQueueStatusBody",
        "type": "object"
      },
      "ReferenceExportBody": {
        "properties": {
          "document_ids": {
            "default": [],
            "items": {
              "type": "integer"
            },
            "title": "Document Ids",
            "type": "array"
          },
          "execution_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Ids"
          },
          "format": {
            "default": "bibtex",
            "title": "Format",
            "type": "string"
          }
        },
        "title": "ReferenceExportBody",
        "type": "object"
      },
      "RendererHeartbeat": {
        "additionalProperties": true,
        "description": "``POST /api/renderer/heartbeat``.\n\n``ttl_sec`` is how long this ping suppresses the backend's own desktop\nnotifications. It is returned rather than assumed because the renderer\nsets its interval from it, and a renderer pinging slower than the TTL\nwould get both notifications.",
        "properties": {
          "ok": {
            "title": "Ok",
            "type": "boolean"
          },
          "ttl_sec": {
            "title": "Ttl Sec",
            "type": "number"
          }
        },
        "required": [
          "ok",
          "ttl_sec"
        ],
        "title": "RendererHeartbeat",
        "type": "object"
      },
      "RendererOriginBody": {
        "additionalProperties": false,
        "properties": {
          "origin": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Origin",
            "type": "string"
          }
        },
        "required": [
          "origin"
        ],
        "title": "RendererOriginBody",
        "type": "object"
      },
      "RepositoryCatalogEntry": {
        "additionalProperties": true,
        "description": "One source, as the Repositories page renders it.\n\nNot decoration: ``rate_limit``, ``upstream_policy`` and\n``keyword_combination`` are read by a user as statements of fact about\nsomebody else's search engine, and ``attribution`` with its\n``attribution_requirement`` is a license obligation rather than a courtesy\nwhen the requirement says ``required``. Those four are the fields a model\nwritten from the table's visible columns would have dropped, and dropping\nan attribution credit is the one failure mode in this file that is not\nmerely a missing feature.",
        "properties": {
          "api_key_requirement": {
            "title": "Api Key Requirement",
            "type": "string"
          },
          "attribution": {
            "title": "Attribution",
            "type": "string"
          },
          "attribution_requirement": {
            "title": "Attribution Requirement",
            "type": "string"
          },
          "attribution_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attribution Source"
          },
          "client_module": {
            "title": "Client Module",
            "type": "string"
          },
          "constraints": {
            "$ref": "#/components/schemas/RepositoryConstraints"
          },
          "credential_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Name"
          },
          "date_granularity": {
            "title": "Date Granularity",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "endpoint": {
            "title": "Endpoint",
            "type": "string"
          },
          "entity_search": {
            "$ref": "#/components/schemas/RepositoryEntitySearch"
          },
          "keyword_combination": {
            "title": "Keyword Combination",
            "type": "string"
          },
          "keyword_combination_notes": {
            "title": "Keyword Combination Notes",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notes": {
            "title": "Notes",
            "type": "string"
          },
          "parallel_safe": {
            "title": "Parallel Safe",
            "type": "string"
          },
          "placeholder": {
            "title": "Placeholder",
            "type": "string"
          },
          "query_method": {
            "title": "Query Method",
            "type": "string"
          },
          "rate_limit": {
            "title": "Rate Limit",
            "type": "string"
          },
          "registration_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registration Url"
          },
          "result_order": {
            "enum": [
              "newest_first",
              "relevance",
              "unstated"
            ],
            "title": "Result Order",
            "type": "string"
          },
          "result_order_established": {
            "title": "Result Order Established",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "subject_coverage": {
            "title": "Subject Coverage",
            "type": "string"
          },
          "upstream_policy": {
            "title": "Upstream Policy",
            "type": "string"
          },
          "website": {
            "title": "Website",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name",
          "description",
          "subject_coverage",
          "endpoint",
          "query_method",
          "rate_limit",
          "client_module",
          "api_key_requirement",
          "credential_name",
          "website",
          "registration_url",
          "placeholder",
          "upstream_policy",
          "parallel_safe",
          "notes",
          "keyword_combination",
          "keyword_combination_notes",
          "attribution",
          "attribution_requirement",
          "attribution_source",
          "date_granularity",
          "result_order",
          "result_order_established",
          "entity_search",
          "constraints"
        ],
        "title": "RepositoryCatalogEntry",
        "type": "object"
      },
      "RepositoryConstraints": {
        "additionalProperties": true,
        "description": "What resmon knows about a source *before* anybody presses the button.\n\nDeliberately not here: whether the source requires a credential. That is\non ``api_key_requirement`` and ``credential_name`` of the entry carrying\nthis object, and a second copy is the exact drift this record exists to\nprevent — a separate list of keyed sources in the sweep engine can disagree\nwith the catalog's, and a source falls through the gap.\n\nAlso deliberately not here: whether the source is up. An outage is not\nsomething a user can act on while composing a query, it belongs to\n``zero_reason`` and the source wall, and a page that warned about every\nprovider's bad day would be warning about nothing.",
        "properties": {
          "default_start_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Start Days"
          },
          "established": {
            "title": "Established",
            "type": "string"
          },
          "keyword_search": {
            "title": "Keyword Search",
            "type": "string"
          },
          "notices": {
            "items": {
              "$ref": "#/components/schemas/RepositorySourceNotice"
            },
            "title": "Notices",
            "type": "array"
          },
          "records_per_request": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Records Per Request"
          },
          "window_effect": {
            "title": "Window Effect",
            "type": "string"
          },
          "window_refiltered_locally": {
            "title": "Window Refiltered Locally",
            "type": "boolean"
          },
          "window_rounding": {
            "title": "Window Rounding",
            "type": "string"
          }
        },
        "required": [
          "window_effect",
          "window_rounding",
          "window_refiltered_locally",
          "keyword_search",
          "records_per_request",
          "default_start_days",
          "notices",
          "established"
        ],
        "title": "RepositoryConstraints",
        "type": "object"
      },
      "RepositoryEntitySearch": {
        "additionalProperties": true,
        "description": "How a source can be asked about a *person*, in that source's own syntax.\n\n``author_syntax`` is the string ``api_base.search_entity`` puts into the\nquery, and a client that rewrites it destroys it silently — which is how\ntwo sources reported that a researcher had published nothing for as long as\nthe capability existed. ``established`` is the dated observation behind the\nrest of the row, and it is the field that makes the others checkable.",
        "properties": {
          "author_query": {
            "title": "Author Query",
            "type": "string"
          },
          "author_syntax": {
            "title": "Author Syntax",
            "type": "string"
          },
          "established": {
            "title": "Established",
            "type": "string"
          },
          "identifier_query": {
            "title": "Identifier Query",
            "type": "string"
          },
          "identifier_syntax": {
            "title": "Identifier Syntax",
            "type": "string"
          },
          "returns_affiliation": {
            "title": "Returns Affiliation",
            "type": "boolean"
          },
          "returns_orcid": {
            "title": "Returns Orcid",
            "type": "boolean"
          }
        },
        "required": [
          "author_query",
          "identifier_query",
          "returns_orcid",
          "returns_affiliation",
          "author_syntax",
          "identifier_syntax",
          "established"
        ],
        "title": "RepositoryEntitySearch",
        "type": "object"
      },
      "RepositoryKeysErased": {
        "additionalProperties": true,
        "description": "``POST /api/admin/erase-repo-keys``: every repository key slot the catalog names cleared.\n\n``repo_keys_removed`` is the number of repository keys that were stored\nand are now gone; a name that held no key is not counted. This route takes\nno ``confirm``.",
        "properties": {
          "repo_keys_removed": {
            "title": "Repo Keys Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "repo_keys_removed"
        ],
        "title": "RepositoryKeysErased",
        "type": "object"
      },
      "RepositorySourceNotice": {
        "additionalProperties": true,
        "description": "One sentence the interface shows before a search is submitted.\n\n``effect`` is the sentence itself, written as what resmon will do rather\nthan as the name of the limitation, because a user cannot act on\n\"year granularity\" and can act on \"it will search the whole of 2025\".\n``established`` is the code or the published wording the sentence was read\nfrom; it is not rendered beside the sentence, but it travels with it so\nthat anything downstream can say where the claim came from.",
        "properties": {
          "applies_when": {
            "title": "Applies When",
            "type": "string"
          },
          "effect": {
            "title": "Effect",
            "type": "string"
          },
          "established": {
            "title": "Established",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "effect",
          "established",
          "applies_when"
        ],
        "title": "RepositorySourceNotice",
        "type": "object"
      },
      "RestartRequest": {
        "description": "Body of ``POST /api/executions/{id}/restart``. Every field optional.\n\nThe route took no body at all before this; it still answers a request that\nsends none, because the renderer's Restart button and every existing caller\ndo exactly that.",
        "properties": {
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          }
        },
        "title": "RestartRequest",
        "type": "object"
      },
      "RestoreAcknowledged": {
        "additionalProperties": true,
        "description": "``POST /api/restore/acknowledge``: the card about the last restore dismissed.\n\n``acknowledged`` is false when there was no record to dismiss, and true\nwhen the record was rewritten with ``acknowledged: true``.",
        "properties": {
          "acknowledged": {
            "title": "Acknowledged",
            "type": "boolean"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "acknowledged"
        ],
        "title": "RestoreAcknowledged",
        "type": "object"
      },
      "RestoreCancelled": {
        "additionalProperties": true,
        "description": "``POST /api/restore/cancel``: no restore is staged now.\n\n``success`` is true whether or not one was staged, and nothing had moved.",
        "properties": {
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "title": "RestoreCancelled",
        "type": "object"
      },
      "RestoreFailed": {
        "additionalProperties": true,
        "description": "The record of a staged restore a backend start refused or could not finish.\n\n``reason`` is a code and ``message`` the sentence for it: among them\n``bundle_missing``, ``verification_failed``, ``manifest_changed``,\n``database_in_use``, ``pointer_unreadable``, a verification refusal such\nas ``not_a_bundle``, or ``restore_failed`` for an error that carried no\ncode. ``undone`` is present, and true, when the restore had begun moving\nfiles and its undo ran; ``vault_copy_kept`` is then the path of a vault\ncopy the undo could not put back by itself, normally ``None``, and is\nabsent from a record written without it. ``acknowledged`` is absent until\nthe person dismisses the card.",
        "properties": {
          "acknowledged": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acknowledged"
          },
          "at_utc": {
            "title": "At Utc",
            "type": "string"
          },
          "bundle": {
            "title": "Bundle",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "ok": {
            "const": false,
            "title": "Ok",
            "type": "boolean"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "undone": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Undone"
          },
          "vault_copy_kept": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vault Copy Kept"
          }
        },
        "required": [
          "ok",
          "reason",
          "message",
          "bundle",
          "at_utc"
        ],
        "title": "RestoreFailed",
        "type": "object"
      },
      "RestorePointer": {
        "additionalProperties": true,
        "description": "A staged restore: the pointer the next backend start acts on.\n\nNothing has moved while this exists. ``bundle`` is the bundle's resolved\npath and ``manifest_sha256`` the manifest's hash when it was staged; a\nstart that finds a different manifest refuses the restore.\n``accept_fk_violations`` is whether the person accepted the bundle's\norphan rows. ``vault_parent`` is the folder the vault is to go into on\nthis machine, ``None`` for the path the bundle's database records; a\npointer staged without one has no such key.",
        "properties": {
          "accept_fk_violations": {
            "title": "Accept Fk Violations",
            "type": "boolean"
          },
          "bundle": {
            "title": "Bundle",
            "type": "string"
          },
          "manifest_sha256": {
            "title": "Manifest Sha256",
            "type": "string"
          },
          "staged_at_utc": {
            "title": "Staged At Utc",
            "type": "string"
          },
          "vault_parent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vault Parent"
          }
        },
        "required": [
          "bundle",
          "manifest_sha256",
          "accept_fk_violations",
          "staged_at_utc"
        ],
        "title": "RestorePointer",
        "type": "object"
      },
      "RestorePointerUnreadable": {
        "additionalProperties": true,
        "description": "A staged-restore pointer whose file is not valid JSON.\n\nThe next start records it as a failed restore, ``pointer_unreadable``,\nand clears it; nothing is restored from it.",
        "properties": {
          "bundle": {
            "title": "Bundle",
            "type": "null"
          },
          "manifest_sha256": {
            "title": "Manifest Sha256",
            "type": "null"
          },
          "unreadable": {
            "const": true,
            "title": "Unreadable",
            "type": "boolean"
          }
        },
        "required": [
          "bundle",
          "manifest_sha256",
          "unreadable"
        ],
        "title": "RestorePointerUnreadable",
        "type": "object"
      },
      "RestoreRequest": {
        "properties": {
          "accept_fk_violations": {
            "default": false,
            "title": "Accept Fk Violations",
            "type": "boolean"
          },
          "confirm": {
            "default": "",
            "title": "Confirm",
            "type": "string"
          },
          "path": {
            "default": "",
            "title": "Path",
            "type": "string"
          },
          "vault_parent": {
            "default": "",
            "title": "Vault Parent",
            "type": "string"
          }
        },
        "title": "RestoreRequest",
        "type": "object"
      },
      "RestoreRewrites": {
        "additionalProperties": true,
        "description": "What a restore changed in the restored database because it described a process rather than the corpus.\n\n``executions_interrupted`` counts runs that were ``running`` in the bundle\nand are now ``interrupted`` with reason ``unknown``, since no process can\nbe asked about them; ``deliveries_requeued`` counts deliveries that were\nbeing sent and are queued again.",
        "properties": {
          "deliveries_requeued": {
            "title": "Deliveries Requeued",
            "type": "integer"
          },
          "executions_interrupted": {
            "title": "Executions Interrupted",
            "type": "integer"
          }
        },
        "required": [
          "executions_interrupted",
          "deliveries_requeued"
        ],
        "title": "RestoreRewrites",
        "type": "object"
      },
      "RestoreStaged": {
        "additionalProperties": true,
        "description": "``POST /api/restore``: a verified bundle staged; the restore itself runs when a backend next starts.\n\nNothing has been replaced when this answers. ``staged`` is the pointer\nwritten, and ``report`` the verification it was staged on, the same\nreport ``POST /api/backup/verify`` answers. ``next_step`` is one sentence\non what will apply the restore on this machine (reopening resmon, or\nrestarting the background service that holds the database), decided from\nthe daemon lock as it stood during the request.",
        "properties": {
          "next_step": {
            "title": "Next Step",
            "type": "string"
          },
          "report": {
            "$ref": "#/components/schemas/BundleReport"
          },
          "staged": {
            "$ref": "#/components/schemas/RestorePointer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "staged",
          "report",
          "next_step"
        ],
        "title": "RestoreStaged",
        "type": "object"
      },
      "RestoreSucceeded": {
        "additionalProperties": true,
        "description": "The record of a staged restore a backend start applied.\n\nRead from the state directory, where it outlives the version that wrote\nit: ``undo_includes_vault``, ``vault_parent`` and ``fk_violations_rows``\nare absent from a record written without them. ``ok`` says the restore's own\nchecks passed: SQLite's ``integrity_check``, and its foreign-key check\nunless the orphan rows were accepted. It does not say the corpus is as the\nperson remembers it.\n\n``undo_copy`` is the folder the replaced database was moved to, and with\nit the replaced vault when ``undo_includes_vault``; ``None`` when there\nwas nothing to move. Nothing removes it but\n``POST /api/restore/undo-copy/delete``. ``credentials_to_reenter`` and\nthe ``fk_violations*`` fields are copied from the bundle's verification\nreport, so the list fields are ``Any`` as they are there, with the same\ncaveat ``BundleReport`` gives for a ``NaN`` in a file edited by hand.\n``schema_relation`` is the bundle's schema against the version that\napplied it. ``acknowledged`` turns true when the person dismisses the\ncard, and ``at_utc`` is when the record was written.",
        "properties": {
          "acknowledged": {
            "title": "Acknowledged",
            "type": "boolean"
          },
          "at_utc": {
            "title": "At Utc",
            "type": "string"
          },
          "bundle": {
            "title": "Bundle",
            "type": "string"
          },
          "credentials_to_reenter": {
            "items": {},
            "title": "Credentials To Reenter",
            "type": "array"
          },
          "fk_violations": {
            "items": {},
            "title": "Fk Violations",
            "type": "array"
          },
          "fk_violations_message": {
            "title": "Fk Violations Message",
            "type": "string"
          },
          "fk_violations_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fk Violations Rows"
          },
          "fk_violations_total": {
            "title": "Fk Violations Total",
            "type": "integer"
          },
          "ok": {
            "const": true,
            "title": "Ok",
            "type": "boolean"
          },
          "rewrites": {
            "$ref": "#/components/schemas/RestoreRewrites"
          },
          "schema_relation": {
            "title": "Schema Relation",
            "type": "string"
          },
          "undo_copy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Undo Copy"
          },
          "undo_includes_vault": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Undo Includes Vault"
          },
          "vault": {
            "$ref": "#/components/schemas/RestoredVault"
          },
          "vault_parent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vault Parent"
          }
        },
        "required": [
          "ok",
          "bundle",
          "undo_copy",
          "schema_relation",
          "vault",
          "rewrites",
          "credentials_to_reenter",
          "fk_violations",
          "fk_violations_total",
          "fk_violations_message",
          "acknowledged",
          "at_utc"
        ],
        "title": "RestoreSucceeded",
        "type": "object"
      },
      "RestoreUndoCopiesDeleted": {
        "additionalProperties": true,
        "description": "``POST /api/restore/undo-copy/delete``: the folders restores set aside, deleted.\n\n``deleted`` is how many folders were listed for deletion. Each is removed\nwith errors ignored, so it counts folders asked to go, not folders proven\ngone; ``GET /api/backup/last`` lists what is still there.",
        "properties": {
          "deleted": {
            "title": "Deleted",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "deleted"
        ],
        "title": "RestoreUndoCopiesDeleted",
        "type": "object"
      },
      "RestoredVault": {
        "additionalProperties": true,
        "description": "What an applied restore did with the Library vault.\n\n``restored`` is false, with ``reason`` ``no_vault_in_backup``, when the\nbundle carried no vault. Otherwise ``root_path`` is where the vault now is\nand ``replaced_kept_at`` where the vault that was there before was moved,\n``None`` when that folder held none. A record written without it has no\n``replaced_kept_at``.",
        "properties": {
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "replaced_kept_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replaced Kept At"
          },
          "restored": {
            "title": "Restored",
            "type": "boolean"
          },
          "root_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Root Path"
          }
        },
        "required": [
          "restored"
        ],
        "title": "RestoredVault",
        "type": "object"
      },
      "Routine": {
        "additionalProperties": true,
        "description": "``GET /api/routines/{routine_id}``: one routine, its switches as\nbooleans, and every fire it missed, oldest first. ``date_window_next`` is\npresent only for a watch whose window moves (``date_window`` in its\nparameters): the dates a run starting now would ask for.",
        "properties": {
          "ai_enabled": {
            "title": "Ai Enabled",
            "type": "boolean"
          },
          "ai_settings": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "date_window_next": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DateWindowComputed"
              },
              {
                "type": "null"
              }
            ]
          },
          "email_ai_summary_enabled": {
            "title": "Email Ai Summary Enabled",
            "type": "boolean"
          },
          "email_enabled": {
            "title": "Email Enabled",
            "type": "boolean"
          },
          "execution_location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Location"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "last_executed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Executed At"
          },
          "missed_fire_details": {
            "items": {
              "$ref": "#/components/schemas/MissedFire"
            },
            "title": "Missed Fire Details",
            "type": "array"
          },
          "missed_fires": {
            "$ref": "#/components/schemas/MissedFires"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notify_on_complete": {
            "title": "Notify On Complete",
            "type": "boolean"
          },
          "parameters": {
            "title": "Parameters",
            "type": "string"
          },
          "schedule_cron": {
            "title": "Schedule Cron",
            "type": "string"
          },
          "storage_settings": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Settings"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "schedule_cron",
          "parameters",
          "is_active",
          "email_enabled",
          "email_ai_summary_enabled",
          "ai_enabled",
          "notify_on_complete",
          "ai_settings",
          "storage_settings",
          "intent",
          "execution_location",
          "created_at",
          "updated_at",
          "last_executed_at",
          "missed_fires",
          "missed_fire_details"
        ],
        "title": "Routine",
        "type": "object"
      },
      "RoutineActivation": {
        "additionalProperties": true,
        "description": "``POST /api/routines/{routine_id}/activate`` and ``/deactivate``. Only\nthe schedule changes: the routine and its runs stay.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "is_active"
        ],
        "title": "RoutineActivation",
        "type": "object"
      },
      "RoutineCoverage": {
        "additionalProperties": true,
        "description": "``GET /api/routines/{routine_id}/coverage``: is this routine finding what\nwas meant, and what is it missing?\n\n``intent_source`` is ``stated`` for a written intent and ``keywords`` where\nnone was written and the routine's keywords stand in, which measures the\nquery against what the query produced. ``cannot_see`` is the sentence that\nbounds both lists: resmon compares only against papers it already holds.\n``reason`` says why there is nothing to measure, or is ``None``.\n``summary`` is present whenever the audit itself ran, including to say why\nit measured nothing; ``missed_reference_distance`` (the median of this\nroutine's own distances, which a missed paper must be inside) only when it\nmeasured. ``window_note`` is present for a watch whose window moves and\nhas run with it: the earliest date its runs asked from, and that an older\npaper was never asked for.",
        "properties": {
          "cannot_see": {
            "title": "Cannot See",
            "type": "string"
          },
          "distribution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoverageDistribution"
              },
              {
                "type": "null"
              }
            ]
          },
          "intent": {
            "title": "Intent",
            "type": "string"
          },
          "intent_source": {
            "title": "Intent Source",
            "type": "string"
          },
          "missed_in_corpus": {
            "items": {
              "$ref": "#/components/schemas/CoveragePaper"
            },
            "title": "Missed In Corpus",
            "type": "array"
          },
          "missed_in_corpus_total": {
            "title": "Missed In Corpus Total",
            "type": "integer"
          },
          "missed_in_corpus_total_is_lower_bound": {
            "title": "Missed In Corpus Total Is Lower Bound",
            "type": "boolean"
          },
          "missed_reference_distance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Missed Reference Distance"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "off_target": {
            "items": {
              "$ref": "#/components/schemas/CoveragePaper"
            },
            "title": "Off Target",
            "type": "array"
          },
          "off_target_total": {
            "title": "Off Target Total",
            "type": "integer"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "results": {
            "title": "Results",
            "type": "integer"
          },
          "results_embedded": {
            "title": "Results Embedded",
            "type": "integer"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "routine_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routine Name"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "window_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Note"
          }
        },
        "required": [
          "routine_id",
          "routine_name",
          "intent",
          "intent_source",
          "model",
          "cannot_see",
          "results",
          "results_embedded",
          "off_target",
          "off_target_total",
          "missed_in_corpus",
          "missed_in_corpus_total",
          "missed_in_corpus_total_is_lower_bound",
          "distribution",
          "reason"
        ],
        "title": "RoutineCoverage",
        "type": "object"
      },
      "RoutineCreate": {
        "properties": {
          "ai_enabled": {
            "default": false,
            "title": "Ai Enabled",
            "type": "boolean"
          },
          "ai_settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "email_ai_summary_enabled": {
            "default": false,
            "title": "Email Ai Summary Enabled",
            "type": "boolean"
          },
          "email_enabled": {
            "default": false,
            "title": "Email Enabled",
            "type": "boolean"
          },
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "is_active": {
            "default": true,
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notify_on_complete": {
            "default": false,
            "title": "Notify On Complete",
            "type": "boolean"
          },
          "parameters": {
            "additionalProperties": true,
            "title": "Parameters",
            "type": "object"
          },
          "schedule_cron": {
            "title": "Schedule Cron",
            "type": "string"
          },
          "storage_settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Settings"
          }
        },
        "required": [
          "name",
          "schedule_cron",
          "parameters"
        ],
        "title": "RoutineCreate",
        "type": "object"
      },
      "RoutineCreated": {
        "additionalProperties": true,
        "description": "``POST /api/routines``. ``entity`` is present only for a routine that\nwatches a person, and ``entity_warning`` only when none of its sources can\nbe asked about one: the routine is still created, and the sentence says it\nwill find nothing until a source that can is added.",
        "properties": {
          "entity": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity"
          },
          "entity_warning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Warning"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "RoutineCreated",
        "type": "object"
      },
      "RoutineDeliveries": {
        "additionalProperties": true,
        "description": "``GET /api/routines/{routine_id}/deliveries``: the record, newest\nfirst.",
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/Delivery"
            },
            "title": "Deliveries",
            "type": "array"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "summary": {
            "$ref": "#/components/schemas/DeliverySummary"
          }
        },
        "required": [
          "routine_id",
          "deliveries",
          "summary"
        ],
        "title": "RoutineDeliveries",
        "type": "object"
      },
      "RoutineDocuments": {
        "additionalProperties": true,
        "description": "``GET /api/routines/{routine_id}/documents``: the papers this routine's\nruns collected, newest run first, each once.\n\n``total`` counts every one; ``document_ids`` stops at ``limit``. Only ids:\nwhat a screen marks on the collection map, not a page of records.",
        "properties": {
          "document_ids": {
            "items": {
              "type": "integer"
            },
            "title": "Document Ids",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "routine_id",
          "document_ids",
          "total",
          "limit"
        ],
        "title": "RoutineDocuments",
        "type": "object"
      },
      "RoutineFiring": {
        "additionalProperties": true,
        "description": "One active routine, and whether anything will fire it.\n\n``will_fire`` is three-valued on purpose. ``True`` only where this\nbackend's own scheduler holds the job; ``False`` where nothing can fire it\nas things stand; ``None`` where the answer depends on which database a\nrunning service serves, which no resmon so far reports. A two-valued field\nwould have had to guess the third case one way or the other.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "reason": {
            "enum": [
              "scheduled",
              "not_scheduled",
              "no_scheduler_running",
              "unconfirmed"
            ],
            "title": "Reason",
            "type": "string"
          },
          "will_fire": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Will Fire"
          }
        },
        "required": [
          "id",
          "will_fire",
          "reason"
        ],
        "title": "RoutineFiring",
        "type": "object"
      },
      "RoutineHealth": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/routine-health``.",
        "properties": {
          "insufficient_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insufficient Reason"
          },
          "minimum_runs": {
            "title": "Minimum Runs",
            "type": "integer"
          },
          "routines": {
            "items": {
              "$ref": "#/components/schemas/RoutineHealthRow"
            },
            "title": "Routines",
            "type": "array"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "stale_after": {
            "title": "Stale After",
            "type": "integer"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "routines",
          "minimum_runs",
          "stale_after",
          "sample_size",
          "sufficient",
          "insufficient_reason"
        ],
        "title": "RoutineHealth",
        "type": "object"
      },
      "RoutineHealthRow": {
        "additionalProperties": true,
        "description": "One watch: what its completed runs found, and its fires that did not run.",
        "properties": {
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "last_missed_fire_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Missed Fire At"
          },
          "last_new_result_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last New Result At"
          },
          "missed_fires": {
            "title": "Missed Fires",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "runs": {
            "title": "Runs",
            "type": "integer"
          },
          "runs_since_new": {
            "title": "Runs Since New",
            "type": "integer"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "schedule_cron": {
            "title": "Schedule Cron",
            "type": "string"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/RoutineHealthRun"
            },
            "title": "Series",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          },
          "total_new": {
            "title": "Total New",
            "type": "integer"
          }
        },
        "required": [
          "routine_id",
          "name",
          "missed_fires",
          "last_missed_fire_at",
          "schedule_cron",
          "is_active",
          "runs",
          "series",
          "runs_since_new",
          "last_new_result_at",
          "total_new",
          "status",
          "sample_size",
          "sufficient"
        ],
        "title": "RoutineHealthRow",
        "type": "object"
      },
      "RoutineHealthRun": {
        "additionalProperties": true,
        "properties": {
          "new_results": {
            "title": "New Results",
            "type": "integer"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "total_results": {
            "title": "Total Results",
            "type": "integer"
          }
        },
        "required": [
          "start_time",
          "new_results",
          "total_results"
        ],
        "title": "RoutineHealthRun",
        "type": "object"
      },
      "RoutineRow": {
        "additionalProperties": true,
        "description": "One row of ``GET /api/routines``: the ``routines`` row as stored, and\nwhat its latest run did.\n\nThe five switches are SQLite's ``0`` and ``1`` here, as this list sends\nthem; the single-routine read below coerces them to booleans. Typed as\nsent rather than as meant, so neither body changes. ``parameters``,\n``ai_settings`` and ``storage_settings`` are the stored JSON text, not\nparsed objects. ``last_execution`` repeats ``last_executed_at`` under the\nname the renderer reads.",
        "properties": {
          "ai_enabled": {
            "title": "Ai Enabled",
            "type": "integer"
          },
          "ai_settings": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "email_ai_summary_enabled": {
            "title": "Email Ai Summary Enabled",
            "type": "integer"
          },
          "email_enabled": {
            "title": "Email Enabled",
            "type": "integer"
          },
          "execution_location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Location"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "is_active": {
            "title": "Is Active",
            "type": "integer"
          },
          "last_executed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Executed At"
          },
          "last_execution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Execution"
          },
          "last_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Status"
          },
          "missed_fires": {
            "$ref": "#/components/schemas/MissedFires"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notify_on_complete": {
            "title": "Notify On Complete",
            "type": "integer"
          },
          "parameters": {
            "title": "Parameters",
            "type": "string"
          },
          "schedule_cron": {
            "title": "Schedule Cron",
            "type": "string"
          },
          "storage_settings": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Settings"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "schedule_cron",
          "parameters",
          "is_active",
          "email_enabled",
          "email_ai_summary_enabled",
          "ai_enabled",
          "notify_on_complete",
          "ai_settings",
          "storage_settings",
          "intent",
          "execution_location",
          "created_at",
          "updated_at",
          "last_executed_at",
          "last_execution",
          "last_status",
          "missed_fires"
        ],
        "title": "RoutineRow",
        "type": "object"
      },
      "RoutineRunStarted": {
        "additionalProperties": true,
        "description": "``POST /api/routines/{routine_id}/run``: a run started now, outside the\nschedule, or queued to start when a slot frees.\n\n``was_inactive`` says the routine was not scheduled and ran once because it\nwas asked to, and ``detail`` says so in a sentence. At the run limit the\nanswer is a 202 with ``execution_id`` null, ``queued`` true and\n``queue_position`` (1 is next): the run starts on its own. A routine\nalready running is refused with a 409 whose detail names that run, and so\nis a fire the full queue turned away; both are error bodies, not this one.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "execution_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Id"
          },
          "missed_fires_marked_ran_late": {
            "title": "Missed Fires Marked Ran Late",
            "type": "integer"
          },
          "queue_position": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Position"
          },
          "queued": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queued"
          },
          "routine_id": {
            "title": "Routine Id",
            "type": "integer"
          },
          "was_inactive": {
            "title": "Was Inactive",
            "type": "boolean"
          }
        },
        "required": [
          "execution_id",
          "routine_id",
          "was_inactive",
          "missed_fires_marked_ran_late",
          "detail"
        ],
        "title": "RoutineRunStarted",
        "type": "object"
      },
      "RoutineUpdate": {
        "properties": {
          "ai_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Enabled"
          },
          "ai_settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "email_ai_summary_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Ai Summary Enabled"
          },
          "email_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Enabled"
          },
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "notify_on_complete": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notify On Complete"
          },
          "parameters": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          },
          "schedule_cron": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Cron"
          },
          "storage_settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Settings"
          }
        },
        "title": "RoutineUpdate",
        "type": "object"
      },
      "RoutineUpdated": {
        "additionalProperties": true,
        "description": "``PUT /api/routines/{routine_id}``: the id and each column the request\nchanged, as stored. Absent where unchanged; ``intent`` is ``None`` where\nthe request cleared it. Switches are stored ``0`` or ``1`` and the JSON\ncolumns as text, which is what this answer repeats.",
        "properties": {
          "ai_enabled": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Enabled"
          },
          "ai_settings": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "email_ai_summary_enabled": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Ai Summary Enabled"
          },
          "email_enabled": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Enabled"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "notify_on_complete": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notify On Complete"
          },
          "parameters": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          },
          "schedule_cron": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Cron"
          },
          "storage_settings": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Settings"
          }
        },
        "required": [
          "id"
        ],
        "title": "RoutineUpdated",
        "type": "object"
      },
      "RoutineWatchingProfile": {
        "additionalProperties": true,
        "description": "A routine whose ``parameters.entity`` points at the profile being deleted.\n\n``mode`` comes out of the routine's JSON blob and is whatever is in there,\nso it is optional: a blob with an ``entity`` and no ``mode`` is a real\nshape, not a broken one.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mode"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "is_active",
          "mode"
        ],
        "title": "RoutineWatchingProfile",
        "type": "object"
      },
      "Run": {
        "additionalProperties": true,
        "description": "``GET /api/executions/{exec_id}``: the row, which backend answered, the\nruns restarted from it (the reverse of ``restarted_from``), and the summary\nlanes it tried.",
        "properties": {
          "ai_lanes": {
            "items": {
              "$ref": "#/components/schemas/RunAiLane"
            },
            "title": "Ai Lanes",
            "type": "array"
          },
          "cancel_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel Reason"
          },
          "coverage": {
            "$ref": "#/components/schemas/RunCoverage"
          },
          "current_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Stage"
          },
          "dedup_cross_source": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Cross Source"
          },
          "dedup_duplicates": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Duplicates"
          },
          "dedup_invalid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Invalid"
          },
          "dedup_new": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup New"
          },
          "dedup_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Total"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "execution_type": {
            "title": "Execution Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "identity": {
            "$ref": "#/components/schemas/RuntimeIdentity"
          },
          "interrupted_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interrupted Reason"
          },
          "keywords": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keywords"
          },
          "last_seen_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen At Utc"
          },
          "log_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Log Path"
          },
          "new_result_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Result Count"
          },
          "new_results": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Results"
          },
          "owner_pid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Pid"
          },
          "owner_runtime_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Runtime Id"
          },
          "parameters": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          },
          "progress_events": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress Events"
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "repositories": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repositories"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "restarted_from": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Restarted From"
          },
          "restarted_into": {
            "items": {
              "type": "integer"
            },
            "title": "Restarted Into",
            "type": "array"
          },
          "result_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Count"
          },
          "result_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Path"
          },
          "routine_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routine Id"
          },
          "saved_configuration_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Id"
          },
          "saved_configuration_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Name"
          },
          "source_outcomes": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunSourceOutcomes"
              },
              {
                "type": "null"
              }
            ]
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total_results": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Results"
          }
        },
        "required": [
          "id",
          "execution_type",
          "routine_id",
          "saved_configuration_id",
          "parameters",
          "start_time",
          "end_time",
          "status",
          "result_count",
          "new_result_count",
          "log_path",
          "result_path",
          "error_message",
          "progress_events",
          "current_stage",
          "owner_pid",
          "owner_runtime_id",
          "last_seen_at_utc",
          "interrupted_reason",
          "restarted_from",
          "cancel_reason",
          "dedup_total",
          "dedup_new",
          "dedup_duplicates",
          "dedup_invalid",
          "dedup_cross_source",
          "request_id",
          "saved_configuration_name",
          "identity",
          "coverage",
          "query",
          "keywords",
          "repositories",
          "total_results",
          "new_results",
          "source_outcomes",
          "restarted_into",
          "ai_lanes"
        ],
        "title": "Run",
        "type": "object"
      },
      "RunAiLane": {
        "additionalProperties": true,
        "description": "One summary lane a run tried, as ``execution_ai`` records it.\n\n``outcome`` is ``ok`` (every paper it was given), ``partial``, ``failed``,\n``skipped`` (an earlier lane covered everything) or ``running`` (the process\nstopped while the lane held the work). ``credential_alias`` names a keyring\nslot, never a key. ``model`` is what was asked for, often an alias;\n``answered_by`` is what the lane's command reported answered, biggest\nwriter first, and is empty where nothing was reported.",
        "properties": {
          "answered_by": {
            "items": {
              "$ref": "#/components/schemas/RunAiLaneModel"
            },
            "title": "Answered By",
            "type": "array"
          },
          "credential_alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Alias"
          },
          "docs_attempted": {
            "title": "Docs Attempted",
            "type": "integer"
          },
          "docs_succeeded": {
            "title": "Docs Succeeded",
            "type": "integer"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "error_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Kind"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "lane_index": {
            "title": "Lane Index",
            "type": "integer"
          },
          "lane_kind": {
            "enum": [
              "subscription",
              "api_key",
              "local"
            ],
            "title": "Lane Kind",
            "type": "string"
          },
          "lane_label": {
            "title": "Lane Label",
            "type": "string"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "outcome": {
            "enum": [
              "running",
              "ok",
              "partial",
              "failed",
              "skipped"
            ],
            "title": "Outcome",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "safe_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Safe Message"
          },
          "started_at": {
            "title": "Started At",
            "type": "string"
          }
        },
        "required": [
          "lane_index",
          "lane_label",
          "lane_kind",
          "provider",
          "model",
          "credential_alias",
          "outcome",
          "error_kind",
          "http_status",
          "safe_message",
          "docs_attempted",
          "docs_succeeded",
          "started_at",
          "ended_at",
          "answered_by"
        ],
        "title": "RunAiLane",
        "type": "object"
      },
      "RunAiLaneModel": {
        "additionalProperties": true,
        "description": "A model an agent CLI reported for a lane's calls.\n\n``model`` is the id as the command reported it, ``name`` the same id in a\nperson's words (\"Haiku 4.5\"), or the id itself where resmon does not\nrecognize its shape. ``calls`` is how many of the lane's calls named it.",
        "properties": {
          "calls": {
            "title": "Calls",
            "type": "integer"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "model",
          "name",
          "calls"
        ],
        "title": "RunAiLaneModel",
        "type": "object"
      },
      "RunCancelRequested": {
        "additionalProperties": true,
        "description": "``POST /api/executions/{exec_id}/cancel``. Cancellation is cooperative:\nthis says it was asked for, not that the run has stopped.",
        "properties": {
          "status": {
            "const": "cancellation_requested",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "RunCancelRequested",
        "type": "object"
      },
      "RunCoverage": {
        "additionalProperties": true,
        "description": "Which sources answered a run, as ``source_coverage.build`` accounts for it.\n\nThe same object the Results page, a delivery envelope and the search\nrecord read, built from saved facts at read time. ``summary`` is the one\nsentence; ``sources`` is the run's selection, in its order, and\n``additional_sources`` what was recorded outside it.",
        "properties": {
          "additional_sources": {
            "items": {
              "$ref": "#/components/schemas/RunCoverageSource"
            },
            "title": "Additional Sources",
            "type": "array"
          },
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "basis_label": {
            "title": "Basis Label",
            "type": "string"
          },
          "counts": {
            "$ref": "#/components/schemas/RunCoverageCounts"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "title": "Notes",
            "type": "array"
          },
          "selection_known": {
            "title": "Selection Known",
            "type": "boolean"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/RunCoverageSource"
            },
            "title": "Sources",
            "type": "array"
          },
          "summary": {
            "title": "Summary",
            "type": "string"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "execution_id",
          "basis",
          "basis_label",
          "selection_known",
          "total",
          "counts",
          "summary",
          "sources",
          "additional_sources",
          "notes"
        ],
        "title": "RunCoverage",
        "type": "object"
      },
      "RunCoverageCounts": {
        "additionalProperties": true,
        "description": "How the selected sources split. ``genuine_empty``, ``partial`` and\n``in_part`` are subsets of ``answered``, not further categories.\n``in_part`` counts the sources resmon's own time budget or the run's cap\nstopped after a stated stretch of the window: answered, and only for that\nstretch.",
        "properties": {
          "answered": {
            "title": "Answered",
            "type": "integer"
          },
          "genuine_empty": {
            "title": "Genuine Empty",
            "type": "integer"
          },
          "in_part": {
            "title": "In Part",
            "type": "integer"
          },
          "non_answer": {
            "title": "Non Answer",
            "type": "integer"
          },
          "partial": {
            "title": "Partial",
            "type": "integer"
          },
          "unknown": {
            "title": "Unknown",
            "type": "integer"
          }
        },
        "required": [
          "answered",
          "non_answer",
          "unknown",
          "genuine_empty",
          "partial",
          "in_part"
        ],
        "title": "RunCoverageCounts",
        "type": "object"
      },
      "RunCoverageSource": {
        "additionalProperties": true,
        "description": "One source's recorded outcome on one run, from ``source_coverage.outcome``.\n\n``category`` is ``answered``, ``non_answer`` or ``unknown``; ``in_part``\nmarks an answer for only the stretch of the window ``note`` states. ``label`` is\nthe short reason a person reads, and ``note`` the sentence that explains\nit. A selected source with no recorded row is ``unknown`` with\n``outcome_recorded`` false, and every recorded field ``None``: nothing about\nan attempt, a failure or an empty answer can be inferred from silence.",
        "properties": {
          "category": {
            "title": "Category",
            "type": "string"
          },
          "genuine_empty": {
            "title": "Genuine Empty",
            "type": "boolean"
          },
          "in_part": {
            "title": "In Part",
            "type": "boolean"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "outcome_recorded": {
            "title": "Outcome Recorded",
            "type": "boolean"
          },
          "partial": {
            "title": "Partial",
            "type": "boolean"
          },
          "recorded_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "result_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Count"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "zero_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zero Reason"
          }
        },
        "required": [
          "source",
          "category",
          "label",
          "note",
          "outcome_recorded",
          "status",
          "result_count",
          "zero_reason",
          "recorded_at",
          "genuine_empty",
          "partial",
          "in_part"
        ],
        "title": "RunCoverageSource",
        "type": "object"
      },
      "RunDocumentIds": {
        "additionalProperties": true,
        "description": "``GET /api/executions/{exec_id}/document-ids``: every paper the run\nstored that is still in the collection, by id, for the run's map.",
        "properties": {
          "ids": {
            "items": {
              "type": "integer"
            },
            "title": "Ids",
            "type": "array"
          }
        },
        "required": [
          "ids"
        ],
        "title": "RunDocumentIds",
        "type": "object"
      },
      "RunLog": {
        "additionalProperties": true,
        "description": "``GET /api/executions/{exec_id}/log``: the run's log as written.",
        "properties": {
          "log_text": {
            "title": "Log Text",
            "type": "string"
          }
        },
        "required": [
          "log_text"
        ],
        "title": "RunLog",
        "type": "object"
      },
      "RunPaper": {
        "additionalProperties": true,
        "description": "One of a run's papers, and where it stands in the reading queue\n(``to_read``, ``read``, or ``None`` when it is not saved).",
        "properties": {
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "categories": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Categories"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "external_id": {
            "title": "External Id",
            "type": "string"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "metadata_hash": {
            "title": "Metadata Hash",
            "type": "string"
          },
          "pub_sort": {
            "title": "Pub Sort",
            "type": "string"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "queue_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Status"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "id",
          "source_repository",
          "external_id",
          "doi",
          "title",
          "authors",
          "abstract",
          "publication_date",
          "url",
          "categories",
          "metadata_hash",
          "first_seen_at",
          "pub_sort",
          "queue_status"
        ],
        "title": "RunPaper",
        "type": "object"
      },
      "RunPapersPage": {
        "additionalProperties": true,
        "description": "``GET /api/executions/{exec_id}/documents``: one page of a run's papers.",
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "only_new": {
            "title": "Only New",
            "type": "boolean"
          },
          "papers": {
            "items": {
              "$ref": "#/components/schemas/RunPaper"
            },
            "title": "Papers",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "papers",
          "total",
          "limit",
          "offset",
          "only_new"
        ],
        "title": "RunPapersPage",
        "type": "object"
      },
      "RunReport": {
        "additionalProperties": true,
        "description": "``GET /api/executions/{exec_id}/report``: the Markdown report as written.",
        "properties": {
          "report_text": {
            "title": "Report Text",
            "type": "string"
          }
        },
        "required": [
          "report_text"
        ],
        "title": "RunReport",
        "type": "object"
      },
      "RunRestarted": {
        "additionalProperties": true,
        "description": "``POST /api/executions/{exec_id}/restart``: a new run with the old one's\nparameters, linked back to it. ``duplicate`` as on ``RunStarted``.",
        "properties": {
          "ai_enabled": {
            "title": "Ai Enabled",
            "type": "boolean"
          },
          "duplicate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duplicate"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "restarted_from": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Restarted From"
          }
        },
        "required": [
          "execution_id",
          "restarted_from",
          "ai_enabled"
        ],
        "title": "RunRestarted",
        "type": "object"
      },
      "RunRow": {
        "additionalProperties": true,
        "description": "One row of ``GET /api/executions``, newest first.",
        "properties": {
          "cancel_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel Reason"
          },
          "coverage": {
            "$ref": "#/components/schemas/RunCoverage"
          },
          "current_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Stage"
          },
          "dedup_cross_source": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Cross Source"
          },
          "dedup_duplicates": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Duplicates"
          },
          "dedup_invalid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Invalid"
          },
          "dedup_new": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup New"
          },
          "dedup_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dedup Total"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "execution_type": {
            "title": "Execution Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "interrupted_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interrupted Reason"
          },
          "keywords": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keywords"
          },
          "last_seen_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen At Utc"
          },
          "log_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Log Path"
          },
          "new_result_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Result Count"
          },
          "new_results": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Results"
          },
          "owner_pid": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Pid"
          },
          "owner_runtime_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Runtime Id"
          },
          "parameters": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          },
          "progress_events": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress Events"
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "repositories": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repositories"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "restarted_from": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Restarted From"
          },
          "result_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Count"
          },
          "result_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Path"
          },
          "routine_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routine Id"
          },
          "saved_configuration_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Id"
          },
          "saved_configuration_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Name"
          },
          "source_outcomes": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunSourceOutcomes"
              },
              {
                "type": "null"
              }
            ]
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total_results": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Results"
          }
        },
        "required": [
          "id",
          "execution_type",
          "routine_id",
          "saved_configuration_id",
          "parameters",
          "start_time",
          "end_time",
          "status",
          "result_count",
          "new_result_count",
          "log_path",
          "result_path",
          "error_message",
          "progress_events",
          "current_stage",
          "owner_pid",
          "owner_runtime_id",
          "last_seen_at_utc",
          "interrupted_reason",
          "restarted_from",
          "cancel_reason",
          "dedup_total",
          "dedup_new",
          "dedup_duplicates",
          "dedup_invalid",
          "dedup_cross_source",
          "request_id",
          "saved_configuration_name",
          "coverage",
          "query",
          "keywords",
          "repositories",
          "total_results",
          "new_results",
          "source_outcomes"
        ],
        "title": "RunRow",
        "type": "object"
      },
      "RunSourceOutcomes": {
        "additionalProperties": true,
        "description": "The compact per-run count the list shows on each row.\n\n``could_not_answer`` counts the zeros that were not answers; ``not_recorded``\nthe zeros resmon never observed, deliberately folded into neither.\n``in_part`` counts, among ``answered``, the sources resmon's own budget or\nthe run's cap stopped after a stated stretch of the window.",
        "properties": {
          "answered": {
            "title": "Answered",
            "type": "integer"
          },
          "could_not_answer": {
            "title": "Could Not Answer",
            "type": "integer"
          },
          "in_part": {
            "title": "In Part",
            "type": "integer"
          },
          "not_recorded": {
            "title": "Not Recorded",
            "type": "integer"
          },
          "selected": {
            "title": "Selected",
            "type": "integer"
          },
          "sources_that_could_not_answer": {
            "items": {
              "type": "string"
            },
            "title": "Sources That Could Not Answer",
            "type": "array"
          }
        },
        "required": [
          "selected",
          "answered",
          "in_part",
          "could_not_answer",
          "not_recorded",
          "sources_that_could_not_answer"
        ],
        "title": "RunSourceOutcomes",
        "type": "object"
      },
      "RunStarted": {
        "additionalProperties": true,
        "description": "``POST /api/search/dive`` and ``POST /api/search/sweep``.\n\n``duplicate`` is present only when ``request_id`` matched a submission\nalready made, and the id is that earlier run's: a retried click starts\nnothing new. Absent rather than ``false`` on a first submission.",
        "properties": {
          "duplicate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duplicate"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          }
        },
        "required": [
          "execution_id"
        ],
        "title": "RunStarted",
        "type": "object"
      },
      "RuntimeIdentity": {
        "additionalProperties": true,
        "description": "Which backend, over which corpus — the attach-or-spawn answer.\n\nThis is the shape that exists because an MCP server once fell back to the\ndefault port and answered every question truthfully about the wrong corpus.\n``corpus_id`` and ``build_id`` are ``None`` where the install has not\nrecorded one; ``runtime_id`` is per process and always present.",
        "properties": {
          "build_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Build Id"
          },
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "corpus_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Corpus Id"
          },
          "runtime_id": {
            "title": "Runtime Id",
            "type": "string"
          },
          "schema_version": {
            "title": "Schema Version",
            "type": "integer"
          }
        },
        "required": [
          "contract_version",
          "runtime_id",
          "schema_version",
          "corpus_id",
          "build_id"
        ],
        "title": "RuntimeIdentity",
        "type": "object"
      },
      "SavedConfiguration": {
        "additionalProperties": true,
        "description": "One saved configuration, as the list returns it.\n\n``parameters`` is a parsed object **here** and a JSON string on the body\n``PUT`` answers — see ``ConfigurationUpdated``. The two really do differ,\nthe list route parses the column and the write route echoes what it stored,\nand declaring both the same way would have made this contract wrong about\none of them. It is ``Any`` rather than ``dict`` because the parse is\nbest-effort: a column that will not parse is left as its original string.",
        "properties": {
          "config_type": {
            "title": "Config Type",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "parameters": {
            "title": "Parameters"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "config_type",
          "parameters",
          "created_at",
          "updated_at"
        ],
        "title": "SavedConfiguration",
        "type": "object"
      },
      "SchedulerStatus": {
        "additionalProperties": true,
        "description": "``GET /api/scheduler/status``.\n\n``service_version`` is the version the running background service reported\n(or its lock recorded, where it reported none), and ``None`` where no\nservice answered. ``routines`` lists the **active** routines only: an\ninactive routine is not expected to fire, and a verdict on it would invite a\nsentence about nothing.",
        "properties": {
          "app_version": {
            "title": "App Version",
            "type": "string"
          },
          "routines": {
            "items": {
              "$ref": "#/components/schemas/RoutineFiring"
            },
            "title": "Routines",
            "type": "array"
          },
          "service_installed": {
            "title": "Service Installed",
            "type": "boolean"
          },
          "service_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Version"
          },
          "state": {
            "enum": [
              "fires_here",
              "no_service",
              "service_stopped",
              "service_other_version",
              "service_elsewhere",
              "service_unreachable",
              "scheduler_off"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "state",
          "app_version",
          "service_installed",
          "service_version",
          "routines"
        ],
        "title": "SchedulerStatus",
        "type": "object"
      },
      "SelectedAnswer": {
        "additionalProperties": true,
        "description": "``POST .../answers`` (202), ``GET .../answers/{answer_id}`` and ``POST .../cancel``: one saved answer.\n\n``state`` is ``admitted`` or ``running``, then one of ``succeeded``,\n``refused``, ``failed``, ``cancelled`` or ``interrupted``. ``result`` is\npresent only for ``succeeded`` and ``refused``; ``validation`` is then\n``exact_text_identity_only_support_unchecked``, and otherwise\n``unvalidated``. ``current_originals`` is ``not_rechecked``: the saved\nexcerpts are not a fresh check of the files. ``partial_text`` is what\narrived before the end, unvalidated.",
        "properties": {
          "answer_id": {
            "title": "Answer Id",
            "type": "string"
          },
          "cleanup_state": {
            "title": "Cleanup State",
            "type": "string"
          },
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "current_originals": {
            "title": "Current Originals",
            "type": "string"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "finished_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At Utc"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "limitations": {
            "title": "Limitations",
            "type": "string"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "partial_text": {
            "title": "Partial Text",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "project_revision": {
            "title": "Project Revision",
            "type": "integer"
          },
          "reports": {
            "items": {
              "$ref": "#/components/schemas/SelectedReport"
            },
            "title": "Reports",
            "type": "array"
          },
          "request": {
            "$ref": "#/components/schemas/SelectedRequest"
          },
          "request_sha256": {
            "title": "Request Sha256",
            "type": "string"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SelectedResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At Utc"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SelectedUsage"
              },
              {
                "type": "null"
              }
            ]
          },
          "validation": {
            "title": "Validation",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "answer_id",
          "vault_id",
          "project_id",
          "project_revision",
          "mode",
          "state",
          "request_sha256",
          "partial_text",
          "cleanup_state",
          "created_at_utc",
          "started_at_utc",
          "finished_at_utc",
          "error_code",
          "error_message",
          "request",
          "result",
          "reports",
          "usage",
          "contract_version",
          "validation",
          "current_originals",
          "limitations"
        ],
        "title": "SelectedAnswer",
        "type": "object"
      },
      "SelectedAnswerRow": {
        "additionalProperties": true,
        "description": "One answer in a project's history, without its request or result.",
        "properties": {
          "answer_id": {
            "title": "Answer Id",
            "type": "string"
          },
          "cleanup_state": {
            "title": "Cleanup State",
            "type": "string"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "finished_at_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At Utc"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "request_sha256": {
            "title": "Request Sha256",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "answer_id",
          "request_sha256",
          "mode",
          "state",
          "created_at_utc",
          "finished_at_utc",
          "cleanup_state"
        ],
        "title": "SelectedAnswerRow",
        "type": "object"
      },
      "SelectedAnswers": {
        "additionalProperties": true,
        "description": "``GET .../answers``: a project's answers, oldest first, at most 50 a page.",
        "properties": {
          "answers": {
            "items": {
              "$ref": "#/components/schemas/SelectedAnswerRow"
            },
            "title": "Answers",
            "type": "array"
          },
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "count_basis": {
            "title": "Count Basis",
            "type": "string"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_after_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next After Id"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "through_id": {
            "title": "Through Id",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "vault_id",
          "project_id",
          "answers",
          "through_id",
          "next_after_id",
          "has_more",
          "total",
          "count_basis"
        ],
        "title": "SelectedAnswers",
        "type": "object"
      },
      "SelectedCitation": {
        "additionalProperties": true,
        "description": "An exact range of a selected source.\n\nIt identifies selected text and nothing more: that the quote supports the\nitem it is attached to is not checked.",
        "properties": {
          "end_codepoint": {
            "title": "End Codepoint",
            "type": "integer"
          },
          "quote": {
            "title": "Quote",
            "type": "string"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          },
          "start_codepoint": {
            "title": "Start Codepoint",
            "type": "integer"
          }
        },
        "required": [
          "end_codepoint",
          "quote",
          "source_id",
          "start_codepoint"
        ],
        "title": "SelectedCitation",
        "type": "object"
      },
      "SelectedCoverage": {
        "additionalProperties": true,
        "description": "What a request carries, counted: files, pages, segments, source bytes and codepoints, and notes.",
        "properties": {
          "file_count": {
            "title": "File Count",
            "type": "integer"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/SelectedCoverageFile"
            },
            "title": "Files",
            "type": "array"
          },
          "note_bytes": {
            "title": "Note Bytes",
            "type": "integer"
          },
          "note_count": {
            "title": "Note Count",
            "type": "integer"
          },
          "page_count": {
            "title": "Page Count",
            "type": "integer"
          },
          "segment_count": {
            "title": "Segment Count",
            "type": "integer"
          },
          "source_bytes": {
            "title": "Source Bytes",
            "type": "integer"
          },
          "source_codepoints": {
            "title": "Source Codepoints",
            "type": "integer"
          }
        },
        "required": [
          "file_count",
          "files",
          "note_bytes",
          "note_count",
          "page_count",
          "segment_count",
          "source_bytes",
          "source_codepoints"
        ],
        "title": "SelectedCoverage",
        "type": "object"
      },
      "SelectedCoverageFile": {
        "additionalProperties": true,
        "description": "Which pages of one selected version were sent or checked, and how many were not examined.\n\n``known_page_count`` and ``unexamined_page_count`` are ``None`` where the\npage count is not known.",
        "properties": {
          "anchor_checked_pages": {
            "items": {
              "type": "integer"
            },
            "title": "Anchor Checked Pages",
            "type": "array"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "known_page_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Known Page Count"
          },
          "selected_pages": {
            "items": {
              "type": "integer"
            },
            "title": "Selected Pages",
            "type": "array"
          },
          "unexamined_page_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unexamined Page Count"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "anchor_checked_pages",
          "file_id",
          "known_page_count",
          "selected_pages",
          "unexamined_page_count",
          "version_id"
        ],
        "title": "SelectedCoverageFile",
        "type": "object"
      },
      "SelectedDisclosure": {
        "additionalProperties": true,
        "description": "What sending a request reveals and reads, said before consent.\n\n``custom_endpoint`` is true when the request goes to a custom API base\nURL. The two reads are always true: the selected file bytes are read to\ncheck their digest, and a selected PDF page's structure is examined.",
        "properties": {
          "custom_endpoint": {
            "title": "Custom Endpoint",
            "type": "boolean"
          },
          "limitations": {
            "title": "Limitations",
            "type": "string"
          },
          "pdf_structure_examined_for_selected_pages": {
            "title": "Pdf Structure Examined For Selected Pages",
            "type": "boolean"
          },
          "retained_digest_reads_selected_file_bytes": {
            "title": "Retained Digest Reads Selected File Bytes",
            "type": "boolean"
          },
          "source_strings_may_contain_private_material": {
            "title": "Source Strings May Contain Private Material",
            "type": "string"
          }
        },
        "required": [
          "custom_endpoint",
          "limitations",
          "pdf_structure_examined_for_selected_pages",
          "retained_digest_reads_selected_file_bytes",
          "source_strings_may_contain_private_material"
        ],
        "title": "SelectedDisclosure",
        "type": "object"
      },
      "SelectedItem": {
        "additionalProperties": true,
        "description": "One item of an answer: ``source_statement``, ``interpretation``, ``note_summary`` or ``question``.\n\nA source statement or interpretation carries citations; a note summary\ncarries ``note_ids`` instead and cites no document.",
        "properties": {
          "citations": {
            "items": {
              "$ref": "#/components/schemas/SelectedCitation"
            },
            "title": "Citations",
            "type": "array"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "note_ids": {
            "items": {
              "type": "string"
            },
            "title": "Note Ids",
            "type": "array"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "citations",
          "kind",
          "note_ids",
          "text"
        ],
        "title": "SelectedItem",
        "type": "object"
      },
      "SelectedNote": {
        "additionalProperties": true,
        "description": "An owner note chosen for a request. ``provenance`` is ``owner_note``: a saved local note, not document evidence.",
        "properties": {
          "anchor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SelectedNoteAnchor"
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "title": "Body",
            "type": "string"
          },
          "created_at_utc": {
            "title": "Created At Utc",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "note_id": {
            "title": "Note Id",
            "type": "string"
          },
          "provenance": {
            "title": "Provenance",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "updated_at_utc": {
            "title": "Updated At Utc",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "anchor",
          "body",
          "created_at_utc",
          "file_id",
          "kind",
          "note_id",
          "provenance",
          "revision",
          "updated_at_utc",
          "version_id"
        ],
        "title": "SelectedNote",
        "type": "object"
      },
      "SelectedNoteAnchor": {
        "additionalProperties": true,
        "description": "Where a selected passage note is pinned: one page's text, by hash and codepoint range.",
        "properties": {
          "end_codepoint": {
            "title": "End Codepoint",
            "type": "integer"
          },
          "extraction_contract": {
            "title": "Extraction Contract",
            "type": "string"
          },
          "page_number": {
            "title": "Page Number",
            "type": "integer"
          },
          "page_text_sha256": {
            "title": "Page Text Sha256",
            "type": "string"
          },
          "quote": {
            "title": "Quote",
            "type": "string"
          },
          "start_codepoint": {
            "title": "Start Codepoint",
            "type": "integer"
          }
        },
        "required": [
          "end_codepoint",
          "extraction_contract",
          "page_number",
          "page_text_sha256",
          "quote",
          "start_codepoint"
        ],
        "title": "SelectedNoteAnchor",
        "type": "object"
      },
      "SelectedPayload": {
        "additionalProperties": true,
        "description": "The exact payload a request sends, which ``request_sha256`` covers.\n\n``response_contract`` is the fixed description of the answer shape the\nruntime is asked for, sent with every request.",
        "properties": {
          "coverage": {
            "$ref": "#/components/schemas/SelectedCoverage"
          },
          "disclosure": {
            "$ref": "#/components/schemas/SelectedDisclosure"
          },
          "instruction": {
            "title": "Instruction",
            "type": "string"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "notes": {
            "items": {
              "$ref": "#/components/schemas/SelectedNote"
            },
            "title": "Notes",
            "type": "array"
          },
          "profile": {
            "title": "Profile",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "project_revision": {
            "title": "Project Revision",
            "type": "integer"
          },
          "requested": {
            "$ref": "#/components/schemas/SelectedRequested"
          },
          "response_contract": {
            "additionalProperties": true,
            "title": "Response Contract",
            "type": "object"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SelectedSource"
            },
            "title": "Sources",
            "type": "array"
          },
          "system_sha256": {
            "title": "System Sha256",
            "type": "string"
          },
          "system_version": {
            "title": "System Version",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "coverage",
          "disclosure",
          "instruction",
          "mode",
          "notes",
          "profile",
          "project_id",
          "project_revision",
          "requested",
          "response_contract",
          "sources",
          "system_sha256",
          "system_version",
          "vault_id",
          "version"
        ],
        "title": "SelectedPayload",
        "type": "object"
      },
      "SelectedPreview": {
        "additionalProperties": true,
        "description": "``POST .../answer-previews``: the exact request a Send would make, before any runtime is called.\n\nIt lives in the serving process until ``expires_at_utc`` and is lost on\nrestart. ``owner_runtime_id`` names the process that holds it.",
        "properties": {
          "contract_version": {
            "title": "Contract Version",
            "type": "integer"
          },
          "expires_at_utc": {
            "title": "Expires At Utc",
            "type": "string"
          },
          "owner_runtime_id": {
            "title": "Owner Runtime Id",
            "type": "string"
          },
          "preview_id": {
            "title": "Preview Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/SelectedRequest"
          },
          "request_sha256": {
            "title": "Request Sha256",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          }
        },
        "required": [
          "contract_version",
          "preview_id",
          "vault_id",
          "project_id",
          "owner_runtime_id",
          "expires_at_utc",
          "request_sha256",
          "request"
        ],
        "title": "SelectedPreview",
        "type": "object"
      },
      "SelectedReport": {
        "additionalProperties": true,
        "description": "A model name the runtime reported, where it reported it, and when. Not the model that was asked for.",
        "properties": {
          "model": {
            "title": "Model",
            "type": "string"
          },
          "observed_at_utc": {
            "title": "Observed At Utc",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "model",
          "observed_at_utc",
          "source"
        ],
        "title": "SelectedReport",
        "type": "object"
      },
      "SelectedRequest": {
        "additionalProperties": true,
        "description": "A request, immutable once admitted: the payload, the system text, and the exact user prompt with their hashes.\n\nThis model and every one inside it declare their fields in sorted key\norder, because a saved request, result, report or usage is canonical\nJSON with sorted keys, and those are the bytes ``request_sha256`` covers.\nA preview's request is the one place the order differs: it is the\nassembly's own dictionary, not yet canonicalized.",
        "properties": {
          "payload": {
            "$ref": "#/components/schemas/SelectedPayload"
          },
          "request_sha256": {
            "title": "Request Sha256",
            "type": "string"
          },
          "system_sha256": {
            "title": "System Sha256",
            "type": "string"
          },
          "system_text": {
            "title": "System Text",
            "type": "string"
          },
          "user_prompt": {
            "title": "User Prompt",
            "type": "string"
          },
          "user_sha256": {
            "title": "User Sha256",
            "type": "string"
          }
        },
        "required": [
          "payload",
          "request_sha256",
          "system_sha256",
          "system_text",
          "user_prompt",
          "user_sha256"
        ],
        "title": "SelectedRequest",
        "type": "object"
      },
      "SelectedRequested": {
        "additionalProperties": true,
        "description": "The public half of the runtime choice a request was made with.\n\n``requested_model`` and ``requested_effort`` are what was asked for. What a\nruntime reported it used is in the answer's ``reports``, kept apart, because\nthe two are different facts. Each ``*_basis`` says where a choice came\nfrom: ``explicit``, a settings or runtime default, or ``not_supported``.",
        "properties": {
          "binding_basis": {
            "title": "Binding Basis",
            "type": "string"
          },
          "effort_basis": {
            "title": "Effort Basis",
            "type": "string"
          },
          "model_basis": {
            "title": "Model Basis",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "requested_effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Effort"
          },
          "requested_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Model"
          },
          "runtime": {
            "title": "Runtime",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "binding_basis",
          "effort_basis",
          "model_basis",
          "provider",
          "requested_effort",
          "requested_model",
          "runtime",
          "version"
        ],
        "title": "SelectedRequested",
        "type": "object"
      },
      "SelectedResult": {
        "additionalProperties": true,
        "description": "The validated answer. ``status`` is ``answer`` or ``insufficient_evidence``.",
        "properties": {
          "limitations": {
            "items": {
              "type": "string"
            },
            "title": "Limitations",
            "type": "array"
          },
          "mode": {
            "title": "Mode",
            "type": "string"
          },
          "request_sha256": {
            "title": "Request Sha256",
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/SelectedSection"
            },
            "title": "Sections",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "limitations",
          "mode",
          "request_sha256",
          "sections",
          "status",
          "version"
        ],
        "title": "SelectedResult",
        "type": "object"
      },
      "SelectedSection": {
        "additionalProperties": true,
        "description": "A section of an answer: ``summary``, ``details``, ``limitations`` or ``questions``.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SelectedItem"
            },
            "title": "Items",
            "type": "array"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "items",
          "kind"
        ],
        "title": "SelectedSection",
        "type": "object"
      },
      "SelectedSource": {
        "additionalProperties": true,
        "description": "One selected segment, ``S01`` to ``S24``: an exact version's page text, or a range of it.\n\n``text`` is the literal selected text. ``start_codepoint`` and\n``end_codepoint`` are global Unicode codepoint offsets on the page, end\nexclusive, never UTF-16 indices. ``page_count`` is ``None`` where a PDF's\ncount is not known.",
        "properties": {
          "byte_size": {
            "title": "Byte Size",
            "type": "integer"
          },
          "end_codepoint": {
            "title": "End Codepoint",
            "type": "integer"
          },
          "extraction_contract": {
            "title": "Extraction Contract",
            "type": "string"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "media_type": {
            "title": "Media Type",
            "type": "string"
          },
          "original_name": {
            "title": "Original Name",
            "type": "string"
          },
          "page_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Count"
          },
          "page_number": {
            "title": "Page Number",
            "type": "integer"
          },
          "page_text_sha256": {
            "title": "Page Text Sha256",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          },
          "source_sha256": {
            "title": "Source Sha256",
            "type": "string"
          },
          "start_codepoint": {
            "title": "Start Codepoint",
            "type": "integer"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "vault_id": {
            "title": "Vault Id",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "byte_size",
          "end_codepoint",
          "extraction_contract",
          "file_id",
          "media_type",
          "original_name",
          "page_count",
          "page_number",
          "page_text_sha256",
          "project_id",
          "sha256",
          "source_id",
          "source_sha256",
          "start_codepoint",
          "text",
          "vault_id",
          "version_id"
        ],
        "title": "SelectedSource",
        "type": "object"
      },
      "SelectedUsage": {
        "additionalProperties": true,
        "description": "Usage as reported. ``provenance`` is ``runtime_report`` and ``billing`` is ``unknown``: no cost is known.",
        "properties": {
          "billing": {
            "title": "Billing",
            "type": "string"
          },
          "provenance": {
            "title": "Provenance",
            "type": "string"
          },
          "reported": {
            "$ref": "#/components/schemas/SelectedUsageReported"
          }
        },
        "required": [
          "billing",
          "provenance",
          "reported"
        ],
        "title": "SelectedUsage",
        "type": "object"
      },
      "SelectedUsageReported": {
        "additionalProperties": true,
        "description": "Token counts a runtime reported. Only the counts it reported are present.",
        "properties": {
          "cache_creation_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Creation Tokens"
          },
          "cache_read_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Tokens"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          }
        },
        "title": "SelectedUsageReported",
        "type": "object"
      },
      "ServiceInstallBody": {
        "properties": {
          "port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Port"
          },
          "register": {
            "default": false,
            "title": "Register",
            "type": "boolean"
          }
        },
        "title": "ServiceInstallBody",
        "type": "object"
      },
      "ServiceInstalled": {
        "additionalProperties": true,
        "description": "``POST /api/service/install`` — the unit written, and where.",
        "properties": {
          "installed": {
            "title": "Installed",
            "type": "boolean"
          },
          "unit_path": {
            "title": "Unit Path",
            "type": "string"
          }
        },
        "required": [
          "installed",
          "unit_path"
        ],
        "title": "ServiceInstalled",
        "type": "object"
      },
      "ServiceStatus": {
        "additionalProperties": true,
        "description": "``GET /api/service/status`` — whether the unit file is installed.\n\n``installed`` is the file's presence at ``unit_path`` and nothing more: an\ninstalled unit says nothing about whether a service is running, which is\n``/api/service/daemon-status``'s question. ``platform`` is ``sys.platform``.\n``runs`` is what the installed unit starts, read from the file: ``app`` (the\nresmon app, which posts notifications as resmon), ``engine`` (the bare\nengine), or ``null`` when there is no unit or it names neither.\n``app_available`` is true when this engine was started by the packaged app, so\na unit written now would run the app.",
        "properties": {
          "app_available": {
            "title": "App Available",
            "type": "boolean"
          },
          "installed": {
            "title": "Installed",
            "type": "boolean"
          },
          "platform": {
            "title": "Platform",
            "type": "string"
          },
          "runs": {
            "anyOf": [
              {
                "enum": [
                  "app",
                  "engine"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runs"
          },
          "unit_path": {
            "title": "Unit Path",
            "type": "string"
          }
        },
        "required": [
          "installed",
          "unit_path",
          "platform",
          "runs",
          "app_available"
        ],
        "title": "ServiceStatus",
        "type": "object"
      },
      "ServiceUninstalled": {
        "additionalProperties": true,
        "description": "``POST /api/service/uninstall``.\n\n``removed`` is whether a file was there to remove: uninstalling a service\nthat was never installed answers ``installed: false`` and ``removed:\nfalse`` rather than an error.",
        "properties": {
          "installed": {
            "title": "Installed",
            "type": "boolean"
          },
          "removed": {
            "title": "Removed",
            "type": "boolean"
          },
          "unit_path": {
            "title": "Unit Path",
            "type": "string"
          }
        },
        "required": [
          "installed",
          "unit_path",
          "removed"
        ],
        "title": "ServiceUninstalled",
        "type": "object"
      },
      "SettingsBody": {
        "properties": {
          "settings": {
            "additionalProperties": true,
            "title": "Settings",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "title": "SettingsBody",
        "type": "object"
      },
      "SettingsReset": {
        "additionalProperties": true,
        "description": "``POST /api/admin/reset-settings``: every stored setting cleared, and every AI, repository and SMTP key.\n\n``settings_cleared`` counts the stored settings deleted; the schema\nversion marker is kept and not counted. The key counts are of keys found\nand removed, and ``smtp_credentials_removed`` counts the SMTP password the\nsame way, apart from the AI and repository keys. Configurations, runs and\npapers are kept.",
        "properties": {
          "ai_keys_removed": {
            "title": "Ai Keys Removed",
            "type": "integer"
          },
          "repo_keys_removed": {
            "title": "Repo Keys Removed",
            "type": "integer"
          },
          "settings_cleared": {
            "title": "Settings Cleared",
            "type": "integer"
          },
          "smtp_credentials_removed": {
            "title": "Smtp Credentials Removed",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "settings_cleared",
          "ai_keys_removed",
          "repo_keys_removed",
          "smtp_credentials_removed"
        ],
        "title": "SettingsReset",
        "type": "object"
      },
      "SettingsSaved": {
        "additionalProperties": true,
        "description": "What the six plain settings PUTs answer: ``{\"success\": true}``.\n\nOne model for six routes rather than six identical ones. The two PUTs that\nanswer more than this —  embeddings and execution — have their own, because\na shared model that declared their extra keys would put those keys into the\nschema of four routes that never send them.",
        "properties": {
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success"
        ],
        "title": "SettingsSaved",
        "type": "object"
      },
      "SharedWording": {
        "additionalProperties": true,
        "description": "``GET /api/shared-wording``.\n\n``state`` is ``never`` (no scan stored), ``other_version`` (the stored\nanswer came from another version of the method and is not shown), or\n``ready``. ``withheld`` counts stored pairs not shown because a paper's text\nchanged or the paper left; ``arrived_since`` counts papers the stored answer\nhas not compared because they arrived after it.",
        "properties": {
          "arrived_since": {
            "title": "Arrived Since",
            "type": "integer"
          },
          "definitions": {
            "$ref": "#/components/schemas/SharedWordingDefinitions"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingGroup"
            },
            "title": "Groups",
            "type": "array"
          },
          "job": {
            "$ref": "#/components/schemas/SharedWordingJob"
          },
          "limits": {
            "items": {
              "type": "string"
            },
            "title": "Limits",
            "type": "array"
          },
          "method_version": {
            "title": "Method Version",
            "type": "integer"
          },
          "scan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SharedWordingScan"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/SharedWordingSettings"
          },
          "state": {
            "enum": [
              "never",
              "other_version",
              "ready"
            ],
            "title": "State",
            "type": "string"
          },
          "withheld": {
            "title": "Withheld",
            "type": "integer"
          }
        },
        "required": [
          "state",
          "method_version",
          "settings",
          "definitions",
          "limits",
          "job",
          "scan",
          "withheld",
          "arrived_since",
          "groups"
        ],
        "title": "SharedWording",
        "type": "object"
      },
      "SharedWordingAuthor": {
        "additionalProperties": true,
        "description": "An author in both records, and whether the ORCID or the name matched.",
        "properties": {
          "by": {
            "enum": [
              "orcid",
              "name"
            ],
            "title": "By",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "other_name": {
            "title": "Other Name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "other_name",
          "by"
        ],
        "title": "SharedWordingAuthor",
        "type": "object"
      },
      "SharedWordingBrief": {
        "additionalProperties": true,
        "description": "A pair in a list: left is the earlier publication date, only as a reading order.",
        "properties": {
          "a": {
            "title": "A",
            "type": "integer"
          },
          "authors_in_common": {
            "title": "Authors In Common",
            "type": "integer"
          },
          "b": {
            "title": "B",
            "type": "integer"
          },
          "category": {
            "enum": [
              "different_authors",
              "same_authors",
              "authors_unknown",
              "same_work",
              "notice"
            ],
            "title": "Category",
            "type": "string"
          },
          "left": {
            "$ref": "#/components/schemas/SharedWordingSide"
          },
          "longest": {
            "title": "Longest",
            "type": "integer"
          },
          "reason_words": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason Words"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          },
          "right": {
            "$ref": "#/components/schemas/SharedWordingSide"
          },
          "share": {
            "title": "Share",
            "type": "number"
          }
        },
        "required": [
          "a",
          "b",
          "category",
          "reasons",
          "reason_words",
          "longest",
          "share",
          "authors_in_common",
          "left",
          "right"
        ],
        "title": "SharedWordingBrief",
        "type": "object"
      },
      "SharedWordingCancel": {
        "additionalProperties": true,
        "description": "``POST /api/shared-wording/scan/cancel``: asked to stop, or nothing was running.",
        "properties": {
          "status": {
            "enum": [
              "idle",
              "cancelling"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "SharedWordingCancel",
        "type": "object"
      },
      "SharedWordingDefinitions": {
        "additionalProperties": true,
        "description": "Each number's definition, one sentence each, for the screen to show beside it.",
        "properties": {
          "authors": {
            "title": "Authors",
            "type": "string"
          },
          "longest": {
            "title": "Longest",
            "type": "string"
          },
          "share": {
            "title": "Share",
            "type": "string"
          }
        },
        "required": [
          "longest",
          "share",
          "authors"
        ],
        "title": "SharedWordingDefinitions",
        "type": "object"
      },
      "SharedWordingFileMatch": {
        "additionalProperties": true,
        "description": "A paper's abstract or another file's page that shares wording with one of this file's pages.",
        "properties": {
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Id"
          },
          "file_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Id"
          },
          "kind": {
            "enum": [
              "paper",
              "file"
            ],
            "title": "Kind",
            "type": "string"
          },
          "linked": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked"
          },
          "longest": {
            "title": "Longest",
            "type": "integer"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "other_page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Other Page"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "passages": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingFilePassage"
            },
            "title": "Passages",
            "type": "array"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "share": {
            "title": "Share",
            "type": "number"
          },
          "shared_phrases": {
            "title": "Shared Phrases",
            "type": "integer"
          },
          "shorter_phrases": {
            "title": "Shorter Phrases",
            "type": "integer"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "kind",
          "page",
          "longest",
          "share",
          "shorter_phrases",
          "shared_phrases",
          "passages"
        ],
        "title": "SharedWordingFileMatch",
        "type": "object"
      },
      "SharedWordingFilePassage": {
        "additionalProperties": true,
        "description": "A passage on this file's page: codepoint ``[start, end)`` in the page's text, and the text.",
        "properties": {
          "end": {
            "title": "End",
            "type": "integer"
          },
          "start": {
            "title": "Start",
            "type": "integer"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "words": {
            "title": "Words",
            "type": "integer"
          }
        },
        "required": [
          "words",
          "start",
          "end",
          "text"
        ],
        "title": "SharedWordingFilePassage",
        "type": "object"
      },
      "SharedWordingFileRef": {
        "additionalProperties": true,
        "properties": {
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "media_type": {
            "title": "Media Type",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "file_id",
          "version_id",
          "name",
          "media_type"
        ],
        "title": "SharedWordingFileRef",
        "type": "object"
      },
      "SharedWordingFileResult": {
        "additionalProperties": true,
        "description": "What one comparison found, and what it read and could not read.",
        "properties": {
          "abstracts_compared": {
            "title": "Abstracts Compared",
            "type": "integer"
          },
          "definitions": {
            "$ref": "#/components/schemas/SharedWordingDefinitions"
          },
          "file": {
            "$ref": "#/components/schemas/SharedWordingFileRef"
          },
          "files_compared": {
            "title": "Files Compared",
            "type": "integer"
          },
          "files_not_read": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingFileUnread"
            },
            "title": "Files Not Read",
            "type": "array"
          },
          "limits": {
            "items": {
              "type": "string"
            },
            "title": "Limits",
            "type": "array"
          },
          "matches": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingFileMatch"
            },
            "title": "Matches",
            "type": "array"
          },
          "method_version": {
            "title": "Method Version",
            "type": "integer"
          },
          "page_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Count"
          },
          "pages_read": {
            "title": "Pages Read",
            "type": "integer"
          },
          "pages_unread": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingPageUnread"
            },
            "title": "Pages Unread",
            "type": "array"
          },
          "settings": {
            "$ref": "#/components/schemas/SharedWordingSettings"
          }
        },
        "required": [
          "file",
          "page_count",
          "pages_read",
          "pages_unread",
          "abstracts_compared",
          "files_compared",
          "files_not_read",
          "matches",
          "settings",
          "definitions",
          "limits",
          "method_version"
        ],
        "title": "SharedWordingFileResult",
        "type": "object"
      },
      "SharedWordingFileUnread": {
        "additionalProperties": true,
        "properties": {
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "file_id",
          "name",
          "reason"
        ],
        "title": "SharedWordingFileUnread",
        "type": "object"
      },
      "SharedWordingForPaper": {
        "additionalProperties": true,
        "description": "``GET /api/shared-wording/papers/{document_id}``.\n\n``compared`` is null when the paper arrived or changed after the scan.",
        "properties": {
          "compared": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compared"
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "pairs": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingBrief"
            },
            "title": "Pairs",
            "type": "array"
          },
          "phrase_words": {
            "title": "Phrase Words",
            "type": "integer"
          },
          "state": {
            "enum": [
              "never",
              "other_version",
              "ready"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "document_id",
          "state",
          "compared",
          "phrase_words",
          "pairs"
        ],
        "title": "SharedWordingForPaper",
        "type": "object"
      },
      "SharedWordingGroup": {
        "additionalProperties": true,
        "description": "One group of pairs. ``pairs`` holds at most 500; ``count`` counts them all.",
        "properties": {
          "category": {
            "enum": [
              "different_authors",
              "same_authors",
              "authors_unknown",
              "same_work",
              "notice"
            ],
            "title": "Category",
            "type": "string"
          },
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "pairs": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingBrief"
            },
            "title": "Pairs",
            "type": "array"
          }
        },
        "required": [
          "category",
          "label",
          "note",
          "count",
          "pairs"
        ],
        "title": "SharedWordingGroup",
        "type": "object"
      },
      "SharedWordingJob": {
        "additionalProperties": true,
        "description": "A scan in the background: ``kind`` is ``full`` or ``new`` (papers since the last answer).",
        "properties": {
          "cancelled": {
            "title": "Cancelled",
            "type": "boolean"
          },
          "done": {
            "title": "Done",
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "found": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Found"
          },
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "full",
                  "new"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "running": {
            "title": "Running",
            "type": "boolean"
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "running",
          "kind",
          "stage",
          "done",
          "total",
          "started_at",
          "finished_at",
          "cancelled",
          "error",
          "found"
        ],
        "title": "SharedWordingJob",
        "type": "object"
      },
      "SharedWordingLibrary": {
        "additionalProperties": true,
        "description": "``POST`` and ``GET /api/library/files/{file_id}/shared-wording``.\n\n``state`` is ``never`` (not compared since the engine started), ``running``,\n``done`` (``result`` holds the answer), ``failed`` (``error`` says why), or\n``cancelled``. Kept in memory only: the comparison is asked for again.",
        "properties": {
          "done": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Done"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "file_id": {
            "title": "File Id",
            "type": "string"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SharedWordingFileResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "state": {
            "enum": [
              "never",
              "running",
              "done",
              "failed",
              "cancelled"
            ],
            "title": "State",
            "type": "string"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "version_id": {
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "state",
          "file_id",
          "version_id"
        ],
        "title": "SharedWordingLibrary",
        "type": "object"
      },
      "SharedWordingNotCompared": {
        "additionalProperties": true,
        "description": "Papers the scan read and did not compare, by reason.",
        "properties": {
          "no_abstract": {
            "default": 0,
            "title": "No Abstract",
            "type": "integer"
          },
          "too_short": {
            "default": 0,
            "title": "Too Short",
            "type": "integer"
          }
        },
        "title": "SharedWordingNotCompared",
        "type": "object"
      },
      "SharedWordingPageUnread": {
        "additionalProperties": true,
        "properties": {
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "page",
          "status"
        ],
        "title": "SharedWordingPageUnread",
        "type": "object"
      },
      "SharedWordingPair": {
        "additionalProperties": true,
        "description": "``GET /api/shared-wording/pairs/{a}/{b}``.\n\n``state`` is ``changed`` when a text is no longer the one compared, and\nthen ``passages`` is empty and ``summary`` says so.",
        "properties": {
          "a": {
            "title": "A",
            "type": "integer"
          },
          "authors_in_common": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingAuthor"
            },
            "title": "Authors In Common",
            "type": "array"
          },
          "b": {
            "title": "B",
            "type": "integer"
          },
          "category": {
            "enum": [
              "different_authors",
              "same_authors",
              "authors_unknown",
              "same_work",
              "notice"
            ],
            "title": "Category",
            "type": "string"
          },
          "common_phrases": {
            "title": "Common Phrases",
            "type": "integer"
          },
          "definitions": {
            "$ref": "#/components/schemas/SharedWordingDefinitions"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "left": {
            "$ref": "#/components/schemas/SharedWordingPairSide"
          },
          "limits": {
            "items": {
              "type": "string"
            },
            "title": "Limits",
            "type": "array"
          },
          "longest": {
            "title": "Longest",
            "type": "integer"
          },
          "method_version": {
            "title": "Method Version",
            "type": "integer"
          },
          "passages": {
            "items": {
              "$ref": "#/components/schemas/SharedWordingPassage"
            },
            "title": "Passages",
            "type": "array"
          },
          "reason_words": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason Words"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          },
          "right": {
            "$ref": "#/components/schemas/SharedWordingPairSide"
          },
          "scanned_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scanned At"
          },
          "share": {
            "title": "Share",
            "type": "number"
          },
          "shared_phrases": {
            "title": "Shared Phrases",
            "type": "integer"
          },
          "shorter": {
            "title": "Shorter",
            "type": "integer"
          },
          "shorter_phrases": {
            "title": "Shorter Phrases",
            "type": "integer"
          },
          "state": {
            "enum": [
              "current",
              "changed"
            ],
            "title": "State",
            "type": "string"
          },
          "summary": {
            "items": {
              "type": "string"
            },
            "title": "Summary",
            "type": "array"
          }
        },
        "required": [
          "a",
          "b",
          "state",
          "category",
          "label",
          "reasons",
          "reason_words",
          "left",
          "right",
          "longest",
          "share",
          "shorter",
          "shorter_phrases",
          "shared_phrases",
          "common_phrases",
          "authors_in_common",
          "passages",
          "summary",
          "definitions",
          "limits",
          "scanned_at",
          "method_version"
        ],
        "title": "SharedWordingPair",
        "type": "object"
      },
      "SharedWordingPairSide": {
        "additionalProperties": true,
        "description": "One paper of a pair in full: ``text`` is its abstract as compared.",
        "properties": {
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Repository"
          },
          "text": {
            "title": "Text",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "words": {
            "title": "Words",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "title",
          "publication_date",
          "source_repository",
          "authors",
          "doi",
          "url",
          "text",
          "words"
        ],
        "title": "SharedWordingPairSide",
        "type": "object"
      },
      "SharedWordingPassage": {
        "additionalProperties": true,
        "description": "One shared passage: codepoint ``[start, end)`` in each side's ``text``, and its words.",
        "properties": {
          "left": {
            "items": {
              "type": "integer"
            },
            "title": "Left",
            "type": "array"
          },
          "right": {
            "items": {
              "type": "integer"
            },
            "title": "Right",
            "type": "array"
          },
          "words": {
            "title": "Words",
            "type": "integer"
          }
        },
        "required": [
          "left",
          "right",
          "words"
        ],
        "title": "SharedWordingPassage",
        "type": "object"
      },
      "SharedWordingScan": {
        "additionalProperties": true,
        "description": "The stored answer's own record: when, what kind of pass, and what it compared.",
        "properties": {
          "compared": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compared"
          },
          "considered": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Considered"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "full_scan_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Scan At"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "method_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method Version"
          },
          "not_compared": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SharedWordingNotCompared"
              },
              {
                "type": "null"
              }
            ]
          },
          "seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seconds"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          }
        },
        "required": [
          "kind",
          "started_at",
          "finished_at",
          "seconds",
          "full_scan_at",
          "considered",
          "compared",
          "not_compared",
          "method_version"
        ],
        "title": "SharedWordingScan",
        "type": "object"
      },
      "SharedWordingSettings": {
        "additionalProperties": true,
        "description": "The method's thresholds, as the scan that answered used them.",
        "properties": {
          "common_works": {
            "title": "Common Works",
            "type": "integer"
          },
          "min_words": {
            "title": "Min Words",
            "type": "integer"
          },
          "phrase_words": {
            "title": "Phrase Words",
            "type": "integer"
          },
          "shown_longest": {
            "title": "Shown Longest",
            "type": "integer"
          },
          "shown_share": {
            "title": "Shown Share",
            "type": "number"
          }
        },
        "required": [
          "phrase_words",
          "min_words",
          "common_works",
          "shown_longest",
          "shown_share"
        ],
        "title": "SharedWordingSettings",
        "type": "object"
      },
      "SharedWordingSide": {
        "additionalProperties": true,
        "description": "One paper of a pair, as a list row names it.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Repository"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "required": [
          "id",
          "title",
          "publication_date",
          "source_repository"
        ],
        "title": "SharedWordingSide",
        "type": "object"
      },
      "SourceContribution": {
        "additionalProperties": true,
        "description": "``GET /api/analytics/source-contribution``: overlap needs two sources to compare.",
        "properties": {
          "insufficient_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insufficient Reason"
          },
          "sample_size": {
            "title": "Sample Size",
            "type": "integer"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SourceContributionRow"
            },
            "title": "Sources",
            "type": "array"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          }
        },
        "required": [
          "sources",
          "sample_size",
          "sufficient",
          "insufficient_reason"
        ],
        "title": "SourceContribution",
        "type": "object"
      },
      "SourceContributionRow": {
        "additionalProperties": true,
        "properties": {
          "duplicated": {
            "title": "Duplicated",
            "type": "integer"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "unique_papers": {
            "title": "Unique Papers",
            "type": "integer"
          },
          "unique_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unique Share"
          }
        },
        "required": [
          "source",
          "total",
          "unique_papers",
          "duplicated",
          "unique_share"
        ],
        "title": "SourceContributionRow",
        "type": "object"
      },
      "SourceWall": {
        "additionalProperties": true,
        "description": "``GET /api/coverage/source-wall``: every source's answer to each of the last runs.\n\nServed classified, with every word a screen draws: the legend, the verdict\nand the notes. A renderer that re-derived a state from ``status`` and\n``zero_reason`` would be the second place to get it wrong.",
        "properties": {
          "notes": {
            "items": {
              "type": "string"
            },
            "title": "Notes",
            "type": "array"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/SourceWallRun"
            },
            "title": "Runs",
            "type": "array"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SourceWallSource"
            },
            "title": "Sources",
            "type": "array"
          },
          "state_legend": {
            "items": {
              "$ref": "#/components/schemas/SourceWallLegendEntry"
            },
            "title": "State Legend",
            "type": "array"
          },
          "states": {
            "items": {
              "type": "string"
            },
            "title": "States",
            "type": "array"
          },
          "totals": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Totals",
            "type": "object"
          },
          "verdict": {
            "$ref": "#/components/schemas/SourceWallVerdict"
          },
          "window": {
            "$ref": "#/components/schemas/SourceWallWindow"
          }
        },
        "required": [
          "runs",
          "sources",
          "states",
          "state_legend",
          "totals",
          "verdict",
          "window",
          "notes"
        ],
        "title": "SourceWall",
        "type": "object"
      },
      "SourceWallCell": {
        "additionalProperties": true,
        "description": "One source's recorded answer to one run, already classified.\n\n``state`` is one of ``source_wall.WALL_STATES``; ``label`` and ``note`` are\n``source_coverage``'s own words, unedited. ``outcome_recorded`` false is a\nrun with no row for this source, which reads as not recorded or, where the\nrun's saved selection says so, not asked. ``in_selection`` is ``None`` when\nthe run's selection cannot be read.",
        "properties": {
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "in_selection": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "In Selection"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "outcome_recorded": {
            "title": "Outcome Recorded",
            "type": "boolean"
          },
          "partial": {
            "title": "Partial",
            "type": "boolean"
          },
          "result_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Count"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "zero_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zero Reason"
          }
        },
        "required": [
          "execution_id",
          "state",
          "label",
          "note",
          "result_count",
          "status",
          "zero_reason",
          "partial",
          "outcome_recorded",
          "in_selection"
        ],
        "title": "SourceWallCell",
        "type": "object"
      },
      "SourceWallLegendEntry": {
        "additionalProperties": true,
        "properties": {
          "label": {
            "title": "Label",
            "type": "string"
          },
          "meaning": {
            "title": "Meaning",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "state",
          "label",
          "meaning"
        ],
        "title": "SourceWallLegendEntry",
        "type": "object"
      },
      "SourceWallRun": {
        "additionalProperties": true,
        "description": "One column of the wall: a run, oldest first.",
        "properties": {
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "execution_type": {
            "title": "Execution Type",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "required": [
          "execution_id",
          "execution_type",
          "status",
          "started_at",
          "ended_at",
          "label"
        ],
        "title": "SourceWallRun",
        "type": "object"
      },
      "SourceWallSource": {
        "additionalProperties": true,
        "description": "One row: a source, its cells in run order, and how many of each state.",
        "properties": {
          "cells": {
            "items": {
              "$ref": "#/components/schemas/SourceWallCell"
            },
            "title": "Cells",
            "type": "array"
          },
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Counts",
            "type": "object"
          },
          "in_catalog": {
            "title": "In Catalog",
            "type": "boolean"
          },
          "latest_known_state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Known State"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name",
          "in_catalog",
          "cells",
          "counts",
          "latest_known_state"
        ],
        "title": "SourceWallSource",
        "type": "object"
      },
      "SourceWallVerdict": {
        "additionalProperties": true,
        "description": "The sentence at the top. ``level`` is ``empty``, ``ok``, ``attention`` or ``unknown``.",
        "properties": {
          "detail": {
            "items": {
              "type": "string"
            },
            "title": "Detail",
            "type": "array"
          },
          "headline": {
            "title": "Headline",
            "type": "string"
          },
          "level": {
            "title": "Level",
            "type": "string"
          }
        },
        "required": [
          "level",
          "headline",
          "detail"
        ],
        "title": "SourceWallVerdict",
        "type": "object"
      },
      "SourceWallWindow": {
        "additionalProperties": true,
        "properties": {
          "max": {
            "title": "Max",
            "type": "integer"
          },
          "requested": {
            "title": "Requested",
            "type": "integer"
          },
          "returned": {
            "title": "Returned",
            "type": "integer"
          },
          "runs_available": {
            "title": "Runs Available",
            "type": "integer"
          }
        },
        "required": [
          "requested",
          "returned",
          "max",
          "runs_available"
        ],
        "title": "SourceWallWindow",
        "type": "object"
      },
      "StarterWatchProfile": {
        "additionalProperties": true,
        "description": "One of the curated profiles that ship with the app.\n\nNot a ``WatchProfile``: a starter is a file on disk, not a row, so it has\nno ``id``, no timestamps, and a ``source_file`` instead. Modeling it as a\nprofile with optional ids would have told a client the two are the same\nthing, which is the drift this contract exists to stop.",
        "properties": {
          "affiliations": {
            "items": {
              "type": "string"
            },
            "title": "Affiliations",
            "type": "array"
          },
          "basis_warning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis Warning"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "field_hints": {
            "items": {
              "type": "string"
            },
            "title": "Field Hints",
            "type": "array"
          },
          "identifiers": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WatchProfileIdentifier"
            },
            "title": "Identifiers",
            "type": "object"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "names": {
            "items": {
              "$ref": "#/components/schemas/WatchProfileName"
            },
            "title": "Names",
            "type": "array"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "source_file": {
            "title": "Source File",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "display_name",
          "names",
          "identifiers",
          "affiliations",
          "field_hints",
          "notes",
          "source_file",
          "basis_warning"
        ],
        "title": "StarterWatchProfile",
        "type": "object"
      },
      "StarterWatchProfileList": {
        "additionalProperties": true,
        "description": "``GET /api/profiles/starter``.",
        "properties": {
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/StarterWatchProfile"
            },
            "title": "Profiles",
            "type": "array"
          }
        },
        "required": [
          "profiles"
        ],
        "title": "StarterWatchProfileList",
        "type": "object"
      },
      "StorageSettings": {
        "additionalProperties": true,
        "description": "``GET /api/settings/storage``.",
        "properties": {
          "archive_after_days": {
            "title": "Archive After Days",
            "type": "string"
          },
          "export_directory": {
            "title": "Export Directory",
            "type": "string"
          },
          "pdf_policy": {
            "title": "Pdf Policy",
            "type": "string"
          },
          "txt_policy": {
            "title": "Txt Policy",
            "type": "string"
          }
        },
        "required": [
          "pdf_policy",
          "txt_policy",
          "archive_after_days",
          "export_directory"
        ],
        "title": "StorageSettings",
        "type": "object"
      },
      "SweepRequest": {
        "properties": {
          "ai_enabled": {
            "default": false,
            "title": "Ai Enabled",
            "type": "boolean"
          },
          "ai_settings": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Settings"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          },
          "ephemeral_credentials": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ephemeral Credentials"
          },
          "keywords": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keywords"
          },
          "max_results": {
            "default": 100,
            "title": "Max Results",
            "type": "integer"
          },
          "query": {
            "title": "Query",
            "type": "string"
          },
          "repositories": {
            "items": {
              "type": "string"
            },
            "title": "Repositories",
            "type": "array"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "saved_configuration_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Saved Configuration Id"
          }
        },
        "required": [
          "repositories",
          "query"
        ],
        "title": "SweepRequest",
        "type": "object"
      },
      "TestEmailSent": {
        "additionalProperties": true,
        "description": "``POST /api/settings/email/test`` — a send the SMTP server accepted.\n\nOnly the first recipient is sent to, and ``recipient`` names it. Every\nfailure, an incomplete configuration included, is a 400 whose ``detail``\nsays which, so this body is the success case alone.",
        "properties": {
          "recipient": {
            "title": "Recipient",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "recipient"
        ],
        "title": "TestEmailSent",
        "type": "object"
      },
      "Today": {
        "additionalProperties": true,
        "description": "``GET /api/today``.\n\n``window`` is ``since_last_look`` when a look is recorded and\n``first_look`` when none is, in which case ``since`` is seven days before\n``now`` and the interface says so. ``papers`` holds at most 1,000, newest\nfirst; ``total`` counts them all.",
        "properties": {
          "from_searches": {
            "title": "From Searches",
            "type": "integer"
          },
          "now": {
            "title": "Now",
            "type": "string"
          },
          "papers": {
            "items": {
              "$ref": "#/components/schemas/TodayPaper"
            },
            "title": "Papers",
            "type": "array"
          },
          "since": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Since"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "watches": {
            "items": {
              "$ref": "#/components/schemas/TodayWatch"
            },
            "title": "Watches",
            "type": "array"
          },
          "window": {
            "enum": [
              "since_last_look",
              "first_look"
            ],
            "title": "Window",
            "type": "string"
          }
        },
        "required": [
          "now",
          "since",
          "window",
          "total",
          "papers",
          "from_searches",
          "watches"
        ],
        "title": "Today",
        "type": "object"
      },
      "TodayLooked": {
        "additionalProperties": true,
        "description": "``POST /api/today/looked``: the moment recorded.",
        "properties": {
          "looked_at": {
            "title": "Looked At",
            "type": "string"
          }
        },
        "required": [
          "looked_at"
        ],
        "title": "TodayLooked",
        "type": "object"
      },
      "TodayPaper": {
        "additionalProperties": true,
        "description": "A paper resmon first collected since the last look.\n\n``abstract_lede`` is the opening of the abstract as the source gave it,\nnever a summary; resmon does not keep summaries per paper.",
        "properties": {
          "abstract_lede": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract Lede"
          },
          "authors": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authors"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "first_seen_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen At"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "queue_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Status"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "watches": {
            "items": {
              "type": "integer"
            },
            "title": "Watches",
            "type": "array"
          }
        },
        "required": [
          "id",
          "title",
          "authors",
          "source",
          "publication_date",
          "first_seen_at",
          "abstract_lede",
          "url",
          "doi",
          "watches",
          "queue_status"
        ],
        "title": "TodayPaper",
        "type": "object"
      },
      "TodayRun": {
        "additionalProperties": true,
        "description": "A watch's most recent run.",
        "properties": {
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "execution_id": {
            "title": "Execution Id",
            "type": "integer"
          },
          "new_result_count": {
            "title": "New Result Count",
            "type": "integer"
          },
          "result_count": {
            "title": "Result Count",
            "type": "integer"
          },
          "sources_answered": {
            "title": "Sources Answered",
            "type": "integer"
          },
          "sources_not_answered": {
            "items": {
              "$ref": "#/components/schemas/TodaySourceNote"
            },
            "title": "Sources Not Answered",
            "type": "array"
          },
          "sources_total": {
            "title": "Sources Total",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "execution_id",
          "status",
          "started_at",
          "ended_at",
          "result_count",
          "new_result_count",
          "sources_total",
          "sources_answered",
          "sources_not_answered"
        ],
        "title": "TodayRun",
        "type": "object"
      },
      "TodaySourceNote": {
        "additionalProperties": true,
        "description": "A source that did not answer on a watch's last run, or whose answer is unknown.\n\n``source`` is the slug; ``name`` is the source as a person knows it, a\nwithdrawn one included. ``category`` is ``non_answer`` (it did not answer)\nor ``unknown`` (resmon cannot say whether it answered), and ``label`` the\nshort words for the particular outcome.",
        "properties": {
          "category": {
            "enum": [
              "non_answer",
              "unknown"
            ],
            "title": "Category",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "note": {
            "title": "Note",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "source",
          "name",
          "category",
          "label",
          "note"
        ],
        "title": "TodaySourceNote",
        "type": "object"
      },
      "TodayWatch": {
        "additionalProperties": true,
        "description": "A routine, with what it found since the last look.\n\n``next_fire_at`` is what the job store holds, not a promise that anything\nwill fire it: ``/api/scheduler/status`` says whether something will.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "last_run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TodayRun"
              },
              {
                "type": "null"
              }
            ]
          },
          "members": {
            "items": {
              "type": "integer"
            },
            "title": "Members",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "new_count": {
            "title": "New Count",
            "type": "integer"
          },
          "next_fire_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Fire At"
          }
        },
        "required": [
          "id",
          "name",
          "is_active",
          "new_count",
          "last_run",
          "next_fire_at",
          "members"
        ],
        "title": "TodayWatch",
        "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"
      },
      "VectorExtensionStatus": {
        "additionalProperties": true,
        "description": "Whether sqlite-vec loaded in *this* process, and why not when it did not.\n\nReturned by ``/api/health`` and twice inside the embeddings page. One model\nfor all three, because they are one function's output: ``extension`` is the\nloaded version or ``None``, and exactly one of the two fields is ever set.",
        "properties": {
          "extension": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extension"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "extension",
          "reason"
        ],
        "title": "VectorExtensionStatus",
        "type": "object"
      },
      "WatchProfile": {
        "additionalProperties": true,
        "description": "A stored watch profile, as every read of one returns it.\n\n``identifiers`` is keyed by scheme — ``watch_profiles.IDENTIFIER_SCHEMES``\nis the closed list of four, and a key outside it never reaches storage.\nThe map is declared open here because the schema cannot say \"one of these\nfour keys, each optional\" without also saying the keys are required, and\nthe runtime constraint lives in ``_clean_identifiers`` where it belongs.\n\n``basis_warning`` is the field this journey exists to carry: a sentence\nwhen every match for this profile will be name-only, ``None`` when the\nprofile can do better. It is computed on every read, never stored, and it\nis the field a careless model would have dropped.",
        "properties": {
          "affiliations": {
            "items": {
              "type": "string"
            },
            "title": "Affiliations",
            "type": "array"
          },
          "basis_warning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis Warning"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "field_hints": {
            "items": {
              "type": "string"
            },
            "title": "Field Hints",
            "type": "array"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "identifiers": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WatchProfileIdentifier"
            },
            "title": "Identifiers",
            "type": "object"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "names": {
            "items": {
              "$ref": "#/components/schemas/WatchProfileName"
            },
            "title": "Names",
            "type": "array"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "display_name",
          "names",
          "identifiers",
          "affiliations",
          "field_hints",
          "notes",
          "created_at",
          "updated_at",
          "basis_warning"
        ],
        "title": "WatchProfile",
        "type": "object"
      },
      "WatchProfileBody": {
        "properties": {
          "affiliations": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Affiliations",
            "type": "array"
          },
          "display_name": {
            "default": "",
            "title": "Display Name",
            "type": "string"
          },
          "field_hints": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Field Hints",
            "type": "array"
          },
          "identifiers": {
            "additionalProperties": true,
            "default": {},
            "title": "Identifiers",
            "type": "object"
          },
          "kind": {
            "default": "person",
            "title": "Kind",
            "type": "string"
          },
          "names": {
            "default": [],
            "items": {},
            "title": "Names",
            "type": "array"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "title": "WatchProfileBody",
        "type": "object"
      },
      "WatchProfileDeleted": {
        "additionalProperties": true,
        "description": "``DELETE /api/profiles/{profile_id}``.\n\n**The conditionally assembled one.** ``detail`` is added by the handler\nonly when something was watching the profile, and the route therefore sets\n``response_model_exclude_unset=True`` — as every modeled route does —\nso an absent ``detail`` stays absent instead of being serialized as\n``null``. A client distinguishing \"no routines were affected\" from \"one was\nand here is the sentence\" by key presence keeps working.",
        "properties": {
          "deleted": {
            "title": "Deleted",
            "type": "integer"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "routines_watching": {
            "items": {
              "$ref": "#/components/schemas/RoutineWatchingProfile"
            },
            "title": "Routines Watching",
            "type": "array"
          }
        },
        "required": [
          "deleted",
          "routines_watching"
        ],
        "title": "WatchProfileDeleted",
        "type": "object"
      },
      "WatchProfileExport": {
        "additionalProperties": true,
        "description": "``GET /api/profiles/{profile_id}/export`` — the interchange format.\n\nIds and timestamps are deliberately absent, because a profile exported from\none resmon and imported into another is the same *person* and not the same\nrow. ``schema`` is ``watch_profiles.JSON_SCHEMA_VERSION`` and is what the\nimporter refuses on.",
        "properties": {
          "affiliations": {
            "items": {
              "type": "string"
            },
            "title": "Affiliations",
            "type": "array"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "field_hints": {
            "items": {
              "type": "string"
            },
            "title": "Field Hints",
            "type": "array"
          },
          "identifiers": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WatchProfileIdentifier"
            },
            "title": "Identifiers",
            "type": "object"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "names": {
            "items": {
              "$ref": "#/components/schemas/WatchProfileName"
            },
            "title": "Names",
            "type": "array"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "schema": {
            "title": "Schema",
            "type": "integer"
          }
        },
        "required": [
          "schema",
          "kind",
          "display_name",
          "names",
          "identifiers",
          "affiliations",
          "field_hints",
          "notes"
        ],
        "title": "WatchProfileExport",
        "type": "object"
      },
      "WatchProfileIdentifier": {
        "additionalProperties": true,
        "description": "An identifier and the place the user says they got it from.",
        "properties": {
          "cited": {
            "title": "Cited",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "value",
          "cited"
        ],
        "title": "WatchProfileIdentifier",
        "type": "object"
      },
      "WatchProfileImportFailure": {
        "additionalProperties": true,
        "description": "One entry of an import file that could not be read, and why.\n\n``index`` is its position in the submitted list, because the point of\nreporting per profile rather than failing the batch is telling the user\nwhich line to look at.",
        "properties": {
          "index": {
            "title": "Index",
            "type": "integer"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "index",
          "reason"
        ],
        "title": "WatchProfileImportFailure",
        "type": "object"
      },
      "WatchProfileImportResult": {
        "additionalProperties": true,
        "description": "``POST /api/profiles/import``.",
        "properties": {
          "failed": {
            "items": {
              "$ref": "#/components/schemas/WatchProfileImportFailure"
            },
            "title": "Failed",
            "type": "array"
          },
          "imported": {
            "items": {
              "$ref": "#/components/schemas/WatchProfile"
            },
            "title": "Imported",
            "type": "array"
          }
        },
        "required": [
          "imported",
          "failed"
        ],
        "title": "WatchProfileImportResult",
        "type": "object"
      },
      "WatchProfileLifecycle": {
        "additionalProperties": true,
        "description": "``GET /api/profiles/{profile_id}/lifecycle``.\n\n``checked_documents`` beside ``matched_documents`` is the coverage half:\na profile whose papers have never been through a lifecycle check has no\nfindings *because nothing looked*, which is a different fact from having\nnone. ``coverage_note`` says that in a sentence rather than leaving it to\nbe inferred from two numbers, and a model that dropped it would have turned\nthe one into the other.\n\n``checked_documents`` counts only the papers a check looked at. Those it\nfound nothing to ask about (``no_identifier_documents``) and those a\nservice failed on (``errored_documents``) are counted apart, because\nneither was cleared.",
        "properties": {
          "checked_documents": {
            "title": "Checked Documents",
            "type": "integer"
          },
          "coverage_note": {
            "title": "Coverage Note",
            "type": "string"
          },
          "errored_documents": {
            "title": "Errored Documents",
            "type": "integer"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/WatchProfileLifecycleFinding"
            },
            "title": "Findings",
            "type": "array"
          },
          "matched_documents": {
            "title": "Matched Documents",
            "type": "integer"
          },
          "no_identifier_documents": {
            "title": "No Identifier Documents",
            "type": "integer"
          }
        },
        "required": [
          "findings",
          "matched_documents",
          "checked_documents",
          "no_identifier_documents",
          "errored_documents",
          "coverage_note"
        ],
        "title": "WatchProfileLifecycle",
        "type": "object"
      },
      "WatchProfileLifecycleFinding": {
        "additionalProperties": true,
        "description": "A retraction or other lifecycle notice on a paper this profile matched.\n\nA join over findings resmon already holds, never a new claim. Every field\nthat carries the notice is here — ``notice_url`` is ``NOT NULL`` in\n``document_lifecycle`` and the DOI and date are not — because a finding\nrendered without its notice link is resmon asserting a retraction on its\nown authority, which it does not do.\n\n``basis`` and ``matched_author`` come from the match, not the finding, so a\nfinding on a ``name_only`` match is visibly a finding on a paper that\nmerely has this name on it.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "matched_author": {
            "title": "Matched Author",
            "type": "string"
          },
          "notice_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notice Date"
          },
          "notice_doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notice Doi"
          },
          "notice_url": {
            "title": "Notice Url",
            "type": "string"
          },
          "provider": {
            "title": "Provider",
            "type": "string"
          },
          "provider_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Source"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "document_id",
          "kind",
          "severity",
          "label",
          "notice_doi",
          "notice_url",
          "notice_date",
          "provider",
          "provider_source",
          "first_seen_at",
          "title",
          "doi",
          "source_repository",
          "basis",
          "matched_author"
        ],
        "title": "WatchProfileLifecycleFinding",
        "type": "object"
      },
      "WatchProfileList": {
        "additionalProperties": true,
        "description": "``GET /api/profiles``.",
        "properties": {
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/WatchProfile"
            },
            "title": "Profiles",
            "type": "array"
          }
        },
        "required": [
          "profiles"
        ],
        "title": "WatchProfileList",
        "type": "object"
      },
      "WatchProfileMatchPage": {
        "additionalProperties": true,
        "description": "``GET /api/profiles/{profile_id}/matches``.\n\n``by_basis`` is a count per basis over the whole profile, not over this\npage, which is why it sits beside ``total`` rather than being derived from\n``matches``.",
        "properties": {
          "by_basis": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "By Basis",
            "type": "object"
          },
          "matches": {
            "items": {
              "$ref": "#/components/schemas/WatchProfileMatchRow"
            },
            "title": "Matches",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "matches",
          "total",
          "by_basis"
        ],
        "title": "WatchProfileMatchPage",
        "type": "object"
      },
      "WatchProfileMatchRef": {
        "additionalProperties": true,
        "description": "A profile that matched one paper, and the basis it matched on.\n\nThe basis rides on every match everywhere it is returned. A match with no\nbasis is the claim resmon refuses to make: that a paper is by this person,\nrather than that a paper has this name on it.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "evidence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence"
          },
          "matched_author": {
            "title": "Matched Author",
            "type": "string"
          },
          "profile_id": {
            "title": "Profile Id",
            "type": "integer"
          }
        },
        "required": [
          "profile_id",
          "display_name",
          "basis",
          "matched_author",
          "evidence"
        ],
        "title": "WatchProfileMatchRef",
        "type": "object"
      },
      "WatchProfileMatchRow": {
        "additionalProperties": true,
        "description": "One paper matched to a profile, as the matches page lists it.\n\nEvery nullable column of ``documents`` is optional here because it is\nnullable there: ``title`` and ``source_repository`` are ``NOT NULL`` in the\nschema and the rest are not.",
        "properties": {
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "document_id": {
            "title": "Document Id",
            "type": "integer"
          },
          "doi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doi"
          },
          "evidence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "matched_author": {
            "title": "Matched Author",
            "type": "string"
          },
          "publication_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publication Date"
          },
          "source_repository": {
            "title": "Source Repository",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "document_id",
          "basis",
          "matched_author",
          "evidence",
          "first_seen_at",
          "title",
          "source_repository",
          "doi",
          "url",
          "publication_date"
        ],
        "title": "WatchProfileMatchRow",
        "type": "object"
      },
      "WatchProfileMatchesByDocument": {
        "additionalProperties": true,
        "description": "``POST /api/profiles/matches/for-documents``.\n\n**The map with caller-supplied keys.** ``matches`` is keyed by document id\nas a string — the handler builds it with ``str(row[\"document_id\"])`` —\nand holds only the documents that matched something, so a key's absence\nmeans \"nothing matched\", not \"not asked about\".",
        "properties": {
          "matches": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/WatchProfileMatchRef"
              },
              "type": "array"
            },
            "title": "Matches",
            "type": "object"
          }
        },
        "required": [
          "matches"
        ],
        "title": "WatchProfileMatchesByDocument",
        "type": "object"
      },
      "WatchProfileName": {
        "additionalProperties": true,
        "description": "One spelling of the watched name.\n\n``script`` is empty rather than guessed when the value is not ASCII — see\n``watch_profiles._clean_names`` — so it is a string that may be empty, not\nan optional one.",
        "properties": {
          "script": {
            "title": "Script",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "value",
          "script"
        ],
        "title": "WatchProfileName",
        "type": "object"
      },
      "WatchdogCounts": {
        "additionalProperties": true,
        "description": "``alarms`` is the badge: broken plus unusual, muted ones excluded.",
        "properties": {
          "advice": {
            "title": "Advice",
            "type": "integer"
          },
          "alarms": {
            "title": "Alarms",
            "type": "integer"
          },
          "broken": {
            "title": "Broken",
            "type": "integer"
          },
          "muted": {
            "title": "Muted",
            "type": "integer"
          },
          "unusual": {
            "title": "Unusual",
            "type": "integer"
          }
        },
        "required": [
          "broken",
          "unusual",
          "advice",
          "muted",
          "alarms"
        ],
        "title": "WatchdogCounts",
        "type": "object"
      },
      "WatchdogFinding": {
        "additionalProperties": true,
        "description": "One thing the watchdog can say is wrong, with what it rests on.\n\n``scope`` and ``evidence`` are declared ``dict`` rather than modeled, for\ntwo different reasons, and only one of them is good.\n\n``evidence`` holds a different key set for each of the eight finding kinds,\nso there is no field list to write down and ``dict`` is the description\nthat fits.\n\n``scope`` is ``dict`` because a source's scope carries a **string** id and\na routine's carries an **integer** one. A model declaring either does not\nsilently coerce the other: on the pinned pydantic 2.12.4, ``id: str`` fed\n``1`` raises rather than stringifying it, so the mistake would be a 500\nthe equality sweep catches and not a wrong body nobody notices.\n``Union[str, int]`` is the right annotation, keeps both runtime types, and\nwould give a client a real shape instead of ``object``. It is not here yet\nbecause typing it adds a model of its own. See the module docstring.\n\n``what_to_do`` is a field, not prose the renderer composes, because the\nsentence depends on the finding and a generic one would be advice resmon\nhas not earned.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "evidence": {
            "additionalProperties": true,
            "title": "Evidence",
            "type": "object"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "muted": {
            "title": "Muted",
            "type": "boolean"
          },
          "muted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Muted At"
          },
          "scope": {
            "additionalProperties": true,
            "title": "Scope",
            "type": "object"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "what_to_do": {
            "title": "What To Do",
            "type": "string"
          }
        },
        "required": [
          "key",
          "severity",
          "kind",
          "scope",
          "title",
          "detail",
          "what_to_do",
          "evidence",
          "muted",
          "muted_at"
        ],
        "title": "WatchdogFinding",
        "type": "object"
      },
      "WatchdogMuteAck": {
        "additionalProperties": true,
        "description": "``POST /api/watchdog/mute`` and ``/unmute``, which differ only in ``status``.",
        "properties": {
          "finding_key": {
            "title": "Finding Key",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "finding_key"
        ],
        "title": "WatchdogMuteAck",
        "type": "object"
      },
      "WatchdogMuteRequest": {
        "properties": {
          "finding_key": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Finding Key",
            "type": "string"
          },
          "note": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "required": [
          "finding_key"
        ],
        "title": "WatchdogMuteRequest",
        "type": "object"
      },
      "WatchdogReport": {
        "additionalProperties": true,
        "description": "``GET /api/watchdog``.\n\n``sufficient`` is false when there is no history to reason over at all. The\ninterface then says \"nothing to check yet\" rather than \"all clear\", which\nwould be a claim the watchdog has not earned — and it is exactly the field\na model written from the happy path would have left out.",
        "properties": {
          "checked_at": {
            "title": "Checked At",
            "type": "string"
          },
          "counts": {
            "$ref": "#/components/schemas/WatchdogCounts"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/WatchdogFinding"
            },
            "title": "Findings",
            "type": "array"
          },
          "not_enough_data": {
            "items": {
              "$ref": "#/components/schemas/WatchdogUnjudged"
            },
            "title": "Not Enough Data",
            "type": "array"
          },
          "sufficient": {
            "title": "Sufficient",
            "type": "boolean"
          },
          "thresholds": {
            "$ref": "#/components/schemas/WatchdogThresholds"
          },
          "watching": {
            "$ref": "#/components/schemas/WatchdogWatching"
          }
        },
        "required": [
          "checked_at",
          "findings",
          "counts",
          "not_enough_data",
          "watching",
          "thresholds",
          "sufficient"
        ],
        "title": "WatchdogReport",
        "type": "object"
      },
      "WatchdogThresholds": {
        "additionalProperties": true,
        "description": "The numbers every rule above was judged against.\n\nReturned rather than documented, so a user reading \"has failed on its last\n3 runs\" can see that 3 is the threshold and not a coincidence.",
        "properties": {
          "cadence_lag_multiple": {
            "title": "Cadence Lag Multiple",
            "type": "number"
          },
          "consecutive_errors": {
            "title": "Consecutive Errors",
            "type": "integer"
          },
          "consecutive_zeros": {
            "title": "Consecutive Zeros",
            "type": "integer"
          },
          "flatline_runs": {
            "title": "Flatline Runs",
            "type": "integer"
          },
          "min_baseline_runs": {
            "title": "Min Baseline Runs",
            "type": "integer"
          },
          "min_runs_for_cadence": {
            "title": "Min Runs For Cadence",
            "type": "integer"
          },
          "overdue_cadence_multiple": {
            "title": "Overdue Cadence Multiple",
            "type": "integer"
          },
          "overdue_floor_days": {
            "title": "Overdue Floor Days",
            "type": "number"
          },
          "skipped_fires_window_days": {
            "title": "Skipped Fires Window Days",
            "type": "integer"
          }
        },
        "required": [
          "consecutive_errors",
          "consecutive_zeros",
          "min_baseline_runs",
          "flatline_runs",
          "overdue_cadence_multiple",
          "overdue_floor_days",
          "cadence_lag_multiple",
          "min_runs_for_cadence",
          "skipped_fires_window_days"
        ],
        "title": "WatchdogThresholds",
        "type": "object"
      },
      "WatchdogUnjudged": {
        "additionalProperties": true,
        "description": "Something the watchdog is watching and cannot judge yet.\n\nThe other half of an empty findings list: silence from a monitor means\neither \"nothing is wrong\" or \"nothing has been measured\", and this list is\nthe second. ``runs_not_a_measurement`` is present on a source row and\nabsent on a routine row, so it is optional and the route excludes unset.",
        "properties": {
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "runs_needed": {
            "title": "Runs Needed",
            "type": "integer"
          },
          "runs_not_a_measurement": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Runs Not A Measurement"
          },
          "runs_recorded": {
            "title": "Runs Recorded",
            "type": "integer"
          },
          "scope": {
            "additionalProperties": true,
            "title": "Scope",
            "type": "object"
          }
        },
        "required": [
          "scope",
          "reason",
          "runs_recorded",
          "runs_needed"
        ],
        "title": "WatchdogUnjudged",
        "type": "object"
      },
      "WatchdogWatching": {
        "additionalProperties": true,
        "description": "How many sources and active routines the counts above are over.",
        "properties": {
          "routines": {
            "title": "Routines",
            "type": "integer"
          },
          "sources": {
            "title": "Sources",
            "type": "integer"
          }
        },
        "required": [
          "sources",
          "routines"
        ],
        "title": "WatchdogWatching",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "resmon"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/admin/erase-ai-keys": {
      "post": {
        "operationId": "admin_erase_ai_keys_api_admin_erase_ai_keys_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiKeysErased"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Admin Erase Ai Keys"
      }
    },
    "/api/admin/erase-app-data": {
      "post": {
        "description": "Erase the corpus + configs + executions + every API key.\n\nThe corpus is included: \"All app data\" that left every collected paper\nbehind would not describe what this does.",
        "operationId": "admin_erase_app_data_api_admin_erase_app_data_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppDataErased"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Erase App Data"
      }
    },
    "/api/admin/erase-configs": {
      "post": {
        "operationId": "admin_erase_configs_api_admin_erase_configs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationsErased"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Erase Configs"
      }
    },
    "/api/admin/erase-corpus": {
      "post": {
        "description": "Erase every collected paper. Executions, configs and keys are kept.",
        "operationId": "admin_erase_corpus_api_admin_erase_corpus_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorpusErased"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Erase Corpus"
      }
    },
    "/api/admin/erase-execution-data": {
      "post": {
        "description": "Erase all configs + all executions. Settings and API keys untouched.",
        "operationId": "admin_erase_execution_data_api_admin_erase_execution_data_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionDataErased"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Erase Execution Data"
      }
    },
    "/api/admin/erase-executions": {
      "post": {
        "operationId": "admin_erase_executions_api_admin_erase_executions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionsErased"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Erase Executions"
      }
    },
    "/api/admin/erase-repo-keys": {
      "post": {
        "operationId": "admin_erase_repo_keys_api_admin_erase_repo_keys_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryKeysErased"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Admin Erase Repo Keys"
      }
    },
    "/api/admin/factory-reset": {
      "post": {
        "description": "Erase every secret, config, execution, setting, and collected paper.\n\nThe corpus is included: a \"factory reset\" that left tens of thousands of\npapers on disk would be the most misleading label in the app.",
        "operationId": "admin_factory_reset_api_admin_factory_reset_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FactoryReset"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Factory Reset"
      }
    },
    "/api/admin/reset-settings": {
      "post": {
        "description": "Reset every setting plus erase every API key. Configs/executions kept.",
        "operationId": "admin_reset_settings_api_admin_reset_settings_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsReset"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Reset Settings"
      }
    },
    "/api/ai/cli/sign-in": {
      "get": {
        "description": "Ask the command itself whether it is signed in. No model call, no cost.\n\nRuns ``claude auth status --json`` or ``codex login status`` in the\nenvironment the lanes use, and answers with what is safe to show. Nothing\nis stored: the next check runs the command again. Called when Settings ›\nAI is opened and on Check again, never on a timer.",
        "operationId": "check_ai_cli_sign_in_api_ai_cli_sign_in_get",
        "parameters": [
          {
            "in": "query",
            "name": "provider",
            "required": true,
            "schema": {
              "maxLength": 32,
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "purpose",
            "required": false,
            "schema": {
              "default": "summaries",
              "maxLength": 32,
              "title": "Purpose",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "binary_path",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4096,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Binary Path"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCliSignIn"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check Ai Cli Sign In"
      },
      "post": {
        "description": "Start the command's own login in a terminal, or say the command to run.\n\nThe sign-in happens between the person and the provider, in the command's\nown login; resmon does not see or keep it. On macOS a ``.command`` script in\nresmon's state directory is opened with ``open`` (``RESMON_SIGN_IN_OPENER``\nnames another opener, for a test that must not open Terminal); elsewhere\nthe command is returned to be copied.",
        "operationId": "open_ai_cli_sign_in_api_ai_cli_sign_in_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiCliSignInBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCliSignInOpened"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Open Ai Cli Sign In"
      }
    },
    "/api/ai/last-answered": {
      "get": {
        "description": "Which model last answered each requested alias, from answers already kept.\n\nAn alias resolves to the CLI's newest model when it runs, so the version is\nknown only once an answer reports it. The pickers say \"Haiku 5.5 when it\nlast answered\" from this, and only the alias where nothing has answered yet.",
        "operationId": "get_ai_last_answered_api_ai_last_answered_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiLastAnswered"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Ai Last Answered"
      }
    },
    "/api/ai/models": {
      "post": {
        "description": "Return the list of model IDs the BYOK credential can access.\n\nThe caller may send a freshly-typed ``key`` or rely on the credential\nalready stored in the OS keyring for ``{provider}_api_key`` (or\n``custom_llm_api_key`` for the Custom provider). ``local`` uses no\nkey and requires ``endpoint`` instead.",
        "operationId": "list_ai_models_api_ai_models_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AIModelsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Ai Models"
      }
    },
    "/api/analytics/discovery-lag": {
      "get": {
        "description": "Median days between publication and resmon first seeing each paper.",
        "operationId": "analytics_discovery_lag_api_analytics_discovery_lag_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryLag"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Analytics Discovery Lag"
      }
    },
    "/api/analytics/keyword-contribution": {
      "get": {
        "description": "Per keyword: papers it found that no other keyword did.\n\nScoped to one execution with ``?execution_id=``, otherwise to every keyword\never searched against the whole corpus. Cached like the other analytics —\nit reads every candidate document once, which is not free on a large corpus.",
        "operationId": "analytics_keyword_contribution_api_analytics_keyword_contribution_get",
        "parameters": [
          {
            "in": "query",
            "name": "execution_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Execution Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeywordContribution"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Analytics Keyword Contribution"
      }
    },
    "/api/analytics/overview": {
      "get": {
        "description": "Everything the Analytics page needs, in one round trip.",
        "operationId": "analytics_overview_api_analytics_overview_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsOverview"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Analytics Overview"
      }
    },
    "/api/analytics/publication-volume": {
      "get": {
        "description": "Papers per publication month, split by source or subject category.",
        "operationId": "analytics_publication_volume_api_analytics_publication_volume_get",
        "parameters": [
          {
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "default": "source",
              "title": "Group By",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "months",
            "required": false,
            "schema": {
              "default": 12,
              "title": "Months",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicationVolume"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Analytics Publication Volume"
      }
    },
    "/api/analytics/routine-health": {
      "get": {
        "description": "Per routine: new results per run, and whether it has gone quiet.",
        "operationId": "analytics_routine_health_api_analytics_routine_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineHealth"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Analytics Routine Health"
      }
    },
    "/api/analytics/source-contribution": {
      "get": {
        "description": "Per source: papers delivered, and how many nothing else found.",
        "operationId": "analytics_source_contribution_api_analytics_source_contribution_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceContribution"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Analytics Source Contribution"
      }
    },
    "/api/analytics/summary": {
      "get": {
        "operationId": "analytics_summary_api_analytics_summary_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorpusSummary"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Analytics Summary"
      }
    },
    "/api/appearance": {
      "get": {
        "operationId": "get_appearance_api_appearance_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appearance"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Appearance"
      },
      "put": {
        "operationId": "update_appearance_api_appearance_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppearanceBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appearance"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Appearance"
      }
    },
    "/api/assistant/permissions": {
      "post": {
        "description": "Ask the person, and hold this request open until they answer.\n\nCalled by ``assistant_permission_server.py``, not by the renderer. The wait\nis the point: ``claude`` is blocked on this reply and will not run the tool\nuntil it arrives, so a write physically cannot precede the answer.\n\nA card that nobody is listening for is denied immediately rather than left to\ntime out — if the panel has closed the stream, there is no one to ask.",
        "operationId": "open_assistant_permission_api_assistant_permissions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantPermissionOpen"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantPermissionDecision"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Open Assistant Permission"
      }
    },
    "/api/assistant/permissions/{request_id}": {
      "post": {
        "description": "The panel's Allow / Deny.\n\nA second answer to the same request is refused rather than applied: two taps\non a card must not turn a deny into an allow.",
        "operationId": "answer_assistant_permission_api_assistant_permissions__request_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "title": "Request Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantPermissionAnswer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantPermissionAnswered"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Answer Assistant Permission"
      }
    },
    "/api/assistant/sessions": {
      "get": {
        "operationId": "list_assistant_sessions_api_assistant_sessions_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantSessions"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Assistant Sessions"
      },
      "post": {
        "operationId": "create_assistant_session_api_assistant_sessions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantSessionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantSession"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Assistant Session"
      }
    },
    "/api/assistant/sessions/browse": {
      "get": {
        "operationId": "browse_assistant_sessions_api_assistant_sessions_browse_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "before_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 9223372036854775807,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before Id"
            }
          },
          {
            "in": "query",
            "name": "through_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 9223372036854775807,
                  "minimum": 0,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Through Id"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "default": "",
              "maxLength": 200,
              "title": "Q",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantSessionPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Browse Assistant Sessions"
      }
    },
    "/api/assistant/sessions/{session_id}": {
      "delete": {
        "operationId": "delete_assistant_session_api_assistant_sessions__session_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantSessionDeleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Assistant Session"
      },
      "get": {
        "operationId": "get_assistant_session_api_assistant_sessions__session_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantTranscript"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Assistant Session"
      }
    },
    "/api/assistant/sessions/{session_id}/cancel": {
      "post": {
        "description": "Stop the running turn. Idempotent, and it says which happened.",
        "operationId": "cancel_assistant_turn_api_assistant_sessions__session_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantTurnCancelled"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Assistant Turn"
      }
    },
    "/api/assistant/sessions/{session_id}/export": {
      "get": {
        "operationId": "export_assistant_session_api_assistant_sessions__session_id__export_get",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": true,
            "schema": {
              "pattern": "^(json|markdown)$",
              "title": "Format",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantExport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Assistant Session"
      }
    },
    "/api/assistant/sessions/{session_id}/messages": {
      "post": {
        "operationId": "send_assistant_message_api_assistant_sessions__session_id__messages_post",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantMessageBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Assistant Message"
      }
    },
    "/api/assistant/status": {
      "get": {
        "description": "Whether the assistant can run, and if not, the reason in one sentence.\n\nEvery runtime is reported, Codex included, with its reason: a user who has\nCodex installed and sees no mention of it would reasonably conclude resmon\nhad not noticed it.",
        "operationId": "assistant_status_api_assistant_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Assistant Status"
      }
    },
    "/api/auth/renderer-origin": {
      "post": {
        "description": "Allow one more exact renderer origin on this backend.\n\nExists for the daemon. launchd starts it long before any window exists, so\nunlike an Electron-spawned backend it cannot be told its renderer's origin\nat spawn — and \"any loopback origin\" is not trusted, because every other local web\nserver has one. Electron's main process, which read the\ntoken from the daemon's token file, registers its renderer's origin here\nonce it has bound the renderer server.\n\nRefused from a browser: a request carrying an Origin is a page, and a page\nmust not be able to widen the set of pages the backend trusts, even the\nrenderer itself.",
        "operationId": "register_renderer_origin_api_auth_renderer_origin_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RendererOriginBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register Renderer Origin"
      }
    },
    "/api/backup": {
      "post": {
        "description": "Write one bundle: the snapshotted database, the vault's bytes, optionally reports.",
        "operationId": "backup_now_api_backup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupWritten"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Backup Now"
      }
    },
    "/api/backup/drive-upload-notice/acknowledge": {
      "post": {
        "description": "Dismiss the notice that the upload to Google Drive is gone, by deleting the settings it is read from.",
        "operationId": "drive_upload_notice_acknowledge_api_backup_drive_upload_notice_acknowledge_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriveUploadNoticeAcknowledged"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Drive Upload Notice Acknowledge"
      }
    },
    "/api/backup/last": {
      "get": {
        "description": "The last bundle, the last restore outcome, and whether an undo copy exists.",
        "operationId": "backup_last_api_backup_last_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupLast"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Backup Last"
      }
    },
    "/api/backup/verify": {
      "post": {
        "description": "Recompute every hash and report what a restore would and would not do.",
        "operationId": "backup_verify_api_backup_verify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BundleReport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Backup Verify"
      }
    },
    "/api/calendar/events": {
      "get": {
        "operationId": "calendar_events_api_calendar_events_get",
        "parameters": [
          {
            "in": "query",
            "name": "start",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "in": "query",
            "name": "end",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CalendarEvent"
                  },
                  "title": "Response Calendar Events Api Calendar Events Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Calendar Events"
      }
    },
    "/api/configurations": {
      "get": {
        "operationId": "list_configurations_api_configurations_get",
        "parameters": [
          {
            "in": "query",
            "name": "config_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Config Type"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SavedConfiguration"
                  },
                  "title": "Response List Configurations Api Configurations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Configurations"
      },
      "post": {
        "operationId": "create_configuration_api_configurations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Configuration"
      }
    },
    "/api/configurations/archive": {
      "post": {
        "description": "The same archive ``POST /api/configurations/export`` writes, as bytes.\n\nThe export route writes to a folder the engine chooses and answers with\nthe path, which with no export folder chosen is the system's temporary\nfolder. This one answers with the archive itself, so a renderer can hand\nit to the system's save dialog and the person chooses where it goes.\n``export_configs`` builds it, so the two can never be two formats. An id\nthat is no longer saved is left out, as the export route leaves it out, and\na choice with none still saved is a 404 rather than an empty archive.",
        "operationId": "download_configurations_api_configurations_archive_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigExport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The archive, as a download."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Configurations"
      }
    },
    "/api/configurations/export": {
      "post": {
        "operationId": "export_configurations_api_configurations_export_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigExport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationExport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Configurations"
      }
    },
    "/api/configurations/import": {
      "post": {
        "operationId": "import_configurations_api_configurations_import_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_import_configurations_api_configurations_import_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Configurations"
      }
    },
    "/api/configurations/{config_id}": {
      "delete": {
        "operationId": "delete_configuration_endpoint_api_configurations__config_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "title": "Config Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationDeleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Configuration Endpoint"
      },
      "put": {
        "operationId": "update_configuration_endpoint_api_configurations__config_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "title": "Config Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationUpdated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Configuration Endpoint"
      }
    },
    "/api/coverage/source-wall": {
      "get": {
        "description": "Every source's recorded answer to each of the last ``limit`` runs.\n\nThe one read that crosses executions. `/api/executions` and\n`/api/executions/{id}` each carry the coverage of a single run, which\nanswers \"what did this run get\"; nobody could ask \"is my coverage still\nwhat it was\" without opening runs one at a time and comparing them by\nhand. The rows have been on disk since schema 6.\n\nThe cells arrive **classified** -- one of the six states in\n``source_wall.WALL_STATES`` -- rather than as a status and a reason for\nthe caller to interpret. That is deliberate: every place that has\nre-derived this classification has eventually derived it differently, and\nthe last time one did it put a tick on sources that had never been asked.\n\n``limit`` bounds what comes back, not what is read: there is no index on\n``executions.start_time``, so finding the newest runs scans the table and\nsorts. Measured at 0.4 ms over 12 executions and 5.7 ms over 50,000.",
        "operationId": "source_wall_grid_api_coverage_source_wall_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 12,
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceWall"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Source Wall Grid"
      }
    },
    "/api/credentials": {
      "get": {
        "description": "Return per-credential status for every known credential name.\n\nNever returns the raw credential value.\n\nEach entry carries ``present`` (kept for compatibility) and ``status``,\nwhich is ``present``, ``absent`` or ``unreadable``. The last one matters:\nan unsigned macOS build is denied access to keychain items stored under a\ndifferent code signature, and reporting that as \"absent\" tells the user their keys\nare gone when they are simply unreachable. ``keyring_responsive`` is\nFalse once a read has timed out, so the interface can say so once at the\ntop rather than fifteen times over. Each webhook destination's signing\nsecret (``webhook_secret_<id>``) is included for every webhook stored.",
        "operationId": "credentials_presence_api_credentials_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsPresence"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Credentials Presence"
      }
    },
    "/api/credentials/validate": {
      "post": {
        "description": "Test a key against its provider: one typed here, or the AI key already stored.\n\n``valid`` is true only when the provider accepted the key. ``outcome`` and\n``detail`` keep apart what the boolean folds together: a key the provider\nrefused, an answer that says nothing about the key, and a provider resmon\ncould not reach (``credential_manager.probe_api_key``). A stored key is\nread from the keychain here and never returned.",
        "operationId": "validate_credential_api_credentials_validate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialValidate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Validate Credential"
      }
    },
    "/api/credentials/{key_name}": {
      "delete": {
        "operationId": "delete_credential_endpoint_api_credentials__key_name__delete",
        "parameters": [
          {
            "in": "path",
            "name": "key_name",
            "required": true,
            "schema": {
              "title": "Key Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialChanged"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Credential Endpoint"
      },
      "put": {
        "operationId": "store_credential_endpoint_api_credentials__key_name__put",
        "parameters": [
          {
            "in": "path",
            "name": "key_name",
            "required": true,
            "schema": {
              "title": "Key Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialStore"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialChanged"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Store Credential Endpoint"
      }
    },
    "/api/deliveries/{delivery_id}/bundle": {
      "get": {
        "description": "The report bundle a webhook envelope linked to, for whoever holds the link.\n\nThis is the one route in resmon that answers without the local API token,\nand it is the one route that is not for resmon: a webhook receiver is a\nprogram the user pointed a routine at, and handing it the token that opens\nevery route would be a far worse trade than a signature over one delivery\nid with an expiry on it. ``api_auth.AUTH_SIGNED_PATHS`` is where the guard\nsteps aside; everything it checks before the token -- the Host, and a\nbrowser's Origin -- still applies here.\n\nEvery way of not being entitled to the file gets the same 403: a wrong\nsignature, an expired one, a destination with no secret stored, and a\ndelivery that was not a webhook at all. A caller guessing learns only that\nit did not work.",
        "operationId": "delivery_bundle_api_deliveries__delivery_id__bundle_get",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "title": "Delivery Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "exp",
            "required": false,
            "schema": {
              "default": "",
              "title": "Exp",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sig",
            "required": false,
            "schema": {
              "default": "",
              "title": "Sig",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delivery Bundle"
      }
    },
    "/api/deliveries/{delivery_id}/deliver": {
      "post": {
        "description": "Release a delivery that was waiting for review. The only promotion.",
        "operationId": "approve_delivery_api_deliveries__delivery_id__deliver_post",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "title": "Delivery Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryActed"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Approve Delivery"
      }
    },
    "/api/deliveries/{delivery_id}/retry": {
      "post": {
        "description": "Start the attempt sequence again, after the backoff has given up.",
        "operationId": "retry_delivery_api_deliveries__delivery_id__retry_post",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "title": "Delivery Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryActed"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retry Delivery"
      }
    },
    "/api/deliveries/{delivery_id}/skip": {
      "post": {
        "operationId": "skip_delivery_api_deliveries__delivery_id__skip_post",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "title": "Delivery Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryActed"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Skip Delivery"
      }
    },
    "/api/documents/briefs": {
      "post": {
        "description": "A line about each paper asked for, for the plate's hover: title, authors,\nsource and dates. Ids that are not in the corpus are left out, not invented.",
        "operationId": "get_document_briefs_api_documents_briefs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentBriefsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DocumentBrief"
                  },
                  "title": "Response Get Document Briefs Api Documents Briefs Post",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Document Briefs"
      }
    },
    "/api/documents/{doc_id}": {
      "get": {
        "description": "One paper as stored, and where it stands in the reading queue.\n\nThe record exactly as resmon holds it: what the source gave (title,\nauthors, abstract, identifiers, date) and when resmon first saw it. It adds\nnothing the corpus does not hold -- no summary, no score -- so a screen\nthat shows a paper from this shows only what was collected.",
        "operationId": "get_document_api_documents__doc_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Paper"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Document"
      }
    },
    "/api/documents/{doc_id}/lifecycle": {
      "get": {
        "description": "Lifecycle events recorded against one paper.",
        "operationId": "document_lifecycle_api_documents__doc_id__lifecycle_get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Document Lifecycle"
      }
    },
    "/api/documents/{doc_id}/why": {
      "get": {
        "description": "What is locally verifiable about why this paper is in the corpus.",
        "operationId": "document_why_api_documents__doc_id__why_get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "execution_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Execution Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperWhy"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Document Why"
      }
    },
    "/api/documents/{document_id}/links": {
      "get": {
        "description": "What else in the corpus looks like the same work as this paper.\n\nA link is an assertion laid beside two records, never a merge: both rows stay,\nboth provenances stay, and nothing is hidden. Each link names the ``method``\nthat produced it, because \"these two share a DOI\" and \"these two have\nnear-identical titles and nearby vectors\" are different strengths of claim.",
        "operationId": "document_links_api_documents__document_id__links_get",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "required": true,
            "schema": {
              "title": "Document Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Document Links"
      }
    },
    "/api/documents/{document_id}/similar": {
      "get": {
        "description": "The papers nearest this one, with distances and their sources.\n\nCosts one index query and nothing at the provider: the document's vector is\nalready stored, so \"more like this\" never calls an embedding model.",
        "operationId": "document_similar_api_documents__document_id__similar_get",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "required": true,
            "schema": {
              "title": "Document Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "k",
            "required": false,
            "schema": {
              "default": 10,
              "title": "K",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Document Similar"
      }
    },
    "/api/embeddings/backfill": {
      "post": {
        "description": "Embed every document lacking a vector for the active model.\n\nReturns immediately; poll ``GET /api/embeddings/status``. Resumable by\nconstruction — the work remaining is a query, not a stored cursor — so a\ncancelled run restarts where the corpus is, not where the last run thought\nit was.",
        "operationId": "start_embedding_backfill_api_embeddings_backfill_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Start Embedding Backfill"
      }
    },
    "/api/embeddings/backfill/cancel": {
      "post": {
        "description": "Stop after the batch in flight. Vectors already written are kept.",
        "operationId": "cancel_embedding_backfill_api_embeddings_backfill_cancel_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Cancel Embedding Backfill"
      }
    },
    "/api/embeddings/estimate": {
      "get": {
        "description": "What a backfill would cost, before it starts.\n\nBuilt from the real pending set and the real text builder, not from an\naverage: the number a user is shown is computed from the documents that will\nactually be sent.",
        "operationId": "embedding_estimate_api_embeddings_estimate_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Embedding Estimate"
      }
    },
    "/api/embeddings/probe": {
      "post": {
        "description": "Ask the configured (or supplied) lane to embed one short string.\n\nThis is what turns a claim about a provider into a fact about this machine.\n``PROVIDER_EMBEDDING`` says what a vendor serves; only a probe says whether\nthis endpoint, this key and this model answer — and for a local server that\nlists models and still refuses to embed, the probe is the entire difference\nbetween a usable lane and a corpus with nothing to rank.",
        "operationId": "probe_embedding_lane_api_embeddings_probe_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EmbeddingProbeBody"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Probe Embedding Lane"
      }
    },
    "/api/embeddings/rebuild": {
      "post": {
        "description": "Rebuild the vector index from the canonical table.\n\nExposed because the index is derived and the table is not: a database copied\nfrom a machine that could not load the extension arrives with every vector\nand no index, and this is the one action that fixes it.",
        "operationId": "rebuild_embedding_index_api_embeddings_rebuild_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Rebuild Embedding Index"
      }
    },
    "/api/embeddings/status": {
      "get": {
        "description": "N of M embedded with model X, the run, the index, and the extension.",
        "operationId": "embedding_status_api_embeddings_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Embedding Status"
      }
    },
    "/api/evidence/projects": {
      "get": {
        "operationId": "evidence_projects_api_evidence_projects_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceProjects"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Evidence Projects"
      },
      "post": {
        "operationId": "evidence_create_project_api_evidence_projects_post",
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceProjectDetail"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Evidence Create Project"
      }
    },
    "/api/evidence/projects/{project_id}": {
      "get": {
        "operationId": "evidence_project_detail_api_evidence_projects__project_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceProjectDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Project Detail"
      },
      "patch": {
        "operationId": "evidence_rename_project_api_evidence_projects__project_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceProjectDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Rename Project"
      }
    },
    "/api/evidence/projects/{project_id}/answer-previews": {
      "post": {
        "operationId": "selected_answer_preview_api_evidence_projects__project_id__answer_previews_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectedPreview"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer Preview"
      }
    },
    "/api/evidence/projects/{project_id}/answers": {
      "get": {
        "operationId": "selected_answer_history_api_evidence_projects__project_id__answers_get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectedAnswers"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer History"
      },
      "post": {
        "operationId": "selected_answer_send_api_evidence_projects__project_id__answers_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectedAnswer"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer Send"
      }
    },
    "/api/evidence/projects/{project_id}/answers/{answer_id}": {
      "get": {
        "operationId": "selected_answer_detail_api_evidence_projects__project_id__answers__answer_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "answer_id",
            "required": true,
            "schema": {
              "title": "Answer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectedAnswer"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer Detail"
      }
    },
    "/api/evidence/projects/{project_id}/answers/{answer_id}/cancel": {
      "post": {
        "operationId": "selected_answer_cancel_api_evidence_projects__project_id__answers__answer_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "answer_id",
            "required": true,
            "schema": {
              "title": "Answer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectedAnswer"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer Cancel"
      }
    },
    "/api/evidence/projects/{project_id}/answers/{answer_id}/events": {
      "get": {
        "operationId": "selected_answer_events_api_evidence_projects__project_id__answers__answer_id__events_get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "answer_id",
            "required": true,
            "schema": {
              "title": "Answer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer Events"
      }
    },
    "/api/evidence/projects/{project_id}/answers/{answer_id}/export": {
      "get": {
        "operationId": "selected_answer_export_api_evidence_projects__project_id__answers__answer_id__export_get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "answer_id",
            "required": true,
            "schema": {
              "title": "Answer Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Selected Answer Export"
      }
    },
    "/api/evidence/projects/{project_id}/bundle": {
      "post": {
        "operationId": "evidence_bundle_api_evidence_projects__project_id__bundle_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Bundle"
      }
    },
    "/api/evidence/projects/{project_id}/files": {
      "get": {
        "operationId": "evidence_files_api_evidence_projects__project_id__files_get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceMembers"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Files"
      },
      "post": {
        "operationId": "evidence_add_file_api_evidence_projects__project_id__files_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceMemberAdded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Add File"
      }
    },
    "/api/evidence/projects/{project_id}/files/{file_id}": {
      "delete": {
        "operationId": "evidence_remove_file_api_evidence_projects__project_id__files__file_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceMemberRemoved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Remove File"
      }
    },
    "/api/evidence/projects/{project_id}/notes": {
      "get": {
        "operationId": "evidence_notes_api_evidence_projects__project_id__notes_get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceNotes"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Notes"
      },
      "post": {
        "operationId": "evidence_create_note_api_evidence_projects__project_id__notes_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceNoteSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Create Note"
      }
    },
    "/api/evidence/projects/{project_id}/notes/{note_id}": {
      "patch": {
        "operationId": "evidence_edit_note_api_evidence_projects__project_id__notes__note_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "note_id",
            "required": true,
            "schema": {
              "title": "Note Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceNoteSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Edit Note"
      }
    },
    "/api/evidence/projects/{project_id}/reader/{file_id}": {
      "get": {
        "operationId": "evidence_read_api_evidence_projects__project_id__reader__file_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePageText"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Evidence Read"
      }
    },
    "/api/executions": {
      "get": {
        "operationId": "list_executions_api_executions_get",
        "parameters": [
          {
            "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": "type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "in": "query",
            "name": "routine_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Routine Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RunRow"
                  },
                  "title": "Response List Executions Api Executions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Executions"
      }
    },
    "/api/executions/active": {
      "get": {
        "operationId": "active_executions_api_executions_active_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveRuns"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Active Executions"
      }
    },
    "/api/executions/archive": {
      "post": {
        "description": "The same archive ``POST /api/executions/export`` writes, as bytes.\n\nSeveral runs' reports, logs, metadata and search records in one ZIP, built\nby ``_build_execution_zip`` as the export route builds it. The export route\nwrites to a folder the engine chooses and answers with the path; this one\nanswers with the archive itself, so a renderer can hand it to the system's\nsave dialog. A run that no longer exists is left out, as the export route\nleaves it out, and a choice with none left is a 404 rather than an empty\narchive.",
        "operationId": "download_executions_api_executions_archive_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutionExport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The archive, as a download."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Executions"
      }
    },
    "/api/executions/export": {
      "post": {
        "description": "Bundle the reports and logs for the selected executions into a .zip.\n\nThe output path respects the Storage tab's configured export directory\nwhen set; otherwise a temporary file is used. Raises 404 if no executions\nin the selection exist.",
        "operationId": "export_executions_api_executions_export_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutionExport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Executions"
      }
    },
    "/api/executions/{exec_id}": {
      "delete": {
        "description": "Delete a run's record; its report and log files stay where they were written.\n\nThe row goes, and with it, by ``ON DELETE CASCADE``, what each source\nanswered (``execution_sources``), its AI lanes (``execution_ai``), where\nits report was sent (``deliveries``), and its links to the papers it found\n(``execution_documents``). The papers stay in the corpus, and a run\nrestarted from this one stays, without the link back.\n\nA run that is still running is refused with 409. Its worker writes its\npapers, its outcomes and its final status into the row as it goes, and a\nrow deleted under it would turn those writes into failures of a run the\nperson can no longer see.",
        "operationId": "delete_execution_api_executions__exec_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Execution"
      },
      "get": {
        "operationId": "get_execution_api_executions__exec_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "expected_runtime_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Expected Runtime Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Execution"
      }
    },
    "/api/executions/{exec_id}/bundle": {
      "get": {
        "description": "One run's bundle as bytes: the archive ``POST /api/executions/export`` writes.\n\nThe report, its PDF and LaTeX where a LaTeX engine could make them, the\nlog, the metadata and the search record, built by ``_delivery_bundle``,\nthe one builder the export route and the delivery queue share. The export\nroute answers with a path on disk; this one with the archive itself, so a\nrenderer can hand it to the save dialog.",
        "operationId": "download_execution_bundle_api_executions__exec_id__bundle_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The archive, as a download."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Execution Bundle"
      }
    },
    "/api/executions/{exec_id}/cancel": {
      "post": {
        "description": "Request cooperative cancellation of a running execution.\n\nA row that is not in the in-memory ``ProgressStore`` is not cancellable,\nand saying only \"Execution not running\" would read, on an\ninterrupted row, as if resmon had lost track of something. The row's own\nstate belongs in the sentence.\n\n``detail`` stays a **string**. FastAPI will serialise a dict there happily,\nand a renderer that renders ``detail`` directly -- which several of\nresmon's do -- would then show ``[object Object]``. Anything that needs the\nstate structurally reads ``status`` off the row it already has.",
        "operationId": "cancel_execution_api_executions__exec_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunCancelRequested"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Execution"
      }
    },
    "/api/executions/{exec_id}/deliveries": {
      "get": {
        "operationId": "list_execution_deliveries_api_executions__exec_id__deliveries_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Execution Deliveries"
      }
    },
    "/api/executions/{exec_id}/document-ids": {
      "get": {
        "description": "Every paper this run stored that is still in the collection, by id.\n\nThe run's map needs all of them and nothing else about them: the map\nalready holds their positions. The papers themselves are paged by\n``/documents``; ids alone are a few bytes each, so they come whole.",
        "operationId": "get_execution_document_ids_api_executions__exec_id__document_ids_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDocumentIds"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Execution Document Ids"
      }
    },
    "/api/executions/{exec_id}/documents": {
      "get": {
        "description": "One page of the papers this run found, each with its stored id.\n\nResults & Logs listed runs and rendered a Markdown report; the papers\ninside a run were reachable only by reading that text or by exporting the\nwhole file. Neither gives a user something to click, and an execution id is\nnot a paper id -- so the Papers tab needed a route that hands back the\ncorpus-local document ids the rest of the app is keyed on (the same ids\n``include_ids`` carries into a JSON export).\n\nPaged rather than whole: a sweep can return thousands, and a renderer that\nholds all of them is a renderer that stops responding on the run that\nmatters most. ``queue_status`` rides along so the Save control can show the\nstate the database actually holds instead of guessing from what the user\nlast clicked.",
        "operationId": "get_execution_papers_api_executions__exec_id__documents_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "only_new",
            "required": false,
            "schema": {
              "default": false,
              "title": "Only New",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunPapersPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Execution Papers"
      }
    },
    "/api/executions/{exec_id}/log": {
      "get": {
        "operationId": "get_execution_log_api_executions__exec_id__log_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunLog"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Execution Log"
      }
    },
    "/api/executions/{exec_id}/progress/events": {
      "get": {
        "operationId": "get_execution_progress_events_api_executions__exec_id__progress_events_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Execution Progress Events"
      }
    },
    "/api/executions/{exec_id}/progress/stream": {
      "get": {
        "operationId": "stream_progress_api_executions__exec_id__progress_stream_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "last_event_id",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Last Event Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Progress"
      }
    },
    "/api/executions/{exec_id}/references": {
      "get": {
        "description": "Export one run; JSON can explicitly include corpus IDs for follow-up reads.",
        "operationId": "export_execution_references_api_executions__exec_id__references_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "bibtex",
              "title": "Format",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "only_new",
            "required": false,
            "schema": {
              "default": false,
              "title": "Only New",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "include_ids",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Ids",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Execution References"
      }
    },
    "/api/executions/{exec_id}/report": {
      "get": {
        "operationId": "get_execution_report_api_executions__exec_id__report_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunReport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Execution Report"
      }
    },
    "/api/executions/{exec_id}/restart": {
      "post": {
        "description": "Start a fresh execution with the source's parameters, linked back to it.\n\nRestart is not resume. ``progress_events`` is persisted once, at the end,\nso an interrupted run has nothing to resume *from* -- there is no durable\nrecord of which sources it had already asked. What resmon can honestly\noffer is the same search again, and a link saying where it came from.\n\nThe source row is never touched. Its history is what happened, and a\nrestart is a second thing that happened, not a correction of the first.",
        "operationId": "restart_execution_api_executions__exec_id__restart_post",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RestartRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunRestarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Restart Execution"
      }
    },
    "/api/executions/{exec_id}/search-record": {
      "get": {
        "description": "The complete, dated account of one search.\n\n``?format=markdown`` returns a methods-section-shaped document as\n``text/markdown`` rather than JSON.",
        "operationId": "execution_search_record_api_executions__exec_id__search_record_get",
        "parameters": [
          {
            "in": "path",
            "name": "exec_id",
            "required": true,
            "schema": {
              "title": "Exec Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "json",
              "title": "Format",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Execution Search Record"
      }
    },
    "/api/explorer/export": {
      "post": {
        "description": "Export everything matching the current filters, not just the page shown.\n\nReuses the same renderers as the per-execution export; only the way the\ndocuments are selected differs.",
        "operationId": "explorer_export_api_explorer_export_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExplorerExportBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Explorer Export"
      }
    },
    "/api/explorer/facets": {
      "post": {
        "description": "Available filter values and their counts, for the current filters.",
        "operationId": "explorer_facets_api_explorer_facets_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExplorerFilters"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Explorer Facets"
      }
    },
    "/api/explorer/search": {
      "post": {
        "description": "Search the whole corpus. POST because the filter set is a structure.\n\n``sort=\"similarity\"`` embeds the search phrase and re-orders the same\nfiltered set by distance from it. The filters still decide *which* papers;\nthe sort decides only their order, so switching sorts cannot change what a\nuser is looking at.",
        "operationId": "explorer_search_api_explorer_search_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExplorerSearchBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExplorerPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Explorer Search"
      }
    },
    "/api/export/references": {
      "post": {
        "description": "Render one selection, with one entry per stored document ID.\n\nExecution selections are unioned before rendering. Publication date then ID\ndescending fixes order independently of selection order, so BibTeX keys are\nallocated once for the complete file. This never merges corpus records.",
        "operationId": "export_selected_references_api_export_references_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferenceExportBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Selected References"
      }
    },
    "/api/health": {
      "get": {
        "description": "Liveness endpoint. Returns process identity so clients can attach-or-spawn.\n\n``embeddings`` reports whether *this* backend can load the vector extension,\nand why not when it cannot. It is here rather than on a route of its own\nbecause the renderer already reads health on startup to decide what to show,\nand the rule is that a feature whose dependency is missing is\n**absent** rather than present-and-broken: the Explorer's similarity sort and\nthe similar-papers panel are not rendered when this says ``null``. A user is\ntold the reason in Settings, not by a control that does nothing.\n\nThe load is attempted against a real connection on every call rather than\nread from a cached probe. It is a ``dlopen`` of a 165 KB library, and a\nhealth endpoint that answered from memory would keep reporting a capability\nthe process had lost.",
        "operationId": "health_api_health_get",
        "parameters": [
          {
            "in": "query",
            "name": "expected_runtime_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Expected Runtime Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Health"
      }
    },
    "/api/library": {
      "get": {
        "operationId": "library_status_api_library_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Library Status"
      }
    },
    "/api/library/export": {
      "get": {
        "operationId": "library_inventory_api_library_export_get",
        "parameters": [
          {
            "in": "query",
            "name": "expected_vault_id",
            "required": true,
            "schema": {
              "title": "Expected Vault Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "json",
              "title": "Format",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryInventory"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Inventory"
      }
    },
    "/api/library/files": {
      "get": {
        "operationId": "library_list_api_library_files_get",
        "parameters": [
          {
            "in": "query",
            "name": "expected_vault_id",
            "required": true,
            "schema": {
              "title": "Expected Vault Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "default": "",
              "title": "Q",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "through_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Through Id"
            }
          },
          {
            "in": "query",
            "name": "before_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFiles"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library List"
      },
      "post": {
        "operationId": "library_import_api_library_files_post",
        "parameters": [
          {
            "in": "query",
            "name": "expected_vault_id",
            "required": true,
            "schema": {
              "title": "Expected Vault Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filename",
            "required": true,
            "schema": {
              "title": "Filename",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "document_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Document Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryImported"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Import"
      }
    },
    "/api/library/files/{file_id}": {
      "get": {
        "operationId": "library_detail_api_library_files__file_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_vault_id",
            "required": true,
            "schema": {
              "title": "Expected Vault Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFileDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Detail"
      }
    },
    "/api/library/files/{file_id}/open": {
      "post": {
        "operationId": "library_open_api_library_files__file_id__open_post",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryOpenBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryOpened"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Open"
      }
    },
    "/api/library/files/{file_id}/paper-links": {
      "post": {
        "operationId": "library_link_api_library_files__file_id__paper_links_post",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryLinkBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryLinked"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Link"
      }
    },
    "/api/library/files/{file_id}/shared-wording": {
      "get": {
        "description": "The last comparison of this file since the engine started, or that there is none.",
        "operationId": "library_shared_wording_api_library_files__file_id__shared_wording_get",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_vault_id",
            "required": true,
            "schema": {
              "title": "Expected Vault Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_version_id",
            "required": true,
            "schema": {
              "title": "Expected Version Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWordingLibrary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Shared Wording"
      },
      "post": {
        "description": "Compare this file, page by page, with the abstracts and the other Library files.\n\nRuns in the background, one file at a time; the GET beside it reads the answer.",
        "operationId": "library_shared_wording_start_api_library_files__file_id__shared_wording_post",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryOpenBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWordingLibrary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Shared Wording Start"
      }
    },
    "/api/library/files/{file_id}/text": {
      "get": {
        "operationId": "library_read_text_api_library_files__file_id__text_get",
        "parameters": [
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "title": "File Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_vault_id",
            "required": true,
            "schema": {
              "title": "Expected Vault Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_version_id",
            "required": true,
            "schema": {
              "title": "Expected Version Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryText"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Read Text"
      }
    },
    "/api/library/vault": {
      "post": {
        "operationId": "library_create_vault_api_library_vault_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryVaultBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Library Create Vault"
      }
    },
    "/api/lifecycle": {
      "get": {
        "description": "Recorded lifecycle events, and how much of the corpus they cover.",
        "operationId": "lifecycle_report_api_lifecycle_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleReport"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Lifecycle Report"
      }
    },
    "/api/lifecycle/check": {
      "post": {
        "description": "Start a bounded lifecycle check over the least recently checked papers.\n\nReturns immediately. Poll ``GET /api/lifecycle`` for progress and results.",
        "operationId": "lifecycle_check_api_lifecycle_check_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleCheckStarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Lifecycle Check"
      }
    },
    "/api/lifecycle/for-documents": {
      "post": {
        "description": "Lifecycle events for a page of results, in one round trip.\n\nThe Explorer renders fifty papers at a time and needs to badge each one.\nAsking per row would be fifty requests to paint one screen; this is one.\nIds with no events are simply absent from the map.",
        "operationId": "lifecycle_for_documents_api_lifecycle_for_documents_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleForDocumentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleForDocuments"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Lifecycle For Documents"
      }
    },
    "/api/lifecycle/stop": {
      "post": {
        "description": "Ask a running check to stop before its next request.\n\nCooperative rather than abrupt: a request already in flight is answered,\nthe papers whose answers are in keep their results, and the rest stay\nunchecked rather than being recorded as clean.",
        "operationId": "lifecycle_stop_api_lifecycle_stop_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleStopAnswer"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Lifecycle Stop"
      }
    },
    "/api/links/collapse-preview": {
      "post": {
        "description": "Which of these ids a collapse *would* fold, without folding anything.\n\nThe interface asks for this only when the reader has switched collapse on.\nIt returns a grouping; the rows themselves are untouched and the totals a\npage reports are computed without it.",
        "operationId": "links_collapse_preview_api_links_collapse_preview_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentIdsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollapsePreview"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Links Collapse Preview"
      }
    },
    "/api/links/for-documents": {
      "post": {
        "description": "Links for a page of results in one round trip.\n\nThe same shape as ``/api/lifecycle/for-documents`` and for the same reason:\nthe Explorer renders fifty rows, and fifty requests to badge them is the\nthing that endpoint exists to avoid.",
        "operationId": "links_for_documents_api_links_for_documents_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentIdsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperLinks"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Links For Documents"
      }
    },
    "/api/links/scan": {
      "post": {
        "description": "Find near-duplicates across the corpus. Returns immediately.\n\nRefused before it starts when there is nothing to compare, rather than\nrunning and reporting zero — \"no near-duplicates\" and \"nothing is embedded\"\nare different answers and only one of them is about the corpus.",
        "operationId": "links_scan_api_links_scan_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Links Scan"
      }
    },
    "/api/links/scan/cancel": {
      "post": {
        "description": "Stop after the document in flight. Links already written are kept.",
        "operationId": "links_scan_cancel_api_links_scan_cancel_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Links Scan Cancel"
      }
    },
    "/api/links/status": {
      "get": {
        "description": "How many links are stored, by method, and the scan's state.",
        "operationId": "links_status_api_links_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Links Status"
      }
    },
    "/api/map": {
      "get": {
        "description": "Where every paper sits on the Atlas plate, and on what basis.\n\nThe first call on a collection starts a fit in the background and answers\n``fitting``; later calls answer from the fit, placing papers that arrived\nsince. See ``collection_map`` for what a position does and does not say.",
        "operationId": "get_collection_map_api_map_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollectionMap"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Collection Map"
      }
    },
    "/api/map/facets": {
      "get": {
        "description": "What the map's filters and colors read about every paper: its source,\nits dates, its place in the reading queue, whether it is new on Today, and\nthe watches that found it. See ``map_facets`` for what each says.",
        "operationId": "get_map_facets_api_map_facets_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MapFacets"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Map Facets"
      }
    },
    "/api/map/find": {
      "get": {
        "description": "The papers whose title or authors contain ``q``, newest first, for\nlighting them on a map. Fewer than two characters find nothing.",
        "operationId": "find_on_map_api_map_find_get",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "default": "",
              "maxLength": 200,
              "title": "Q",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MapFind"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Find On Map"
      }
    },
    "/api/map/views/{name}": {
      "get": {
        "description": "The filters and colors a map was last left with, and how the list\nbeside it was grouped: Today's (``today``), or every run's map (``run``).",
        "operationId": "get_map_view_api_map_views__name__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MapView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Map View"
      },
      "put": {
        "operationId": "put_map_view_api_map_views__name__put",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapViewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MapView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Map View"
      }
    },
    "/api/onboarding": {
      "get": {
        "description": "What the first-run card renders, as facts rather than as prose.",
        "operationId": "onboarding_state_api_onboarding_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingState"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Onboarding State"
      }
    },
    "/api/onboarding/dismiss": {
      "post": {
        "description": "Put the card away for good.\n\nDeliberately not a settings *group*: a group is something the assistant's\n``update_settings`` reaches, and the assistant putting away the user's own\ngetting-started card is not a write anyone would ask for.",
        "operationId": "dismiss_onboarding_api_onboarding_dismiss_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingDismissed"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Dismiss Onboarding"
      }
    },
    "/api/profiles": {
      "get": {
        "operationId": "list_watch_profiles_api_profiles_get",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Kind"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Watch Profiles"
      },
      "post": {
        "operationId": "create_watch_profile_api_profiles_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchProfileBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfile"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Watch Profile"
      }
    },
    "/api/profiles/import": {
      "post": {
        "description": "Import one or more exported profiles.\n\nReports per profile rather than failing the batch: a file with one bad\nentry should import the rest and say which one it could not read, because\nthe alternative is a user editing JSON to find out which line resmon\nobjected to.",
        "operationId": "import_watch_profiles_api_profiles_import_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileImportBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileImportResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Watch Profiles"
      }
    },
    "/api/profiles/matches/for-documents": {
      "post": {
        "description": "Which watch profiles matched a page of papers, and on what basis.\n\nThe Explorer and the Results list render fifty papers at a time and each\none may carry a basis badge. Asking per row would be fifty requests to\npaint one screen; this is one — the same shape and the same reason as\n``/api/lifecycle/for-documents``.\n\nDeclared **above** ``/api/profiles/{profile_id}`` deliberately. FastAPI\nmatches in declaration order, and a path parameter declared first swallows\na literal segment after it: ``/api/profiles/starter`` was written below\n``/api/profiles/{profile_id}`` once and three tests failed on it.",
        "operationId": "profile_matches_for_documents_api_profiles_matches_for_documents_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileMatchesForDocumentsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileMatchesByDocument"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Profile Matches For Documents"
      }
    },
    "/api/profiles/starter": {
      "get": {
        "description": "The curated set that ships with the app, not yet anybody's profile.\n\nServed rather than bundled into the renderer so the files stay the one\nsource: the picker shows what is on disk, and a user who edits or removes\none sees that.",
        "operationId": "list_starter_profiles_api_profiles_starter_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StarterWatchProfileList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Starter Profiles"
      }
    },
    "/api/profiles/{profile_id}": {
      "delete": {
        "description": "Remove a profile and its matches. **The corpus is untouched.**\n\nA routine pointing at this profile is *named* rather than silently orphaned.\nThere is no foreign key from a routine to a profile — a routine's\nconfiguration is a JSON blob — so the deletion cannot cascade, and the next\nfire of such a routine fails with a sentence saying the profile is gone.\nSaying which routines those are here is the difference between that being a\nsurprise and being a consequence.",
        "operationId": "delete_watch_profile_api_profiles__profile_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileDeleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Watch Profile"
      },
      "get": {
        "operationId": "get_watch_profile_api_profiles__profile_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfile"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Watch Profile"
      },
      "put": {
        "operationId": "update_watch_profile_api_profiles__profile_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchProfileBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfile"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Watch Profile"
      }
    },
    "/api/profiles/{profile_id}/export": {
      "get": {
        "operationId": "export_watch_profile_api_profiles__profile_id__export_get",
        "parameters": [
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileExport"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export Watch Profile"
      }
    },
    "/api/profiles/{profile_id}/lifecycle": {
      "get": {
        "description": "Retractions and other lifecycle findings on this profile's papers.\n\nA **join** over findings resmon already holds, never a new claim: the rule\nthat resmon never asserts a lifecycle event on its own authority is at its\nmost load-bearing here, because a false retraction attached to a named\nperson is defamatory. Every finding carries its notice link and every match\ncarries its basis, so a finding on a `name_only` match is visibly a finding\non a paper that merely has this name on it.",
        "operationId": "get_watch_profile_lifecycle_api_profiles__profile_id__lifecycle_get",
        "parameters": [
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileLifecycle"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Watch Profile Lifecycle"
      }
    },
    "/api/profiles/{profile_id}/matches": {
      "get": {
        "description": "Papers matched to this profile, **each with the basis it was matched on**.\n\nThe basis rides on every row and is never omitted: a list of papers with no\nbasis is exactly the claim resmon refuses to make.",
        "operationId": "get_watch_profile_matches_api_profiles__profile_id__matches_get",
        "parameters": [
          {
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "title": "Profile Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchProfileMatchPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Watch Profile Matches"
      }
    },
    "/api/reading-queue": {
      "get": {
        "description": "One page of saved papers. ``status`` omitted (or ``all``) means both.",
        "operationId": "list_reading_queue_api_reading_queue_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingQueuePage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Reading Queue"
      },
      "post": {
        "description": "Save a stored paper. Saving one already saved returns it unchanged.\n\n201 either way: the request's outcome -- this paper is in the queue -- is\nthe same, and the body carries the entry, so a second click cannot be\nmistaken for a state change. ``saved_at`` in that body is the original save\ntime, which is how a caller can tell the two apart if it needs to.",
        "operationId": "save_to_reading_queue_api_reading_queue_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadingQueueSaveBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingQueueEntry"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Save To Reading Queue"
      }
    },
    "/api/reading-queue/{document_id}": {
      "delete": {
        "description": "Take a paper out of the queue. The paper itself is not touched.\n\n404 when there was nothing to remove, because \"it is gone\" and \"it was\nnever there\" are different answers and the second one usually means the\ninterface is looking at a list somebody else already changed.",
        "operationId": "remove_from_reading_queue_api_reading_queue__document_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "required": true,
            "schema": {
              "title": "Document Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingQueueRemoval"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove From Reading Queue"
      },
      "put": {
        "description": "Mark a saved paper read or unread.",
        "operationId": "set_reading_queue_status_api_reading_queue__document_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "required": true,
            "schema": {
              "title": "Document Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadingQueueStatusBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadingQueueEntry"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Reading Queue Status"
      }
    },
    "/api/renderer/heartbeat": {
      "post": {
        "description": "Renderer-presence ping.\n\nThe Electron renderer posts here every few seconds while it is\nrunning. The backend uses the most recent ping to decide whether\nto suppress its own desktop-notification dispatch (which would\notherwise duplicate the in-renderer ``new Notification(...)`` and,\non macOS, surface under ``Script Editor`` because it's invoked via\n``osascript``). When the heartbeat is stale (renderer closed), the\nbackend resumes dispatching so the headless-daemon path still\nworks.",
        "operationId": "renderer_heartbeat_api_renderer_heartbeat_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RendererHeartbeat"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Renderer Heartbeat"
      }
    },
    "/api/repositories/catalog": {
      "get": {
        "description": "Return the static repository catalog (never returns secrets).",
        "operationId": "repositories_catalog_api_repositories_catalog_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RepositoryCatalogEntry"
                  },
                  "title": "Response Repositories Catalog Api Repositories Catalog Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Repositories Catalog"
      }
    },
    "/api/restore": {
      "post": {
        "description": "Verify a bundle and stage it. The restore itself happens on the next start.",
        "operationId": "restore_stage_api_restore_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreStaged"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Restore Stage"
      }
    },
    "/api/restore/acknowledge": {
      "post": {
        "description": "Dismiss the one-time \"what a restore did not bring back\" card.",
        "operationId": "restore_acknowledge_api_restore_acknowledge_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreAcknowledged"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Restore Acknowledge"
      }
    },
    "/api/restore/cancel": {
      "post": {
        "description": "Forget a staged restore. Nothing had been moved yet, so nothing is undone.",
        "operationId": "restore_cancel_api_restore_cancel_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreCancelled"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Restore Cancel"
      }
    },
    "/api/restore/undo-copy/delete": {
      "post": {
        "description": "Delete the database copies a restore set aside. Irreversible, so confirm-gated.",
        "operationId": "restore_delete_undo_api_restore_undo_copy_delete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreUndoCopiesDeleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Restore Delete Undo"
      }
    },
    "/api/routines": {
      "get": {
        "operationId": "list_routines_api_routines_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RoutineRow"
                  },
                  "title": "Response List Routines Api Routines Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Routines"
      },
      "post": {
        "operationId": "create_routine_api_routines_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutineCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Routine"
      }
    },
    "/api/routines/{routine_id}": {
      "delete": {
        "operationId": "delete_routine_endpoint_api_routines__routine_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Routine Endpoint"
      },
      "get": {
        "description": "Fetch a single routine by ID.\n\nThe renderer's notification path needs the per-routine\n``notify_on_complete`` flag to decide whether to fire a desktop\nnotification under ``notify_automatic_mode == 'selected'``. Without\nthis endpoint the renderer's fetch silently 404s and the per-routine\nopt-in is treated as ``false``, which suppresses notifications even\nwhen the user enabled the per-row toggle.",
        "operationId": "get_routine_api_routines__routine_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Routine"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Routine"
      },
      "put": {
        "operationId": "update_routine_endpoint_api_routines__routine_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutineUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineUpdated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Routine Endpoint"
      }
    },
    "/api/routines/{routine_id}/activate": {
      "post": {
        "operationId": "activate_routine_api_routines__routine_id__activate_post",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineActivation"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Activate Routine"
      }
    },
    "/api/routines/{routine_id}/coverage": {
      "get": {
        "description": "Is this routine finding what its owner meant, and what is it missing?\n\nTwo lists, both scoped to the corpus resmon already holds — which is the one\nclaim this endpoint is entitled to make, and it returns the sentence saying\nso rather than leaving the interface to remember it.",
        "operationId": "routine_coverage_api_routines__routine_id__coverage_get",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineCoverage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Routine Coverage"
      }
    },
    "/api/routines/{routine_id}/deactivate": {
      "post": {
        "operationId": "deactivate_routine_api_routines__routine_id__deactivate_post",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineActivation"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deactivate Routine"
      }
    },
    "/api/routines/{routine_id}/deliveries": {
      "get": {
        "operationId": "list_routine_deliveries_api_routines__routine_id__deliveries_get",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineDeliveries"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Routine Deliveries"
      }
    },
    "/api/routines/{routine_id}/delivery-targets": {
      "get": {
        "operationId": "list_routine_delivery_targets_api_routines__routine_id__delivery_targets_get",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryTargets"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Routine Delivery Targets"
      },
      "post": {
        "operationId": "add_routine_delivery_target_api_routines__routine_id__delivery_targets_post",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryTargetCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryTargetAdded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Routine Delivery Target"
      }
    },
    "/api/routines/{routine_id}/delivery-targets/{target_id}": {
      "delete": {
        "operationId": "delete_routine_delivery_target_api_routines__routine_id__delivery_targets__target_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "target_id",
            "required": true,
            "schema": {
              "title": "Target Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Routine Delivery Target"
      },
      "put": {
        "operationId": "update_routine_delivery_target_api_routines__routine_id__delivery_targets__target_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "target_id",
            "required": true,
            "schema": {
              "title": "Target Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryTargetUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Routine Delivery Target"
      }
    },
    "/api/routines/{routine_id}/documents": {
      "get": {
        "description": "The papers this routine's runs collected: a watch's constellation.\n\nIds only, newest run first and each paper once, because what a screen does\nwith them is mark them on the collection map; a page of records is the\nExplorer's job. ``total`` counts all of them, so a screen whose ``limit``\ncut the list short can say so rather than imply the marks are complete.",
        "operationId": "routine_documents_api_routines__routine_id__documents_get",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 2000,
              "maximum": 10000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineDocuments"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Routine Documents"
      }
    },
    "/api/routines/{routine_id}/run": {
      "post": {
        "description": "Run a routine immediately, outside its schedule.\n\nRoutines can be activated or deactivated, and without this route running\none now would mean rebuilding its configuration by hand as a sweep. That\nwould be a gap in the application rather than only in the tool surface -- \"run my arXiv routine\nnow\" is something a person should be able to do from the interface too.\n\nDeliberately a thin wrapper over ``_dispatch_routine_fire``, the same\nfunction the scheduler calls, so a manual run and a scheduled fire take one\ncode path and cannot drift apart. Everything that makes a scheduled fire\ncorrect -- admission control, the routine_id stamp, progress registration,\nthe last_executed_at update -- applies here for free because it is\nliterally the same code.\n\nAn **inactive** routine does run, and the response says so. ``is_active``\ngoverns whether the scheduler fires a routine on its own; it is not a\nstatement that the routine may never run. Refusing here would mean a user\nhas to activate a routine, run it, and deactivate it again to get one\nresult.\n\nAt the run limit the fire is **queued**, and the answer is a 202 with no\nexecution id, ``queued`` and its place in the queue: it starts on its own\nwhen a run finishes. Only when the queue is full too is it refused (409).",
        "operationId": "run_routine_now_api_routines__routine_id__run_post",
        "parameters": [
          {
            "in": "path",
            "name": "routine_id",
            "required": true,
            "schema": {
              "title": "Routine Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutineRunStarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run Routine Now"
      }
    },
    "/api/scheduler/jobs": {
      "get": {
        "operationId": "get_scheduler_jobs_api_scheduler_jobs_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Scheduler Jobs"
      }
    },
    "/api/scheduler/status": {
      "get": {
        "description": "Whether this database's active routines will fire, and what decides it.\n\nThe Routines page showed **Active** for a routine nothing would ever fire,\nand it looked exactly like one that would. The packaged app starts its own\nbackend with ``RESMON_DISABLE_SCHEDULER=1`` and attaches\nto the background service only when that service is live, has a token file\nand runs the same version. When it does not attach, nothing fires -- and\n``_record_missed_fires`` never runs, because it runs only where a scheduler\nstarts, so the missed-fire count stays empty however many fires were\nmissed. A routine that does not run and a routine that runs and finds\nnothing must not look the same; this is what lets the page tell them apart.\n\n**What decides a routine's verdict.** Every released resmon keeps\nAPScheduler's job store inside the corpus file itself\n(``scheduler._DEFAULT_DB_URL`` is built from the same ``DEFAULT_DB_PATH``\nthe corpus opens), and a scheduler fires only what is in its store. So a\nroutine with no job in *this* database's store will not fire, whichever\nprocess runs and whichever database it serves -- and activating a routine\nin a backend with no scheduler writes no job, because the CRUD sync helpers\nreturn early when ``scheduler is None``. That is the case measured on the\nowner's corpus, and it is answered with certainty.\n\nA routine that does have a job here fires only if some live scheduler\nserves this file. This backend's own scheduler is known. Another process's\nis not: ``/api/health`` reports ``identity.corpus_id``, and it is ``null``\non every version so far, so no running service can be shown to serve this\ndatabase. Where one is running, or may be, the verdict is ``None`` --\nunconfirmed -- rather than a guess either way. Where no service answers and\nnone is listening, nothing is running a schedule at all, and the verdict is\n``False``.\n\nThe states, for a backend with no scheduler of its own, come from the\ndaemon-status probe: ``no_service`` / ``service_stopped`` (nothing\nanswers; unit file absent / present), ``service_other_version`` (a service\nanswered as a version this app does not attach to),\n``service_elsewhere`` (one of this version answered, and it is another\nprocess), ``service_unreachable`` (the lock names a service that did not\nanswer cleanly), and ``scheduler_off`` (the lock names this very process,\nstarted with its scheduler turned off). Nothing here starts, stops or\nchanges a schedule.",
        "operationId": "scheduler_status_api_scheduler_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchedulerStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Scheduler Status"
      }
    },
    "/api/search/dive": {
      "post": {
        "operationId": "search_dive_api_search_dive_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunStarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Dive"
      }
    },
    "/api/search/repositories": {
      "get": {
        "operationId": "search_repositories_api_search_repositories_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "string"
                  },
                  "title": "Response Search Repositories Api Search Repositories Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Search Repositories"
      }
    },
    "/api/search/sweep": {
      "post": {
        "operationId": "search_sweep_api_search_sweep_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SweepRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunStarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Sweep"
      }
    },
    "/api/service/daemon-status": {
      "get": {
        "description": "Return ground-truth daemon status read from ``daemon.lock``.\n\nUnlike ``/api/health`` (which always describes the\n*current* backend), this endpoint reads the on-disk daemon lock file\nand probes the daemon's actual port. The Advanced tab uses it so that\na renderer-spawned fallback backend cannot masquerade as the daemon.\n\nResponse shape::\n\n    {\n      \"lock_present\": bool,\n      \"running\": bool,                # true iff lock present AND health probe succeeds\n      \"pid\": int | None,              # from the live health probe\n      \"port\": int | None,\n      \"version\": str | None,\n      \"started_at\": str | None,\n      \"lock_pid\": int | None,         # raw lock-file payload (for diagnostics)\n      \"lock_port\": int | None,\n      \"lock_version\": str | None,\n      \"error\": str | None,            # populated when lock_present but probe failed\n    }",
        "operationId": "service_daemon_status_api_service_daemon_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DaemonStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Service Daemon Status"
      }
    },
    "/api/service/install": {
      "post": {
        "description": "Render the platform unit template and write it to the install path.\n\n``register=True`` additionally asks the OS service manager to enable the\nunit at login (launchctl / systemctl / schtasks).",
        "operationId": "service_install_api_service_install_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceInstallBody",
                "default": {
                  "register": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceInstalled"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Service Install"
      }
    },
    "/api/service/status": {
      "get": {
        "description": "Return whether the daemon unit file is installed and its path.",
        "operationId": "service_status_api_service_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Service Status"
      }
    },
    "/api/service/uninstall": {
      "post": {
        "description": "Remove the unit file; optionally deregister with the OS first.",
        "operationId": "service_uninstall_api_service_uninstall_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceInstallBody",
                "default": {
                  "register": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUninstalled"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Service Uninstall"
      }
    },
    "/api/settings/ai": {
      "get": {
        "operationId": "get_ai_settings_api_settings_ai_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSettings"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Ai Settings"
      },
      "put": {
        "operationId": "update_ai_settings_api_settings_ai_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Ai Settings"
      }
    },
    "/api/settings/ai/cli-status": {
      "get": {
        "description": "Report whether each subscription-lane CLI can be found, and where.\n\nDetection only — this never runs the binary, so it cannot say whether\nanyone is logged in. That distinction is deliberate and is carried in the\nresponse: a CLI that is present but logged out fails on first use with\n``CLI_AUTH``, and claiming \"ready\" here would be a promise this endpoint\nhas not checked.\n\n``tried`` is returned because \"not found\" on its own is unhelpful. A\npackaged app launched from the Finder searches a far smaller PATH than a\nterminal does, so showing the candidate paths is what lets someone see that\nresmon looked in the wrong place rather than that their CLI is broken.",
        "operationId": "get_ai_cli_status_api_settings_ai_cli_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCliStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Ai Cli Status"
      }
    },
    "/api/settings/assistant": {
      "get": {
        "operationId": "get_assistant_settings_api_settings_assistant_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssistantSettings"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Assistant Settings"
      },
      "put": {
        "operationId": "update_assistant_settings_api_settings_assistant_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Assistant Settings"
      }
    },
    "/api/settings/email": {
      "get": {
        "operationId": "get_email_settings_api_settings_email_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSettings"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Email Settings"
      },
      "put": {
        "operationId": "update_email_settings_api_settings_email_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Email Settings"
      }
    },
    "/api/settings/email/test": {
      "post": {
        "description": "Send a test email using the currently-stored SMTP settings.\n\nLoads the SMTP config via the same helper used for routine\ncompletion emails (settings table + keychain for the password) and\ninvokes :func:`email_notifier.send_test_email`. Returns HTTP 400\nwith a human-readable reason when configuration is incomplete or\nthe SMTP handshake fails.",
        "operationId": "send_test_email_endpoint_api_settings_email_test_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestEmailSent"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Send Test Email Endpoint"
      }
    },
    "/api/settings/embeddings": {
      "get": {
        "description": "The stored settings, plus everything the tab needs to render honestly.\n\n``providers`` carries a *can embed* answer for every provider resmon lists,\nincluding the ones that cannot, so the interface states the limitation rather\nthan quietly omitting the option. The evidence string travels with it: a user\nreading \"Anthropic does not offer an embeddings API\" can see what that rests\non.",
        "operationId": "get_embedding_settings_api_settings_embeddings_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingSettingsPage"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Embedding Settings"
      },
      "put": {
        "description": "Store the settings, refusing a provider that cannot embed.\n\nThe refusal is **here**, at configuration, and not at backfill. A user\nwho picks Anthropic learns it when they pick it, with the reason, rather than\nafter waiting for a run that was never going to produce anything.",
        "operationId": "update_embedding_settings_api_settings_embeddings_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingSettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Embedding Settings"
      }
    },
    "/api/settings/execution": {
      "get": {
        "operationId": "get_execution_settings_api_settings_execution_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionSettings"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Execution Settings"
      },
      "put": {
        "operationId": "update_execution_settings_api_settings_execution_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutionSettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionSettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Execution Settings"
      }
    },
    "/api/settings/notifications": {
      "get": {
        "operationId": "get_notification_settings_api_settings_notifications_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationSettings"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Notification Settings"
      },
      "put": {
        "operationId": "update_notification_settings_api_settings_notifications_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Notification Settings"
      }
    },
    "/api/settings/storage": {
      "get": {
        "operationId": "get_storage_settings_api_settings_storage_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageSettings"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Storage Settings"
      },
      "put": {
        "operationId": "update_storage_settings_api_settings_storage_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSaved"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Storage Settings"
      }
    },
    "/api/shared-wording": {
      "get": {
        "description": "The last scan, the scan in progress, and the pairs it found by group.\n\nSee ``shared_wording`` for what each number means, which pairs are shown,\nand what the method cannot see.",
        "operationId": "shared_wording_overview_api_shared_wording_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWording"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Shared Wording Overview"
      }
    },
    "/api/shared-wording/pairs/{a}/{b}": {
      "get": {
        "description": "Two abstracts side by side, the passages they share, and the numbers.",
        "operationId": "shared_wording_pair_api_shared_wording_pairs__a___b__get",
        "parameters": [
          {
            "in": "path",
            "name": "a",
            "required": true,
            "schema": {
              "title": "A",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "b",
            "required": true,
            "schema": {
              "title": "B",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWordingPair"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Shared Wording Pair"
      }
    },
    "/api/shared-wording/papers/{document_id}": {
      "get": {
        "description": "The pairs one paper is in, for its page.",
        "operationId": "shared_wording_for_paper_api_shared_wording_papers__document_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "required": true,
            "schema": {
              "title": "Document Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWordingForPaper"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Shared Wording For Paper"
      }
    },
    "/api/shared-wording/scan": {
      "post": {
        "description": "Compare every abstract with every other, in the background. Returns at once.",
        "operationId": "shared_wording_scan_api_shared_wording_scan_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWordingJob"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Shared Wording Scan"
      }
    },
    "/api/shared-wording/scan/cancel": {
      "post": {
        "description": "Stop the scan in progress. The answer stored before it is kept.",
        "operationId": "shared_wording_scan_cancel_api_shared_wording_scan_cancel_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedWordingCancel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Shared Wording Scan Cancel"
      }
    },
    "/api/today": {
      "get": {
        "description": "The papers resmon first collected since Today was last looked at, by watch.\n\nSee ``today`` for what \"new\", \"looked\" and \"watch\" mean. Reading this does\nnot mark anything looked at; ``POST /api/today/looked`` does.",
        "operationId": "get_today_api_today_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Today"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Today"
      }
    },
    "/api/today/looked": {
      "post": {
        "description": "Record that Today was looked at now: the next window starts here.",
        "operationId": "mark_today_looked_api_today_looked_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TodayLooked"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Mark Today Looked"
      }
    },
    "/api/watchdog": {
      "get": {
        "description": "Findings, what could not be judged yet, and the thresholds used.",
        "operationId": "watchdog_report_api_watchdog_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchdogReport"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Watchdog Report"
      }
    },
    "/api/watchdog/mute": {
      "post": {
        "description": "Acknowledge one finding so it stops counting toward the alarm total.\n\nMuting is per finding, never per source or per routine: the mute is dropped\nautomatically once the condition clears, so the same source failing again\nlater is reported again.",
        "operationId": "watchdog_mute_api_watchdog_mute_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchdogMuteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchdogMuteAck"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Watchdog Mute"
      }
    },
    "/api/watchdog/unmute": {
      "post": {
        "description": "Un-acknowledge a finding, returning it to the alarm total.",
        "operationId": "watchdog_unmute_api_watchdog_unmute_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchdogMuteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchdogMuteAck"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Watchdog Unmute"
      }
    }
  }
}
