{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hogarmas.net/answer-audit/schema.json",
  "title": "H/M Claim Map export",
  "description": "A browser-local claim verification plan. It contains no automated truth verdict.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "ruleset", "generatedAt", "input", "analysis", "limitations"],
  "properties": {
    "schema": { "const": "hm.claim-map.v1" },
    "ruleset": { "const": "2026-07-20.1" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": ["sha256", "question", "answer", "sample"],
      "properties": {
        "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
        "question": { "type": "string", "maxLength": 4000 },
        "answer": { "type": "string", "minLength": 20, "maxLength": 24000 },
        "sample": { "type": "boolean" }
      }
    },
    "analysis": {
      "type": "object",
      "additionalProperties": false,
      "required": ["mode", "language", "summary", "claims"],
      "properties": {
        "mode": { "enum": ["quick", "research", "high-impact"] },
        "language": { "enum": ["en", "es", "zh"] },
        "summary": { "$ref": "#/$defs/summary" },
        "claims": {
          "type": "array",
          "minItems": 1,
          "maxItems": 28,
          "items": { "$ref": "#/$defs/claim" }
        }
      }
    },
    "limitations": {
      "type": "object",
      "additionalProperties": false,
      "required": ["truthVerdictProduced", "sourceSupportVerified", "textUploadedByAnalyzer", "deterministicHeuristics"],
      "properties": {
        "truthVerdictProduced": { "const": false },
        "sourceSupportVerified": { "const": false },
        "textUploadedByAnalyzer": { "const": false },
        "deterministicHeuristics": { "const": true }
      }
    }
  },
  "$defs": {
    "summary": {
      "type": "object",
      "additionalProperties": { "type": "integer", "minimum": 0 },
      "required": ["claims", "verifyFirst", "sourceAttached", "temporal", "highImpact", "checked", "supported", "contradicted", "unclear"]
    },
    "claim": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "text", "priority", "pressure", "signals", "status", "sourceUrls", "note"],
      "properties": {
        "id": { "type": "string", "pattern": "^claim-[0-9]{2}$" },
        "text": { "type": "string", "minLength": 1, "maxLength": 2000 },
        "priority": { "enum": ["verify-first", "high", "review"] },
        "pressure": { "type": "integer", "minimum": 0, "maximum": 10 },
        "signals": {
          "type": "array",
          "uniqueItems": true,
          "items": { "enum": ["high-impact", "temporal", "numeric", "date", "absolute", "quote", "citation", "external-claim", "subjective"] }
        },
        "status": { "enum": ["unchecked", "supported", "contradicted", "unclear"] },
        "sourceUrls": { "type": "array", "uniqueItems": true, "items": { "type": "string", "format": "uri" } },
        "note": { "type": "string", "maxLength": 1000 }
      }
    }
  }
}
