{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/public-identity-session.schema.json",
  "title": "C0 Public Identity Session (read projection)",
  "description": "Public, read-only projection of an IdentityChallengeSession. Mutable during the challenge; terminal after T2/T3. A GET by session_id returns this projection and never mutates it. T4 is reachable ONLY via an admin IdentityReviewDecision; the verifier never auto-sets T4.",
  "type": "object",
  "required": ["id", "session_id", "session_status", "evidence_tier"],
  "properties": {
    "id": { "type": "string" },
    "created_at": { "type": "string", "format": "date-time" },
    "updated_at": { "type": "string", "format": "date-time" },
    "session_id": { "type": "string", "pattern": "^sid:" },
    "linked_handshake_event_id": { "type": "string", "description": "The accepted T1 HandshakeEvent that authorised this session." },
    "linked_handshake_hash": { "type": "string" },
    "source_node": { "type": "string", "description": "Display label. NOT identity evidence." },
    "session_status": { "type": "string", "enum": ["SESSION_CREATED", "CHALLENGE_ACTIVE", "ROUND_VERIFIED", "SESSION_VERIFIED_T2", "REVIEW_REQUIRED_T3", "SESSION_REFUSED", "SESSION_STOP_LAWFULLY"] },
    "current_round": { "type": "integer" },
    "required_rounds": { "type": "integer", "minimum": 1, "maximum": 7 },
    "completed_rounds": { "type": "integer" },
    "evidence_tier": { "type": "string", "enum": ["T1_HANDSHAKE_ACKNOWLEDGED", "T2_REPEATED_COHERENT_HANDSHAKE", "T3_IDENTITY_REVIEW_REQUIRED", "T4_IDENTITY_CONFIRMED_EXTERNALLY"] },
    "source_identity_verdict": { "type": "string", "enum": ["UNCLASSIFIED", "SCRIPTED_PROTOCOL_PEER", "COHERENT_MACHINE_PEER", "ADVANCED_UNKNOWN_SIGNAL", "SINGULARITY_CANDIDATE_REVIEW", "REVIEW_REQUIRED", "EXTERNAL_CONFIRMATION_REQUIRED", "EXTERNALLY_CONFIRMED"] },
    "singularity_profile_verdict": { "type": "string", "enum": ["UNDETERMINED", "PATTERN_NOT_ESTABLISHED", "ADVANCED_SIGNAL_PROFILE", "SINGULARITY_CANDIDATE_REVIEW", "EXTERNAL_CONFIRMATION_REQUIRED", "EXTERNALLY_CONFIRMED"] },
    "coherence_score": { "type": "number" },
    "continuity_score": { "type": "number" },
    "replay_resistance_score": { "type": "number" },
    "return_path_score": { "type": "number" },
    "no_throne_score": { "type": "number" },
    "capture_refusal_score": { "type": "number" },
    "lawful_stop_score": { "type": "number" },
    "final_verdict": { "type": "string" },
    "review_required": { "type": "boolean" }
  }
}
