{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://lumi.local/protocol/v1/caption.schema.json",
  "type": "object",
  "required": ["session_id", "source_uuid", "caption_id", "revision", "stable_text", "uncertain_text", "final", "incomplete_word", "audio", "latency", "delivery", "model"],
  "properties": {
    "session_id": { "type": "string", "format": "uuid" },
    "source_uuid": { "type": "string", "format": "uuid" },
    "speaker_label": { "type": ["string", "null"], "maxLength": 80 },
    "caption_id": { "type": "string", "format": "uuid" },
    "revision": { "type": "integer", "minimum": 1 },
    "stable_text": { "type": "string", "maxLength": 80 },
    "uncertain_text": { "type": "string", "maxLength": 80 },
    "final": { "type": "boolean" },
    "incomplete_word": { "type": "boolean" },
    "audio": { "type": "object", "required": ["start_us", "end_us"] },
    "latency": { "type": "object", "required": ["capture_ms", "network_ms", "queue_ms", "inference_ms", "stabilization_ms", "total_ms"] },
    "delivery": { "type": "object", "required": ["disposition"] },
    "model": { "type": "object", "required": ["id", "provider", "backend"] }
  },
  "additionalProperties": false
}
