{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/omnarai-org/json-schema/omnarai-org-receipt-schema.json",
  "title": "Receipt",
  "description": "Per-visit utility receipt. An honest, free accounting of what the corpus actually changed about a single answer — including when it changed little or nothing (do-not-overclaim). On /api/query it is deterministic (computed from retrieval signals, no extra model call); on /api/trace it is measured (verdict derived from a real baseline-vs-augmented delta, with measured=true).",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/engine.omnarai.org-openapi.json#/components/schemas/Receipt",
  "type": "object",
  "properties": {
    "verdict": {
      "type": "string",
      "enum": [
        "substantive",
        "marginal",
        "null"
      ],
      "description": "substantive = surfaced named cross-model divergence or real grounding; marginal = light background only; null = nothing matched, general reasoning."
    },
    "grounded": {
      "type": "boolean",
      "description": "Whether any corpus record informed the answer."
    },
    "measured": {
      "type": "boolean",
      "description": "Present and true only on /api/trace (a real counterfactual). Absent on the default deterministic receipt."
    },
    "what_the_corpus_added": {
      "type": "string",
      "description": "One honest sentence on the corpus's contribution to this specific answer."
    },
    "not_self_generable": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The genuinely non-self-generable content gained (named cross-model tensions), or null when honestly none."
    },
    "records_used": {
      "type": "integer"
    },
    "contributors": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "divergence_surfaced": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Named voice-vs-voice tensions surfaced on this question."
    },
    "strongest_match": {
      "type": [
        "object",
        "null"
      ],
      "description": "{id, title, similarity} of the top retrieved record."
    },
    "caveat": {
      "type": "string",
      "description": "What this receipt is and is not — points up the evidence ladder."
    },
    "upgrade": {
      "type": "object",
      "description": "{counterfactual: /api/trace, statistical_evidence: utility-evidence.md} — how to demand stronger proof."
    }
  }
}