mas-lab-component-controller 0.2.0__py3-none-any.whl

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 (89) hide show
  1. mas/lab/controller/__init__.py +7 -0
  2. mas/lab/controller/__main__.py +5 -0
  3. mas/lab/controller/agent_chat.py +226 -0
  4. mas/lab/controller/api.py +364 -0
  5. mas/lab/controller/artifact_discovery.py +107 -0
  6. mas/lab/controller/artifacts.py +112 -0
  7. mas/lab/controller/cli.py +493 -0
  8. mas/lab/controller/client.py +271 -0
  9. mas/lab/controller/config.py +75 -0
  10. mas/lab/controller/constants.py +30 -0
  11. mas/lab/controller/daemon.py +190 -0
  12. mas/lab/controller/deps.py +172 -0
  13. mas/lab/controller/fastapi_app.py +166 -0
  14. mas/lab/controller/http_server.py +243 -0
  15. mas/lab/controller/io_capture.py +55 -0
  16. mas/lab/controller/item_service.py +625 -0
  17. mas/lab/controller/job_store.py +209 -0
  18. mas/lab/controller/jobs.py +375 -0
  19. mas/lab/controller/kinds.py +149 -0
  20. mas/lab/controller/lab_registry.py +1076 -0
  21. mas/lab/controller/manifest_layout.py +832 -0
  22. mas/lab/controller/manifest_store.py +214 -0
  23. mas/lab/controller/manifest_validation.py +90 -0
  24. mas/lab/controller/models.py +215 -0
  25. mas/lab/controller/path_safety.py +68 -0
  26. mas/lab/controller/pipeline_validation.py +79 -0
  27. mas/lab/controller/registry.py +83 -0
  28. mas/lab/controller/routes/__init__.py +82 -0
  29. mas/lab/controller/routes/_api.py +15 -0
  30. mas/lab/controller/routes/apps.py +190 -0
  31. mas/lab/controller/routes/artifacts.py +37 -0
  32. mas/lab/controller/routes/benchmark.py +307 -0
  33. mas/lab/controller/routes/choices.py +141 -0
  34. mas/lab/controller/routes/datasets.py +91 -0
  35. mas/lab/controller/routes/design_patterns.py +121 -0
  36. mas/lab/controller/routes/eval_output.py +31 -0
  37. mas/lab/controller/routes/experiments.py +194 -0
  38. mas/lab/controller/routes/health.py +178 -0
  39. mas/lab/controller/routes/items.py +187 -0
  40. mas/lab/controller/routes/jobs.py +107 -0
  41. mas/lab/controller/routes/libraries.py +144 -0
  42. mas/lab/controller/routes/overlays.py +164 -0
  43. mas/lab/controller/routes/pipelines.py +139 -0
  44. mas/lab/controller/routes/registry.py +40 -0
  45. mas/lab/controller/routes/run.py +215 -0
  46. mas/lab/controller/routes/runs.py +392 -0
  47. mas/lab/controller/routes/scopes.py +139 -0
  48. mas/lab/controller/routes/uploads.py +24 -0
  49. mas/lab/controller/routes/validate.py +36 -0
  50. mas/lab/controller/run_bridge.py +276 -0
  51. mas/lab/controller/run_store.py +190 -0
  52. mas/lab/controller/schema_registry.py +109 -0
  53. mas/lab/controller/schemas/pipeline-step-types-post.json +764 -0
  54. mas/lab/controller/schemas/pipeline-step-types-pre.json +35 -0
  55. mas/lab/controller/scope_catalog.py +266 -0
  56. mas/lab/controller/scope_service.py +134 -0
  57. mas/lab/controller/sessions.py +63 -0
  58. mas/lab/controller/settings.py +65 -0
  59. mas/lab/controller/ui_stream/__init__.py +13 -0
  60. mas/lab/controller/ui_stream/app.py +2147 -0
  61. mas/lab/controller/ui_stream/artefact_bind.py +308 -0
  62. mas/lab/controller/ui_stream/auth.py +136 -0
  63. mas/lab/controller/ui_stream/bus.py +156 -0
  64. mas/lab/controller/ui_stream/export.py +400 -0
  65. mas/lab/controller/ui_stream/governance.py +141 -0
  66. mas/lab/controller/ui_stream/ingest.py +300 -0
  67. mas/lab/controller/ui_stream/inspect.py +55 -0
  68. mas/lab/controller/ui_stream/layouts.py +161 -0
  69. mas/lab/controller/ui_stream/metrics.py +274 -0
  70. mas/lab/controller/ui_stream/plot_folds.py +609 -0
  71. mas/lab/controller/ui_stream/plugin_registry.py +139 -0
  72. mas/lab/controller/ui_stream/refs.py +259 -0
  73. mas/lab/controller/ui_stream/replay.py +236 -0
  74. mas/lab/controller/ui_stream/replay_cli.py +707 -0
  75. mas/lab/controller/ui_stream/run_index.py +337 -0
  76. mas/lab/controller/ui_stream/spec_load.py +48 -0
  77. mas/lab/controller/ui_stream/spec_snapshot.py +313 -0
  78. mas/lab/controller/ui_stream/stream.py +95 -0
  79. mas/lab/controller/ui_stream/streams.py +42 -0
  80. mas/lab/controller/ui_stream/timeline.py +183 -0
  81. mas/lab/controller/ui_stream/ui_trace.py +258 -0
  82. mas/lab/controller/uploads.py +61 -0
  83. mas/lab/controller/worker_model.py +137 -0
  84. mas/lab/controller/workers.py +296 -0
  85. mas/lab/controller/workspace_library.py +70 -0
  86. mas_lab_component_controller-0.2.0.dist-info/METADATA +21 -0
  87. mas_lab_component_controller-0.2.0.dist-info/RECORD +89 -0
  88. mas_lab_component_controller-0.2.0.dist-info/WHEEL +4 -0
  89. mas_lab_component_controller-0.2.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,764 @@
