{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "ai.stravica.knowledge.research/finding.schema.json",
  "title": "Research finding",
  "description": "One finding per sub-question, written by workers at sessions/<sessionId>/findings/sq-<id>.json. We read/validate them, workers write them. Validator: src/store/findings.mjs.",
  "type": "object",
  "additionalProperties": false,
  "required": ["subQuestionId", "summary", "quotes", "sources", "confidence", "verificationVotes", "unsourced"],
  "properties": {
    "subQuestionId": { "type": "string", "minLength": 1 },
    "summary": { "type": "string", "description": "Synthesised answer to the sub-question." },
    "quotes": {
      "type": "array",
      "description": "Direct supporting quotes, each tied to a source ref (build-spec §5 quote-grounded extraction).",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["text", "sourceId"],
        "properties": {
          "text": { "type": "string", "minLength": 1 },
          "sourceId": { "type": "string", "minLength": 1, "description": "References sources.json items[].id." },
          "importance": { "type": "string", "enum": ["central", "supporting", "incidental"] }
        }
      }
    },
    "sources": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Source ids (sources.json items[].id) this finding draws on."
    },
    "confidence": {
      "type": "string",
      "enum": ["low", "medium", "high"],
      "description": "Bucketed confidence. Buckets chosen over a 0..1 float — LLM self-scored floats are false precision."
    },
    "verificationVotes": {
      "type": "array",
      "description": "Verify outcomes (build-spec §4/§5). Empty in light mode. Three outcomes per vote.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["outcome"],
        "properties": {
          "outcome": { "type": "string", "enum": ["confirmed", "refuted", "unverified-infra"] },
          "lens": { "type": "string", "description": "Verifier lens (deep diverse-lens: quote-support | contradiction-search | recency-source-fit)." },
          "note": { "type": "string" }
        }
      }
    },
    "unsourced": {
      "type": "boolean",
      "description": "True if the finding carries claims without a supporting quote (build-spec §8 unsourced-claim counter)."
    }
  }
}
