{
  "components": {
    "schemas": {
      "AssertFactRequest": {
        "description": "REST API request body for POST /v1/facts.",
        "properties": {
          "data": {
            "additionalProperties": true,
            "title": "Data",
            "type": "object"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "template": {
            "title": "Template",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "template",
          "data"
        ],
        "title": "AssertFactRequest",
        "type": "object"
      },
      "AssertFactResponse": {
        "description": "REST API response body from POST /v1/facts.",
        "properties": {
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          }
        },
        "title": "AssertFactResponse",
        "type": "object"
      },
      "CompileRequest": {
        "description": "REST API request body for the compile endpoint.",
        "properties": {
          "yaml_content": {
            "maxLength": 1000000,
            "title": "Yaml Content",
            "type": "string"
          }
        },
        "required": [
          "yaml_content"
        ],
        "title": "CompileRequest",
        "type": "object"
      },
      "CompileResponse": {
        "description": "REST API response body from the compile endpoint.",
        "properties": {
          "clips": {
            "title": "Clips",
            "type": "string"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "title": "Errors",
            "type": "array"
          }
        },
        "required": [
          "clips"
        ],
        "title": "CompileResponse",
        "type": "object"
      },
      "ErrorResponse": {
        "description": "REST API error response body.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "error": {
            "title": "Error",
            "type": "string"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field"
          }
        },
        "required": [
          "error",
          "detail"
        ],
        "title": "ErrorResponse",
        "type": "object"
      },
      "EvaluateRequest": {
        "description": "REST API request body for the evaluate endpoint.",
        "properties": {
          "facts": {
            "items": {
              "$ref": "#/components/schemas/FactInput"
            },
            "maxItems": 500,
            "title": "Facts",
            "type": "array"
          },
          "ruleset": {
            "title": "Ruleset",
            "type": "string"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          }
        },
        "required": [
          "facts",
          "ruleset"
        ],
        "title": "EvaluateRequest",
        "type": "object"
      },
      "EvaluateResponse": {
        "description": "REST API response body from the evaluate endpoint.\n\nMirrors :class:`EvaluationResult` field for field, and the gRPC\n``EvaluateResponse`` message alongside it. A caller who moves between the\ntwo transports, or between the library and either of them, should not have\nto discover that one of them drops a field the others carry.",
        "properties": {
          "attestation_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attestation Token"
          },
          "decision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decision"
          },
          "duration_us": {
            "title": "Duration Us",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Metadata",
            "type": "object"
          },
          "module_trace": {
            "items": {
              "type": "string"
            },
            "title": "Module Trace",
            "type": "array"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "rule_trace": {
            "items": {
              "type": "string"
            },
            "title": "Rule Trace",
            "type": "array"
          }
        },
        "required": [
          "decision",
          "reason",
          "rule_trace",
          "module_trace",
          "duration_us"
        ],
        "title": "EvaluateResponse",
        "type": "object"
      },
      "FactInput": {
        "description": "REST API input for a single fact assertion.",
        "properties": {
          "data": {
            "additionalProperties": true,
            "title": "Data",
            "type": "object"
          },
          "template": {
            "title": "Template",
            "type": "string"
          }
        },
        "required": [
          "template",
          "data"
        ],
        "title": "FactInput",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "OPADataRequest": {
        "description": "OPA's Data API request body: `{\"input\": {...}}`.",
        "properties": {
          "input": {
            "additionalProperties": true,
            "title": "Input",
            "type": "object"
          }
        },
        "title": "OPADataRequest",
        "type": "object"
      },
      "OPAErrorResponse": {
        "description": "OPA's error envelope. Declared so the OpenAPI document says so.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "OPAErrorResponse",
        "type": "object"
      },
      "QueryFactsRequest": {
        "description": "REST API request body for POST /v1/query.",
        "properties": {
          "filter": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "template": {
            "title": "Template",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "template"
        ],
        "title": "QueryFactsRequest",
        "type": "object"
      },
      "QueryFactsResponse": {
        "description": "REST API response body from POST /v1/query.",
        "properties": {
          "facts": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Facts",
            "type": "array"
          }
        },
        "required": [
          "facts"
        ],
        "title": "QueryFactsResponse",
        "type": "object"
      },
      "RetractFactsRequest": {
        "description": "REST API request body for DELETE /v1/facts.",
        "properties": {
          "filter": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter"
          },
          "session_id": {
            "title": "Session Id",
            "type": "string"
          },
          "template": {
            "title": "Template",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "template"
        ],
        "title": "RetractFactsRequest",
        "type": "object"
      },
      "RetractFactsResponse": {
        "description": "REST API response body from DELETE /v1/facts.",
        "properties": {
          "retracted_count": {
            "title": "Retracted Count",
            "type": "integer"
          }
        },
        "required": [
          "retracted_count"
        ],
        "title": "RetractFactsResponse",
        "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"
      }
    }
  },
  "info": {
    "description": "Deterministic reasoning runtime for AI agents",
    "title": "Fathom Rules Engine",
    "version": "0.12.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/health": {
      "get": {
        "description": "Health check endpoint.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Health Health Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health"
      }
    },
    "/v1/compile": {
      "post": {
        "description": "Compile YAML content into CLIPS constructs.\n\nRule literals are emitted according to the declared slot type, so this\nendpoint compiles against the templates of the engine mounted on\n``app.state.engine`` when one is configured. Without an engine there is\nno type context available and literals fall back to the untyped form \u2014\nwhich may differ from what ``Engine.from_rules`` builds for the same\nYAML. Post the templates alongside the rules, or use ``fathom compile``\nagainst the ruleset directory, when the exact form matters.\n\nDeclared ``def`` so compilation runs in the threadpool, not on\nthe event loop.",
        "operationId": "compile_yaml_v1_compile_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompileResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body failed validation"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service unavailable"
          }
        },
        "summary": "Compile Yaml"
      }
    },
    "/v1/data/{path}": {
      "get": {
        "description": "The GET form of the Data API, with `input` as a JSON query parameter.\n\nOPA supports it and shell-based checks use it. Note that query strings are\nlogged by intermediaries, so anything sensitive belongs in the POST body.",
        "operationId": "opa_data_get_v1_data__path__get",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "input",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Input"
            }
          },
          {
            "in": "query",
            "name": "template",
            "required": false,
            "schema": {
              "default": "input",
              "title": "Template",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OPAErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OPAErrorResponse"
                }
              }
            },
            "description": "Evaluation failed"
          }
        },
        "summary": "Opa Data Get"
      },
      "post": {
        "description": "Evaluate a ruleset through OPA's Data API.\n\n`POST /v1/data/authz/basic/allow` with `{\"input\": {...}}` answers\n`{\"result\": true}`; drop the trailing `allow`/`deny` to get the whole\ndecision object instead.\n\nDeclared ``def`` for the same reason as ``/v1/evaluate``: CLIPS evaluation\nis blocking CPU work and belongs in the threadpool, not on the event loop.",
        "operationId": "opa_data_v1_data__path__post",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "template",
            "required": false,
            "schema": {
              "default": "input",
              "title": "Template",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OPADataRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OPAErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OPAErrorResponse"
                }
              }
            },
            "description": "Evaluation failed"
          }
        },
        "summary": "Opa Data"
      }
    },
    "/v1/evaluate": {
      "post": {
        "description": "Evaluate facts against a ruleset (stateless or stateful).\n\nRequest-scoped: the supplied facts are asserted, evaluated, then\nwithdrawn (:meth:`Engine.evaluate_once`), so an earlier request on the\nsame session can never change this one's decision.\n\n``ruleset`` names a path under ``FATHOM_RULESET_ROOT`` and is always\nresolved and jailed. It selects the policy only on a server with no\nEngine mounted on ``app.state.engine`` \u2014 the shipped\n``uvicorn fathom.integrations.rest:app`` deployment. A server that\nmounts one serves *that* Engine, because it is the one\n``POST /v1/rules/reload`` swaps and a reload the data plane cannot see\nis not a reload. ``session_id`` is refused there with 400\n``sessions_unavailable`` for the same reason: a session's Engine is\ncompiled from the ruleset the caller named, so opening one would hand\npolicy selection back to the data plane.\n\nDeclared ``def`` (not ``async def``) on purpose: CLIPS evaluation is\nblocking CPU work, so Starlette must run it in the threadpool rather\nthan on the event loop, where one large request stalls every other\nconnection.",
        "operationId": "evaluate_v1_evaluate_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body failed validation"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service unavailable"
          }
        },
        "summary": "Evaluate"
      }
    },
    "/v1/facts": {
      "delete": {
        "description": "Retract facts matching template + optional filter from working memory.\n\nThe ``session_id`` must reference an existing session created via\n``/v1/evaluate``. Unknown session ids return 404. Retract is by\ntemplate + filter (matches the gRPC surface), not by fact index.\n\nDeclared ``def`` so the blocking CLIPS call runs in the threadpool.",
        "operationId": "retract_facts_v1_facts_delete",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetractFactsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetractFactsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body failed validation"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service unavailable"
          }
        },
        "summary": "Retract Facts"
      },
      "post": {
        "description": "Assert a single fact into a session's working memory.\n\nUnlike ``/v1/evaluate``, this endpoint does **not** create sessions on\nthe fly \u2014 the ``session_id`` must reference a session previously\ncreated via ``/v1/evaluate``. Unknown session ids return 404.\n\nDeclared ``def`` so the blocking CLIPS call runs in the threadpool.",
        "operationId": "assert_fact_v1_facts_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssertFactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssertFactResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body failed validation"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service unavailable"
          }
        },
        "summary": "Assert Fact"
      }
    },
    "/v1/modules": {
      "get": {
        "description": "Return all registered module definitions for a session.",
        "operationId": "list_modules_v1_modules_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Session-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Session-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Modules V1 Modules Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Modules"
      }
    },
    "/v1/query": {
      "post": {
        "description": "Query a session's working memory for facts matching template + filter.\n\nThe ``session_id`` must reference an existing session created via\n``/v1/evaluate``. Unknown session ids return 404.\n\nDeclared ``def`` so the blocking CLIPS call runs in the threadpool.",
        "operationId": "query_facts_v1_query_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryFactsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryFactsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid token"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body too large"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request body failed validation"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service unavailable"
          }
        },
        "summary": "Query Facts"
      }
    },
    "/v1/rules": {
      "get": {
        "description": "Return all loaded rule definitions for a session.",
        "operationId": "list_rules_v1_rules_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Session-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Session-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Rules V1 Rules Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Rules"
      }
    },
    "/v1/rules/reload": {
      "post": {
        "description": "Atomically swap the loaded ruleset with a new (optionally signed) one.\n\nRequires the scoped admin token (``FATHOM_ADMIN_TOKEN`` when set, else the\ndata-plane token). Bodies larger than ``FATHOM_MAX_RELOAD_BYTES`` (default\n5 MB) are rejected with 413 before any YAML parsing \u2014 the cap is enforced\non the actual bytes received, not the Content-Length header (chunked\nbodies lie). Rate limiting is host-level (reverse proxy) by design.\n\nSee design C5 / AC-5.1 / AC-5.4\u20135.6 / AC-5.8.",
        "operationId": "reload_rules_v1_rules_reload_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "Request body for ``POST /v1/rules/reload``.\n\nExactly one of ``ruleset_path`` / ``ruleset_yaml`` must be supplied.\n``signature`` is base64-encoded raw 64-byte Ed25519 over the YAML bytes.",
                "properties": {
                  "ruleset_path": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Ruleset Path"
                  },
                  "ruleset_yaml": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Ruleset Yaml"
                  },
                  "signature": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Signature"
                  }
                },
                "title": "RulesetReloadRequest",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reload Rules"
      }
    },
    "/v1/status": {
      "get": {
        "description": "Report engine liveness info: loaded ruleset hash, version, last-load time.\n\nUnauthenticated (matches ``/health``): status is a liveness/info endpoint\nused by orchestrators and operators to confirm which ruleset is live.",
        "operationId": "status_v1_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "title": "Response Status V1 Status Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Status"
      }
    },
    "/v1/templates": {
      "get": {
        "description": "Return all registered template definitions for a session.",
        "operationId": "list_templates_v1_templates_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "in": "header",
            "name": "X-Session-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Session-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Templates V1 Templates Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Templates"
      }
    }
  }
}