{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tasfi.app/schemas/tasfi/guard/evidence-graph.schema.json",
  "title": "Tasfi Evidence Graph",
  "type": "object",
  "required": ["id", "version", "generatedAt", "privacy", "summary", "nodes", "edges", "sha256"],
  "properties": {
    "id": { "type": "string" },
    "version": { "type": "string", "const": "tasfi-evidence-graph-0.3.0" },
    "generatedAt": { "type": "string" },
    "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "privacy": {
      "type": "object",
      "required": ["mode", "rawTextIncluded", "rawCitationTextIncluded", "hashesOnlyForSubmittedContent"],
      "properties": {
        "mode": { "type": "string", "const": "metadata_only" },
        "rawTextIncluded": { "type": "boolean", "const": false },
        "rawCitationTextIncluded": { "type": "boolean", "const": false },
        "hashesOnlyForSubmittedContent": { "type": "boolean", "const": true }
      }
    },
    "summary": {
      "type": "object",
      "required": ["nodes", "edges", "claims", "citations", "riskRules", "contradictions", "reusedClaims"]
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "kind"],
        "properties": {
          "id": { "type": "string" },
          "kind": {
            "type": "string",
            "enum": [
              "verification_run",
              "claim",
              "citation",
              "source_record",
              "source_bundle",
              "policy_pack",
              "policy_rule",
              "risk_rule",
              "receipt",
              "scholar_decision"
            ]
          }
        },
        "additionalProperties": true
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["from", "to", "relation"],
        "properties": {
          "from": { "type": "string" },
          "to": { "type": "string" },
          "relation": { "type": "string" }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
