{
  "openapi": "3.1.0",
  "info": {
    "title": "PlatPhorm AgentOps",
    "description": "Agent operations discovery for the PlatPhorm News network. Compare the canonical network graph and base sitemap index, inspect local route-safety documentation, and see unsupported capabilities honestly.",
    "version": "0.2.0",
    "contact": {
      "name": "PlatPhorm News",
      "url": "https://platphormnews.com"
    },
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://agentops.platphormnews.com",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Health",
      "description": "Health and status endpoints"
    },
    {
      "name": "Services",
      "description": "Service registry operations"
    },
    {
      "name": "Routes",
      "description": "Route documentation operations"
    },
    {
      "name": "Web Status",
      "description": "Web Status endpoints"
    },
    {
      "name": "Discovery",
      "description": "Discovery and machine-readable files"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Health check",
        "description": "Returns service health status",
        "tags": [
          "Health"
        ],
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "service": {
                      "type": "string"
                    },
                    "site": {
                      "type": "string"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "getVersionedHealth",
        "summary": "Versioned health check",
        "description": "Returns the same runtime-backed health envelope as /api/health.",
        "tags": [
          "Health"
        ],
        "responses": {
          "200": {
            "description": "Current service and dependency state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/storage/status": {
      "get": {
        "operationId": "getStorageStatus",
        "summary": "Storage status",
        "description": "Returns current storage adapter status - no database required",
        "tags": [
          "Health"
        ],
        "responses": {
          "200": {
            "description": "Storage status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageStatus"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services": {
      "get": {
        "operationId": "listServices",
        "summary": "List services",
        "description": "Returns curated service-purpose records. Non-AgentOps status remains unknown until observed.",
        "tags": [
          "Services"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "description": "Filter by category",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of services",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{slug}": {
      "get": {
        "operationId": "getService",
        "summary": "Get service",
        "description": "Returns a specific service by slug",
        "tags": [
          "Services"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Service slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Service not found"
          }
        }
      }
    },
    "/api/v1/routes": {
      "get": {
        "operationId": "listRoutes",
        "summary": "List routes",
        "description": "Returns all documented routes",
        "tags": [
          "Routes"
        ],
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "description": "Filter by service slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "safetyClass",
            "in": "query",
            "description": "Filter by safety class",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of routes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/routes/agent-safe": {
      "get": {
        "operationId": "listAgentSafeRoutes",
        "summary": "List agent-safe routes",
        "description": "Returns routes safe for autonomous agent operation",
        "tags": [
          "Routes"
        ],
        "responses": {
          "200": {
            "description": "List of agent-safe routes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/web/status": {
      "get": {
        "operationId": "getWebStatus",
        "summary": "Web Status",
        "description": "Returns operational readiness status",
        "tags": [
          "Web Status"
        ],
        "responses": {
          "200": {
            "description": "Web Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebStatus"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/network/discovery": {
      "get": {
        "operationId": "getCanonicalNetworkDiscovery",
        "summary": "Discover trusted and pending network domains",
        "description": "Reads the fixed root graph and base sitemap index with validation, size limits, timeout, trusted-domain filtering, and trace propagation.",
        "tags": [
          "Discovery"
        ],
        "responses": {
          "200": {
            "description": "A successful or honestly degraded discovery snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "data": {
            "type": "object"
          },
          "meta": {
            "type": "object",
            "properties": {
              "generatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": "string"
              },
              "traceId": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object"
              }
            }
          }
        }
      },
      "StorageStatus": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string"
              },
              "databaseRequired": {
                "type": "boolean"
              },
              "databaseConfigured": {
                "type": "boolean"
              },
              "degraded": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "WebStatus": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string"
          },
          "site": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "storage": {
            "type": "object"
          },
          "readiness": {
            "type": "object"
          },
          "counts": {
            "type": "object"
          },
          "degraded": {
            "type": "boolean"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Service": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "baseUrl": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "degraded",
              "unavailable",
              "planned",
              "unknown"
            ]
          },
          "publicSafe": {
            "type": "boolean"
          },
          "protected": {
            "type": "boolean"
          }
        }
      },
      "Route": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "serviceSlug": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "safetyClass": {
            "type": "string"
          },
          "publicSafe": {
            "type": "boolean"
          },
          "protected": {
            "type": "boolean"
          },
          "authRequired": {
            "type": "boolean"
          },
          "agentAllowed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agentDisallowed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "PLATPHORM_API_KEY for protected actions"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-PlatPhorm-API-Key",
        "description": "PLATPHORM_API_KEY for protected actions"
      }
    }
  }
}