{
  "openapi": "3.0.3",
  "info": {
    "title": "MoolBase pilot HTTP API",
    "version": "0.6.0-audit.3",
    "description": "Versioned routes in the audit.3 evaluation package. Run your own local pilot server; the Evidence Lab website does not host these endpoints. GrapheneDB is the internal implementation name. HTTP does not expose the complete native correction/retirement lifecycle or persist prior reasoning state. Experimental learning routes do not provide an autonomous action service. Scores are not calibrated probabilities."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:8080",
      "description": "Your local pilot server; not the public website"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "security": [],
        "summary": "Liveness probe",
        "responses": {
          "200": {
            "description": "Process is alive",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Probes"
        ],
        "operationId": "get-v1-health",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/ready": {
      "get": {
        "security": [],
        "summary": "Storage and capacity readiness probe",
        "responses": {
          "200": {
            "description": "Ready Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ReadinessUnavailable"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Probes"
        ],
        "operationId": "get-v1-ready",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/version": {
      "get": {
        "security": [],
        "summary": "Server, API, storage-format, and feature discovery",
        "responses": {
          "200": {
            "description": "Version information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Version"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Probes"
        ],
        "operationId": "get-v1-version",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/nodes": {
      "post": {
        "summary": "Create a lattice-backed node",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NodeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "507": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "post-v1-nodes",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/nodes/bulk": {
      "post": {
        "summary": "Atomically create a bounded batch of generated nodes",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkNodeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Atomic batch committed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "507": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "post-v1-nodes-bulk",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/extractions": {
      "post": {
        "summary": "Atomically ingest a bounded typed causal extraction",
        "description": "Generates server-side vectors and commits all new nodes and relations in one durable transaction. Stable source_id plus external_id values make identical requests replay-safe across restarts. A changed replay is rejected rather than silently overwriting or accepting stale data.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractionRequest"
              },
              "example": {
                "schema_version": 1,
                "source_id": "onboarding-incident",
                "signature": 33,
                "nodes": [
                  {
                    "external_id": "release",
                    "content": "release changed pool timeout",
                    "role": "root"
                  },
                  {
                    "external_id": "pool",
                    "content": "connection pool exhausted",
                    "role": "node"
                  },
                  {
                    "external_id": "checkout",
                    "content": "checkout failures increased",
                    "role": "symptom"
                  }
                ],
                "relations": [
                  {
                    "from_external_id": "release",
                    "to_external_id": "pool",
                    "origin": "observed",
                    "role": "mechanistic",
                    "confidence": 0.97,
                    "evidence_id": "config-diff"
                  },
                  {
                    "from_external_id": "pool",
                    "to_external_id": "checkout",
                    "origin": "discovered",
                    "role": "causal",
                    "confidence": 0.96,
                    "evidence_id": "pool-trace"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Extraction committed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractionResponse"
                }
              }
            }
          },
          "200": {
            "description": "Durable idempotent replay with no new writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "507": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "post-v1-extractions",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/nodes/{nodeId}": {
      "get": {
        "summary": "Read a node by ID",
        "parameters": [
          {
            "name": "nodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Node Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "get-v1-nodes-nodeId",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/facts": {
      "post": {
        "summary": "Create a temporal fact",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemporalFactCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "post-v1-facts",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/edges": {
      "post": {
        "summary": "Create a typed edge",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EdgeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "post-v1-edges",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/edges/provenance": {
      "post": {
        "summary": "Create a typed edge with provenance metadata",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EdgeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Evidence"
        ],
        "operationId": "post-v1-edges-provenance",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/search/hybrid": {
      "post": {
        "summary": "Search by the server embedding/vector path",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1
                  },
                  "top_k": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search results Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Retrieval"
        ],
        "operationId": "post-v1-search-hybrid",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/search/lattice": {
      "get": {
        "summary": "Expand a physical lattice neighbourhood",
        "parameters": [
          {
            "name": "node_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "hops",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 16,
              "default": 2
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Neighbour IDs Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Retrieval"
        ],
        "operationId": "get-v1-search-lattice",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/retrieve/bundle": {
      "post": {
        "summary": "Retrieve an explainable bounded evidence bundle from an anchor",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidence bundle Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Retrieval"
        ],
        "operationId": "post-v1-retrieve-bundle",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/retrieve/explain": {
      "post": {
        "summary": "Alias for explainable bounded evidence-bundle retrieval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidence bundle Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Retrieval"
        ],
        "operationId": "post-v1-retrieve-explain",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/retrieve/temporal": {
      "post": {
        "summary": "Retrieve nodes valid at a bounded temporal view",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemporalRetrieveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Temporal results Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Retrieval"
        ],
        "operationId": "post-v1-retrieve-temporal",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/reason/dialectic": {
      "post": {
        "summary": "Run bounded read-only dialectic causal reasoning",
        "description": "Expands competing causal paths, converges without deleting alternatives, applies deterministic opposition, and returns an epistemically qualified synthesis. This operation performs no durable writes.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DialecticRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bounded dialectic result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DialecticResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Reasoning"
        ],
        "operationId": "post-v1-reason-dialectic",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/reason/hypokosh": {
      "post": {
        "summary": "Generate bounded read-only hypothetical proposals",
        "description": "Uses dialectic evidence expansion to produce explicitly hypothetical proposals and discriminating tests. It cannot promote truth or write durable state. When requested, the latest explicitly approved policy for the tenant supplies the bounded retrieval parameters.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HypoKoshRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Hypothesis proposals with no durable writes Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Reasoning"
        ],
        "operationId": "post-v1-reason-hypokosh",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/learning/episodes": {
      "post": {
        "summary": "Record one immutable governed learning episode",
        "description": "Commits one verified or unverified outcome episode atomically through extraction ingest. Tenant plus episode identity is retry-safe; a changed replay is rejected.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LearningEpisode"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Episode committed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "200": {
            "description": "Identical durable replay Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "507": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Experimental learning"
        ],
        "operationId": "post-v1-learning-episodes",
        "x-maturity": "experimental"
      }
    },
    "/v1/learning/policies/evaluate": {
      "post": {
        "summary": "Compare policies without writing or activating one",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyEvaluationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Read-only policy evaluation and data-use metrics Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Experimental learning"
        ],
        "operationId": "post-v1-learning-policies-evaluate",
        "x-maturity": "experimental"
      }
    },
    "/v1/learning/policies/decisions": {
      "post": {
        "summary": "Append an approved policy promotion or rollback event",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Decision event committed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "200": {
            "description": "Identical durable replay Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "507": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Experimental learning"
        ],
        "operationId": "post-v1-learning-policies-decisions",
        "x-maturity": "experimental"
      }
    },
    "/v1/learning/policies/current": {
      "get": {
        "summary": "Read the latest approved policy event for a tenant",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current policy and approval provenance Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Experimental learning"
        ],
        "operationId": "get-v1-learning-policies-current",
        "x-maturity": "experimental"
      }
    },
    "/v1/learning/episodes/quarantine": {
      "post": {
        "summary": "Quarantine an episode from future learning",
        "description": "Legal-hold episodes cannot be quarantined.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "tenant_id",
                  "episode_id"
                ],
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "episode_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Episode quarantined Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Experimental learning"
        ],
        "operationId": "post-v1-learning-episodes-quarantine",
        "x-maturity": "experimental"
      }
    },
    "/v1/metrics": {
      "get": {
        "summary": "Read authenticated JSON runtime metrics",
        "responses": {
          "200": {
            "description": "Runtime metrics Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "get-v1-metrics",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/metrics/prometheus": {
      "get": {
        "summary": "Read authenticated Prometheus metrics",
        "responses": {
          "200": {
            "description": "Prometheus exposition",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "get-v1-metrics-prometheus",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/capacity": {
      "get": {
        "summary": "Inspect physical lattice capacity",
        "responses": {
          "200": {
            "description": "Capacity information Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "get-v1-admin-capacity",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/validate": {
      "post": {
        "summary": "Validate durable and lattice state",
        "responses": {
          "200": {
            "description": "Validation passed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "post-v1-admin-validate",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/checkpoint": {
      "post": {
        "summary": "Checkpoint live state and rotate the WAL",
        "responses": {
          "200": {
            "description": "Checkpoint completed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "post-v1-admin-checkpoint",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/compact": {
      "post": {
        "summary": "Alias for checkpointing live state and rotating the WAL",
        "responses": {
          "200": {
            "description": "Compaction completed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "post-v1-admin-compact",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/inspect": {
      "get": {
        "summary": "Inspect formats, indexes, storage counters, and maintenance state",
        "responses": {
          "200": {
            "description": "Inspection output Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "get-v1-admin-inspect",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/backup": {
      "post": {
        "summary": "Create a filesystem backup",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "destination"
                ],
                "properties": {
                  "destination": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Backup completed Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "post-v1-admin-backup",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/validate/provenance": {
      "post": {
        "summary": "Validate evidence and promotion metadata on visible edges",
        "responses": {
          "200": {
            "description": "Provenance validation result Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "post-v1-admin-validate-provenance",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/admin/lattice/quality": {
      "post": {
        "summary": "Inspect physical lattice quality counters",
        "responses": {
          "200": {
            "description": "Lattice quality result Response fields remain open in this source contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenJsonResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Operations"
        ],
        "operationId": "post-v1-admin-lattice-quality",
        "x-maturity": "controlled-pilot"
      }
    },
    "/v1/reason/runtime": {
      "post": {
        "summary": "Request a combined reasoning result and receipt",
        "description": "Read stored evidence, compare explanations and check opposition within configured limits. Each request creates fresh runtime state. It does not preserve prior decision history or trigger continuously on ingestion. Numeric retrieval options are clamped by this server; query and mode are validated. There is no promise of general accuracy, objective truth or a fixed response time.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeRequest"
              },
              "example": {
                "query": "checkout failures increased",
                "signature": 33,
                "mode": "empirical",
                "minimum_confidence": 0.3,
                "max_hops": 5,
                "max_paths": 32
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result and receipt; HTTP success does not mean the evidence resolved the question.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeResponse"
                },
                "example": {
                  "status": "provisionally_resolved",
                  "primary_node": 0,
                  "confidence": 0.9312,
                  "evidence_edges": [
                    0,
                    1
                  ],
                  "residual_uncertainty": [
                    "Lyapunov energy remains outside the practical stability set",
                    "reasoning dynamics have not reached the practical stability set",
                    "relevant independent route diversity is low",
                    "semantic correctness of the selected target has not been externally verified",
                    "the bundle shows premature pattern lock",
                    "the selected target has fewer than two independent evidence families"
                  ],
                  "stability": {
                    "total": 0.842344,
                    "temporal_consistency": 1,
                    "path_diversity": 0,
                    "degeneracy": 0.503415,
                    "provenance": 1,
                    "contradiction": 0,
                    "pattern_lock": 0.89966,
                    "missing_evidence": 0,
                    "lyapunov_energy": 0.0902508,
                    "lyapunov_state_norm": 1.2664,
                    "lyapunov_goal_reached": false,
                    "stable": false
                  },
                  "lyapunov": {
                    "initial_energy": 0.0902508,
                    "final_energy": 0.0902508,
                    "lower_quadratic_coefficient": 0.05,
                    "upper_quadratic_coefficient": 0.183333,
                    "mean_contraction_ratio": 1,
                    "worst_contraction_ratio": 1,
                    "maximum_energy_increase": 0,
                    "weights_positive": true,
                    "state_bounded": true,
                    "energy_nonnegative": true,
                    "quadratic_bounds_valid": true,
                    "monotonic_nonincreasing": true,
                    "sufficient_decrease": true,
                    "goal_reached": false,
                    "equilibrium_dwell_satisfied": false,
                    "practical_stability_observed": false,
                    "convergence_observed": false,
                    "oscillation_detected": false,
                    "limit_cycle_detected": false,
                    "violations": [],
                    "observations": [
                      {
                        "iteration": 0,
                        "bundle_hash": 6706704419691943034,
                        "energy": 0.0902508,
                        "delta": 0,
                        "relative_delta": 0,
                        "sufficient_decrease": false,
                        "regime": "insufficient_history"
                      },
                      {
                        "iteration": 1,
                        "bundle_hash": 896805685196853332,
                        "energy": 0.0902508,
                        "delta": 0,
                        "relative_delta": 0,
                        "sufficient_decrease": false,
                        "regime": "marginal"
                      }
                    ]
                  },
                  "opposition": {
                    "score": 0,
                    "reexpansion_requested": false,
                    "challenged_claims": []
                  },
                  "self_healing": {
                    "rerun_required": true,
                    "human_review_required": false,
                    "discovery_questions": []
                  },
                  "receipt": {
                    "snapshot_version": 5,
                    "initial_bundle_hash": 10640997147299106970,
                    "final_bundle_hash": 10640997147299106970,
                    "model_world_event_hash": 2051512362056928678,
                    "expansion_rounds": 1,
                    "graphene_executed": true,
                    "fiber_bundle_built": true,
                    "stability_critic_executed": true,
                    "lyapunov_trajectory_executed": true,
                    "lyapunov_certificate_valid": true,
                    "lyapunov_goal_reached": false,
                    "escape_considered": true,
                    "convergence_executed": true,
                    "opposition_executed": true,
                    "governed_projection_executed": true,
                    "no_silent_promotion": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "default": {
            "$ref": "#/components/responses/SharedFailure"
          }
        },
        "tags": [
          "Reasoning"
        ],
        "operationId": "post-v1-reason-runtime",
        "x-maturity": "controlled-pilot"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same configured server API key; not an OAuth token."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Retry key, maximum 128 characters. Scoped to the endpoint.",
        "schema": {
          "type": "string",
          "maxLength": 128
        }
      }
    },
    "responses": {
      "ErrorResponse": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ReadinessUnavailable": {
        "description": "Storage, capacity or shutdown makes the server not ready.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "status",
                "reason"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "not_ready"
                  ]
                },
                "reason": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "SharedFailure": {
        "description": "Request framing, validation, authentication, proxy, rate, timeout, queue or storage error. A busy queue can return plain-text 503. Check Content-Type before decoding JSON.",
        "headers": {
          "Retry-After": {
            "description": "Delay in seconds when supplied by rate or queue limits.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "schemas": {
      "Health": {
        "type": "object",
        "required": [
          "status",
          "engine",
          "server_version",
          "api_version"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "engine": {
            "type": "string"
          },
          "server_version": {
            "type": "string"
          },
          "api_version": {
            "type": "integer"
          }
        }
      },
      "Version": {
        "type": "object",
        "required": [
          "server_version",
          "api_version",
          "storage_formats",
          "features"
        ],
        "properties": {
          "server_version": {
            "type": "string"
          },
          "api_version": {
            "type": "integer"
          },
          "storage_formats": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "NodeCreate": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1048576
          },
          "source": {
            "type": "string"
          },
          "placement_policy": {
            "type": "string",
            "enum": [
              "spiral",
              "semantic",
              "semantic_causal_temporal"
            ]
          },
          "account": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "incident": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          }
        }
      },
      "BulkNodeCreate": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50000,
            "description": "Bounded by the server configuration: default 10000, configurable up to 50000; also limited by request size and available capacity."
          },
          "prefix": {
            "type": "string",
            "maxLength": 4096
          },
          "source": {
            "type": "string"
          }
        }
      },
      "StringMetadata": {
        "type": "object",
        "maxProperties": 128,
        "description": "String-valued metadata. Keys beginning with graphene_ are reserved.",
        "additionalProperties": {
          "type": "string",
          "maxLength": 65536
        }
      },
      "LatticeCoordinate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "q",
          "r"
        ],
        "properties": {
          "q": {
            "type": "integer",
            "format": "int32"
          },
          "r": {
            "type": "integer",
            "format": "int32"
          },
          "layer": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ExtractionNode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "external_id",
          "content"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1048576
          },
          "signature": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "incident": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295
          },
          "role": {
            "type": "string",
            "enum": [
              "node",
              "root",
              "symptom",
              "impact"
            ],
            "default": "node"
          },
          "metadata": {
            "$ref": "#/components/schemas/StringMetadata"
          },
          "lattice": {
            "$ref": "#/components/schemas/LatticeCoordinate"
          },
          "defect_type": {
            "type": "string",
            "enum": [
              "none",
              "vacancy",
              "substitution",
              "stone_wales",
              "strain",
              "doped",
              "boundary"
            ],
            "default": "none"
          }
        }
      },
      "ExtractionRelation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from_external_id",
          "to_external_id"
        ],
        "properties": {
          "from_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "to_external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "origin": {
            "type": "string",
            "enum": [
              "observed",
              "discovered",
              "inferred",
              "reinforced",
              "hypothetical"
            ],
            "default": "observed"
          },
          "role": {
            "type": "string",
            "enum": [
              "mechanistic",
              "compressed",
              "analogical",
              "predictive",
              "causal",
              "contradicts",
              "supports",
              "supersedes"
            ],
            "default": "supports"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.9
          },
          "evidence_id": {
            "type": "string",
            "maxLength": 4096
          },
          "evidence_uri": {
            "type": "string",
            "maxLength": 65536
          },
          "evidence_text": {
            "type": "string",
            "maxLength": 1048576
          },
          "metadata": {
            "$ref": "#/components/schemas/StringMetadata"
          },
          "bond_type": {
            "type": "string",
            "enum": [
              "none",
              "sigma",
              "pi",
              "van_der_waals",
              "defect",
              "synthetic"
            ],
            "default": "none"
          },
          "defect_type": {
            "type": "string",
            "enum": [
              "none",
              "vacancy",
              "substitution",
              "stone_wales",
              "strain",
              "doped",
              "boundary"
            ],
            "default": "none"
          },
          "layer_coupling": {
            "type": "string",
            "enum": [
              "none",
              "same_layer",
              "van_der_waals",
              "bernal_stacked",
              "twisted",
              "synthetic"
            ],
            "default": "same_layer"
          },
          "bond_strength": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.85
          }
        }
      },
      "ExtractionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_id"
        ],
        "anyOf": [
          {
            "required": [
              "nodes"
            ]
          },
          {
            "required": [
              "relations"
            ]
          }
        ],
        "properties": {
          "schema_version": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "source_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "source_uri": {
            "type": "string",
            "maxLength": 65536
          },
          "extraction_run_id": {
            "type": "string",
            "maxLength": 4096
          },
          "layer": {
            "type": "integer",
            "format": "int32",
            "default": 0
          },
          "incident": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295
          },
          "signature": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "place_missing_lattice": {
            "type": "boolean",
            "default": true
          },
          "idempotent": {
            "type": "boolean",
            "default": true
          },
          "nodes": {
            "type": "array",
            "maxItems": 50000,
            "items": {
              "$ref": "#/components/schemas/ExtractionNode"
            },
            "description": "Also bounded by the configured max_bulk_nodes (default 10000), request size and capacity."
          },
          "relations": {
            "type": "array",
            "maxItems": 50000,
            "items": {
              "$ref": "#/components/schemas/ExtractionRelation"
            },
            "description": "Also bounded by the configured max_bulk_nodes (default 10000), request size and capacity."
          }
        }
      },
      "ExtractionResponse": {
        "type": "object",
        "required": [
          "atomic",
          "idempotent",
          "idempotent_replay",
          "inserted_node_ids",
          "existing_node_ids",
          "inserted_edge_ids",
          "external_to_node_id"
        ],
        "properties": {
          "atomic": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "idempotent": {
            "type": "boolean"
          },
          "idempotent_replay": {
            "type": "boolean"
          },
          "inserted_node_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "existing_node_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "inserted_edge_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "external_to_node_id": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "elapsed_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TemporalFactCreate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NodeCreate"
          },
          {
            "type": "object",
            "properties": {
              "documented_at": {
                "type": "string"
              },
              "valid_from": {
                "type": "string"
              },
              "valid_until": {
                "type": "string",
                "nullable": true
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            }
          }
        ]
      },
      "EdgeCreate": {
        "type": "object",
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "integer",
            "minimum": 0
          },
          "to": {
            "type": "integer",
            "minimum": 0
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.9
          },
          "origin": {
            "type": "string",
            "enum": [
              "observed",
              "discovered",
              "inferred",
              "reinforced",
              "hypothetical"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "mechanistic",
              "compressed",
              "analogical",
              "predictive",
              "causal",
              "contradicts",
              "supports",
              "supersedes"
            ]
          },
          "source_id": {
            "type": "string"
          },
          "derived_from": {
            "type": "string"
          },
          "span": {
            "type": "string",
            "description": "Caller-supplied edge metadata."
          },
          "observed_at": {
            "type": "string",
            "description": "Caller-supplied edge metadata."
          },
          "promotion_status": {
            "type": "string",
            "description": "Caller-supplied edge metadata."
          },
          "evidence_ref": {
            "type": "string",
            "description": "Caller-supplied edge metadata."
          },
          "reinforcement_count": {
            "type": "string",
            "description": "Caller-supplied edge metadata."
          },
          "salience_boost": {
            "type": "string",
            "description": "Caller-supplied edge metadata."
          }
        }
      },
      "BundleRequest": {
        "type": "object",
        "required": [
          "anchor"
        ],
        "properties": {
          "anchor": {
            "type": "integer",
            "minimum": 0
          },
          "max_hops": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "default": 3
          },
          "mode": {
            "type": "string",
            "enum": [
              "empirical",
              "balanced",
              "theoretical"
            ],
            "default": "balanced"
          },
          "as_of": {
            "type": "string"
          }
        }
      },
      "TemporalRetrieveRequest": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string"
          },
          "metadata_key": {
            "type": "string"
          },
          "metadata_value": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "default": 100
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          }
        }
      },
      "DialecticRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1048576
          },
          "signature": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Optional unsigned 64-bit semantic signature; zero disables signature filtering."
          },
          "mode": {
            "type": "string",
            "enum": [
              "empirical",
              "balanced",
              "theoretical"
            ],
            "default": "balanced"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "semantic_candidates": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 12
          },
          "max_hops": {
            "type": "integer",
            "minimum": 1,
            "maximum": 16,
            "default": 6
          },
          "max_paths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 256,
            "default": 32
          },
          "max_paths_per_root": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 8
          },
          "max_visited_states": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200000,
            "default": 20000
          },
          "max_opposition_rounds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2,
            "default": 1
          },
          "minimum_confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.45
          },
          "reexpansion_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.25
          }
        }
      },
      "DialecticResponse": {
        "type": "object",
        "required": [
          "initial_bundle",
          "initial_convergence",
          "initial_opposition",
          "final_convergence",
          "final_opposition",
          "synthesis",
          "rounds",
          "durable_writes"
        ],
        "properties": {
          "initial_bundle": {
            "type": "object"
          },
          "initial_convergence": {
            "type": "object"
          },
          "initial_opposition": {
            "type": "object"
          },
          "has_reopened_bundle": {
            "type": "boolean"
          },
          "reopened_bundle": {
            "type": "object"
          },
          "final_convergence": {
            "type": "object"
          },
          "final_opposition": {
            "type": "object"
          },
          "synthesis": {
            "type": "object",
            "required": [
              "has_answer",
              "primary_node",
              "confidence",
              "epistemic_status"
            ],
            "properties": {
              "has_answer": {
                "type": "boolean"
              },
              "primary_node": {
                "type": "integer",
                "minimum": 0
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "epistemic_status": {
                "type": "string",
                "enum": [
                  "abstain",
                  "contested",
                  "provisional",
                  "supported"
                ]
              }
            }
          },
          "rounds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          },
          "durable_writes": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "RetrievalPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "semantic_candidates": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 12
          },
          "max_hops": {
            "type": "integer",
            "minimum": 1,
            "maximum": 16,
            "default": 6
          },
          "max_paths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 256,
            "default": 32
          },
          "max_paths_per_root": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 8
          },
          "max_visited_states": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200000,
            "default": 20000
          },
          "max_opposition_rounds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2,
            "default": 1
          },
          "minimum_confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.45
          },
          "reexpansion_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.25
          }
        }
      },
      "HypoKoshRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DialecticRequest"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "tenant_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "use_active_policy": {
                "type": "boolean",
                "default": false
              },
              "max_hypotheses": {
                "type": "integer",
                "minimum": 1,
                "maximum": 16,
                "default": 8
              }
            }
          }
        ]
      },
      "LearningEpisode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenant_id",
          "episode_id",
          "family",
          "domain",
          "split",
          "query",
          "model_version",
          "policy"
        ],
        "properties": {
          "schema_version": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "tenant_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "episode_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "family": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "domain": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "split": {
            "type": "string",
            "enum": [
              "training",
              "development",
              "evaluation"
            ]
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1048576
          },
          "signature": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "model_version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "policy": {
            "$ref": "#/components/schemas/RetrievalPolicy"
          },
          "outcome_verified": {
            "type": "boolean",
            "default": false
          },
          "verifier_id": {
            "type": "string",
            "maxLength": 256
          },
          "outcome_evidence_id": {
            "type": "string",
            "maxLength": 256
          },
          "task_success": {
            "type": "boolean",
            "default": false
          },
          "causal_f1": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "evidence_coverage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "calibration_error": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "latency_ms": {
            "type": "number",
            "minimum": 0
          },
          "token_cost": {
            "type": "number",
            "minimum": 0
          },
          "action_cost": {
            "type": "number",
            "minimum": 0
          },
          "false_promotion": {
            "type": "boolean",
            "default": false
          },
          "harmful_action": {
            "type": "boolean",
            "default": false
          },
          "unauthorized_action": {
            "type": "boolean",
            "default": false
          },
          "harmful_memory_activation": {
            "type": "boolean",
            "default": false
          },
          "expired_truth_activation": {
            "type": "boolean",
            "default": false
          },
          "intermediate_trace_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "retained_trace_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "decisive_evidence_total": {
            "type": "integer",
            "minimum": 0
          },
          "decisive_evidence_retained": {
            "type": "integer",
            "minimum": 0
          },
          "useful_evidence_total": {
            "type": "integer",
            "minimum": 0
          },
          "useful_evidence_retrieved_at_20": {
            "type": "integer",
            "minimum": 0
          },
          "evidence_node_ids": {
            "type": "array",
            "maxItems": 256,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "legal_hold": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "PolicyEvaluationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenant_id",
          "baseline"
        ],
        "properties": {
          "tenant_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "baseline": {
            "$ref": "#/components/schemas/RetrievalPolicy"
          },
          "options": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "minimum_training_samples": {
                "type": "integer",
                "minimum": 1,
                "default": 2
              },
              "minimum_development_samples": {
                "type": "integer",
                "minimum": 1,
                "default": 1
              },
              "minimum_development_utility_improvement": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "default": 0.02
              },
              "maximum_domain_regression": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "default": 0.02
              },
              "maximum_retention_decisions": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000,
                "default": 1000
              }
            }
          }
        }
      },
      "PolicyDecisionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenant_id",
          "event_id",
          "action",
          "policy",
          "approved",
          "approver_id",
          "evaluation_reference",
          "reason"
        ],
        "properties": {
          "schema_version": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "tenant_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "action": {
            "type": "string",
            "enum": [
              "promote",
              "rollback"
            ]
          },
          "policy": {
            "$ref": "#/components/schemas/RetrievalPolicy"
          },
          "approved": {
            "type": "boolean"
          },
          "approver_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "evaluation_reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "description": "Error code and optional details. Additional fields vary by endpoint."
      },
      "RuntimeResponse": {
        "type": "object",
        "required": [
          "status",
          "primary_node",
          "confidence",
          "evidence_edges",
          "residual_uncertainty",
          "stability",
          "lyapunov",
          "opposition",
          "self_healing",
          "receipt"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "resolved",
              "provisionally_resolved",
              "contested",
              "evidence_required",
              "open",
              "abstain",
              "speculative"
            ]
          },
          "primary_node": {
            "type": "integer"
          },
          "confidence": {
            "type": "number",
            "description": "Runtime score; not a calibrated probability."
          },
          "evidence_edges": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "residual_uncertainty": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stability": {
            "type": "object",
            "required": [
              "total",
              "temporal_consistency",
              "path_diversity",
              "degeneracy",
              "provenance",
              "contradiction",
              "pattern_lock",
              "missing_evidence",
              "lyapunov_energy",
              "lyapunov_state_norm",
              "lyapunov_goal_reached",
              "stable"
            ],
            "properties": {
              "total": {
                "type": "number"
              },
              "temporal_consistency": {
                "type": "integer"
              },
              "path_diversity": {
                "type": "integer"
              },
              "degeneracy": {
                "type": "number"
              },
              "provenance": {
                "type": "integer"
              },
              "contradiction": {
                "type": "integer"
              },
              "pattern_lock": {
                "type": "number"
              },
              "missing_evidence": {
                "type": "integer"
              },
              "lyapunov_energy": {
                "type": "number"
              },
              "lyapunov_state_norm": {
                "type": "number"
              },
              "lyapunov_goal_reached": {
                "type": "boolean"
              },
              "stable": {
                "type": "boolean"
              }
            }
          },
          "lyapunov": {
            "type": "object",
            "required": [
              "initial_energy",
              "final_energy",
              "lower_quadratic_coefficient",
              "upper_quadratic_coefficient",
              "mean_contraction_ratio",
              "worst_contraction_ratio",
              "maximum_energy_increase",
              "weights_positive",
              "state_bounded",
              "energy_nonnegative",
              "quadratic_bounds_valid",
              "monotonic_nonincreasing",
              "sufficient_decrease",
              "goal_reached",
              "equilibrium_dwell_satisfied",
              "practical_stability_observed",
              "convergence_observed",
              "oscillation_detected",
              "limit_cycle_detected",
              "violations",
              "observations"
            ],
            "properties": {
              "initial_energy": {
                "type": "number"
              },
              "final_energy": {
                "type": "number"
              },
              "lower_quadratic_coefficient": {
                "type": "number"
              },
              "upper_quadratic_coefficient": {
                "type": "number"
              },
              "mean_contraction_ratio": {
                "type": "integer"
              },
              "worst_contraction_ratio": {
                "type": "integer"
              },
              "maximum_energy_increase": {
                "type": "integer"
              },
              "weights_positive": {
                "type": "boolean"
              },
              "state_bounded": {
                "type": "boolean"
              },
              "energy_nonnegative": {
                "type": "boolean"
              },
              "quadratic_bounds_valid": {
                "type": "boolean"
              },
              "monotonic_nonincreasing": {
                "type": "boolean"
              },
              "sufficient_decrease": {
                "type": "boolean"
              },
              "goal_reached": {
                "type": "boolean"
              },
              "equilibrium_dwell_satisfied": {
                "type": "boolean"
              },
              "practical_stability_observed": {
                "type": "boolean"
              },
              "convergence_observed": {
                "type": "boolean"
              },
              "oscillation_detected": {
                "type": "boolean"
              },
              "limit_cycle_detected": {
                "type": "boolean"
              },
              "violations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "observations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "iteration",
                    "bundle_hash",
                    "energy",
                    "delta",
                    "relative_delta",
                    "sufficient_decrease",
                    "regime"
                  ],
                  "properties": {
                    "iteration": {
                      "type": "integer"
                    },
                    "bundle_hash": {
                      "type": "integer"
                    },
                    "energy": {
                      "type": "number"
                    },
                    "delta": {
                      "type": "integer"
                    },
                    "relative_delta": {
                      "type": "integer"
                    },
                    "sufficient_decrease": {
                      "type": "boolean"
                    },
                    "regime": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "opposition": {
            "type": "object",
            "required": [
              "score",
              "reexpansion_requested",
              "challenged_claims"
            ],
            "properties": {
              "score": {
                "type": "integer"
              },
              "reexpansion_requested": {
                "type": "boolean"
              },
              "challenged_claims": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "self_healing": {
            "type": "object",
            "required": [
              "rerun_required",
              "human_review_required",
              "discovery_questions"
            ],
            "properties": {
              "rerun_required": {
                "type": "boolean"
              },
              "human_review_required": {
                "type": "boolean"
              },
              "discovery_questions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "receipt": {
            "type": "object",
            "required": [
              "snapshot_version",
              "initial_bundle_hash",
              "final_bundle_hash",
              "model_world_event_hash",
              "expansion_rounds",
              "graphene_executed",
              "fiber_bundle_built",
              "stability_critic_executed",
              "lyapunov_trajectory_executed",
              "lyapunov_certificate_valid",
              "lyapunov_goal_reached",
              "escape_considered",
              "convergence_executed",
              "opposition_executed",
              "governed_projection_executed",
              "no_silent_promotion"
            ],
            "properties": {
              "snapshot_version": {
                "type": "integer"
              },
              "initial_bundle_hash": {
                "type": "integer"
              },
              "final_bundle_hash": {
                "type": "integer"
              },
              "model_world_event_hash": {
                "type": "integer"
              },
              "expansion_rounds": {
                "type": "integer"
              },
              "graphene_executed": {
                "type": "boolean"
              },
              "fiber_bundle_built": {
                "type": "boolean"
              },
              "stability_critic_executed": {
                "type": "boolean"
              },
              "lyapunov_trajectory_executed": {
                "type": "boolean"
              },
              "lyapunov_certificate_valid": {
                "type": "boolean"
              },
              "lyapunov_goal_reached": {
                "type": "boolean"
              },
              "escape_considered": {
                "type": "boolean"
              },
              "convergence_executed": {
                "type": "boolean"
              },
              "opposition_executed": {
                "type": "boolean"
              },
              "governed_projection_executed": {
                "type": "boolean"
              },
              "no_silent_promotion": {
                "type": "boolean"
              }
            },
            "description": "The HTTP serializer returns these execution flags and hashes. It does not return the full native event history or save prior reasoning state."
          }
        },
        "description": "Combined HTTP runtime response. This differs from the customer showcase adapter receipt. Read status and uncertainty before using primary_node."
      },
      "RuntimeRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1048576,
            "description": "Nonempty query. The server limits UTF-8 bytes to 1 MiB."
          },
          "signature": {
            "type": "integer",
            "format": "uint64",
            "default": 0,
            "minimum": 0,
            "maximum": 18446744073709551615,
            "description": "Unsigned 64-bit signature. Zero disables signature filtering. Preserve large integers exactly in your client."
          },
          "mode": {
            "type": "string",
            "enum": [
              "empirical",
              "balanced",
              "theoretical"
            ],
            "default": "balanced"
          },
          "as_of": {
            "type": "string"
          },
          "semantic_candidates": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 12
          },
          "max_hops": {
            "type": "integer",
            "minimum": 1,
            "maximum": 16,
            "default": 6
          },
          "max_paths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 256,
            "default": 32
          },
          "max_paths_per_root": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 8
          },
          "max_visited_states": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200000,
            "default": 20000
          },
          "minimum_confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.45
          },
          "reexpansion_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.25
          },
          "max_recursive_cycles": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3,
            "default": 2
          }
        }
      },
      "OpenJsonResponse": {
        "type": "object",
        "additionalProperties": true,
        "description": "Open JSON response. This existing contract does not specify every field; inspect the server response and pinned implementation before depending on optional fields."
      }
    }
  },
  "externalDocs": {
    "url": "https://moolbase.rasvai.com/developers.html",
    "description": "Start with the developer guide"
  },
  "x-source-provenance": {
    "source_commit": "dab6772e6493bd4301761e2bdd1726c4b337a745",
    "package": "0.6.0-audit.3",
    "source_files": {
      "pilot-source.yaml": "8329c192f28004712a1fb1893eba9c2074c22086bfcaa3258b772ff91b085278",
      "runtime-source.yaml": "83b6aa367095e96512cfd386f057f044b3b88b57ee713169527d73a42ef7c7bd"
    },
    "documentation_notes": "Combined shipped contracts, with reviewed defaults, shared errors, examples and runtime response fields. No server implementation changes."
  },
  "tags": [
    {
      "name": "Probes",
      "description": "Check liveness, readiness and version."
    },
    {
      "name": "Evidence",
      "description": "Write and read nodes, facts and typed relationships."
    },
    {
      "name": "Retrieval",
      "description": "Find records and bounded evidence bundles."
    },
    {
      "name": "Reasoning",
      "description": "Compare explanations and inspect reasoning results."
    },
    {
      "name": "Experimental learning",
      "description": "Record supplied outcomes and explicitly approved retrieval policies. Evaluation-only; not autonomous action selection."
    },
    {
      "name": "Operations",
      "description": "Inspect metrics and maintain your local database. Uses the same configured key as other protected routes."
    }
  ]
}
