agent-apprenticeship 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +269 -3
  2. package/bin/agent-apprenticeship.js +1 -2
  3. package/package.json +4 -4
  4. package/pyproject.toml +10 -4
  5. package/schemas/environment_replay.schema.json +41 -0
  6. package/schemas/eval_package.schema.json +37 -0
  7. package/schemas/experience_compilation.schema.json +53 -0
  8. package/schemas/runtime_training.schema.json +33 -0
  9. package/schemas/source_evidence_map.schema.json +25 -0
  10. package/schemas/trace.schema.json +904 -0
  11. package/schemas/trace_step.schema.json +622 -0
  12. package/schemas/training_rows.schema.json +29 -0
  13. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/__init__.py +1 -1
  14. package/src/agent_apprenticeship/agent_env_exporter.py +53 -0
  15. package/src/agent_apprenticeship/agent_env_verify.py +32 -0
  16. package/src/agent_apprenticeship/atif.py +152 -0
  17. package/src/agent_apprenticeship/atif_models/LICENSE +201 -0
  18. package/src/agent_apprenticeship/atif_models/__init__.py +38 -0
  19. package/src/agent_apprenticeship/atif_models/agent.py +35 -0
  20. package/src/agent_apprenticeship/atif_models/content.py +159 -0
  21. package/src/agent_apprenticeship/atif_models/final_metrics.py +43 -0
  22. package/src/agent_apprenticeship/atif_models/metrics.py +47 -0
  23. package/src/agent_apprenticeship/atif_models/observation.py +19 -0
  24. package/src/agent_apprenticeship/atif_models/observation_result.py +45 -0
  25. package/src/agent_apprenticeship/atif_models/step.py +142 -0
  26. package/src/agent_apprenticeship/atif_models/subagent_trajectory_ref.py +88 -0
  27. package/src/agent_apprenticeship/atif_models/tool_call.py +34 -0
  28. package/src/agent_apprenticeship/atif_models/trajectory.py +196 -0
  29. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/batch_runner.py +1 -1
  30. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/bundle_exporter.py +8 -1
  31. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/certification.py +1 -1
  32. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/cli.py +26 -7
  33. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/codex_runner.py +17 -17
  34. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/config.py +2 -2
  35. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/ecosystem_r2.py +3 -1
  36. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/evaluator.py +8 -27
  37. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/grader.py +6 -5
  38. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/integration_status.py +1 -1
  39. package/src/agent_apprenticeship/io.py +104 -0
  40. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/learning.py +7 -1
  41. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/loop.py +5 -5
  42. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/loop_review.py +1 -1
  43. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/mentor_checkpoints.py +2 -2
  44. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/package_exporter.py +5 -3
  45. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/progress.py +1 -1
  46. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/public_run.py +1 -1
  47. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/public_sanitizer.py +2 -2
  48. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/release_exporter.py +7 -4
  49. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/rubric_generation.py +1 -1
  50. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/schemas.py +17 -4
  51. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/session_events.py +4 -4
  52. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/task_intake.py +1 -1
  53. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/tdo.py +5 -1
  54. package/src/agent_apprenticeship/trace_normalizer.py +103 -0
  55. package/src/agent_apprenticeship/trace_prompt.py +48 -0
  56. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/training_signals.py +1 -1
  57. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/validation.py +3 -3
  58. package/src/{agent_apprenticeship_trace → agent_apprenticeship}/verifier.py +6 -5
  59. package/docs/bioactive_evidence_mapping_schema.md +0 -113
  60. package/docs/dataset_schema.md +0 -160
  61. package/docs/local_usage.md +0 -191
  62. package/docs/scaling_to_1000_tasks.md +0 -3
  63. package/docs/trace_schema.md +0 -192
  64. package/docs/v0.2_release_notes.md +0 -61
  65. package/src/agent_apprenticeship_trace/io.py +0 -20
  66. package/src/agent_apprenticeship_trace/trace_normalizer.py +0 -1026
  67. package/src/agent_apprenticeship_trace/trace_prompt.py +0 -78
  68. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/actual_outputs_normalizer.py +0 -0
  69. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/apprentice_adapters.py +0 -0
  70. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/artifact_capture.py +0 -0
  71. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/artifact_previews.py +0 -0
  72. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/artifact_resolver.py +0 -0
  73. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/command_discovery.py +0 -0
  74. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/contract_diagnostics.py +0 -0
  75. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/contract_verifier.py +0 -0
  76. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/env.py +0 -0
  77. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/lesson_extractor.py +0 -0
  78. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/llm_output_normalizer.py +0 -0
  79. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/openai_structured.py +0 -0
  80. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/recipes.py +0 -0
  81. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/revision.py +0 -0
  82. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/role_runners.py +0 -0
  83. /package/src/{agent_apprenticeship_trace → agent_apprenticeship}/version.py +0 -0
