{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "ai.stravica.knowledge.research/sources.schema.json",
  "title": "Research sources",
  "description": "Aggregated source registry at sessions/<sessionId>/sources.json. One entry per fetched source; finding.sources[] and quote.sourceId reference items[].id. Validator: src/store/sources.mjs.",
  "type": "object",
  "additionalProperties": false,
  "required": ["items"],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "kind"],
        "properties": {
          "id": { "type": "string", "minLength": 1, "description": "Stable id referenced by findings." },
          "kind": {
            "type": "string",
            "enum": ["web", "playwright", "kb", "codebase", "prior-session"],
            "description": "Source capability (build-spec §2/§3)."
          },
          "url": { "type": "string" },
          "title": { "type": "string" },
          "fetchedAt": { "type": "string", "description": "ISO 8601 UTC." },
          "checksum": { "type": "string", "description": "Optional content hash for dedup/change-detection." }
        }
      }
    }
  }
}
