{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:sensorium-interface-control-lease:v1",
  "title": "Sensorium Interface Control Lease v1",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "schema/v", "interface/id", "holder/ref", "grant/id", "source/generation-ref", "lease/id", "lease/epoch", "issued/at", "expires/at", "hold/cumulative-ms", "methods", "limits", "authority/refs"],
  "properties": {
    "schema": { "const": "sensorium-interface-control-lease.v1" },
    "schema/v": { "const": 1 },
    "interface/id": { "$ref": "#/$defs/interface_ref" },
    "holder/ref": { "$ref": "#/$defs/ref" },
    "grant/id": { "$ref": "#/$defs/ref" },
    "source/generation-ref": { "$ref": "#/$defs/ref" },
    "lease/id": { "type": "string", "pattern": "^sensorium-control-lease:[^\\s]+$", "maxLength": 512 },
    "lease/epoch": { "type": "integer", "minimum": 1 },
    "issued/at": { "type": "string", "format": "date-time" },
    "expires/at": { "type": "string", "format": "date-time" },
    "hold/cumulative-ms": { "type": "integer", "minimum": 1, "maximum": 86400000 },
    "methods": { "type": "array", "minItems": 1, "maxItems": 32, "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z][a-z0-9.-]{0,127}$" } },
    "limits": { "$ref": "sensorium-interface-actuation-grant-scope.v1.schema.json#/$defs/limits" },
    "authority/refs": { "type": "array", "minItems": 1, "maxItems": 16, "uniqueItems": true, "items": { "$ref": "#/$defs/ref" } },
    "caller/last-sequence": { "type": "integer", "minimum": 0 },
    "operator/held": { "type": "boolean" }
  },
  "$defs": {
    "ref": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^[^\\s]+$" },
    "interface_ref": { "type": "string", "pattern": "^sensorium-interface:[^\\s]+$", "maxLength": 512 }
  }
}