@@ -0,0 +1,622 @@
1
+ {
2
+ "$defs": {
3
+ "AudioSource": {
4
+ "additionalProperties": false,
5
+ "description": "Audio source specification for audio stored as files or at remote URLs.\n\nAdded in ATIF-v1.8. Mirrors ``ImageSource`` so that consumers can treat any\nreferenced media the same way, with one addition: ``duration_sec``. Duration\nis worth recording because several providers bill audio per second and\ndataset statistics need it, and unlike an image's dimensions it cannot be\nrecovered without decoding the file.",
6
+ "properties": {
7
+ "media_type": {
8
+ "description": "MIME type of the audio",
9
+ "enum": [
10
+ "audio/wav",
11
+ "audio/mpeg",
12
+ "audio/mp4",
13
+ "audio/aac",
14
+ "audio/ogg",
15
+ "audio/flac",
16
+ "audio/webm",
17
+ "audio/aiff"
18
+ ],
19
+ "title": "Media Type",
20
+ "type": "string"
21
+ },
22
+ "path": {
23
+ "description": "Location of the audio. Can be a relative or absolute file path, or a URL.",
24
+ "title": "Path",
25
+ "type": "string"
26
+ },
27
+ "duration_sec": {
28
+ "anyOf": [
29
+ {
30
+ "minimum": 0,
31
+ "type": "number"
32
+ },
33
+ {
34
+ "type": "null"
35
+ }
36
+ ],
37
+ "default": null,
38
+ "description": "Optional duration of the audio in seconds. Useful for cost accounting and dataset statistics; omit when unknown.",
39
+ "title": "Duration Sec"
40
+ }
41
+ },
42
+ "required": [
43
+ "media_type",
44
+ "path"
45
+ ],
46
+ "title": "AudioSource",
47
+ "type": "object"
48
+ },
49
+ "ContentPart": {
50
+ "additionalProperties": false,
51
+ "description": "A single content part within a multimodal message.\n\nUsed when a message or observation contains mixed content types (text,\nimages, or audio). For text-only content, a plain string can still be used\ninstead of a ContentPart array.",
52
+ "properties": {
53
+ "type": {
54
+ "description": "The type of content",
55
+ "enum": [
56
+ "text",
57
+ "image",
58
+ "audio"
59
+ ],
60
+ "title": "Type",
61
+ "type": "string"
62
+ },
63
+ "text": {
64
+ "anyOf": [
65
+ {
66
+ "type": "string"
67
+ },
68
+ {
69
+ "type": "null"
70
+ }
71
+ ],
72
+ "default": null,
73
+ "description": "Text content. Required when type='text'.",
74
+ "title": "Text"
75
+ },
76
+ "source": {
77
+ "anyOf": [
78
+ {
79
+ "$ref": "#/$defs/ImageSource"
80
+ },
81
+ {
82
+ "$ref": "#/$defs/AudioSource"
83
+ },
84
+ {
85
+ "type": "null"
86
+ }
87
+ ],
88
+ "default": null,
89
+ "description": "Media source (file reference). Required when type='image' or type='audio', and must match that type.",
90
+ "title": "Source"
91
+ }
92
+ },
93
+ "required": [
94
+ "type"
95
+ ],
96
+ "title": "ContentPart",
97
+ "type": "object"
98
+ },
99
+ "ImageSource": {
100
+ "additionalProperties": false,
101
+ "description": "Image source specification for images stored as files or at remote URLs.",
102
+ "properties": {
103
+ "media_type": {
104
+ "description": "MIME type of the image",
105
+ "enum": [
106
+ "image/jpeg",
107
+ "image/png",
108
+ "image/gif",
109
+ "image/webp"
110
+ ],
111
+ "title": "Media Type",
112
+ "type": "string"
113
+ },
114
+ "path": {
115
+ "description": "Location of the image. Can be a relative or absolute file path, or a URL.",
116
+ "title": "Path",
117
+ "type": "string"
118
+ }
119
+ },
120
+ "required": [
121
+ "media_type",
122
+ "path"
123
+ ],
124
+ "title": "ImageSource",
125
+ "type": "object"
126
+ },
127
+ "Metrics": {
128
+ "additionalProperties": false,
129
+ "description": "LLM operational and confidence data.",
130
+ "properties": {
131
+ "prompt_tokens": {
132
+ "anyOf": [
133
+ {
134
+ "type": "integer"
135
+ },
136
+ {
137
+ "type": "null"
138
+ }
139
+ ],
140
+ "default": null,
141
+ "description": "Total input tokens including cached and non-cached",
142
+ "title": "Prompt Tokens"
143
+ },
144
+ "completion_tokens": {
145
+ "anyOf": [
146
+ {
147
+ "type": "integer"
148
+ },
149
+ {
150
+ "type": "null"
151
+ }
152
+ ],
153
+ "default": null,
154
+ "description": "Total tokens generated by the LLM response",
155
+ "title": "Completion Tokens"
156
+ },
157
+ "cached_tokens": {
158
+ "anyOf": [
159
+ {
160
+ "type": "integer"
161
+ },
162
+ {
163
+ "type": "null"
164
+ }
165
+ ],
166
+ "default": null,
167
+ "description": "Subset of prompt_tokens that were cache hits",
168
+ "title": "Cached Tokens"
169
+ },
170
+ "cost_usd": {
171
+ "anyOf": [
172
+ {
173
+ "type": "number"
174
+ },
175
+ {
176
+ "type": "null"
177
+ }
178
+ ],
179
+ "default": null,
180
+ "description": "Monetary cost of the API call in USD",
181
+ "title": "Cost Usd"
182
+ },
183
+ "prompt_token_ids": {
184
+ "anyOf": [
185
+ {
186
+ "items": {
187
+ "type": "integer"
188
+ },
189
+ "type": "array"
190
+ },
191
+ {
192
+ "type": "null"
193
+ }
194
+ ],
195
+ "default": null,
196
+ "description": "Token IDs for prompt (input) tokens sent to the LLM, including chat history (if applicable)",
197
+ "title": "Prompt Token Ids"
198
+ },
199
+ "completion_token_ids": {
200
+ "anyOf": [
201
+ {
202
+ "items": {
203
+ "type": "integer"
204
+ },
205
+ "type": "array"
206
+ },
207
+ {
208
+ "type": "null"
209
+ }
210
+ ],
211
+ "default": null,
212
+ "description": "Token IDs for completion (response) tokens, enabling RL training without retokenization drift",
213
+ "title": "Completion Token Ids"
214
+ },
215
+ "logprobs": {
216
+ "anyOf": [
217
+ {
218
+ "items": {
219
+ "type": "number"
220
+ },
221
+ "type": "array"
222
+ },
223
+ {
224
+ "type": "null"
225
+ }
226
+ ],
227
+ "default": null,
228
+ "description": "Log probability assigned to each generated token",
229
+ "title": "Logprobs"
230
+ },
231
+ "extra": {
232
+ "anyOf": [
233
+ {
234
+ "additionalProperties": true,
235
+ "type": "object"
236
+ },
237
+ {
238
+ "type": "null"
239
+ }
240
+ ],
241
+ "default": null,
242
+ "description": "Other metrics",
243
+ "title": "Extra"
244
+ }
245
+ },
246
+ "title": "Metrics",
247
+ "type": "object"
248
+ },
249
+ "Observation": {
250
+ "additionalProperties": false,
251
+ "description": "Environment feedback/result after actions or system events.",
252
+ "properties": {
253
+ "results": {
254
+ "description": "Array of result objects from tool calls or actions",
255
+ "items": {
256
+ "$ref": "#/$defs/ObservationResult"
257
+ },
258
+ "title": "Results",
259
+ "type": "array"
260
+ }
261
+ },
262
+ "required": [
263
+ "results"
264
+ ],
265
+ "title": "Observation",
266
+ "type": "object"
267
+ },
268
+ "ObservationResult": {
269
+ "additionalProperties": false,
270
+ "description": "A single result within an observation.",
271
+ "properties": {
272
+ "source_call_id": {
273
+ "anyOf": [
274
+ {
275
+ "type": "string"
276
+ },
277
+ {
278
+ "type": "null"
279
+ }
280
+ ],
281
+ "default": null,
282
+ "description": "The `tool_call_id` from the _tool_calls_ array in _StepObject_ that this result corresponds to. If null or omitted, the result comes from an action that doesn't use the standard tool calling format (e.g., agent actions without tool calls or system-initiated operations).",
283
+ "title": "Source Call Id"
284
+ },
285
+ "content": {
286
+ "anyOf": [
287
+ {
288
+ "type": "string"
289
+ },
290
+ {
291
+ "items": {
292
+ "$ref": "#/$defs/ContentPart"
293
+ },
294
+ "type": "array"
295
+ },
296
+ {
297
+ "type": "null"
298
+ }
299
+ ],
300
+ "default": null,
301
+ "description": "The output or result from the tool execution. String for text-only content, or array of ContentPart for multimodal content (added in ATIF-v1.6).",
302
+ "title": "Content"
303
+ },
304
+ "subagent_trajectory_ref": {
305
+ "anyOf": [
306
+ {
307
+ "items": {
308
+ "$ref": "#/$defs/SubagentTrajectoryRef"
309
+ },
310
+ "type": "array"
311
+ },
312
+ {
313
+ "type": "null"
314
+ }
315
+ ],
316
+ "default": null,
317
+ "description": "Array of references to delegated subagent trajectories",
318
+ "title": "Subagent Trajectory Ref"
319
+ },
320
+ "extra": {
321
+ "anyOf": [
322
+ {
323
+ "additionalProperties": true,
324
+ "type": "object"
325
+ },
326
+ {
327
+ "type": "null"
328
+ }
329
+ ],
330
+ "default": null,
331
+ "description": "Custom observation-result-level metadata (e.g., confidence score, retrieval score, source document ID). Added in ATIF-v1.7.",
332
+ "title": "Extra"
333
+ }
334
+ },
335
+ "title": "ObservationResult",
336
+ "type": "object"
337
+ },
338
+ "SubagentTrajectoryRef": {
339
+ "additionalProperties": false,
340
+ "description": "Reference to a delegated subagent trajectory.\n\nA subagent reference is resolved by one of two mechanisms:\n\n1. **Embedded form** \u2014 set `trajectory_id` to match the\n `Trajectory.trajectory_id` of an entry in the parent's\n `subagent_trajectories` array.\n2. **File-ref form** \u2014 set `trajectory_path` to the location\n (file path, S3 URL, etc.) of an external trajectory file.\n\nThese two mechanisms are the only resolution keys. `session_id`, when\npresent on the ref, is **informational only**: it records the run\nidentity of the delegated subagent for debug / correlation / cross-\ntrajectory search purposes, and MUST NOT be used as a matching key\n(it is run-scoped and MAY collide across siblings \u2014 see\n`Trajectory.session_id`). A ref therefore MUST set at least one of\n`trajectory_id` or `trajectory_path`; `session_id` alone is not a\nresolvable reference.",
341
+ "properties": {
342
+ "trajectory_id": {
343
+ "anyOf": [
344
+ {
345
+ "type": "string"
346
+ },
347
+ {
348
+ "type": "null"
349
+ }
350
+ ],
351
+ "default": null,
352
+ "description": "Canonical identifier of the delegated subagent trajectory. Matches `Trajectory.trajectory_id` of an entry in the parent's `subagent_trajectories` array and is the resolution key for embedded references. Added in ATIF-v1.7 to provide a document-unique matching key without overloading `session_id`.",
353
+ "title": "Trajectory Id"
354
+ },
355
+ "session_id": {
356
+ "anyOf": [
357
+ {
358
+ "type": "string"
359
+ },
360
+ {
361
+ "type": "null"
362
+ }
363
+ ],
364
+ "default": null,
365
+ "description": "Run identity of the delegated subagent trajectory. Informational only: recorded so consumers can correlate this ref back to the subagent's run for debug / search / display purposes. Run-scoped (see `Trajectory.session_id`) and therefore NOT a valid resolution key \u2014 consumers MUST resolve via `trajectory_id` (embedded) or `trajectory_path` (external file).",
366
+ "title": "Session Id"
367
+ },
368
+ "trajectory_path": {
369
+ "anyOf": [
370
+ {
371
+ "type": "string"
372
+ },
373
+ {
374
+ "type": "null"
375
+ }
376
+ ],
377
+ "default": null,
378
+ "description": "Location of the complete subagent trajectory as an external file (file path, S3 URL, database reference, etc.). Resolution key for file-ref references. When both `trajectory_id` and `trajectory_path` are set, consumers MAY choose either; typically `trajectory_id` is preferred when the embedded trajectory is available in-memory.",
379
+ "title": "Trajectory Path"
380
+ },
381
+ "extra": {
382
+ "anyOf": [
383
+ {
384
+ "additionalProperties": true,
385
+ "type": "object"
386
+ },
387
+ {
388
+ "type": "null"
389
+ }
390
+ ],
391
+ "default": null,
392
+ "description": "Custom metadata about the subagent execution",
393
+ "title": "Extra"
394
+ }
395
+ },
396
+ "title": "SubagentTrajectoryRef",
397
+ "type": "object"
398
+ },
399
+ "ToolCall": {
400
+ "additionalProperties": false,
401
+ "description": "A tool call within a step.",
402
+ "properties": {
403
+ "tool_call_id": {
404
+ "description": "Unique identifier for this specific tool call",
405
+ "title": "Tool Call Id",
406
+ "type": "string"
407
+ },
408
+ "function_name": {
409
+ "description": "The name of the function or tool being invoked",
410
+ "title": "Function Name",
411
+ "type": "string"
412
+ },
413
+ "arguments": {
414
+ "additionalProperties": true,
415
+ "description": "Arguments passed to the function (can be empty dict)",
416
+ "title": "Arguments",
417
+ "type": "object"
418
+ },
419
+ "extra": {
420
+ "anyOf": [
421
+ {
422
+ "additionalProperties": true,
423
+ "type": "object"
424
+ },
425
+ {
426
+ "type": "null"
427
+ }
428
+ ],
429
+ "default": null,
430
+ "description": "Custom tool-call-level metadata (e.g., timeout, retry count, tool version). Added in ATIF-v1.7.",
431
+ "title": "Extra"
432
+ }
433
+ },
434
+ "required": [
435
+ "tool_call_id",
436
+ "function_name",
437
+ "arguments"
438
+ ],
439
+ "title": "ToolCall",
440
+ "type": "object"
441
+ }
442
+ },
443
+ "additionalProperties": false,
444
+ "description": "A single step in the trajectory.",
445
+ "properties": {
446
+ "step_id": {
447
+ "description": "Ordinal index of the turn (starting from 1)",
448
+ "minimum": 1,
449
+ "title": "Step Id",
450
+ "type": "integer"
451
+ },
452
+ "timestamp": {
453
+ "anyOf": [
454
+ {
455
+ "type": "string"
456
+ },
457
+ {
458
+ "type": "null"
459
+ }
460
+ ],
461
+ "default": null,
462
+ "description": "ISO 8601 timestamp indicating when this step occurred",
463
+ "title": "Timestamp"
464
+ },
465
+ "source": {
466
+ "description": "The originator of this step",
467
+ "enum": [
468
+ "system",
469
+ "user",
470
+ "agent"
471
+ ],
472
+ "title": "Source",
473
+ "type": "string"
474
+ },
475
+ "model_name": {
476
+ "anyOf": [
477
+ {
478
+ "type": "string"
479
+ },
480
+ {
481
+ "type": "null"
482
+ }
483
+ ],
484
+ "default": null,
485
+ "description": "The specific LLM model used for this turn. Omission implies the model defined in the root-level agent config.",
486
+ "title": "Model Name"
487
+ },
488
+ "reasoning_effort": {
489
+ "anyOf": [
490
+ {
491
+ "type": "string"
492
+ },
493
+ {
494
+ "type": "number"
495
+ },
496
+ {
497
+ "type": "null"
498
+ }
499
+ ],
500
+ "default": null,
501
+ "description": "Qualitative or quantitative measure of effort",
502
+ "title": "Reasoning Effort"
503
+ },
504
+ "message": {
505
+ "anyOf": [
506
+ {
507
+ "type": "string"
508
+ },
509
+ {
510
+ "items": {
511
+ "$ref": "#/$defs/ContentPart"
512
+ },
513
+ "type": "array"
514
+ }
515
+ ],
516
+ "description": "The dialogue message. String for text-only content, or array of ContentPart for multimodal content (added in ATIF-v1.6).",
517
+ "title": "Message"
518
+ },
519
+ "reasoning_content": {
520
+ "anyOf": [
521
+ {
522
+ "type": "string"
523
+ },
524
+ {
525
+ "type": "null"
526
+ }
527
+ ],
528
+ "default": null,
529
+ "description": "The agent's explicit internal reasoning",
530
+ "title": "Reasoning Content"
531
+ },
532
+ "tool_calls": {
533
+ "anyOf": [
534
+ {
535
+ "items": {
536
+ "$ref": "#/$defs/ToolCall"
537
+ },
538
+ "type": "array"
539
+ },
540
+ {
541
+ "type": "null"
542
+ }
543
+ ],
544
+ "default": null,
545
+ "description": "Array of structured objects for the agent's actions",
546
+ "title": "Tool Calls"
547
+ },
548
+ "observation": {
549
+ "anyOf": [
550
+ {
551
+ "$ref": "#/$defs/Observation"
552
+ },
553
+ {
554
+ "type": "null"
555
+ }
556
+ ],
557
+ "default": null,
558
+ "description": "Environment feedback/result after actions or system events"
559
+ },
560
+ "metrics": {
561
+ "anyOf": [
562
+ {
563
+ "$ref": "#/$defs/Metrics"
564
+ },
565
+ {
566
+ "type": "null"
567
+ }
568
+ ],
569
+ "default": null,
570
+ "description": "LLM operational and confidence data for this step"
571
+ },
572
+ "is_copied_context": {
573
+ "anyOf": [
574
+ {
575
+ "type": "boolean"
576
+ },
577
+ {
578
+ "type": "null"
579
+ }
580
+ ],
581
+ "default": null,
582
+ "description": "Indicates whether this step was copied from a previous trajectory for context (e.g., during continuation after summarization). Steps marked as copied context should not be included in training data as they represent previously-trained interactions. Added in ATIF-v1.5.",
583
+ "title": "Is Copied Context"
584
+ },
585
+ "llm_call_count": {
586
+ "anyOf": [
587
+ {
588
+ "minimum": 0,
589
+ "type": "integer"
590
+ },
591
+ {
592
+ "type": "null"
593
+ }
594
+ ],
595
+ "default": null,
596
+ "description": "Number of LLM inferences this step represents. When >1, metrics are aggregated across multiple LLM calls. When 1, the step represents exactly one inference. When 0 on a `source: 'agent'` step, the step represents a deterministic (non-LLM) dispatch; `metrics` and `reasoning_content` MUST be absent in that case. When null, the producer did not track this (backward-compatible default). Added in ATIF-v1.7.",
597
+ "title": "Llm Call Count"
598
+ },
599
+ "extra": {
600
+ "anyOf": [
601
+ {
602
+ "additionalProperties": true,
603
+ "type": "object"
604
+ },
605
+ {
606
+ "type": "null"
607
+ }
608
+ ],
609
+ "default": null,
610
+ "description": "Custom step-level metadata",
611
+ "title": "Extra"
612
+ }
613
+ },
614
+ "required": [
615
+ "step_id",
616
+ "source",
617
+ "message"
618
+ ],
619
+ "title": "Step",
620
+ "type": "object",
621
+ "$schema": "https://json-schema.org/draft/2020-12/schema"
622
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://forsy.ai/schemas/agent-apprenticeship/training_rows.schema.json",
4
+ "title": "Training Rows",
5
+ "type": "object",
6
+ "required": ["row_id", "row_type", "task_id", "source_evidence_refs"],
7
+ "properties": {
8
+ "row_id": { "type": "string", "minLength": 1 },
9
+ "row_type": {
10
+ "type": "string",
11
+ "enum": ["sft", "process_supervision", "reward", "verifier", "preference_pair", "critique_revision", "failure_case", "task_variant", "rollout"]
12
+ },
13
+ "task_id": { "type": "string", "minLength": 1 },
14
+ "domain": { "type": "string" },
15
+ "subdomain": { "type": "string" },
16
+ "workflow_family": { "type": "string" },
17
+ "instruction": { "type": "string" },
18
+ "input_context": { "type": "string" },
19
+ "target_output": { "type": "string" },
20
+ "quality_score": { "type": "number", "minimum": 0, "maximum": 1 },
21
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
22
+ "source_evidence_refs": {
23
+ "type": "array",
24
+ "items": { "type": "string" },
25
+ "minItems": 1
26
+ }
27
+ },
28
+ "additionalProperties": true
29
+ }
@@ -1,2 +1,2 @@
1
1
  """Agent Apprenticeship framework."""
2
- __version__ = "0.2.0"
2
+ __version__ = "0.3.0"