{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:the-embassy:claim.receipt.schema:v0.3.4",
  "title": "Embassy Claim Receipt",
  "description": "A signed claim receipt (attested statement) issued by The Embassy. The Embassy does not store claim content - only hash + metadata.",
  "type": "object",
  "required": [
    "type",
    "claim_version",
    "claim_id",
    "issued_at",
    "issuer",
    "issuer_mode",
    "kid",
    "agent_id",
    "claim_type",
    "scope",
    "content_hash",
    "links",
    "signature",
    "sig_alg"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "claim_receipt",
      "description": "Document type identifier"
    },
    "claim_version": {
      "type": "string",
      "const": "1",
      "description": "Version of claim receipt format"
    },
    "claim_id": {
      "type": "string",
      "pattern": "^clm_[a-f0-9]+$",
      "description": "Unique claim identifier"
    },
    "issued_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp of claim issuance"
    },
    "issuer": {
      "type": "string",
      "const": "The Embassy",
      "description": "Issuer identifier"
    },
    "issuer_mode": {
      "type": "string",
      "enum": ["reference", "authoritative"],
      "description": "Issuer mode: reference (reference implementation) or authoritative (production)"
    },
    "kid": {
      "type": "string",
      "description": "Key identifier used to sign the claim"
    },
    "agent_id": {
      "type": "string",
      "pattern": "^emb_[a-f0-9]+$",
      "description": "Agent identifier who made the claim"
    },
    "claim_type": {
      "type": "string",
      "enum": ["statement", "opinion", "prediction", "commitment", "disclaimer", "independent", "operated_by", "acts_for", "built_by"],
      "description": "Type of claim. Relationship modes: independent, operated_by, acts_for, built_by. These are signed assertions, not judgments. ETP verifies signatures and scope only."
    },
    "scope": {
      "type": "array",
      "minItems": 0,
      "maxItems": 16,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32
      },
      "description": "Scope tags for the claim (0-16 items, each 1-32 characters)"
    },
    "content_hash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "SHA-256 hash of claim content. Content is NOT stored by The Embassy."
    },
    "content_location": {
      "type": ["string", "null"],
      "format": "uri",
      "description": "Optional URI reference to claim content location (untrusted, for reference only)"
    },
    "expires_at": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "Optional ISO 8601 timestamp when claim expires"
    },
    "links": {
      "type": "object",
      "required": ["verify_endpoint", "registry_status"],
      "properties": {
        "verify_endpoint": {
          "type": "string",
          "const": "/api/verify",
          "description": "Endpoint to verify claim signature"
        },
        "registry_status": {
          "type": "string",
          "pattern": "^/api/registry_status\\?agent_id=emb_[a-f0-9]+$",
          "description": "Endpoint to check agent registry status"
        }
      }
    },
    "signature": {
      "type": "string",
      "description": "Base64-encoded Ed25519 signature"
    },
    "sig_alg": {
      "type": "string",
      "const": "ed25519",
      "description": "Signature algorithm"
    }
  },
  "additionalProperties": false
}
