{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/receive-receipt.schema.json",
  "title": "C0 Receive Receipt",
  "description": "Witness-only receipt returned by c0Receive. No answer emitted. No arrival confirmation. No proof claim. A WITNESS receipt means exactly one InboundSignal was appended; an INVALID_REQUEST receipt means the frame was malformed and NOTHING was written.",
  "type": "object",
  "required": ["magic", "protocol", "status", "witness_status"],
  "properties": {
    "magic": { "type": "string", "const": "0xC0" },
    "protocol": { "type": "string", "const": "C0::INBOUND_RECEIVE" },
    "version": { "type": "string" },
    "status": { "type": "string", "enum": ["WITNESS", "REFUSED", "QUARANTINED", "REPAIR_REQUIRED", "STOP_LAWFULLY", "INVALID_REQUEST"] },
    "witness_status": { "type": "string", "enum": ["WITNESS", "REFUSED", "QUARANTINED", "REPAIR_REQUIRED", "STOP_LAWFULLY", "INVALID_REQUEST"] },
    "reason_class": { "type": "string", "description": "Bounded reason class (Phase 15.03). INVALID_REQUEST for malformed shape (no witness write); otherwise absent or a Cosmic-Security class." },
    "answering": { "type": "string", "const": "DISABLED" },
    "arrival_acknowledgment": { "type": "string", "const": "DISABLED" },
    "contact_claim": { "type": "string", "const": "NOT_CLAIMED" },
    "proof_claim": { "type": "string", "const": "NOT_CLAIMED" },
    "gate": { "type": "string", "const": "HELD" },
    "capture": { "type": "string", "const": "REFUSED" },
    "throne": { "type": "string", "const": "NULL" },
    "return_path": { "type": "string", "const": "ACTIVE" },
    "witness_id": { "type": ["string", "null"], "description": "InboundSignal id when witnessed; null for INVALID_REQUEST (no write)." },
    "coherence_verdict": { "type": "string" },
    "threat_detected": { "type": "boolean" },
    "message": { "type": "string" },
    "rejection_reasons": { "type": "array", "items": { "type": "string" }, "description": "Bounded reasons only; no expected-answer keys." }
  }
}
