{ "$id": "https://stella-ops.org/schemas/events/scheduler.graph.job.completed@1.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Scheduler Graph Job Completed Event", "description": "Legacy scheduler event emitted when a graph build or overlay job reaches a terminal state. Consumers validate downstream caches and surface overlay freshness.", "type": "object", "additionalProperties": false, "required": ["eventId", "kind", "tenant", "ts", "payload"], "properties": { "eventId": { "type": "string", "format": "uuid", "description": "Globally unique identifier per event." }, "kind": { "const": "scheduler.graph.job.completed" }, "tenant": { "type": "string", "description": "Tenant identifier scoped to the originating job." }, "ts": { "type": "string", "format": "date-time", "description": "UTC timestamp when the job reached a terminal state." }, "payload": { "type": "object", "additionalProperties": false, "required": ["jobType", "job", "status", "occurredAt"], "properties": { "jobType": { "type": "string", "enum": ["build", "overlay"], "description": "Job flavour, matches the CLR type of the serialized job payload." }, "status": { "type": "string", "enum": ["completed", "failed", "cancelled"], "description": "Terminal status recorded for the job." }, "occurredAt": { "type": "string", "format": "date-time", "description": "UTC timestamp of the terminal transition, mirrors job.CompletedAt." }, "job": { "oneOf": [ {"$ref": "#/definitions/graphBuildJob"}, {"$ref": "#/definitions/graphOverlayJob"} ], "description": "Canonical serialized representation of the finished job." }, "resultUri": { "type": "string", "description": "Optional URI pointing to Cartographer snapshot or overlay bundle (if available)." } } }, "attributes": { "type": "object", "description": "Optional correlation bag for downstream consumers.", "additionalProperties": { "type": "string" } } }, "definitions": { "graphBuildJob": { "type": "object", "additionalProperties": false, "required": [ "schemaVersion", "id", "tenantId", "sbomId", "sbomVersionId", "sbomDigest", "status", "trigger", "attempts", "createdAt" ], "properties": { "schemaVersion": { "const": "scheduler.graph-build-job@1" }, "id": {"type": "string"}, "tenantId": {"type": "string"}, "sbomId": {"type": "string"}, "sbomVersionId": {"type": "string"}, "sbomDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }, "graphSnapshotId": {"type": "string"}, "status": { "type": "string", "enum": ["pending", "queued", "running", "completed", "failed", "cancelled"] }, "trigger": { "type": "string", "enum": ["sbom-version", "backfill", "manual"] }, "attempts": { "type": "integer", "minimum": 0 }, "cartographerJobId": {"type": "string"}, "correlationId": {"type": "string"}, "createdAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": {"type": "string"}, "metadata": { "type": "object", "additionalProperties": {"type": "string"} } } }, "graphOverlayJob": { "type": "object", "additionalProperties": false, "required": [ "schemaVersion", "id", "tenantId", "graphSnapshotId", "overlayKind", "overlayKey", "status", "trigger", "attempts", "createdAt" ], "properties": { "schemaVersion": { "const": "scheduler.graph-overlay-job@1" }, "id": {"type": "string"}, "tenantId": {"type": "string"}, "graphSnapshotId": {"type": "string"}, "buildJobId": {"type": "string"}, "overlayKind": { "type": "string", "enum": ["policy", "advisory", "vex"] }, "overlayKey": {"type": "string"}, "subjects": { "type": "array", "items": {"type": "string"}, "uniqueItems": true }, "status": { "type": "string", "enum": ["pending", "queued", "running", "completed", "failed", "cancelled"] }, "trigger": { "type": "string", "enum": ["policy", "advisory", "vex", "sbom-version", "manual"] }, "attempts": { "type": "integer", "minimum": 0 }, "correlationId": {"type": "string"}, "createdAt": { "type": "string", "format": "date-time" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "error": {"type": "string"}, "metadata": { "type": "object", "additionalProperties": {"type": "string"} } } } } }