{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Research knowledge record",
  "type": "object",
  "required": [
    "id",
    "kind",
    "title",
    "companies",
    "text",
    "evidence_status",
    "as_of",
    "source_ids",
    "related_record_ids",
    "artifact_path",
    "metadata"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "enum": [
        "claim",
        "gap",
        "review",
        "flow",
        "asset",
        "task",
        "analysis",
        "source",
        "workflow_answer",
        "documentation"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "companies": {
      "type": "array",
      "items": {
        "enum": [
          "Cove",
          "Visitt",
          "PRISM"
        ]
      },
      "uniqueItems": true
    },
    "text": {
      "type": "string",
      "minLength": 1
    },
    "evidence_status": {
      "type": "string",
      "minLength": 1
    },
    "as_of": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "source_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^src-[0-9a-f]{16}$"
      },
      "uniqueItems": true
    },
    "related_record_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "artifact_path": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": "object"
    },
    "resolved_sources": {
      "type": "array",
      "description": "Optional compact source summaries added by the search CLI; full observations remain in sources.json.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "title",
          "publisher",
          "url",
          "source_dates",
          "notes"
        ]
      }
    }
  },
  "additionalProperties": false
}
