{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/geronimo-iia/llm-wiki/schemas/v0.1.0/paper.json",
  "title": "Source type",
  "description": "What a specific source claims. Shared by paper, article, documentation, clipping, transcript, note, data, book-chapter, thread.",
  "type": "object",
  "required": ["title", "type"],
  "properties": {
    "title": {
      "type": "string",
      "description": "Display name"
    },
    "type": {
      "type": "string",
      "description": "Page type from registry"
    },
    "summary": {
      "type": "string",
      "description": "One-line scope"
    },
    "status": {
      "type": "string",
      "description": "Lifecycle state",
      "enum": ["active", "draft", "stub", "generated"]
    },
    "last_updated": {
      "type": "string",
      "description": "ISO 8601 date"
    },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Lowercase hyphenated search terms"
    },
    "owner": {
      "type": "string",
      "description": "Person, team, or agent responsible"
    },
    "superseded_by": {
      "type": "string",
      "description": "Slug of replacement page"
    },
    "read_when": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Retrieval conditions"
    },
    "tldr": {
      "type": "string",
      "description": "One-sentence key takeaway"
    },
    "sources": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Slugs of other source pages (e.g. papers cited by a survey)"
    },
    "concepts": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Slugs of concept pages this source informs"
    },
    "confidence": {
      "type": "number",
      "description": "Certainty of this page's content. 0.0=speculative, 1.0=verified.",
      "minimum": 0.0,
      "maximum": 1.0,
      "default": 0.5
    },
    "claims": {
      "type": "array",
      "description": "Structured claims extracted from this source",
      "items": {
        "type": "object",
        "required": ["text"],
        "properties": {
          "text": {
            "type": "string",
            "description": "The claim as a factual statement"
          },
          "confidence": {
            "type": "number",
            "minimum": 0.0,
            "maximum": 1.0,
            "description": "Certainty of this claim. 0.0=speculative, 1.0=verified."
          },
          "source": {
            "type": "string",
            "description": "Slug of the source page"
          },
          "section": {
            "type": "string",
            "description": "Section in the source where the claim appears"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "x-wiki-types": {
    "paper": "Academic source — research papers, preprints",
    "article": "Editorial source — blog posts, news, essays",
    "documentation": "Reference source — product docs, API references",
    "clipping": "Web capture — browser clips, bookmarks",
    "transcript": "Spoken source — meeting transcripts, podcasts",
    "note": "Informal source — freeform drafts, quick captures",
    "data": "Structured source — CSV, JSON, datasets",
    "book-chapter": "Published source — book excerpts",
    "thread": "Discussion source — forum threads, social media"
  },
  "x-graph-edges": {
    "sources": {
      "relation": "cites",
      "direction": "outgoing",
      "target_types": ["paper", "article", "documentation", "clipping", "transcript", "note", "data", "book-chapter", "thread"]
    },
    "concepts": {
      "relation": "informs",
      "direction": "outgoing",
      "target_types": ["concept"]
    },
    "superseded_by": {
      "relation": "superseded-by",
      "direction": "outgoing"
    }
  },
  "additionalProperties": true
}
