-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrace_v1.json
More file actions
380 lines (380 loc) · 15.3 KB
/
trace_v1.json
File metadata and controls
380 lines (380 loc) · 15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://sentience.ai/schemas/trace/v1",
"title": "Sentience Agent Trace Event",
"description": "Schema for Sentience agent trace events in JSONL format",
"type": "object",
"required": ["v", "type", "ts", "run_id", "seq", "data"],
"properties": {
"v": {
"type": "integer",
"const": 1,
"description": "Schema version"
},
"type": {
"type": "string",
"enum": ["run_start", "step_start", "snapshot", "snapshot_taken", "llm_called", "llm_response", "action", "action_executed", "verification", "recovery", "step_end", "run_end", "error"],
"description": "Event type"
},
"ts": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp"
},
"ts_ms": {
"type": "integer",
"description": "Unix timestamp in milliseconds"
},
"run_id": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"description": "UUID for the agent run"
},
"seq": {
"type": "integer",
"minimum": 1,
"description": "Monotonically increasing sequence number"
},
"step_id": {
"type": ["string", "null"],
"description": "Step identifier in 'step-N' format where N is the step index (present for step-scoped events)"
},
"step_index": {
"type": ["integer", "null"],
"minimum": 0,
"description": "Step index (0-based), present for step-scoped events"
},
"data": {
"type": "object",
"description": "Event-specific payload",
"oneOf": [
{
"description": "run_start data",
"properties": {
"agent": {"type": "string"},
"llm_model": {"type": ["string", "null"]},
"config": {"type": "object"}
}
},
{
"description": "step_start data",
"required": ["step_id", "step_index", "goal", "attempt"],
"properties": {
"step_id": {"type": "string"},
"step_index": {"type": "integer"},
"goal": {"type": "string"},
"attempt": {"type": "integer"},
"pre_url": {"type": ["string", "null"]}
}
},
{
"description": "snapshot or snapshot_taken data",
"properties": {
"step_id": {"type": ["string", "null"]},
"step_index": {"type": ["integer", "null"], "minimum": 0, "description": "Step index for Studio compatibility"},
"snapshot_id": {"type": ["string", "null"]},
"snapshot_digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"snapshot_digest_loose": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"url": {"type": ["string", "null"]},
"element_count": {"type": "integer"},
"timestamp": {"type": ["string", "null"]},
"diagnostics": {
"type": ["object", "null"],
"properties": {
"confidence": {"type": ["number", "null"]},
"reasons": {"type": "array", "items": {"type": "string"}},
"metrics": {
"type": ["object", "null"],
"properties": {
"ready_state": {"type": ["string", "null"]},
"quiet_ms": {"type": ["number", "null"]},
"node_count": {"type": ["integer", "null"]},
"interactive_count": {"type": ["integer", "null"]},
"raw_elements_count": {"type": ["integer", "null"]}
},
"additionalProperties": true
},
"captcha": {
"type": ["object", "null"],
"properties": {
"detected": {"type": "boolean"},
"provider_hint": {
"type": ["string", "null"],
"enum": ["recaptcha", "hcaptcha", "turnstile", "arkose", "awswaf", "unknown", null]
},
"confidence": {"type": "number"},
"evidence": {
"type": "object",
"properties": {
"text_hits": {"type": "array", "items": {"type": "string"}},
"selector_hits": {"type": "array", "items": {"type": "string"}},
"iframe_src_hits": {"type": "array", "items": {"type": "string"}},
"url_hits": {"type": "array", "items": {"type": "string"}}
}
}
},
"required": ["detected", "confidence", "evidence"]
}
},
"additionalProperties": true
},
"elements": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {"type": "integer"},
"role": {"type": "string"},
"text": {"type": ["string", "null"]},
"importance": {"type": "number"},
"importance_score": {"type": "number"},
"bbox": {
"type": "object",
"properties": {
"x": {"type": "number"},
"y": {"type": "number"},
"width": {"type": "number"},
"height": {"type": "number"}
},
"required": ["x", "y", "width", "height"]
},
"visual_cues": {
"type": "object",
"properties": {
"is_primary": {"type": "boolean"},
"is_clickable": {"type": "boolean"},
"background_color_name": {"type": ["string", "null"]}
}
},
"in_viewport": {"type": "boolean"},
"is_occluded": {"type": "boolean"},
"z_index": {"type": "integer"},
"rerank_index": {"type": ["integer", "null"]},
"heuristic_index": {"type": ["integer", "null"]},
"ml_probability": {"type": ["number", "null"]},
"ml_score": {"type": ["number", "null"]},
"diff_status": {
"type": ["string", "null"],
"enum": ["ADDED", "REMOVED", "MODIFIED", "MOVED", null],
"description": "Diff status for Diff Overlay feature. ADDED: new element, REMOVED: element was removed, MODIFIED: element changed, MOVED: element position changed, null: no change"
}
},
"required": ["id", "role", "importance", "bbox", "visual_cues"]
}
},
"screenshot_base64": {"type": ["string", "null"]},
"screenshot_format": {"type": ["string", "null"], "enum": ["png", "jpeg", null]}
}
},
{
"description": "llm_called data",
"required": ["step_id", "response_text", "response_hash"],
"properties": {
"step_id": {"type": "string"},
"model": {"type": ["string", "null"]},
"temperature": {"type": "number"},
"system_prompt_hash": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"user_prompt_hash": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"response_text": {"type": "string"},
"response_hash": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {"type": "integer"},
"completion_tokens": {"type": "integer"},
"total_tokens": {"type": "integer"}
}
}
}
},
{
"description": "step_end data (StepResult)",
"required": ["step_id", "step_index", "goal", "attempt", "pre", "llm", "exec", "post", "verify"],
"properties": {
"v": {"type": "integer", "const": 1},
"step_id": {"type": "string"},
"step_index": {"type": "integer"},
"goal": {"type": "string"},
"attempt": {"type": "integer"},
"pre": {
"type": "object",
"required": ["snapshot_digest"],
"properties": {
"url": {"type": ["string", "null"]},
"snapshot_digest": {"type": "string"},
"snapshot_digest_loose": {"type": "string"}
}
},
"llm": {
"type": "object",
"required": ["response_text", "response_hash"],
"properties": {
"response_text": {"type": "string"},
"response_hash": {"type": "string"},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {"type": "integer"},
"completion_tokens": {"type": "integer"},
"total_tokens": {"type": "integer"}
}
}
}
},
"action": {
"type": "object",
"required": ["kind"],
"properties": {
"kind": {"type": "string", "enum": ["click", "type", "press", "finish", "navigate", "scroll"]},
"element_id": {"type": "integer"},
"text": {"type": "string"},
"key": {"type": "string"},
"url": {"type": "string"},
"raw": {"type": "string"}
}
},
"exec": {
"type": "object",
"required": ["success", "outcome", "duration_ms"],
"properties": {
"success": {"type": "boolean"},
"outcome": {"type": "string"},
"action": {"type": "string"},
"element_id": {"type": "integer"},
"text": {"type": "string"},
"key": {"type": "string"},
"url_changed": {"type": ["boolean", "null"]},
"duration_ms": {"type": "integer"},
"error": {"type": ["string", "null"]},
"bounding_box": {
"type": "object",
"properties": {
"x": {"type": "number"},
"y": {"type": "number"},
"width": {"type": "number"},
"height": {"type": "number"}
}
}
}
},
"post": {
"type": "object",
"properties": {
"url": {"type": ["string", "null"]},
"snapshot_digest": {"type": "string"},
"snapshot_digest_loose": {"type": "string"}
}
},
"verify": {
"type": "object",
"required": ["passed"],
"properties": {
"policy": {"type": "string"},
"passed": {"type": "boolean"},
"signals": {
"type": "object",
"properties": {
"url_changed": {"type": "boolean"},
"error": {"type": ["string", "null"]},
"elements_found": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {"type": "string"},
"bounding_box": {
"type": "object",
"properties": {
"x": {"type": "number"},
"y": {"type": "number"},
"width": {"type": "number"},
"height": {"type": "number"}
}
}
}
}
},
"assertions": {
"type": "array",
"description": "Assertion results from agent verification loop",
"items": {
"type": "object",
"required": ["label", "passed"],
"properties": {
"label": {"type": "string", "description": "Human-readable assertion label"},
"passed": {"type": "boolean", "description": "Whether the assertion passed"},
"required": {"type": "boolean", "description": "If true, assertion gates step success"},
"reason": {"type": "string", "description": "Explanation (especially when failed)"},
"details": {"type": "object", "description": "Additional structured data for debugging"}
}
}
},
"task_done": {"type": "boolean", "description": "True if task completion assertion passed"},
"task_done_label": {"type": "string", "description": "Label of the task completion assertion"}
}
}
}
},
"recovery": {
"type": ["object", "null"],
"properties": {
"attempted": {"type": "boolean"},
"success": {"type": "boolean"},
"strategy": {"type": "string"},
"attempts": {"type": "array"}
}
}
}
},
{
"description": "verification data",
"required": ["step_id", "passed"],
"properties": {
"step_id": {"type": "string"},
"passed": {"type": "boolean"},
"kind": {
"type": "string",
"enum": ["assert", "task_done", "captcha"],
"description": "Type of verification event"
},
"label": {"type": "string", "description": "Human-readable label for the assertion"},
"required": {"type": "boolean", "description": "If true, assertion gates step success"},
"reason": {"type": "string", "description": "Explanation (especially when failed)"},
"details": {"type": "object", "description": "Additional structured data for debugging"},
"signals": {"type": "object"}
}
},
{
"description": "recovery data",
"required": ["step_id", "strategy"],
"properties": {
"step_id": {"type": "string"},
"strategy": {"type": "string"},
"attempt": {"type": "integer"}
}
},
{
"description": "run_end data",
"required": ["steps"],
"properties": {
"steps": {"type": "integer"},
"status": {
"type": "string",
"enum": ["success", "failure", "partial", "unknown"],
"description": "Final execution status"
}
}
},
{
"description": "error data",
"required": ["step_id", "error"],
"properties": {
"step_id": {"type": "string"},
"attempt": {"type": "integer"},
"error": {"type": "string"}
}
}
]
}
}
}