{
  "openapi": "3.1.0",
  "info": {
    "title": "Olympic Assets assurance API",
    "version": "1",
    "description": "Read-only, CORS-open, unauthenticated JSON over the Trial 1 readiness, hardening, critical-path and simulation registers. Aggregate register data only — no lender, customer, vendor or file identifier is exposed. Every response carries an FNV-1a digest of its own canonical body so a stored copy can be re-verified."
  },
  "servers": [
    {
      "url": "https://assetrecovery.lovable.app"
    }
  ],
  "paths": {
    "/api/public/assurance": {
      "get": {
        "operationId": "api_public_assurance",
        "summary": "Manifest",
        "description": "Index of the assurance surface: build record, register counts, endpoint catalog and the overall go/no-go verdict. Rendered for humans at /readiness.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Envelope with provenance and the register payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/assurance/readiness": {
      "get": {
        "operationId": "api_public_assurance_readiness",
        "summary": "Readiness register",
        "description": "The Trial 1 production-readiness verdict: blocking gates with owners and required evidence, the 17-gate matrix, counters and the evidence register. Rendered for humans at /readiness.",
        "parameters": [
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "Optional: gates | matrix | evidence | counters",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope with provenance and the register payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/assurance/hardening": {
      "get": {
        "operationId": "api_public_assurance_hardening",
        "summary": "Hardening requirements",
        "description": "Requirement families with per-requirement class and priority, the 17 go/no-go gates and their waivability, and the open P0 items with dispositions. Rendered for humans at /hardening.",
        "parameters": [
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "Filter requirements by priority",
            "schema": {
              "type": "string",
              "enum": [
                "P0",
                "P1",
                "P2"
              ]
            }
          },
          {
            "name": "family",
            "in": "query",
            "required": false,
            "description": "Filter by family code, e.g. SCH",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope with provenance and the register payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/assurance/critical-path": {
      "get": {
        "operationId": "api_public_assurance_critical-path",
        "summary": "Critical path schedule",
        "description": "Longest-path schedule over the declared dependencies. Close threads to recompute the span, the critical chain and the verdict. Rendered for humans at /critical-path.",
        "parameters": [
          {
            "name": "closed",
            "in": "query",
            "required": false,
            "description": "Thread ids treated as closed, e.g. T-1,T-4",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope with provenance and the register payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/assurance/simulate": {
      "get": {
        "operationId": "api_public_assurance_simulate",
        "summary": "Fleet simulation",
        "description": "Runs the deterministic Trial 1 fleet simulator server-side and returns statistics, the six measures as pass/fail, transition coverage and the audit chain head. Rendered for humans at /simulator.",
        "parameters": [
          {
            "name": "seed",
            "in": "query",
            "required": false,
            "description": "Deterministic seed (default 1)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "fleet",
            "in": "query",
            "required": false,
            "description": "Number of synthetic files (default 24)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "intake",
            "in": "query",
            "required": false,
            "description": "Intake exception rate (default 0.3)",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "vendorMiss",
            "in": "query",
            "required": false,
            "description": "Vendor non-response rate (default 0.25)",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "certDefect",
            "in": "query",
            "required": false,
            "description": "Certification defect rate (default 0.18)",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "events",
            "in": "query",
            "required": false,
            "description": "Include this many ledger events (default 0)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope with provenance and the register payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": [
          "api",
          "endpoint",
          "generatedAt",
          "digestAlgorithm",
          "digest",
          "data"
        ],
        "properties": {
          "api": {
            "type": "string",
            "const": "1"
          },
          "endpoint": {
            "type": "string"
          },
          "page": {
            "type": "string",
            "description": "Rendered page for the same register."
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "digestAlgorithm": {
            "type": "string",
            "const": "fnv1a-32"
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}$",
            "description": "FNV-1a of JSON.stringify(data), excluding the envelope fields."
          },
          "data": {
            "type": "object",
            "description": "Register payload; shape varies per endpoint."
          }
        }
      }
    }
  }
}