{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mosaicstack.dev/schemas/orchestrator/event.schema.json",
  "title": "Mosaic Orchestrator Event",
  "type": "object",
  "required": ["event_id", "event_type", "task_id", "status", "timestamp", "source"],
  "properties": {
    "event_id": {
      "type": "string",
      "description": "UUID string"
    },
    "event_type": {
      "type": "string",
      "enum": [
        "task.assigned",
        "task.started",
        "task.progress",
        "task.completed",
        "task.failed",
        "rail.check.started",
        "rail.check.passed",
        "rail.check.failed"
      ]
    },
    "task_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": ["pending", "running", "completed", "failed"]
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "source": {
      "type": "string",
      "enum": ["controller", "worker", "quality-gate"]
    },
    "message": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    }
  },
  "additionalProperties": true
}
