{
  "openapi": "3.1.0",
  "info": {
    "title": "SophiaLabs & Nomos Public Repository X-Ray & Corpus API",
    "version": "4.38.0",
    "description": "Read-only static AST X-Ray API (<= 100MB public GitHub tarballs, zero code execution), SVG score badges, and Markdown agent twins."
  },
  "servers": [
    {
      "url": "https://sophialabs.ca"
    }
  ],
  "paths": {
    "/mcp": {
      "get": {
        "operationId": "discoverMcpServer",
        "summary": "Inspect stateless Streamable HTTP MCP protocol versions, read-only tools, resources, and prompts.",
        "responses": {
          "200": {
            "description": "Stateless MCP server metadata and tool schemas"
          }
        }
      },
      "post": {
        "operationId": "invokeMcpJsonRpc",
        "summary": "Execute zero-auth JSON-RPC 2.0 MCP methods (initialize, tools/list, tools/call, resources/read, prompts/get).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 MCP response payload"
          }
        }
      }
    },
    "/api/a2a": {
      "post": {
        "operationId": "invokeA2aJsonRpc",
        "summary": "Execute stateless Agent-to-Agent (A2A) JSON-RPC 2.0 card discovery or deterministic message/send tool routing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 A2A Agent Card or Task artifact response"
          }
        }
      }
    },
    "/docs/specs/capabilities.md": {
      "get": {
        "operationId": "getNomosCapabilitiesMapMarkdown",
        "summary": "Fetch Page 0 SSoT Markdown catalog of all 66 Nomos capabilities, 16 CLI commands, 42 gate ProbeIDs, nomos.yaml contracts, and MCP endpoints.",
        "responses": {
          "200": {
            "description": "Canonical CAPABILITIES.md Markdown document"
          }
        }
      }
    },
    "/api/xray": {
      "get": {
        "operationId": "xrayGitHubRepository",
        "summary": "Scan a public GitHub repository, pull request delta, repo-vs-repo shootout, or organization rollup in under 5s and return deterministic AST metrics.",
        "parameters": [
          {
            "name": "repo",
            "in": "query",
            "required": false,
            "description": "Public GitHub owner/repo slug (for example \"go-chi/chi\")",
            "schema": {
              "type": "string",
              "examples": [
                "go-chi/chi"
              ]
            }
          },
          {
            "name": "pr",
            "in": "query",
            "required": false,
            "description": "Optional public pull request number to compute base-vs-head ratchet delta",
            "schema": {
              "type": "integer",
              "examples": [
                42
              ]
            }
          },
          {
            "name": "vs",
            "in": "query",
            "required": false,
            "description": "Optional rival owner/repo slug for a side-by-side AST shootout",
            "schema": {
              "type": "string",
              "examples": [
                "gin-gonic/gin"
              ]
            }
          },
          {
            "name": "focus",
            "in": "query",
            "required": false,
            "description": "Optional file or directory path to spotlight hotspots and spine membership",
            "schema": {
              "type": "string",
              "examples": [
                "mux.go"
              ]
            }
          },
          {
            "name": "org",
            "in": "query",
            "required": false,
            "description": "Optional GitHub organization or user handle for a multi-repo rollup",
            "schema": {
              "type": "string",
              "examples": [
                "go-chi"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deterministic JSON X-Ray scorecard, PR delta, shootout, or org rollup"
          }
        }
      }
    },
    "/xray/github.com/{owner}/{repo}.md": {
      "get": {
        "operationId": "xrayGitHubRepositoryMarkdown",
        "summary": "Fetch a zero-HTML Markdown X-Ray scorecard for a public GitHub repository.",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown X-Ray scorecard"
          }
        }
      }
    },
    "/api/xray/badge/{owner}/{repo}.svg": {
      "get": {
        "operationId": "getXrayRepoBadgeSvg",
        "summary": "Render an embeddable SVG AI Hangover Score badge for a public GitHub repository.",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SVG badge image"
          }
        }
      }
    }
  }
}