{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "ace://schemas/status-event/1.0.0",
  "title": "ACE Status Event",
  "type": "object",
  "required": [
    "schema_version",
    "event_id",
    "trace_id",
    "timestamp",
    "source_module",
    "event_type",
    "status",
    "payload"
  ],
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "1.0.0"
    },
    "event_id": {
      "type": "string",
      "minLength": 1
    },
    "trace_id": {
      "type": "string",
      "minLength": 1
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "source_module": {
      "type": "string",
      "pattern": "^(capability|agent)-[a-z0-9-]+$"
    },
    "event_type": {
      "type": "string",
      "minLength": 1
    },
    "status": {
      "type": "string",
      "enum": [
        "started",
        "in_progress",
        "pass",
        "fail",
        "blocked",
        "done"
      ]
    },
    "objective_id": {
      "type": "string"
    },
    "decision_id": {
      "type": "string"
    },
    "payload": {
      "type": "object",
      "required": [
        "summary"
      ],
      "properties": {
        "summary": {
          "type": "string",
          "minLength": 1
        },
        "gate_id": {
          "type": "string"
        },
        "evidence_ref": {
          "type": "string"
        },
        "artifact_delta": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    }
  }
}
