{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://marqdo.dev/schemas/trace-v2.schema.json", "title": "Marqdo Trace v2", "type": "object", "required": ["schema", "schema_version", "run", "source", "limits", "truncated", "events"], "properties": { "schema": {"const": "marqdo.trace"}, "schema_version": {"const": 2}, "run": { "type": "object", "required": ["id", "entry", "status"], "properties": { "id": {"type": "string", "minLength": 1}, "entry": {"type": "string", "minLength": 1}, "status": {"type": "string", "minLength": 1} }, "additionalProperties": true }, "source": { "type": "object", "required": ["root_id", "analysis_digest"], "properties": { "root_id": {"type": "string", "pattern": "^(root:|sha256:[0-9a-f]{64}$)"}, "analysis_digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"} }, "additionalProperties": true }, "limits": { "type": "object", "required": ["max_events", "max_bytes"], "properties": { "max_events": {"type": "integer", "minimum": 0}, "max_bytes": {"type": "integer", "minimum": 0} }, "additionalProperties": false }, "truncated": { "oneOf": [ {"type": "null"}, { "type": "object", "required": ["reason", "limit", "written"], "properties": { "reason": {"enum": ["event_budget", "byte_budget"]}, "limit": {"type": "integer", "minimum": 0}, "written": {"type": "integer", "minimum": 0} }, "additionalProperties": true } ] }, "events": { "type": "array", "items": { "type": "object", "required": ["seq", "kind", "module_id", "span", "detail"], "properties": { "seq": {"type": "integer", "minimum": 0}, "kind": {"type": "string", "minLength": 1}, "function_id": {"type": ["string", "null"]}, "module_id": {"type": ["string", "null"]}, "span": { "oneOf": [ {"type": "null"}, { "type": "object", "required": ["start", "end"], "properties": { "start": {"type": "integer", "minimum": 0}, "end": {"type": "integer", "minimum": 0} }, "additionalProperties": true } ] }, "detail": {"type": ["string", "null"]}, "operation": {"type": "string"}, "duration_micros": {"type": "integer", "minimum": 0} }, "additionalProperties": true } } }, "additionalProperties": true }