{
  "openapi": "3.1.0",
  "info": {
    "title": "Glyphd SFT Context Resolver",
    "version": "0.2.0",
    "description": "Fixture-bounded operation compilation, context construction, evidence gating, deterministic solver dispatch, and strategy comparison. The service is read-only, versioned, and does not commit accepted world state."
  },
  "servers": [{ "url": "https://www.glyphd.com" }],
  "paths": {
    "/api/sft/resolve": {
      "get": {
        "summary": "Read the resolver manifest and authored fixture scenarios",
        "responses": {
          "200": {
            "description": "Resolver manifest",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      },
      "post": {
        "summary": "Resolve one operation or compare context strategies",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": ["scenarioId"],
                "properties": {
                  "mode": { "type": "string", "enum": ["resolve", "compare"], "default": "resolve" },
                  "scenarioId": { "type": "string", "enum": ["architecture", "assembly", "robot", "game"] },
                  "query": { "type": "string", "maxLength": 2000 },
                  "command": { "$ref": "https://www.glyphd.com/schemas/semantic-fractal-topology.command.schema.json" },
                  "strategy": { "type": "string", "enum": ["FULL_SCENE", "LEXICAL_TOP_K", "GRAPH_NEIGHBORHOOD", "SFT_OPERATIONAL"], "default": "SFT_OPERATIONAL" },
                  "execute": { "type": "boolean", "default": true },
                  "lexicalLimit": { "type": "integer", "minimum": 2, "maximum": 12, "default": 5 }
                },
                "oneOf": [{ "required": ["query"] }, { "required": ["command"] }]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Context resolution or comparison",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    { "$ref": "https://www.glyphd.com/schemas/sft-resolver-response.schema.json" },
                    { "type": "object", "required": ["schemaVersion", "sceneRevision", "oracle", "rows"] }
                  ]
                }
              }
            }
          },
          "400": { "description": "Invalid or unsupported request" },
          "413": { "description": "Request body exceeds 100 KB" }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "summary": "Stateless MCP Streamable HTTP endpoint",
        "description": "Accepts one JSON-RPC 2.0 MCP request per POST. Initialize, tools, and resources are supported. GET/SSE is intentionally disabled.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "type": "object" } } }
        },
        "responses": {
          "200": { "description": "JSON-RPC response" },
          "202": { "description": "Notification accepted" },
          "400": { "description": "Invalid JSON-RPC or protocol version" },
          "403": { "description": "Browser Origin is not allowed" }
        }
      },
      "get": {
        "summary": "Report that SSE transport is disabled",
        "responses": { "405": { "description": "Use HTTP POST" } }
      }
    }
  },
  "externalDocs": {
    "description": "Interactive SFT Context Resolver",
    "url": "https://www.glyphd.com/sft/context-resolver"
  }
}
