返回 CodeWhale
event-v1.schema.json
根目录 / pet / schema / event-v1.schema.json
1 {
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://whalesong.local/schema/event-v1.json",
4 "title": "Whalesong normalized event v1",
5 "description": "Canonical normalized events. Import accepts missing optional normalized defaults; canonical output fills them. Category extension uses other + subtype. Additional source fields survive in raw subject to privacy. endTime >= startTime is additionally checked by the importer.",
6 "type": "object",
7 "required": [
8 "schemaVersion",
9 "id",
10 "traceId",
11 "name",
12 "startTime",
13 "endTime",
14 "agentId",
15 "category",
16 "status",
17 "attributes"
18 ],
19 "properties": {
20 "schemaVersion": {
21 "const": 1
22 },
23 "id": {
24 "type": "string",
25 "minLength": 1
26 },
27 "traceId": {
28 "type": "string",
29 "minLength": 1
30 },
31 "parentId": {
32 "type": "string"
33 },
34 "name": {
35 "type": "string",
36 "minLength": 1
37 },
38 "startTime": {
39 "type": "number",
40 "minimum": 0,
41 "description": "Milliseconds relative to the trace origin."
42 },
43 "endTime": {
44 "type": "number",
45 "minimum": 0,
46 "description": "Milliseconds; must be >= startTime. Equal endpoints encode a point event."
47 },
48 "openEnded": {
49 "type": "boolean",
50 "description": "The source duration is unknown. Display as onset-only."
51 },
52 "agentId": {
53 "type": "string"
54 },
55 "category": {
56 "enum": [
57 "reasoning",
58 "tool",
59 "memory",
60 "code",
61 "filesystem",
62 "network",
63 "browser",
64 "communication",
65 "agent",
66 "orchestration",
67 "error",
68 "human",
69 "other"
70 ]
71 },
72 "status": {
73 "enum": [
74 "pending",
75 "running",
76 "success",
77 "error",
78 "unknown"
79 ]
80 },
81 "attributes": {
82 "type": "object",
83 "additionalProperties": true
84 },
85 "payload": {},
86 "raw": {},
87 "observation": {
88 "$ref": "urn:whalesong:evidence:v1#/$defs/observation",
89 "description": "Boundary evidence record this event normalizes; the importer validates it and the JSONL exporter emits it."
90 },
91 "links": {
92 "type": "array",
93 "items": {
94 "type": "object",
95 "required": [
96 "traceId",
97 "spanId"
98 ],
99 "properties": {
100 "traceId": {
101 "type": "string"
102 },
103 "spanId": {
104 "type": "string"
105 },
106 "attributes": {
107 "type": "object"
108 }
109 },
110 "additionalProperties": false
111 }
112 },
113 "agentType": {
114 "type": "string"
115 },
116 "parentAgentId": {
117 "type": "string"
118 },
119 "subtype": {
120 "type": "string"
121 },
122 "model": {
123 "type": "string"
124 },
125 "provider": {
126 "type": "string"
127 },
128 "tool": {
129 "type": "string"
130 },
131 "costCurrency": {
132 "type": "string"
133 },
134 "sourceId": {
135 "type": "string"
136 },
137 "targetId": {
138 "type": "string"
139 },
140 "targetType": {
141 "type": "string"
142 },
143 "inputTokens": {
144 "type": "number",
145 "minimum": 0
146 },
147 "outputTokens": {
148 "type": "number",
149 "minimum": 0
150 },
151 "cachedTokens": {
152 "type": "number",
153 "minimum": 0
154 },
155 "cost": {
156 "type": "number",
157 "minimum": 0
158 },
159 "latency": {
160 "type": "number",
161 "minimum": 0
162 },
163 "contextTokens": {
164 "type": "number",
165 "minimum": 0
166 },
167 "contextLimit": {
168 "type": "number",
169 "minimum": 0
170 },
171 "retry": {
172 "type": "number",
173 "minimum": 0
174 }
175 },
176 "additionalProperties": false
177 }
178
178 lines JSON