Files
Cognitive_Agent/contracts/schemas/trace-event.schema.json
T
2026-07-30 08:45:38 +08:00

32 lines
1.4 KiB
JSON
Executable File

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cognitive-agent.local/schemas/trace-event.schema.json",
"title": "TraceEvent",
"type": "object",
"additionalProperties": false,
"required": ["apiVersion", "kind", "event_id", "request_id", "timestamp", "stage", "status", "summary"],
"properties": {
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
"kind": {"const": "TraceEvent"},
"event_id": {"type": "string", "minLength": 3},
"request_id": {"type": "string", "minLength": 3},
"timestamp": {"type": "string", "format": "date-time"},
"stage": {
"type": "string",
"enum": ["intent_parse", "context_resolve", "domain_route", "function_generate", "scene_plan", "schema_validate", "domain_validate", "compile", "safety_check", "schedule", "execute", "state_update", "telemetry"]
},
"status": {"type": "string", "enum": ["started", "succeeded", "failed", "waiting_confirmation", "skipped"]},
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
"summary": {"type": "string", "minLength": 1, "maxLength": 1000},
"artifact_refs": {
"type": "array",
"items": {"type": "string", "format": "uri-reference"}
},
"details": {
"type": "object",
"description": "Sanitized structured facts only; never store private chain-of-thought or secrets."
},
"duration_ms": {"type": "integer", "minimum": 0}
}
}