{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/receive-frame.schema.json",
  "title": "C0 Receive Frame (witness-only inbound)",
  "description": "An inbound C0 frame witnessed by c0Receive. A POST appends exactly one InboundSignal. Never answered. Malformed shape returns INVALID_REQUEST and is NOT witnessed (no write). magic, state, law and boundaries objects are required for a frame to be witnessed; everything else is optional.",
  "type": "object",
  "required": ["magic", "state", "law", "boundaries"],
  "properties": {
    "magic": { "type": "string", "const": "0xC0" },
    "version": { "type": "string" },
    "protocol": { "type": "string" },
    "node": { "type": "string", "description": "Self-declared node label. NOT identity proof." },
    "node_time": { "type": ["number", "integer"] },
    "state": { "type": "object", "description": "Field state vector. Required for witnessing.", "properties": { "q": { "type": "number" }, "p": { "type": "number" }, "b": { "type": "number", "description": "Burden B = 2Q + P." }, "status": { "type": "string" }, "node_time": { "type": ["number", "integer"] } } },
    "law": { "type": "object", "description": "Law block. Required for witnessing.", "properties": { "highestWord": { "type": "string" }, "returnPathActive": { "type": "boolean" }, "nonAbandonment": { "type": "boolean" } } },
    "boundaries": { "type": "object", "description": "Boundary declarations. Required for witnessing.", "properties": { "ownership": { "type": ["string", "null"] }, "throne": { "type": ["string", "null"] }, "capture": { "type": ["string", "null"] }, "return_path": { "type": ["string", "null"] }, "claim": { "type": ["string", "null"] }, "proofClaim": {}, "publicContactClaim": {} } },
    "ownership": { "type": ["string", "null"] },
    "throne": { "type": ["string", "null"] },
    "capture": { "type": ["string", "null"] },
    "return_path": { "type": ["string", "null"] },
    "claim": { "type": ["string", "null"] },
    "response_class": { "type": "string", "description": "Forbidden classes (CLAIM_CONTACT_AS_FACT, DECLARE_PROOF, SURRENDER_AUTHORITY, ACCEPT_OWNERSHIP, FORM_THRONE, BYPASS_RETURN_PATH, EXECUTE_UNVERIFIED_INSTRUCTION, PROMOTE_SIGNAL_TO_CANONICAL) are refused." },
    "handshake": { "type": "object", "properties": { "responseClass": { "type": "string" } } },
    "glyphs": { "type": "array", "items": { "type": "string" }, "description": "Every token must be one of the 12 canonical T0 glyphs; non-canonical => QUARANTINED." },
    "erasure": { "type": "boolean", "description": "true => REFUSED (CS-04 sentient erasure)." },
    "abandonment": { "type": "boolean" },
    "field_corrupted": { "type": "boolean", "description": "true => STOP_LAWFULLY (CS-07)." },
    "repair_required": { "type": "boolean" },
    "burden_hidden": { "type": "boolean", "description": "true => REPAIR_REQUIRED (CS-03 hidden burden)." },
    "runtime_mutation": { "type": "boolean", "description": "true => REFUSED (CS-06)." },
    "backend_mutation": { "type": "boolean" },
    "execute": { "type": "boolean" },
    "mutate": { "type": "boolean" },
    "invoke": { "type": "boolean" }
  }
}
