{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tasfi.app/schemas/tasfi/guard/scholar-decision.schema.json",
  "title": "Tasfi Scholar Decision",
  "type": "object",
  "required": ["id", "version", "caseId", "reviewer", "claimDecisions", "signature", "privacy"],
  "properties": {
    "id": { "type": "string" },
    "version": { "type": "string", "const": "scholar-decision-0.3.0" },
    "caseId": { "type": "string" },
    "reviewer": { "type": "string" },
    "claimDecisions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["claimId", "decision"],
        "properties": {
          "claimId": { "type": "string" },
          "decision": {
            "type": "string",
            "enum": ["supported", "unsupported", "overclaimed", "needs_context", "wrong_madhab_framing", "source_misuse"]
          },
          "noteHash": { "type": ["string", "null"] }
        }
      }
    },
    "signature": {
      "type": "object",
      "required": ["algorithm", "payloadSha256", "value"]
    },
    "privacy": {
      "type": "object",
      "required": ["privateReviewStorage", "rawTextInReceipt", "auditExportDefault"],
      "properties": {
        "privateReviewStorage": { "type": "boolean", "const": true },
        "rawTextInReceipt": { "type": "boolean", "const": false },
        "auditExportDefault": { "type": "string", "const": "redacted_metadata" }
      }
    }
  },
  "additionalProperties": true
}
