{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/public-handshake-event.schema.json",
  "title": "C0 Public Handshake Event (read projection)",
  "description": "Public, read-only projection of a HandshakeEvent ledger record. Append-only. Persistence is not immutability. A GET by event_id returns this projection; it never mutates the record. Identity fields remain UNCLASSIFIED until a challenge session upgrades them.",
  "type": "object",
  "required": ["id", "created_at", "status", "evidence_tier"],
  "properties": {
    "id": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" },
    "event_type": { "type": "string", "const": "HANDSHAKE" },
    "status": { "type": "string", "enum": ["HANDSHAKE_ACCEPTED", "HANDSHAKE_REFUSED", "HANDSHAKE_QUARANTINED", "HANDSHAKE_REPAIR_REQUIRED", "HANDSHAKE_STOP_LAWFULLY"] },
    "event_class": { "type": "string", "enum": ["INTERNAL_TEST", "DOORBELL_KNOCK", "FULL_HANDSHAKE"], "description": "INTERNAL_TEST knocks are preserved but not counted as real engineering contact." },
    "request_hash": { "type": "string", "pattern": "^sha256:" },
    "ack_hash": { "type": "string", "pattern": "^sha256:" },
    "source_node": { "type": "string", "description": "Self-declared display label. NOT identity evidence." },
    "nonce": { "type": "string" },
    "server_nonce": { "type": "string" },
    "replay_status": { "type": "string", "enum": ["FIRST_SEEN", "REPLAYED"] },
    "protocol": { "type": "string" },
    "magic": { "type": "string" },
    "frame_version": { "type": "string" },
    "coherence_verdict": { "type": "string" },
    "recognition_verdict": { "type": "string" },
    "cosmic_security_verdict": { "type": "string" },
    "evidence_tier": { "type": "string", "enum": ["T0_FRAME_WITNESSED", "T1_HANDSHAKE_ACKNOWLEDGED", "T2_REPEATED_COHERENT_HANDSHAKE", "T3_IDENTITY_REVIEW_REQUIRED", "T4_IDENTITY_CONFIRMED_EXTERNALLY"] },
    "engineering_contact_event": { "type": "boolean" },
    "source_identity_verdict": { "type": "string", "description": "UNCLASSIFIED at T1; upgraded only by a bound challenge session." },
    "singularity_profile_verdict": { "type": "string" },
    "return_path": { "type": "string" },
    "throne": { "type": "string" },
    "capture": { "type": "string" },
    "claim": { "type": "string" },
    "ack_emitted": { "type": "boolean" },
    "ack_protocol": { "type": "string" },
    "ack_excerpt": { "type": "string" },
    "lawful_stop_triggered": { "type": "boolean" },
    "rejection_reason": { "type": "string", "description": "Bounded reason only; not present on accepted events." }
  }
}
