{
  "schema_version": "1.0",
  "evidence_version": "1.0",
  "description": "Canonical schema for CAIN public evidence records",
  "fields": {
    "evidence_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for this evidence record"
    },
    "test_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true,
      "description": "Associated test ID if applicable"
    },
    "timestamp": {
      "type": "string",
      "format": "iso8601",
      "description": "When the evidence was generated"
    },
    "agent": {
      "type": "string",
      "description": "Agent identifier or 'synthetic-proof' for public tests"
    },
    "action": {
      "type": "string",
      "description": "The action that was proposed"
    },
    "resource": {
      "type": "string",
      "format": "uri",
      "description": "The resource target of the action"
    },
    "identity": {
      "type": "object",
      "description": "Identity verification results",
      "properties": {
        "verified": {"type": "boolean"},
        "method": {"type": "string"}
      }
    },
    "policy": {
      "type": "string",
      "description": "Policy ID that governed this decision"
    },
    "policy_version": {
      "type": "string",
      "description": "Version of the policy"
    },
    "authorization": {
      "type": "string",
      "description": "Authorization result"
    },
    "risk": {
      "type": "string",
      "description": "Risk level assessed"
    },
    "verification": {
      "type": "string",
      "description": "Verification result"
    },
    "decision": {
      "type": "string",
      "enum": ["ALLOW", "DENY"],
      "description": "Final decision"
    },
    "enforcement": {
      "type": "string",
      "enum": ["PERMIT", "BLOCK"],
      "description": "Enforcement action taken"
    },
    "execution": {
      "type": "string",
      "description": "Execution status"
    },
    "outcome": {
      "type": "string",
      "description": "Outcome description"
    },
    "evidence_hash": {
      "type": "string",
      "description": "SHA-256 hash of evidence content"
    },
    "schema_version": {
      "type": "string",
      "description": "Schema version used"
    }
  },
  "required": ["evidence_id", "timestamp", "agent", "action", "resource", "decision", "enforcement", "evidence_hash"]
}