1
+ {
2
+ "$comment": "Registry of all pipeline step types with their config schemas. Use this to build a dynamic pipeline editor in React.",
3
+ "step_types": [
4
+ {
5
+ "type": "service_stop",
6
+ "label": "Stop Service",
7
+ "description": "Stop an infrastructure service (Neo4j, OTel collector, etc.) after all scenarios complete.",
8
+ "phase": "post",
9
+ "category": "infrastructure",
10
+ "config": {
11
+ "service": {
12
+ "type": "string",
13
+ "required": true,
14
+ "description": "Service name declared in the infra bundle (e.g. neo4j, otel-collector)"
15
+ }
16
+ }
17
+ },
18
+ {
19
+ "type": "extract_trajectories",
20
+ "label": "Extract Trajectories",
21
+ "description": "Parse benchmark run traces into a structured trajectories.jsonl file. Extracts the input prompt, final output, per-agent messages, and session metadata from each run's events.jsonl. This is typically the first step in a pipeline — downstream steps like plot_multilevel_trajectory and annotate_metrics consume its output.",
22
+ "phase": "post",
23
+ "category": "extraction",
24
+ "config": {
25
+ "csv_file": {
26
+ "type": "string",
27
+ "default": "results.csv",
28
+ "description": "Benchmark results CSV filename"
29
+ },
30
+ "runs_dir": {
31
+ "type": "string",
32
+ "default": "runs",
33
+ "description": "Relative dir for orphan run scan"
34
+ },
35
+ "overwrite": {
36
+ "type": "boolean",
37
+ "default": false,
38
+ "description": "Overwrite existing extractions"
39
+ }
40
+ }
41
+ },
42
+ {
43
+ "type": "extract_trace_stats",
44
+ "label": "Extract Trace Stats",
45
+ "description": "Compute structural metrics from raw trace files — counts LLM calls, tool invocations, governance events, and measures total duration per run. Outputs a tidy CSV (one row per run) for cost analysis and efficiency comparisons across scenarios. Reads events.jsonl directly from the benchmark output directory.",
46
+ "phase": "post",
47
+ "category": "extraction",
48
+ "config": {
49
+ "output": {
50
+ "type": "string",
51
+ "default": "results/trace_stats.csv",
52
+ "description": "Output CSV path, relative to the level folder (no absolute paths, no '..')"
53
+ },
54
+ "scenarios": {
55
+ "type": "array",
56
+ "description": "Optional list of scenario IDs to include (all if omitted)"
57
+ },
58
+ "item_glob": {
59
+ "type": "string",
60
+ "default": "item*",
61
+ "description": "Glob pattern for item directories"
62
+ },
63
+ "run_glob": {
64
+ "type": "string",
65
+ "default": "r*",
66
+ "description": "Glob pattern for run directories"
67
+ }
68
+ }
69
+ },
70
+ {
71
+ "type": "analysis",
72
+ "label": "Consolidate Results",
73
+ "description": "Consolidate experiment results into DataFrame + optional parquet cache.",
74
+ "phase": "post",
75
+ "category": "analysis",
76
+ "config": {
77
+ "include_events": {
78
+ "type": "boolean",
79
+ "default": true,
80
+ "description": "Include event data in consolidation"
81
+ },
82
+ "cache": {
83
+ "type": "boolean",
84
+ "default": true,
85
+ "description": "Write consolidated.parquet"
86
+ }
87
+ }
88
+ },
89
+ {
90
+ "type": "annotate_metrics",
91
+ "label": "Annotate Metrics",
92
+ "description": "Session-level evaluation metrics via EvalMetric class (e.g., AnswerRelevancyMetric).",
93
+ "phase": "post",
94
+ "category": "evaluation",
95
+ "config": {
96
+ "metric_class": {
97
+ "type": "string",
98
+ "default": "mas.lab.components.evaluation.deepeval_wrapper.AnswerRelevancyMetric",
99
+ "description": "Fully qualified metric class"
100
+ },
101
+ "metric_kwargs": {
102
+ "type": "object",
103
+ "default": {"model": "azure/gpt-4o"},
104
+ "description": "Kwargs passed to metric constructor (model, threshold, etc.)"
105
+ },
106
+ "level": {
107
+ "type": "string",
108
+ "default": "session",
109
+ "enum": [
110
+ "session",
111
+ "turn"
112
+ ],
113
+ "description": "Evaluation granularity"
114
+ },
115
+ "max_items": {
116
+ "type": "integer",
117
+ "default": null,
118
+ "description": "Limit items to evaluate"
119
+ },
120
+ "overwrite": {
121
+ "type": "boolean",
122
+ "default": false,
123
+ "description": "Overwrite existing metrics"
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "type": "embed_trajectories",
129
+ "label": "Embed Trajectories",
130
+ "description": "Compute embedding vectors for trajectory text fields.",
131
+ "phase": "post",
132
+ "category": "analysis",
133
+ "config": {
134
+ "model": {
135
+ "type": "string",
136
+ "default": "text-embedding-3-small",
137
+ "description": "Embedding model"
138
+ },
139
+ "api_base": {
140
+ "type": "string",
141
+ "default": "",
142
+ "description": "API base URL"
143
+ },
144
+ "api_key_env": {
145
+ "type": "string",
146
+ "default": "OPENAI_API_KEY",
147
+ "description": "Env var for API key"
148
+ },
149
+ "levels": {
150
+ "type": "array",
151
+ "default": [
152
+ "session"
153
+ ],
154
+ "description": "Granularity levels"
155
+ },
156
+ "fields": {
157
+ "type": "array",
158
+ "default": [
159
+ "input",
160
+ "output"
161
+ ],
162
+ "description": "Fields to embed"
163
+ },
164
+ "max_items": {
165
+ "type": "integer",
166
+ "default": null,
167
+ "description": "Limit items"
168
+ },
169
+ "overwrite": {
170
+ "type": "boolean",
171
+ "default": false,
172
+ "description": "Overwrite existing"
173
+ },
174
+ "batch_size": {
175
+ "type": "integer",
176
+ "default": 64,
177
+ "description": "Batch size"
178
+ }
179
+ }
180
+ },
181
+ {
182
+ "type": "ggplot",
183
+ "label": "Plot (Custom Class)",
184
+ "description": "Render a publication-quality figure from a MASPlot subclass. Uses experiment results directory for data.",
185
+ "phase": "post",
186
+ "category": "visualization",
187
+ "config": {
188
+ "class": {
189
+ "type": "string",
190
+ "required": true,
191
+ "description": "Plot library YAML name under plot_library/ (e.g. ablation_heatmap)",
192
+ "default": "ablation_heatmap"
193
+ },
194
+ "formats": {
195
+ "type": "array",
196
+ "default": [
197
+ "svg"
198
+ ],
199
+ "description": "Output formats"
200
+ }
201
+ }
202
+ },
203
+ {
204
+ "type": "plot",
205
+ "label": "Plot (Legacy)",
206
+ "description": "Generate visualizations from analysis DataFrame (legacy or declarative).",
207
+ "phase": "post",
208
+ "category": "visualization",
209
+ "config": {
210
+ "type": {
211
+ "type": "string",
212
+ "default": null,
213
+ "enum": [
214
+ "latency_distribution",
215
+ "success_rate",
216
+ "pattern_comparison",
217
+ "pareto_frontier"
218
+ ],
219
+ "description": "Legacy plot type"
220
+ },
221
+ "params": {
222
+ "type": "object",
223
+ "default": {},
224
+ "description": "Plot parameters"
225
+ },
226
+ "spec": {
227
+ "type": "object",
228
+ "default": null,
229
+ "description": "Declarative plot spec (alternative to type)"
230
+ },
231
+ "data_key": {
232
+ "type": "string",
233
+ "default": null,
234
+ "description": "Key in dependency data for declarative mode"
235
+ },
236
+ "filename": {
237
+ "type": "string",
238
+ "default": null,
239
+ "description": "Output filename for declarative mode"
240
+ }
241
+ }
242
+ },
243
+ {
244
+ "type": "plot_trajectory",
245
+ "label": "Plot Trajectory",
246
+ "description": "Render agent trajectory diagram from a single trace.",
247
+ "phase": "post",
248
+ "category": "visualization",
249
+ "config": {
250
+ "log_path": {
251
+ "type": "string",
252
+ "default": null,
253
+ "description": "Path to events.jsonl"
254
+ },
255
+ "format": {
256
+ "type": "string",
257
+ "default": "mermaid",
258
+ "enum": [
259
+ "mermaid",
260
+ "html",
261
+ "svg",
262
+ "table"
263
+ ],
264
+ "description": "Output format"
265
+ },
266
+ "include_prompts": {
267
+ "type": "boolean",
268
+ "default": true,
269
+ "description": "Include prompt text"
270
+ },
271
+ "filename": {
272
+ "type": "string",
273
+ "default": "trajectory",
274
+ "description": "Output filename"
275
+ },
276
+ "highlight_agents": {
277
+ "type": "array",
278
+ "default": null,
279
+ "description": "Agent names to highlight"
280
+ },
281
+ "highlight_keywords": {
282
+ "type": "array",
283
+ "default": null,
284
+ "description": "Keywords to highlight"
285
+ }
286
+ }
287
+ },
288
+ {
289
+ "type": "plot_trajectory_batch",
290
+ "label": "Plot Trajectory (Batch)",
291
+ "description": "Render trajectory diagrams for multiple runs.",
292
+ "phase": "post",
293
+ "category": "visualization",
294
+ "config": {
295
+ "runs": {
296
+ "type": "array",
297
+ "required": true,
298
+ "description": "List of {log_path, filename} entries"
299
+ },
300
+ "format": {
301
+ "type": "string",
302
+ "default": "html",
303
+ "enum": [
304
+ "mermaid",
305
+ "html",
306
+ "svg",
307
+ "table"
308
+ ],
309
+ "description": "Output format"
310
+ },
311
+ "include_prompts": {
312
+ "type": "boolean",
313
+ "default": true,
314
+ "description": "Include prompt text"
315
+ },
316
+ "concurrency": {
317
+ "type": "integer",
318
+ "default": 1,
319
+ "description": "Parallel renders"
320
+ }
321
+ }
322
+ },
323
+ {
324
+ "type": "plot_multilevel_trajectory",
325
+ "label": "Plot Multilevel Trajectory",
326
+ "description": "Render an interactive timeline showing how agents, LLM calls, and tool invocations interleave across a run. The diagram reveals execution structure: which agent delegated to which, how long each step took, and where parallelism or bottlenecks occur. Outputs HTML (interactive) or SVG (static). Depends on extract_trajectories.",
327
+ "phase": "post",
328
+ "category": "visualization",
329
+ "config": {
330
+ "log_path": {
331
+ "type": "string",
332
+ "default": null,
333
+ "description": "Path to events.jsonl"
334
+ },
335
+ "format": {
336
+ "type": "string",
337
+ "default": "html",
338
+ "enum": [
339
+ "html",
340
+ "svg"
341
+ ],
342
+ "description": "Output format"
343
+ },
344
+ "title": {
345
+ "type": "string",
346
+ "default": "MAS Multilevel Trajectory",
347
+ "description": "Diagram title"
348
+ },
349
+ "width_mode": {
350
+ "type": "string",
351
+ "default": "log",
352
+ "enum": [
353
+ "log",
354
+ "linear"
355
+ ],
356
+ "description": "Width scaling mode"
357
+ },
358
+ "show_user_actors": {
359
+ "type": "boolean",
360
+ "default": true,
361
+ "description": "Show user actors"
362
+ },
363
+ "filename": {
364
+ "type": "string",
365
+ "default": "multilevel_trajectory",
366
+ "description": "Output filename"
367
+ },
368
+ "annotations": {
369
+ "type": "string",
370
+ "default": null,
371
+ "description": "Annotations YAML path"
372
+ },
373
+ "highlight_agents": {
374
+ "type": "array",
375
+ "default": null,
376
+ "description": "Agents to highlight"
377
+ },
378
+ "pins": {
379
+ "type": "array",
380
+ "default": null,
381
+ "description": "Pin markers"
382
+ }
383
+ }
384
+ },
385
+ {
386
+ "type": "plot_multilevel_trajectory_batch",
387
+ "label": "Plot Multilevel Trajectory (Batch)",
388
+ "description": "Batch multilevel trajectory rendering across runs.",
389
+ "phase": "post",
390
+ "category": "visualization",
391
+ "config": {
392
+ "runs": {
393
+ "type": "array",
394
+ "default": null,
395
+ "description": "Explicit run list (auto-derived if omitted)"
396
+ },
397
+ "format": {
398
+ "type": "string",
399
+ "default": "html",
400
+ "enum": [
401
+ "html",
402
+ "svg"
403
+ ],
404
+ "description": "Output format"
405
+ },
406
+ "width_mode": {
407
+ "type": "string",
408
+ "default": "log",
409
+ "enum": [
410
+ "log",
411
+ "linear"
412
+ ],
413
+ "description": "Width scaling"
414
+ },
415
+ "show_user_actors": {
416
+ "type": "boolean",
417
+ "default": true,
418
+ "description": "Show user actors"
419
+ },
420
+ "title": {
421
+ "type": "string",
422
+ "default": "MAS Multilevel Trajectory",
423
+ "description": "Diagram title"
424
+ },
425
+ "annotations": {
426
+ "type": "string",
427
+ "default": null,
428
+ "description": "Annotations YAML"
429
+ },
430
+ "highlight_agents": {
431
+ "type": "array",
432
+ "default": null,
433
+ "description": "Agents to highlight"
434
+ },
435
+ "pins": {
436
+ "type": "array",
437
+ "default": null,
438
+ "description": "Pin markers"
439
+ },
440
+ "concurrency": {
441
+ "type": "integer",
442
+ "default": 1,
443
+ "description": "Parallel renders"
444
+ }
445
+ }
446
+ },
447
+ {
448
+ "type": "plot_communication_flow",
449
+ "label": "Plot Communication Flow",
450
+ "description": "Agent communication-flow diagram.",
451
+ "phase": "post",
452
+ "category": "visualization",
453
+ "config": {
454
+ "log_path": {
455
+ "type": "string",
456
+ "default": null,
457
+ "description": "Path to events.jsonl"
458
+ },
459
+ "format": {
460
+ "type": "string",
461
+ "default": "html",
462
+ "enum": [
463
+ "html",
464
+ "mermaid"
465
+ ],
466
+ "description": "Output format"
467
+ },
468
+ "title": {
469
+ "type": "string",
470
+ "default": "MAS Agent Communication Flow",
471
+ "description": "Diagram title"
472
+ },
473
+ "filename": {
474
+ "type": "string",
475
+ "default": "communication_flow",
476
+ "description": "Output filename"
477
+ }
478
+ }
479
+ },
480
+ {
481
+ "type": "collect_metrics",
482
+ "label": "Collect Metrics",
483
+ "description": "Aggregate all per-run metrics.json and run_info.json files into a single tidy CSV (metrics_results.csv). Each row is one (scenario, item, run, metric) observation with columns for score, latency, LLM/tool call counts, and cache keys. Optionally enriches rows with dataset item metadata (group, complexity) for richer downstream grouping. Typically depends on eval_mce.",
484
+ "phase": "post",
485
+ "category": "evaluation",
486
+ "config": {
487
+ "output": {
488
+ "type": "string",
489
+ "default": "results.csv",
490
+ "description": "Output CSV path, relative to the level folder (no absolute paths, no '..')"
491
+ },
492
+ "run_glob": {
493
+ "type": "string",
494
+ "default": "*/*/r*",
495
+ "description": "Glob for run directories relative to the level folder"
496
+ },
497
+ "scenarios": {
498
+ "type": "array",
499
+ "default": [],
500
+ "description": "Optional scenario filter (all if empty)"
501
+ },
502
+ "metrics_filename": {
503
+ "type": "string",
504
+ "default": "metrics.json",
505
+ "description": "Name of the metrics file in each run directory"
506
+ },
507
+ "dataset": {
508
+ "type": "string",
509
+ "default": "",
510
+ "description": "Path to dataset YAML/JSON for item enrichment (or dict with path, join_on, columns)"
511
+ }
512
+ }
513
+ },
514
+ {
515
+ "type": "compute_ci",
516
+ "label": "Compute CI",
517
+ "description": "Compute confidence intervals across repeated runs. Groups the metrics CSV by scenario and metric (or custom groupby columns), then calculates mean, std, and 95% CI bounds (ci_low, ci_high) for each group. Outputs a summary CSV ready for plotting. Use ci_method 't' for small samples (<30 runs), 'bootstrap' for non-normal data. Depends on collect_metrics.",
518
+ "phase": "post",
519
+ "category": "analysis",
520
+ "config": {
521
+ "data": {
522
+ "type": "string",
523
+ "required": true,
524
+ "default": "@collect-metrics",
525
+ "description": "Input CSV path or @step-name reference (e.g. @collect-metrics)"
526
+ },
527
+ "value_col": {
528
+ "type": "string",
529
+ "default": "value",
530
+ "description": "Column to aggregate"
531
+ },
532
+ "metric_col": {
533
+ "type": "string",
534
+ "default": "metric",
535
+ "description": "Column that names each metric"
536
+ },
537
+ "metrics": {
538
+ "type": "array",
539
+ "default": [],
540
+ "description": "Optional: restrict to these metric values"
541
+ },
542
+ "groupby": {
543
+ "type": "array",
544
+ "default": ["scenario", "metric"],
545
+ "description": "Grouping columns for CI computation"
546
+ },
547
+ "ci_method": {
548
+ "type": "string",
549
+ "default": "t",
550
+ "enum": ["t", "bootstrap", "normal"],
551
+ "description": "CI method: t (default, for n<30), bootstrap, or normal"
552
+ },
553
+ "ci_level": {
554
+ "type": "number",
555
+ "default": 0.95,
556
+ "description": "Confidence level (e.g. 0.95 for 95% CI)"
557
+ },
558
+ "min_runs": {
559
+ "type": "integer",
560
+ "default": 2,
561
+ "description": "Warn when a group has fewer runs"
562
+ },
563
+ "output": {
564
+ "type": "string",
565
+ "default": "ci_summary.csv",
566
+ "description": "Output CSV path, relative to the level folder (no absolute paths, no '..')"
567
+ }
568
+ }
569
+ },
570
+ {
571
+ "type": "eval_mce",
572
+ "label": "Eval MCE",
573
+ "description": "Run LLM-as-judge evaluation on every benchmark run using MCE (Metrics Computation Engine). Computes session-level quality metrics — goal success, answer relevancy, groundedness, response completeness, and more — by prompting a judge LLM to score each run's conversation. Writes a metrics.json file next to each run's traces. Expensive (one LLM call per metric per run); use max_workers to control concurrency.",
574
+ "phase": "post",
575
+ "category": "evaluation",
576
+ "config": {
577
+ "runs_dir": {
578
+ "type": "string",
579
+ "default": "",
580
+ "description": "Path to runs root (defaults to pipeline output_dir)"
581
+ },
582
+ "response_agent": {
583
+ "type": "string",
584
+ "default": "",
585
+ "description": "Agent ID whose last execution_end is the final response (auto-detected if empty)"
586
+ },
587
+ "metrics": {
588
+ "type": "array",
589
+ "default": [],
590
+ "description": "MCE metric IDs to compute (all session-level if empty)"
591
+ },
592
+ "overwrite": {
593
+ "type": "boolean",
594
+ "default": false,
595
+ "description": "Re-compute runs that already have metrics.json"
596
+ },
597
+ "validate": {
598
+ "type": "boolean",
599
+ "default": true,
600
+ "description": "Validate each metrics.json against its JSON schema"
601
+ },
602
+ "max_workers": {
603
+ "type": "integer",
604
+ "default": 2,
605
+ "description": "Concurrent evaluation threads"
606
+ },
607
+ "fail_threshold": {
608
+ "type": "number",
609
+ "default": 1.0,
610
+ "description": "Fraction of items that may fail before step raises (0.0 = any, 1.0 = never)"
611
+ },
612
+ "model": {
613
+ "type": "string",
614
+ "default": "azure/gpt-4o",
615
+ "description": "Override judge model (re-installs LLM service with this model)"
616
+ },
617
+ "metrics_filename": {
618
+ "type": "string",
619
+ "default": "metrics.json",
620
+ "description": "Name of the output metrics file per run"
621
+ }
622
+ }
623
+ },
624
+ {
625
+ "type": "plotnine",
626
+ "label": "Plotnine Chart",
627
+ "description": "Render a publication-quality chart using plotnine (ggplot2 for Python). Maps CSV columns to aesthetics (x, y, fill, ymin, ymax) and renders bar charts (geom: col), CI rectangles (geom: crossbar), point plots, box plots, and more. Add facet to split into a grid by metric or scenario. Use as the final visualization step after compute_ci to compare scenarios across metrics.",
628
+ "phase": "post",
629
+ "category": "visualization",
630
+ "config": {
631
+ "data": {
632
+ "type": "string",
633
+ "required": true,
634
+ "default": "@compute-ci",
635
+ "description": "DataFrame source: file path (CSV/Parquet/JSON) or @step-name reference"
636
+ },
637
+ "output": {
638
+ "type": "string",
639
+ "default": "plot.png",
640
+ "description": "Output file path (png/svg/pdf), relative to the level folder (no absolute paths, no '..')"
641
+ },
642
+ "mapping": {
643
+ "type": "object",
644
+ "required": true,
645
+ "default": {"x": "scenario", "y": "mean", "fill": "scenario", "ymin": "ci_low", "ymax": "ci_high"},
646
+ "description": "aes() mapping: {x, y, fill, color, ymin, ymax, ...}. ymin+ymax auto-trigger error bars."
647
+ },
648
+ "geom": {
649
+ "type": "string",
650
+ "default": "crossbar",
651
+ "enum": ["bar", "col", "crossbar", "point", "boxplot", "jitter", "line", "tile"],
652
+ "description": "Geometry type (crossbar draws CI rectangles from ymin to ymax; col draws bars from 0 to y)"
653
+ },
654
+ "stat": {
655
+ "type": "string",
656
+ "default": "",
657
+ "enum": ["", "summary", "mean", "sum"],
658
+ "description": "Stat summary function (omit for pre-aggregated data)"
659
+ },
660
+ "facet": {
661
+ "type": "string",
662
+ "default": "~ metric",
663
+ "description": "Facet formula: '~ metric' or 'metric ~ .' (facet by metric is recommended for multi-metric data)"
664
+ },
665
+ "labels": {
666
+ "type": "object",
667
+ "default": {"title": "Scenario Comparison by Metric (95% CI)", "x": "Scenario", "y": "MCE Score (mean ± 95% CI)"},
668
+ "description": "Plot labels: {title, subtitle, x, y, fill, ...}"
669
+ },
670
+ "width": {
671
+ "type": "number",
672
+ "default": 14,
673
+ "description": "Figure width in inches"
674
+ },
675
+ "height": {
676
+ "type": "number",
677
+ "default": 10,
678
+ "description": "Figure height in inches"
679
+ },
680
+ "dpi": {
681
+ "type": "integer",
682
+ "default": 150,
683
+ "description": "DPI for raster output"
684
+ },
685
+ "filter": {
686
+ "type": "string",
687
+ "default": "",
688
+ "description": "Optional row filter (pandas query string or dict)"
689
+ },
690
+ "legend_position": {
691
+ "type": "string",
692
+ "default": "bottom",
693
+ "description": "Legend position: right, left, top, bottom, none, or [x,y] coords"
694
+ }
695
+ }
696
+ },
697
+ {
698
+ "type": "list_clickhouse_sessions",
699
+ "label": "List ClickHouse Sessions",
700
+ "description": "List session IDs from ClickHouse sessions_mapping.",
701
+ "phase": "post",
702
+ "category": "graph",
703
+ "config": {
704
+ "dataset_id": {
705
+ "type": "string",
706
+ "required": true,
707
+ "description": "Dataset ID"
708
+ },
709
+ "limit": {
710
+ "type": "integer",
711
+ "default": 0,
712
+ "description": "Max sessions (0 = unlimited)"
713
+ }
714
+ }
715
+ }
716
+ ],
717
+ "categories": [
718
+ {
719
+ "id": "data",
720
+ "label": "Data",
721
+ "color": "#3b82f6"
722
+ },
723
+ {
724
+ "id": "execution",
725
+ "label": "Execution",
726
+ "color": "#8b5cf6"
727
+ },
728
+ {
729
+ "id": "extraction",
730
+ "label": "Extraction",
731
+ "color": "#06b6d4"
732
+ },
733
+ {
734
+ "id": "normalization",
735
+ "label": "Normalization",
736
+ "color": "#14b8a6"
737
+ },
738
+ {
739
+ "id": "analysis",
740
+ "label": "Analysis",
741
+ "color": "#f59e0b"
742
+ },
743
+ {
744
+ "id": "evaluation",
745
+ "label": "Evaluation",
746
+ "color": "#ef4444"
747
+ },
748
+ {
749
+ "id": "visualization",
750
+ "label": "Visualization",
751
+ "color": "#22c55e"
752
+ },
753
+ {
754
+ "id": "graph",
755
+ "label": "Graph DB",
756
+ "color": "#a855f7"
757
+ },
758
+ {
759
+ "id": "infrastructure",
760
+ "label": "Infrastructure",
761
+ "color": "#64748b"
762
+ }
763
+ ]
764
+ }