{
  "openapi": "3.1.0",
  "info": {
    "title": "biosingularity API",
    "version": "0.4.0",
    "description": "Policy-driven biomedical evidence linter. The typed proposition contract returns ALLOW/REVIEW/BLOCK with exact evidence receipts; experimental free-text discovery is conservatively capped at REVIEW. No model is in the decision path.",
    "x-cardinal-rule": "A false 'pass' is the only unforgivable failure; unverifiable \u2192 review."
  },
  "servers": [
    {
      "url": "https://biosingularity.netlify.app",
      "description": "public demo subset (open, per-IP rate-limited, no key)"
    },
    {
      "url": "https://<your-host>",
      "description": "metered hosted API \u2014 full datalake depth (x-api-key)"
    }
  ],
  "paths": {
    "/api/verify": {
      "get": {
        "operationId": "verify",
        "summary": "Verify a whole free-text answer \u2014 the full ground() verdict.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/repair": {
      "get": {
        "operationId": "repair",
        "summary": "Verify then REPAIR an answer into a shippable one \u2014 retracted citations deleted, contradicted sentences struck, sourced warnings appended. Never rewrites a claim.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/discovery": {
      "get": {
        "operationId": "discovery",
        "summary": "Trust-gate an AI-generated discovery (publish/review/reject).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-runs-on": "hosted"
      }
    },
    "/api/audit": {
      "get": {
        "operationId": "audit",
        "summary": "Audit cited DOIs for retraction / erratum.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/target": {
      "get": {
        "operationId": "target",
        "summary": "Gene\u2013disease corroboration (add &disease=).",
        "parameters": [
          {
            "name": "gene",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/entities": {
      "get": {
        "operationId": "entities",
        "summary": "Drug / trial verifier (drug= and/or nct=). Trials include ICMJE prospective-registration and FDAAA results-reporting compliance.",
        "parameters": [
          {
            "name": "drug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/cellline": {
      "get": {
        "operationId": "cellline",
        "summary": "Cell-line authentication vs the Cellosaurus problematic register (or ?q=<text> to scan prose). Offline, bundled register.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/label": {
      "get": {
        "operationId": "label",
        "summary": "FDA structured product label facts \u2014 boxed warning, contraindications, dosage.",
        "parameters": [
          {
            "name": "drug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/decompose": {
      "get": {
        "operationId": "decompose",
        "summary": "Extract checkable entities from a claim.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/evidence/search": {
      "get": {
        "operationId": "evidence_search",
        "summary": "Find candidate papers through OpenAlex + SemOpenAlex. Discovery only; never a verification verdict.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "published_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "open_access",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sources",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "comma-separated allow-list: openalex_api,semopenalex"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/evidence/neighbourhood": {
      "get": {
        "operationId": "evidence_neighbourhood",
        "summary": "Expand one bounded citation hop around an OpenAlex work. Discovery only.",
        "parameters": [
          {
            "name": "work_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "references",
                "citations",
                "both"
              ],
              "default": "both"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "sources",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/evidence/resolve": {
      "get": {
        "operationId": "evidence_resolve",
        "summary": "Resolve an exact DOI or OpenAlex work id to a provenance-stamped discovery record.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/evidence/context": {
      "get": {
        "operationId": "evidence_context",
        "summary": "Return non-deciding OA, topic, citation, and retraction-screening context.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/contested": {
      "get": {
        "operationId": "contested",
        "summary": "Is this reference DISPUTED in the citing literature? (scite Smart Citations \u2014 contested is not retracted, so the verdict is amber.)",
        "parameters": [
          {
            "name": "doi",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "hosted"
      }
    },
    "/api/resolve": {
      "get": {
        "operationId": "resolve",
        "summary": "Resolve a gene name to its HGNC approved symbol, ABSTAINING when the name matches several genes with no single approved symbol.",
        "parameters": [
          {
            "name": "gene",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [],
        "x-runs-on": "hosted"
      }
    },
    "/api/provenance": {
      "get": {
        "operationId": "provenance",
        "summary": "Durable receipt lookup for a prior verdict.",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-runs-on": "hosted"
      }
    },
    "/api/evidence-base": {
      "get": {
        "operationId": "evidence-base",
        "summary": "Integrity score for a systematic review's INCLUDED studies. The denominator is the explicit included list, never a bibliography; add &bibliography= to have background citations partitioned out.",
        "parameters": [
          {
            "name": "included",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-runs-on": "hosted"
      }
    },
    "/api/desk": {
      "get": {
        "operationId": "desk",
        "summary": "Editor's desk screen over manuscript TEXT: retracted/disputed references, misidentified cell lines, trial-registry compliance, uncheckable prose \u2014 with an extraction-quality gate, so a document we could not fully read can never read clean.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-runs-on": "hosted"
      }
    },
    "/api/portfolio": {
      "get": {
        "operationId": "portfolio",
        "summary": "Funder portfolio integrity exposure for comma-separated NIH core project numbers. A portfolio report, never a scoreboard of people.",
        "parameters": [
          {
            "name": "grants",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-runs-on": "hosted"
      }
    },
    "/api/repro": {
      "get": {
        "operationId": "repro",
        "summary": "Does the paper's DECLARED evidence resolve? Data accessions (GEO/ENA/SRA/BioProject/ArrayExpress/dbGaP/PDB/PRIDE/DataCite) + the data-availability statement. Cannot return red: a dead accession is not evidence the paper is wrong.",
        "parameters": [
          {
            "name": "doi",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded input"
          }
        ],
        "responses": {
          "200": {
            "description": "verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verdict"
                }
              }
            }
          },
          "429": {
            "description": "rate limit / quota exhausted (reserved before work)"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-runs-on": "hosted"
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Datalake reachability (hosted, no auth).",
        "responses": {
          "200": {
            "description": "health"
          }
        }
      }
    },
    "/api/capabilities": {
      "get": {
        "operationId": "capabilities",
        "summary": "Machine-readable capability manifest (public, no auth).",
        "responses": {
          "200": {
            "description": "capabilities"
          }
        }
      }
    },
    "/api/v2/verify": {
      "post": {
        "operationId": "verifyProposition",
        "summary": "Verify one typed proposition under a declared policy \u2014 the automatable gate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerificationRequestV2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "typed verification decision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "malformed contract"
          },
          "429": {
            "description": "rate limit / quota exhausted"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    },
    "/api/scientific-review": {
      "post": {
        "operationId": "reviewScientificManuscript",
        "summary": "Extract claims/issues, audit methods/statistics, bind discovery candidates, and compare revisions. Heuristics are REVIEW-only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "additionalProperties": false,
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000000
                  },
                  "manuscript_id": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "previous_text": {
                    "type": "string",
                    "maxLength": 2000000
                  },
                  "review_issues": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 20000
                        },
                        {
                          "type": "object",
                          "minProperties": 1
                        }
                      ]
                    }
                  },
                  "discover": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "four-stage candidate review packet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScientificReviewV1"
                }
              }
            }
          },
          "400": {
            "description": "malformed request"
          },
          "413": {
            "description": "request exceeds text bound"
          },
          "429": {
            "description": "rate limit / quota exhausted"
          }
        },
        "security": [],
        "x-runs-on": "demo+hosted"
      }
    }
  },
  "components": {
    "schemas": {
      "Verdict": {
        "type": "object",
        "properties": {
          "recommend": {
            "type": "string",
            "enum": [
              "pass",
              "review",
              "reject"
            ]
          },
          "overall_severity": {
            "type": "string",
            "enum": [
              "red",
              "amber",
              "info",
              "green"
            ]
          },
          "coverage_confidence": {
            "type": [
              "number",
              "null"
            ],
            "description": "grounded/total \u2014 COVERAGE, not a probability"
          },
          "verdict_certainty": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "high",
              "moderate",
              "low",
              null
            ],
            "description": "how firm the verdict is \u2014 threshold retry-vs-surface on this"
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "description": "back-compat alias of coverage_confidence"
          },
          "summary": {
            "type": "string"
          },
          "counts": {
            "type": "object"
          },
          "coverage": {
            "type": "object"
          },
          "claims": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "red",
                    "amber",
                    "info",
                    "green"
                  ]
                },
                "detail": {
                  "type": "string"
                },
                "receipt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "grounded": {
                  "type": "boolean"
                },
                "code": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "stable reason code \u2014 branch on this"
                },
                "remediation": {
                  "type": "object",
                  "description": "{action, instruction, target?} on red/amber claims"
                }
              }
            }
          },
          "graph": {
            "type": "object"
          }
        },
        "required": [
          "recommend",
          "overall_severity",
          "claims"
        ]
      },
      "VerificationRequestV2": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://biosingularity.example/schemas/verification-request-v2.schema.json",
        "title": "biosingularity Verification Contract v2 request",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "predicate",
          "object"
        ],
        "properties": {
          "schema_version": {
            "const": "2.0"
          },
          "subject": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              },
              "identifiers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "predicate": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "object": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "value"
            ],
            "properties": {
              "value": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            }
          },
          "polarity": {
            "enum": [
              "affirmed",
              "denied"
            ],
            "default": "affirmed"
          },
          "qualifiers": {
            "type": "object"
          },
          "citations": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string",
              "maxLength": 1000
            }
          },
          "policy": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "research-ai-core/0.1"
          }
        }
      },
      "VerificationResponseV2": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://biosingularity.example/schemas/verification-response-v2.schema.json",
        "title": "biosingularity Verification Contract v2 response",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "decision",
          "recommendation",
          "reason",
          "subject",
          "predicate",
          "object",
          "polarity",
          "resolution",
          "evidence",
          "policy",
          "receipt"
        ],
        "properties": {
          "schema_version": {
            "const": "2.0"
          },
          "decision": {
            "enum": [
              "SUPPORTED",
              "CONTRADICTED",
              "UNRESOLVED",
              "OUT_OF_SCOPE"
            ]
          },
          "recommendation": {
            "enum": [
              "ALLOW",
              "REVIEW",
              "BLOCK"
            ]
          },
          "reason": {
            "type": "string"
          },
          "subject": {
            "type": "object"
          },
          "predicate": {
            "type": "string"
          },
          "object": {
            "type": "object"
          },
          "polarity": {
            "enum": [
              "affirmed",
              "denied"
            ]
          },
          "resolution": {
            "type": "object"
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source",
                "source_name",
                "source_class",
                "commercial_status",
                "record_id",
                "url",
                "detail",
                "data_as_of"
              ],
              "properties": {
                "source": {
                  "type": "string"
                },
                "source_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source_class": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "commercial_status": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "record_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "detail": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "data_as_of": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "policy": {
            "type": "object"
          },
          "receipt": {
            "type": "object",
            "required": [
              "issued_at",
              "request_sha256",
              "snapshot_id",
              "predicate_registry_version",
              "source_registry_version",
              "hash_covers",
              "result_sha256",
              "receipt_id"
            ]
          }
        }
      },
      "ScientificReviewV1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://biosingularity.ai/schemas/scientific-review-v1.schema.json",
        "title": "biosingularity scientific review packet",
        "type": "object",
        "required": [
          "schema_version",
          "generated_at",
          "manuscript",
          "status",
          "recommendation",
          "stages",
          "counts",
          "safety",
          "receipt"
        ],
        "properties": {
          "schema_version": {
            "const": "scientific-review/1"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "manuscript": {
            "$ref": "#/$defs/manuscript"
          },
          "status": {
            "enum": [
              "review_required",
              "incomplete"
            ]
          },
          "recommendation": {
            "const": "REVIEW"
          },
          "stages": {
            "type": "object",
            "required": [
              "claims",
              "methods",
              "evidence",
              "revision"
            ],
            "properties": {
              "claims": {
                "$ref": "#/$defs/claimsStage"
              },
              "methods": {
                "$ref": "#/$defs/methodsStage"
              },
              "evidence": {
                "$ref": "#/$defs/evidenceStage"
              },
              "revision": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/$defs/revisionStage"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "counts": {
            "type": "object"
          },
          "safety": {
            "type": "object",
            "required": [
              "maximum_heuristic_recommendation",
              "discovery_decision_eligible",
              "empty_claims_can_be_clean",
              "human_confirmation_required"
            ],
            "properties": {
              "maximum_heuristic_recommendation": {
                "const": "REVIEW"
              },
              "discovery_decision_eligible": {
                "const": false
              },
              "empty_claims_can_be_clean": {
                "const": false
              },
              "human_confirmation_required": {
                "const": true
              }
            },
            "additionalProperties": false
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "receipt": {
            "$ref": "#/$defs/receipt"
          },
          "annotation_scaffold": {
            "type": "object"
          }
        },
        "additionalProperties": false,
        "$defs": {
          "manuscript": {
            "type": "object",
            "required": [
              "id",
              "sha256",
              "chars"
            ],
            "properties": {
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "chars": {
                "type": "integer",
                "minimum": 1
              }
            },
            "additionalProperties": false
          },
          "locator": {
            "type": "object",
            "required": [
              "section",
              "paragraph",
              "sentence",
              "char_start",
              "char_end",
              "source_sha256"
            ],
            "properties": {
              "section": {
                "type": "string"
              },
              "paragraph": {
                "type": "integer",
                "minimum": 1
              },
              "sentence": {
                "type": "integer",
                "minimum": 1
              },
              "char_start": {
                "type": "integer",
                "minimum": 0
              },
              "char_end": {
                "type": "integer",
                "minimum": 1
              },
              "source_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "additionalProperties": false
          },
          "claim": {
            "type": "object",
            "required": [
              "claim_id",
              "source_quote",
              "source_quote_sha256",
              "locator",
              "claim_type",
              "subject",
              "predicate",
              "object",
              "polarity",
              "qualifiers",
              "extraction_confidence",
              "priority_score",
              "review_priority",
              "uncertainties",
              "status",
              "decision",
              "human_confirmation_required",
              "receipt"
            ],
            "properties": {
              "claim_id": {
                "type": "string",
                "pattern": "^clm_[a-f0-9]{16}$"
              },
              "source_quote": {
                "type": "string",
                "minLength": 1
              },
              "source_quote_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "locator": {
                "$ref": "#/$defs/locator"
              },
              "claim_type": {
                "enum": [
                  "causal",
                  "safety",
                  "comparative",
                  "association",
                  "quantitative",
                  "methodological",
                  "interpretive",
                  "descriptive"
                ]
              },
              "subject": {
                "type": "object",
                "required": [
                  "type",
                  "id"
                ]
              },
              "predicate": {
                "type": "string"
              },
              "object": {
                "type": "object",
                "required": [
                  "type",
                  "value"
                ]
              },
              "polarity": {
                "enum": [
                  "affirmed",
                  "denied"
                ]
              },
              "qualifiers": {
                "type": "object"
              },
              "extraction_confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "priority_score": {
                "type": "number",
                "minimum": 0,
                "maximum": 5
              },
              "review_priority": {
                "enum": [
                  "high",
                  "medium",
                  "standard"
                ]
              },
              "uncertainties": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "status": {
                "const": "candidate"
              },
              "decision": {
                "const": "REVIEW"
              },
              "human_confirmation_required": {
                "const": true
              },
              "receipt": {
                "type": "object"
              }
            },
            "additionalProperties": false
          },
          "issue": {
            "type": "object",
            "required": [
              "issue_id",
              "taxonomy",
              "severity",
              "status",
              "decision",
              "source_quote",
              "locator",
              "rationale",
              "remediation",
              "human_confirmation_required"
            ],
            "properties": {
              "issue_id": {
                "type": "string"
              },
              "taxonomy": {
                "type": "string"
              },
              "severity": {
                "enum": [
                  "low",
                  "moderate",
                  "high",
                  "critical"
                ]
              },
              "status": {
                "type": "string"
              },
              "decision": {
                "const": "REVIEW"
              },
              "claim_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_quote": {
                "type": "string"
              },
              "locator": {
                "$ref": "#/$defs/locator"
              },
              "rationale": {
                "type": "string"
              },
              "remediation": {
                "type": "string"
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "human_confirmation_required": {
                "const": true
              }
            },
            "additionalProperties": false
          },
          "claimsStage": {
            "type": "object",
            "required": [
              "schema_version",
              "manuscript",
              "status",
              "recommendation",
              "claims",
              "issue_candidates",
              "review_queue",
              "coverage",
              "receipt"
            ],
            "properties": {
              "schema_version": {
                "const": "scientific-claims/1"
              },
              "generated_at": {
                "type": "string"
              },
              "manuscript": {
                "$ref": "#/$defs/manuscript"
              },
              "status": {
                "enum": [
                  "complete",
                  "partial",
                  "incomplete"
                ]
              },
              "recommendation": {
                "const": "REVIEW"
              },
              "claims": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/claim"
                }
              },
              "issue_candidates": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/issue"
                }
              },
              "review_queue": {
                "type": "array",
                "maxItems": 50,
                "items": {
                  "type": "string"
                }
              },
              "coverage": {
                "type": "object"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "receipt": {
                "$ref": "#/$defs/receipt"
              }
            },
            "additionalProperties": false
          },
          "methodsStage": {
            "type": "object",
            "required": [
              "schema_version",
              "status",
              "recommendation",
              "checks",
              "findings",
              "receipt"
            ],
            "properties": {
              "schema_version": {
                "const": "methods-validity/1"
              },
              "generated_at": {
                "type": "string"
              },
              "manuscript": {
                "type": "object"
              },
              "status": {
                "const": "review_required"
              },
              "recommendation": {
                "const": "REVIEW"
              },
              "design_profile": {
                "type": "object"
              },
              "checks": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "counts": {
                "type": "object"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "receipt": {
                "$ref": "#/$defs/receipt"
              }
            },
            "additionalProperties": false
          },
          "evidenceStage": {
            "type": "object",
            "required": [
              "schema_version",
              "status",
              "claims",
              "counts",
              "receipt"
            ],
            "properties": {
              "schema_version": {
                "const": "claim-evidence/1"
              },
              "generated_at": {
                "type": "string"
              },
              "manuscript": {
                "type": "object"
              },
              "status": {
                "enum": [
                  "complete",
                  "partial"
                ]
              },
              "claims": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "counts": {
                "type": "object"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "receipt": {
                "$ref": "#/$defs/receipt"
              }
            },
            "additionalProperties": false
          },
          "revisionStage": {
            "type": "object",
            "required": [
              "schema_version",
              "status",
              "recommendation",
              "claim_changes",
              "issue_resolutions",
              "counts",
              "receipt"
            ],
            "properties": {
              "schema_version": {
                "const": "review-resolution/1"
              },
              "generated_at": {
                "type": "string"
              },
              "manuscript": {
                "type": "object"
              },
              "status": {
                "const": "review_required"
              },
              "recommendation": {
                "const": "REVIEW"
              },
              "claim_changes": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "issue_resolutions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "counts": {
                "type": "object"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "receipt": {
                "$ref": "#/$defs/receipt"
              }
            },
            "additionalProperties": false
          },
          "receipt": {
            "type": "object",
            "required": [
              "result_sha256",
              "receipt_id"
            ],
            "properties": {
              "subject_sha256": {
                "type": "string"
              },
              "result_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "receipt_id": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "x-mcp": {
    "command": "biosingularity-mcp",
    "install": "pip install 'biosingularity[mcp,store]'",
    "tools": "/tools/anthropic.json"
  }
}
