{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://resolutionprotocol.org/rp/0.2/event.schema.json",
 "title": "Resolution Protocol event",
 "description": "One engine outcome. Never carries speech content; is personal data (SPEC §9).",
 "$defs": {
  "level": {
   "type": "integer",
   "minimum": 0,
   "maximum": 5
  },
  "duration": {
   "oneOf": [
    {
     "type": "string",
     "pattern": "^P(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?$"
    },
    {
     "type": "number",
     "minimum": 0
    }
   ]
  }
 },
 "type": "object",
 "required": [
  "session",
  "seq",
  "t",
  "type"
 ],
 "properties": {
  "session": {
   "type": "string"
  },
  "seq": {
   "type": "integer",
   "minimum": 1
  },
  "t": {
   "type": "number"
  },
  "type": {
   "type": "string",
   "description": "voice level provisional confirmed reverted forget retention ignored end claim, or an extension type"
  },
  "voice": {
   "type": [
    "string",
    "null"
   ]
  },
  "slot": {
   "type": "integer"
  },
  "levels": {
   "type": "object",
   "additionalProperties": {
    "$ref": "#/$defs/level"
   },
   "description": "voice id (or * for the default) → applied level"
  },
  "intent": {
   "type": "string"
  },
  "until": {
   "type": "number"
  },
  "reason": {
   "type": "string",
   "description": "unsure-speaker no-slot nothing-to-undo not-lowered not-addressed not-a-raise room-raise-disabled unsupported"
  },
  "t0": {
   "type": [
    "number",
    "null"
   ]
  },
  "t1": {
   "type": "number"
  },
  "seconds": {
   "type": "number"
  }
 }
}