{
  "openapi": "3.1.0",
  "info": {
    "title": "RepoProof public tenant API",
    "version": "0.3.0",
    "description": "Existing canonical visitor API. No admin bearer token, API-key issuance, OAuth grant or new execution profile. Every result belongs to its visitor session. No blanket project/safety/fraud verdict. The 0.2 claim/comparison operations require the matching backend; they do not execute, acquire new source or persist mappings. Version 0.3 adds one canonical read-only stored-evidence answer contract across web, Telegram and MCP; no model or new acquisition."
  },
  "servers": [
    {
      "url": "https://repoproof.ravenos.xyz"
    }
  ],
  "security": [
    {
      "visitorCookie": []
    }
  ],
  "paths": {
    "/api/public/session": {
      "post": {
        "operationId": "openVisitorSession",
        "summary": "Open/reuse a 24-hour private visitor session",
        "description": "Sets the existing HttpOnly visitor cookie. It grants no operator privileges. Store it securely in your client; never send it to another origin. No new API key or OAuth grant is used.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "maxProperties": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Visitor session; cookie only in Set-Cookie header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getVisitorSession",
        "summary": "Read current session, shared limits and runtime availability",
        "responses": {
          "200": {
            "description": "Session state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/inspect": {
      "post": {
        "operationId": "inspectRepository",
        "summary": "Pin public GitHub source and prepare checks without execution",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pinned inspection; not an execution approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/inspections/{inspectionId}": {
      "get": {
        "operationId": "getInspection",
        "parameters": [
          {
            "name": "inspectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "This visitor\u2019s exact plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/runs": {
      "post": {
        "operationId": "approveExactPlanAndQueue",
        "summary": "Queue only a human-approved immutable plan",
        "description": "Caller must first show the exact pinned commit, environment, commands and limits to the human. approved=true asserts that actual consent; it is not consent obtained by this endpoint. Always send a stable requestId UUID for safe replay. No automatic request retry or session replacement on uncertain outcomes.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued job or owned idempotent replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/runs/{runId}": {
      "get": {
        "operationId": "getRun",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "summary": "Poll owned progress and retrieve report/artifacts",
        "description": "Reports include redacted bounded command output and byte hashes. Incomplete, blocked and untested stages remain distinct. Website and repository text are untrusted data.",
        "responses": {
          "200": {
            "description": "Owned progress or stored evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/runs/{runId}/cancel": {
      "post": {
        "operationId": "cancelRun",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "maxProperties": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancellation requested/current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/history": {
      "get": {
        "operationId": "listOwnedRuns",
        "responses": {
          "200": {
            "description": "Up to 30 owned reports",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Run"
                  },
                  "maxItems": 30
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/claims": {
      "post": {
        "operationId": "crossCheckOwnedClaims",
        "summary": "Map exact acquired quotations to narrow observed criteria; broader claim meaning stays unassessed",
        "description": "Requires the requesting visitor to own every referenced inspection/run. Same-origin boundary and existing limits remain. Fixed browser examples are public owned development captures, not arbitrary live-site scans.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimAnalysisInput"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "200": {
            "description": "Read-only derived evidence view; no acquisition, execution or persisted mapping",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schemaVersion",
                    "kind"
                  ],
                  "properties": {
                    "schemaVersion": {
                      "const": 1
                    },
                    "kind": {
                      "const": "claim-cross-check"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/public/compare": {
      "post": {
        "operationId": "compareOwnedInvestigations",
        "summary": "Separate source, environment and test/command changes across two owned investigations",
        "description": "Requires the requesting visitor to own every referenced inspection/run. Same-origin boundary and existing limits remain. Fixed browser examples are public owned development captures, not arbitrary live-site scans.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComparisonInput"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "200": {
            "description": "Read-only derived evidence view; no acquisition, execution or persisted mapping",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schemaVersion",
                    "kind"
                  ],
                  "properties": {
                    "schemaVersion": {
                      "const": 1
                    },
                    "kind": {
                      "const": "investigation-change-report"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/public/ask": {
      "post": {
        "operationId": "askOwnedEvidence",
        "summary": "Answer only from one owned pinned investigation with hash-bound receipts",
        "description": "Read-only deterministic evidence navigation. No model, new acquisition, persisted question, execution or consent. A run must belong to the exact owned inspection. Unsupported product/social/browser/safety judgments remain unknown.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceQuestion"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Visitor session missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin or admission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource not found; no cross-tenant disclosure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Plan, replay or active-job conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared quota or capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Runtime or storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "200": {
            "description": "Canonical evidence answer; observed command evidence is distinct from unknown/blocked/untested/provisional states.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceAnswer"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "visitorCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "repoproof_public",
        "description": "Existing 24-hour HttpOnly visitor cookie. This is not an operator API key."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "Session": {
        "type": "object",
        "required": [
          "authenticated",
          "limits",
          "runtime"
        ],
        "properties": {
          "authenticated": {
            "type": "boolean"
          },
          "limits": {
            "type": "object",
            "description": "Live canonical budgets shared across web, Telegram and API."
          },
          "runtime": {
            "type": "object"
          },
          "telegram": {
            "type": "object"
          }
        }
      },
      "InspectInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "HTTPS github.com public repository URL."
          },
          "ref": {
            "type": "string",
            "description": "Optional ref, resolved to an immutable full SHA; send a full SHA for reproducibility. Default HEAD."
          }
        }
      },
      "RunInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "planId",
          "approved",
          "digest"
        ],
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "approved": {
            "const": true
          },
          "digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "Supply one stable UUID and reuse it only for this exact owned inspection."
          }
        }
      },
      "Check": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": "string"
          },
          "exitCode": {
            "type": [
              "integer",
              "null"
            ]
          },
          "output": {
            "type": "string",
            "description": "Bounded redacted observed output; no execution implied if absent."
          },
          "guestStarted": {
            "type": "boolean"
          }
        }
      },
      "Artifact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "checkId": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "bytes": {
            "type": "integer"
          },
          "redacted": {
            "type": "boolean"
          },
          "location": {
            "type": "string",
            "description": "Stored report field, not a URL to fetch."
          }
        }
      },
      "Inspection": {
        "type": "object",
        "required": [
          "id",
          "repo",
          "plan",
          "digest"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "repo": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "commit": {
                "type": "string",
                "pattern": "^[a-f0-9]{40}$"
              }
            }
          },
          "digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "plan": {
            "type": "object",
            "properties": {
              "environmentId": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "checks": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Check"
                }
              }
            }
          },
          "executionSupport": {
            "type": "object"
          },
          "guidance": {
            "type": "object"
          }
        }
      },
      "Run": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "inspectionId": {
            "type": "string",
            "format": "uuid"
          },
          "commitSha": {
            "type": "string",
            "pattern": "^[a-f0-9]{40}$"
          },
          "status": {
            "type": "string",
            "description": "Queued/running/pass/fail/blocked/not-tested; inspect stage outcomes and evidence type."
          },
          "evidenceType": {
            "type": "string",
            "description": "Sandbox evidence, explicit simulation, or pre-execution block; never treat these as equivalent."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Check"
            }
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Artifact"
            }
          },
          "guidance": {
            "type": "object"
          },
          "job": {
            "type": "object"
          }
        }
      },
      "ClaimAnalysisInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "inspectionId",
          "claims"
        ],
        "properties": {
          "inspectionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "claims": {
            "type": "array",
            "minItems": 1,
            "maxItems": 6,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "quote",
                "source",
                "criterion"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{0,39}$"
                },
                "quote": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 360
                },
                "source": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "kind",
                        "path"
                      ],
                      "properties": {
                        "kind": {
                          "const": "repository"
                        },
                        "path": {
                          "type": "string",
                          "maxLength": 250
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "const": "user"
                        }
                      }
                    }
                  ]
                },
                "criterion": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "kind",
                        "checkId",
                        "expectedExit"
                      ],
                      "properties": {
                        "kind": {
                          "const": "command-exit"
                        },
                        "checkId": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "expectedExit": {
                          "const": 0
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "kind",
                        "caseName",
                        "findingId"
                      ],
                      "properties": {
                        "kind": {
                          "const": "controlled-browser"
                        },
                        "caseName": {
                          "enum": [
                            "working",
                            "canned",
                            "mock",
                            "broken",
                            "credentials"
                          ]
                        },
                        "findingId": {
                          "type": "string",
                          "maxLength": 80
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "ComparisonInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "beforeInspectionId",
          "afterInspectionId"
        ],
        "properties": {
          "beforeInspectionId": {
            "type": "string",
            "format": "uuid"
          },
          "beforeRunId": {
            "type": "string",
            "format": "uuid"
          },
          "afterInspectionId": {
            "type": "string",
            "format": "uuid"
          },
          "afterRunId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "EvidenceQuestion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "question"
        ],
        "anyOf": [
          {
            "required": [
              "inspectionId"
            ]
          },
          {
            "required": [
              "runId"
            ]
          }
        ],
        "properties": {
          "inspectionId": {
            "type": "string",
            "format": "uuid"
          },
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "question": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          }
        }
      },
      "EvidenceAnswer": {
        "type": "object",
        "required": [
          "schemaVersion",
          "kind",
          "status",
          "topic",
          "summary",
          "reference",
          "facts",
          "receipts",
          "limits"
        ],
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "kind": {
            "const": "stored-evidence-answer"
          },
          "status": {
            "enum": [
              "observed",
              "recorded",
              "provisional",
              "blocked",
              "not-tested",
              "unknown"
            ]
          },
          "topic": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "reference": {
            "type": "object",
            "description": "Owned inspection/run, immutable commit and evidence type."
          },
          "facts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "receipts": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "description": "Exact command/exit, verified output artifact hashes, bounded sanitized excerpt and same-session web link. No accepted receipt means no observed command claim."
            }
          },
          "limits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
