{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zaroz.cloud/contract/units/v1/unit-signal-status.schema.json",
  "title": "UnitSignal (units.zaroz.cloud/v1) status",
  "description": "Written by the agent through the status subresource only, coalesced to at most 5 patches per second. Every field is always present (null, not absent) because the agent patches with a JSON merge patch.",
  "type": "object",
  "required": ["observedGeneration", "agentVersion", "signalledReady", "accepting", "activity", "activitySince", "shutdownRequestedAt", "allocationAck", "seq"],
  "properties": {
    "observedGeneration": { "type": "integer" },
    "agentVersion": { "type": "string" },
    "signalledReady": { "oneOf": [{ "type": "null" }, { "type": "string", "format": "date-time" }] },
    "accepting": { "type": "boolean" },
    "activity": { "oneOf": [{ "type": "null" }, { "enum": ["idle", "busy"] }] },
    "activitySince": { "oneOf": [{ "type": "null" }, { "type": "string", "format": "date-time" }] },
    "shutdownRequestedAt": { "oneOf": [{ "type": "null" }, { "type": "string", "format": "date-time" }] },
    "allocationAck": { "oneOf": [{ "type": "null" }, { "type": "string" }], "description": "Id of the allocation whose files are written, null when none." },
    "seq": { "type": "integer", "minimum": 0, "description": "Monotonic per agent start." }
  }
}
