{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oms.local/schemas/lease-expiry.schema.json",
  "title": "OMS expired worker lease evidence",
  "type": "object",
  "additionalProperties": false,
  "required": ["ticket_id", "attempt", "lease_token", "worktree_start_commit", "expired_at", "reason"],
  "properties": {
    "ticket_id": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "attempt": { "type": "integer", "minimum": 1 },
    "lease_token": { "type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$" },
    "worktree_start_commit": { "type": "string", "pattern": "^[a-f0-9]{40}(?:[a-f0-9]{24})?$" },
    "expired_at": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]{1,3})?Z$"
    },
    "reason": { "type": "string", "minLength": 1, "maxLength": 2048 }
  }
}
