@tangle-network/agent-eval 0.123.8 → 0.125.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 (61) hide show
  1. package/CHANGELOG.md +29 -4
  2. package/dist/analyst/index.d.ts +5 -0
  3. package/dist/analyst/index.js +4 -4
  4. package/dist/benchmarks/index.js +4 -4
  5. package/dist/campaign/index.d.ts +20 -1
  6. package/dist/campaign/index.js +4 -4
  7. package/dist/{chunk-ZU3QWGZE.js → chunk-A62YMFWA.js} +89 -8
  8. package/dist/chunk-A62YMFWA.js.map +1 -0
  9. package/dist/{chunk-BUR5R4R4.js → chunk-A6GT67HT.js} +3 -3
  10. package/dist/{chunk-EEHHBAWH.js → chunk-DT7OXY3C.js} +2 -2
  11. package/dist/{chunk-PDHIOKRE.js → chunk-EQUK3RFS.js} +8 -4
  12. package/dist/chunk-EQUK3RFS.js.map +1 -0
  13. package/dist/{chunk-V7HQGZBT.js → chunk-GID26AN4.js} +2 -2
  14. package/dist/{chunk-27UXRPIQ.js → chunk-HM6V7F3M.js} +2 -2
  15. package/dist/chunk-IPYXE555.js +594 -0
  16. package/dist/chunk-IPYXE555.js.map +1 -0
  17. package/dist/chunk-LKKT3IVV.js +1644 -0
  18. package/dist/chunk-LKKT3IVV.js.map +1 -0
  19. package/dist/chunk-M7AH34KV.js +155 -0
  20. package/dist/chunk-M7AH34KV.js.map +1 -0
  21. package/dist/chunk-MAX3TN3C.js +249 -0
  22. package/dist/chunk-MAX3TN3C.js.map +1 -0
  23. package/dist/{chunk-QVGVJQMR.js → chunk-PMITBABE.js} +7 -5
  24. package/dist/{chunk-QVGVJQMR.js.map → chunk-PMITBABE.js.map} +1 -1
  25. package/dist/{chunk-J3LHTAAB.js → chunk-QOTFXW5L.js} +1 -47
  26. package/dist/chunk-QOTFXW5L.js.map +1 -0
  27. package/dist/chunk-RZTMDUO7.js +49 -0
  28. package/dist/chunk-RZTMDUO7.js.map +1 -0
  29. package/dist/chunk-VBQ3CRKH.js +291 -0
  30. package/dist/chunk-VBQ3CRKH.js.map +1 -0
  31. package/dist/{chunk-RQ5TP2TV.js → chunk-W5B3ZGP3.js} +3 -3
  32. package/dist/cli.js +13 -2
  33. package/dist/cli.js.map +1 -1
  34. package/dist/contract/index.d.ts +7 -0
  35. package/dist/contract/index.js +4 -4
  36. package/dist/index.d.ts +833 -82
  37. package/dist/index.js +61 -121
  38. package/dist/index.js.map +1 -1
  39. package/dist/openapi.json +1 -1
  40. package/dist/pipelines/index.js +4 -2
  41. package/dist/pipelines/index.js.map +1 -1
  42. package/dist/rl.d.ts +3 -0
  43. package/dist/rl.js +2 -2
  44. package/dist/rollout/index.d.ts +1061 -0
  45. package/dist/rollout/index.js +109 -0
  46. package/dist/rollout/index.js.map +1 -0
  47. package/dist/supervisor-run/index.d.ts +857 -0
  48. package/dist/supervisor-run/index.js +64 -0
  49. package/dist/supervisor-run/index.js.map +1 -0
  50. package/dist/wire/index.d.ts +3 -0
  51. package/dist/wire/index.js +2 -2
  52. package/docs/rollout.md +48 -0
  53. package/package.json +11 -1
  54. package/dist/chunk-J3LHTAAB.js.map +0 -1
  55. package/dist/chunk-PDHIOKRE.js.map +0 -1
  56. package/dist/chunk-ZU3QWGZE.js.map +0 -1
  57. /package/dist/{chunk-BUR5R4R4.js.map → chunk-A6GT67HT.js.map} +0 -0
  58. /package/dist/{chunk-EEHHBAWH.js.map → chunk-DT7OXY3C.js.map} +0 -0
  59. /package/dist/{chunk-V7HQGZBT.js.map → chunk-GID26AN4.js.map} +0 -0
  60. /package/dist/{chunk-27UXRPIQ.js.map → chunk-HM6V7F3M.js.map} +0 -0
  61. /package/dist/{chunk-RQ5TP2TV.js.map → chunk-W5B3ZGP3.js.map} +0 -0
@@ -0,0 +1,857 @@
1
+ /**
2
+ * `tangle.rollout.v1` — THE canonical rollout serialization, owned by
3
+ * agent-eval. One JSONL line per agent invocation (a solo eval run, a
4
+ * supervisor episode, a worker session, a proposer shot, a judge call, an
5
+ * analyst pass), labeled with its task/split coordinates and a single
6
+ * scalar reward, carrying the FULL message transcript inline.
7
+ *
8
+ * This schema is the reconciliation of two prior producers:
9
+ * - agent-eval's RunRecord-joined rollout rows (PR #410): identity,
10
+ * provenance hashes, the realness gate travelling into the reward,
11
+ * trace-derived steps.
12
+ * - the bench rollout-ledger (agent-runtime PR #591): the wire shape —
13
+ * role, task.split/rep, parent_rollout_id, policy provenance, capture
14
+ * provenance, inline canonical chat-with-tools messages.
15
+ * Where the two conflicted, RunRecord-derived semantics won; the wire
16
+ * field names follow the ledger (snake_case). See `docs/rollout.md` for
17
+ * the field-by-field decision table.
18
+ *
19
+ * Messages are inlined — never referenced — because every harness store a
20
+ * rollout can be recovered from is mutable or garbage-collected. A line
21
+ * must stay a complete training/eval example on its own.
22
+ *
23
+ * `outcome.reward` is THE single scalar (null = no verdict exists — a
24
+ * labeled gap, never 0). `outcome.realness_gated` is the anti-Goodhart
25
+ * flag: a gated line must never export as a positive training example.
26
+ */
27
+ declare const ROLLOUT_SCHEMA = "tangle.rollout.v1";
28
+ /** `agent` = a solo evaluation run (no multi-agent topology). */
29
+ type RolloutRole = 'agent' | 'supervisor' | 'worker' | 'proposer' | 'judge' | 'analyst';
30
+ /**
31
+ * Split vocabulary follows `RunRecord.splitTag` ('search' is the pool the
32
+ * optimizer may read — the trainable split), extended with the ledger's
33
+ * 'canary'. 'train' is a legacy alias for 'search' emitted by
34
+ * pre-unification ledgers; it validates and counts as trainable, but new
35
+ * producers must emit 'search'.
36
+ */
37
+ type RolloutSplit = 'search' | 'dev' | 'holdout' | 'canary' | 'train';
38
+ /** 'mint' = joined live from RunRecord + trace by `mintRolloutRows`. */
39
+ type RolloutCapture = 'mint' | 'settle-time' | 'backfill';
40
+ type ChatRole = 'system' | 'user' | 'assistant' | 'tool';
41
+ interface ChatToolCall {
42
+ id: string;
43
+ type: 'function';
44
+ function: {
45
+ name: string;
46
+ /** JSON-encoded argument object, exactly as the model emitted it. */
47
+ arguments: string;
48
+ };
49
+ }
50
+ interface ChatMessage {
51
+ role: ChatRole;
52
+ content: string | null;
53
+ /** Reasoning/thinking channel where the harness captured it (full fidelity). */
54
+ reasoning_content?: string;
55
+ tool_calls?: ChatToolCall[];
56
+ /** Required on role:"tool" — the ChatToolCall this result answers. */
57
+ tool_call_id?: string;
58
+ name?: string;
59
+ }
60
+ interface ToolDef {
61
+ type: 'function';
62
+ function: {
63
+ name: string;
64
+ description?: string;
65
+ parameters?: Record<string, unknown>;
66
+ };
67
+ }
68
+ /**
69
+ * Compact trace-span projection (llm/tool step) carried alongside the
70
+ * conversation when the line was minted from a trace. Optional: lines
71
+ * recovered from harness stores have no span structure.
72
+ */
73
+ interface RolloutStep {
74
+ kind: string;
75
+ name: string;
76
+ /** llm: last-message summary · tool: stringified args. Scrubbed. */
77
+ input?: string;
78
+ /** llm: output text · tool: stringified result. Scrubbed. */
79
+ output?: string;
80
+ status?: 'ok' | 'error';
81
+ durationMs?: number;
82
+ }
83
+ interface RolloutTask {
84
+ /** Benchmark/suite id (e.g. "swe-bench-verified") or the experiment id. */
85
+ suite: string;
86
+ instance_id: string;
87
+ split: RolloutSplit;
88
+ /** Sampling seed the campaign pinned; null = not recorded. */
89
+ seed: number | null;
90
+ /** Replicate index (0-based). */
91
+ rep: number;
92
+ }
93
+ interface RolloutPolicy {
94
+ /** Harness that drove the invocation (e.g. "opencode", "claude", "pi-loops"). */
95
+ harness: string | null;
96
+ harness_version: string | null;
97
+ model: string | null;
98
+ provider: string | null;
99
+ /** Commit of the agent profile / candidate under evaluation. */
100
+ profile_commit: string | null;
101
+ /** sha256 of the effective prompt (post-steering), when recorded. */
102
+ prompt_hash?: string | null;
103
+ /** sha256 of the effective run config, when recorded. */
104
+ config_hash?: string | null;
105
+ /** Canonical agent-profile cell identity, when the run carries one. */
106
+ agent_profile_cell_id?: string | null;
107
+ /** Sampling params (temperature, top_p, max_tokens…); null = not recorded. */
108
+ sampling: Record<string, unknown> | null;
109
+ }
110
+ interface RolloutOutcome {
111
+ /**
112
+ * THE single scalar training signal — the official verdict.
113
+ * null = no verdict exists for this invocation (a labeled gap, never 0).
114
+ */
115
+ reward: number | null;
116
+ /** Where the reward came from (judge id; "/inherited" = parent episode's). */
117
+ reward_source: string | null;
118
+ /** Raw judge verdict record, verbatim. */
119
+ verdict: unknown;
120
+ /** Everything that is NOT the scalar reward. */
121
+ metrics: Record<string, unknown>;
122
+ is_completed: boolean;
123
+ is_truncated: boolean;
124
+ error: string | null;
125
+ /**
126
+ * Anti-Goodhart flag from `RunRecord.outcome.realness.gated`: the run
127
+ * faked its success signal. Reward is forced to 0 at mint time and the
128
+ * line never qualifies for SFT. Optional on the wire (absent = false)
129
+ * so pre-unification ledgers stay readable.
130
+ */
131
+ realness_gated?: boolean;
132
+ }
133
+ interface RolloutCostBlock {
134
+ usd: number | null;
135
+ tokens_in: number | null;
136
+ tokens_out: number | null;
137
+ tokens_reasoning: number | null;
138
+ cache_read: number | null;
139
+ cache_write: number | null;
140
+ wall_s: number | null;
141
+ }
142
+ interface RolloutArtifacts {
143
+ patch_path: string | null;
144
+ run_dir: string | null;
145
+ /** Source-of-truth transcript pointer (session id / jsonl path) for audit. */
146
+ transcript_ref: string | null;
147
+ }
148
+ interface RolloutProvenance {
149
+ captured_at: string;
150
+ capture: RolloutCapture;
151
+ /** Present on gap lines: why `messages` could not be recovered. */
152
+ gap?: string;
153
+ }
154
+ interface RolloutLine {
155
+ schema: typeof ROLLOUT_SCHEMA;
156
+ rollout_id: string;
157
+ /** Spawning invocation within the same episode (worker → supervisor). */
158
+ parent_rollout_id: string | null;
159
+ run_id: string;
160
+ /** Logical experiment grouping from `RunRecord.experimentId`. Optional on
161
+ * the wire (pre-unification ledgers lack it); null = not recorded. */
162
+ experiment_id?: string | null;
163
+ /** Stable candidate identity from `RunRecord.candidateId`; null = not recorded. */
164
+ candidate_id?: string | null;
165
+ /** Improvement-loop generation (-1 = baseline); null = not an improvement loop. */
166
+ generation: number | null;
167
+ /** Improvement-loop candidate index (-1 = baseline); null = not an improvement loop. */
168
+ candidate_index: number | null;
169
+ role: RolloutRole;
170
+ task: RolloutTask;
171
+ policy: RolloutPolicy;
172
+ /** Full transcript, inline. [] = gap line (see provenance.gap). */
173
+ messages: ChatMessage[];
174
+ tool_defs: ToolDef[];
175
+ /** Trace-span projections, when minted from a trace. */
176
+ steps?: RolloutStep[];
177
+ outcome: RolloutOutcome;
178
+ cost: RolloutCostBlock;
179
+ artifacts: RolloutArtifacts;
180
+ provenance: RolloutProvenance;
181
+ }
182
+
183
+ /**
184
+ * Supervisor-run analysis — the multi-agent analogue of single-rollout trace
185
+ * analysis. A solo rollout is one invocation with a transcript; a supervisor
186
+ * run is a TREE of invocations (a brain that spawns, steers, and settles
187
+ * workers) plus the event timeline that connects them. `src/trace-analyst`
188
+ * answers "what happened inside one session"; this module answers "what did
189
+ * the tree do" — did the brain steer anyone mid-task, how many spawn waves,
190
+ * how concurrent, how idle, what did each role cost, what came back.
191
+ *
192
+ * The nodes of that tree are NOT a new shape: they are `tangle.rollout.v1`
193
+ * rows (`src/rollout`), keyed by `parent_rollout_id`, with `role` already
194
+ * spanning `supervisor` / `worker`. `supervisorRunRolloutLines` mints them.
195
+ * What rollout rows deliberately do NOT carry is the inter-invocation event
196
+ * timeline (spawn/settle/steer instants), which is what every structural
197
+ * metric here is computed from — so the reader consumes the journal event
198
+ * stream and emits rollout rows, rather than maintaining a parallel node type.
199
+ *
200
+ * ## UNAVAILABLE ≠ ZERO
201
+ *
202
+ * Every metric whose backing artifact can be missing is typed
203
+ * `Measured<T> = T | { unavailable: reason }`. A supervisor that steered
204
+ * nobody reports `steers: 0`; a supervisor whose worker logs were never
205
+ * written reports `steers: unavailable — <reason>`. The two have driven
206
+ * opposite conclusions about the same architecture, so they never collapse.
207
+ */
208
+
209
+ /** A metric that could not be computed, with the reason its artifact was missing. */
210
+ interface Unavailable {
211
+ readonly unavailable: string;
212
+ }
213
+ /** A metric value, or the reason it is unknown. NEVER collapse `unavailable` to 0. */
214
+ type Measured<T> = T | Unavailable;
215
+ declare function unavailable(reason: string): Unavailable;
216
+ declare function isUnavailable(v: unknown): v is Unavailable;
217
+ /** Render a measured scalar for the markdown/headline: `0` and `unavailable` stay distinct. */
218
+ declare function showMeasured(v: Measured<number | string | boolean | null>): string;
219
+ /** One worker's logs, as read. `null` = the artifact did not exist. */
220
+ interface WorkerLogSource {
221
+ readonly label: string;
222
+ /** Worker event stream — started / progress / finished / message events (JSONL). */
223
+ readonly events: string | null;
224
+ /** The durable steer queue — one line per steer request (JSONL). */
225
+ readonly inbox: string | null;
226
+ /** Worker patch byte length, or null when absent. */
227
+ readonly patchBytes: number | null;
228
+ /** Where this worker's transcript lives, for the rollout row. Null = no such artifact. */
229
+ readonly transcriptRef?: string | null;
230
+ /** Where this worker's delivered patch lives. Null = the store keeps no patch per worker. */
231
+ readonly patchPath?: string | null;
232
+ /** This worker's own inference tokens, when the store records them per worker. */
233
+ readonly tokensIn?: number | null;
234
+ readonly tokensOut?: number | null;
235
+ readonly cacheRead?: number | null;
236
+ readonly cacheWrite?: number | null;
237
+ }
238
+ /**
239
+ * Facts a SOURCE structurally cannot express, each with the reason.
240
+ *
241
+ * The difference between "the artifact is missing" and "this store never
242
+ * records that fact" is the difference between a run that spent $0 and a
243
+ * harness that does not price inference — and the second harness is where a
244
+ * loops-shaped assumption becomes a fabricated zero. A reader declares its
245
+ * limits once; the analyzer reports `unavailable` for everything downstream.
246
+ *
247
+ * `null` on a field means the source DOES carry that fact.
248
+ */
249
+ interface SourceLimits {
250
+ /** Reason inference spend has no price in this store (null = the store prices it). */
251
+ readonly spendUsd: string | null;
252
+ /** Reason workers carry no pass/fail verdict (null = verdicts are recorded). */
253
+ readonly workerVerdicts: string | null;
254
+ /** Reason no delivered artifact (patch/diff) is retained per worker (null = retained). */
255
+ readonly deliverables: string | null;
256
+ }
257
+ /** A source that carries every fact the analyzer can use. */
258
+ declare const NO_SOURCE_LIMITS: SourceLimits;
259
+ /**
260
+ * Everything the pure analyzer reads — already-read bytes, never paths. Each
261
+ * field is `null` when its artifact was absent, which is what turns the
262
+ * dependent metrics into `unavailable` rather than 0.
263
+ *
264
+ * This is the whole input contract. Any store that can produce these strings
265
+ * (an on-disk loops run, an object-store archive, a database, a test fixture)
266
+ * is a valid source; `loopsSupervisorRunReader` is ONE implementation.
267
+ */
268
+ interface SupervisorRunSources {
269
+ /** Stable identity of the run being analyzed (a directory, a run id, a URL). */
270
+ readonly runRef: string;
271
+ readonly instanceId: string | null;
272
+ /** Which arm/variant of a comparison this run is, when the run belongs to one. */
273
+ readonly arm: string | null;
274
+ /** Identity of the supervision-tree store this was read from; null = none found. */
275
+ readonly supRunDir: string | null;
276
+ /** Supervision journal — spawned / settled / cancelled / metered events (JSONL). */
277
+ readonly journal: string | null;
278
+ /** Per-brain-call tap (JSONL): finish_reason, completion tokens, requested max tokens. */
279
+ readonly brainLog: string | null;
280
+ /** Supervisor state document (JSON). */
281
+ readonly state: string | null;
282
+ /** Supervisor progress stream (JSONL). */
283
+ readonly progress: string | null;
284
+ /** Per-worker logs; `null` = the worker log store itself was missing. */
285
+ readonly workers: readonly WorkerLogSource[] | null;
286
+ /** Why `workers` is null (only set when it is). */
287
+ readonly workersMissingReason: string | null;
288
+ /** Run result document (JSON). */
289
+ readonly result: string | null;
290
+ /**
291
+ * Judge verdict document (JSON), or the matching ledger row re-encoded as
292
+ * one. Runners that write the verdict straight to a ledger leave no judge
293
+ * document, so the ledger row is the same fact from the same run — not a
294
+ * substitute measurement.
295
+ */
296
+ readonly judge: string | null;
297
+ /** Where `judge` came from, for the report's provenance line. */
298
+ readonly judgeSource: string | null;
299
+ /** Delivered unified-diff patch text. */
300
+ readonly patch: string | null;
301
+ /** Outer-driver log (used for the driver's steer verbs + deadline evidence). */
302
+ readonly driverLog: string | null;
303
+ /**
304
+ * Worker tokens recovered from a harness session store; null = store unavailable.
305
+ * `store` names the store in the report's provenance line (e.g. `opencode`).
306
+ */
307
+ readonly harnessWorkerTokens: {
308
+ store: string;
309
+ sessions: number;
310
+ input: number;
311
+ output: number;
312
+ /** Cached prompt tokens, when the store counts them separately. */
313
+ cacheRead?: number;
314
+ cacheWrite?: number;
315
+ } | null;
316
+ readonly harnessMissingReason: string | null;
317
+ /** What this store structurally cannot record. See `SourceLimits`. */
318
+ readonly limits: SourceLimits;
319
+ /**
320
+ * Where the ROOT invocation's transcript lives. Undefined lets the rollout
321
+ * minter fall back to the loops layout (`<supRunDir>/journal.jsonl`); any
322
+ * other store must say, or the row points at a path that never existed.
323
+ */
324
+ readonly rootTranscriptRef?: string | null;
325
+ /**
326
+ * The `traces` CLI command that covers this run's harness-session layer.
327
+ * Null falls back to the analyzer's default (an opencode worker fleet).
328
+ */
329
+ readonly traceCommand: string | null;
330
+ }
331
+ /**
332
+ * A source of supervisor-run bytes. Implementations own their storage layout;
333
+ * the analyzer only ever sees `SupervisorRunSources`.
334
+ */
335
+ interface SupervisorRunReader {
336
+ /** Stable identity of what this reader points at (for logs and report labels). */
337
+ readonly runRef: string;
338
+ read(): Promise<SupervisorRunSources>;
339
+ }
340
+ declare const SUPERVISOR_RUN_SCHEMA = "tangle.supervisor-run@1";
341
+ declare const SUPERVISOR_RUN_ROLLUP_SCHEMA = "tangle.supervisor-run-rollup@1";
342
+ interface SteerBreakdown {
343
+ readonly worker: string;
344
+ /** Steer requests durably queued to this worker's inbox. */
345
+ readonly queued: number;
346
+ /** Steers the worker's executor actually accepted (control event `delivered:true`). */
347
+ readonly delivered: number;
348
+ }
349
+ interface OrchestrationMetrics {
350
+ readonly workersSpawned: Measured<number>;
351
+ readonly workersSettled: Measured<number>;
352
+ readonly workersCancelled: Measured<number>;
353
+ /** THE HEADLINE: mid-task steers the brain sent to live workers. 0 ≠ unavailable. */
354
+ readonly steers: Measured<number>;
355
+ readonly steersDelivered: Measured<number>;
356
+ readonly steersByWorker: Measured<readonly SteerBreakdown[]>;
357
+ /** Outer-driver `supervisor_steer` tool calls seen in the driver log (a second steer path). */
358
+ readonly driverSteerCalls: Measured<number>;
359
+ /**
360
+ * Spawn waves. A wave is a maximal run of worker spawns with no settle/cancel between
361
+ * them: wave N+1 begins at the first spawn issued after at least one worker from an
362
+ * earlier wave has settled. Structural, not a time threshold — no tunable constant.
363
+ */
364
+ readonly waves: Measured<number>;
365
+ readonly waveSizes: Measured<readonly number[]>;
366
+ readonly maxConcurrency: Measured<number>;
367
+ /** Worker spawns issued after the first settlement — the retry/respawn tail. */
368
+ readonly respawns: Measured<number>;
369
+ /** Labels spawned more than once (a literal retry of the same subtask). */
370
+ readonly repeatedLabels: Measured<readonly string[]>;
371
+ /** Longest parent chain below the root, in worker hops. */
372
+ readonly delegationDepth: Measured<number>;
373
+ readonly timeToFirstSpawnMs: Measured<number>;
374
+ readonly supervisorWallMs: Measured<number>;
375
+ /** Wall time inside the supervisor run with ZERO live workers. */
376
+ readonly idleMs: Measured<number>;
377
+ readonly idlePct: Measured<number>;
378
+ /** sum(worker wall) / supervisor wall. >1 means real parallelism. */
379
+ readonly workerUtilization: Measured<number>;
380
+ }
381
+ interface DecisionMetrics {
382
+ readonly settledByStatus: Measured<Record<string, number>>;
383
+ readonly settledVerdicts: Measured<Record<string, number>>;
384
+ /** Worker verified its own work green AND produced a patch. */
385
+ readonly accepted: Measured<number>;
386
+ /** Worker settled with a failing verify. */
387
+ readonly rejected: Measured<number>;
388
+ /** Worker verified green but delivered no patch bytes — output with nothing to accept. */
389
+ readonly emptyPass: Measured<number>;
390
+ /** Settlements the brain observed before issuing its next spawn (evidence→respawn). */
391
+ readonly observeThenRespawn: Measured<number>;
392
+ /** Respawns with no settled evidence in front of them. */
393
+ readonly respawnWithoutEvidence: Measured<number>;
394
+ /** Steer + question traffic on the live down/up legs — the only "review while running" signal. */
395
+ readonly reviewActions: Measured<number>;
396
+ readonly workerEvidenceBytes: Measured<number>;
397
+ }
398
+ interface RoleSpend {
399
+ readonly tokensIn: Measured<number>;
400
+ readonly tokensOut: Measured<number>;
401
+ /**
402
+ * Cached prompt tokens read/written. On a harness that caches aggressively
403
+ * these dwarf `tokensIn`, so a report that omits them understates the context
404
+ * each invocation actually consumed. `unavailable` = the store has no such counter.
405
+ */
406
+ readonly cacheRead: Measured<number>;
407
+ readonly cacheWrite: Measured<number>;
408
+ readonly usd: Measured<number>;
409
+ readonly source: string;
410
+ }
411
+ interface PerWorkerRow {
412
+ readonly worker: string;
413
+ readonly wallMs: number | null;
414
+ /** `null` = this store does not attribute tokens per worker (NOT "zero tokens"). */
415
+ readonly tokensIn: number | null;
416
+ readonly tokensOut: number | null;
417
+ readonly usd: number | null;
418
+ readonly patchBytes: number | null;
419
+ readonly passed: boolean | null;
420
+ }
421
+ interface WallDistribution {
422
+ readonly n: number;
423
+ readonly min: number;
424
+ readonly p50: number;
425
+ readonly p90: number;
426
+ readonly max: number;
427
+ readonly sum: number;
428
+ }
429
+ interface EconomicsMetrics {
430
+ /** Driver/brain inference — journal `metered` events. */
431
+ readonly brain: RoleSpend;
432
+ /**
433
+ * Brain completions that came back `finish_reason: "length"` — output TRUNCATED. Any value
434
+ * above 0 means the supervisor planned into a wall and then acted on the half-written plan,
435
+ * which is a defect and not a cost figure. The journal's `metered` rows carry token counts
436
+ * but no finish reason, so this reads the per-call brain tap; a run whose supervisor
437
+ * predates that tap reports `unavailable`, never 0.
438
+ */
439
+ readonly brainTruncations: Measured<number>;
440
+ /** Worker inference — journal `settled` spend plus the harness session join. */
441
+ readonly workers: RoleSpend;
442
+ readonly totalUsd: Measured<number>;
443
+ /**
444
+ * Where `totalUsd` came from. CLI-backend workers never price their own inference into
445
+ * the journal, so on those arms the total is BRAIN-ONLY and the worker row's token
446
+ * counts (recovered from the harness store) are the honest worker-side figure.
447
+ */
448
+ readonly totalUsdSource: string;
449
+ readonly costPerAcceptedPatchUsd: Measured<number>;
450
+ readonly workerWallMsDistribution: Measured<WallDistribution>;
451
+ readonly perWorker: Measured<readonly PerWorkerRow[]>;
452
+ }
453
+ interface PatchStats {
454
+ readonly files: number;
455
+ readonly linesAdded: number;
456
+ readonly linesRemoved: number;
457
+ readonly testFilesTouched: readonly string[];
458
+ }
459
+ interface OutcomeMetrics {
460
+ readonly supStatus: Measured<string>;
461
+ readonly supVerdict: Measured<string>;
462
+ readonly delivered: Measured<boolean>;
463
+ readonly judgeResolved: Measured<boolean | null>;
464
+ readonly judgeScore: Measured<number | null>;
465
+ readonly judgePassed: Measured<number | null>;
466
+ readonly judgeTotal: Measured<number | null>;
467
+ readonly verifyPass: Measured<boolean>;
468
+ readonly verifyRc: Measured<number>;
469
+ readonly patch: Measured<PatchStats>;
470
+ /** Which document the judge fields came from (a judge file, a ledger row, or nothing). */
471
+ readonly judgeSource: string | null;
472
+ }
473
+ interface SupervisorRunReport {
474
+ readonly schema: typeof SUPERVISOR_RUN_SCHEMA;
475
+ /** The `runRef` of the sources this report was computed from. */
476
+ readonly runRef: string;
477
+ readonly instanceId: string | null;
478
+ readonly arm: string | null;
479
+ readonly supervisorId: Measured<string>;
480
+ readonly generatedAt: string;
481
+ readonly orchestration: OrchestrationMetrics;
482
+ readonly decision: DecisionMetrics;
483
+ readonly economics: EconomicsMetrics;
484
+ readonly outcome: OutcomeMetrics;
485
+ /** Artifacts that were missing, in read order — the provenance of every `unavailable`. */
486
+ readonly gaps: readonly string[];
487
+ /** The `traces` CLI command that covers the harness-session layer for this run. */
488
+ readonly traceCommand: string;
489
+ }
490
+ interface RollupCellRow {
491
+ readonly instanceId: string | null;
492
+ readonly arm: string | null;
493
+ readonly steers: Measured<number>;
494
+ readonly waves: Measured<number>;
495
+ readonly utilization: Measured<number>;
496
+ readonly idlePct: Measured<number>;
497
+ readonly resolved: Measured<boolean | null>;
498
+ readonly usd: Measured<number>;
499
+ }
500
+ interface SupervisorRunRollup {
501
+ readonly schema: typeof SUPERVISOR_RUN_ROLLUP_SCHEMA;
502
+ readonly cells: number;
503
+ readonly steersTotal: Measured<number>;
504
+ readonly cellsWithSteers: Measured<number>;
505
+ readonly cellsWithUnavailableSteers: number;
506
+ readonly wavesMean: Measured<number>;
507
+ readonly maxConcurrencyMax: Measured<number>;
508
+ readonly utilizationMean: Measured<number>;
509
+ readonly idlePctMean: Measured<number>;
510
+ readonly workersSpawnedTotal: Measured<number>;
511
+ readonly acceptedTotal: Measured<number>;
512
+ readonly usdTotal: Measured<number>;
513
+ readonly resolvedCount: Measured<number>;
514
+ readonly perCell: readonly RollupCellRow[];
515
+ }
516
+ /**
517
+ * A supervision tree expressed in the canonical rollout row type: one
518
+ * `RolloutLine` per invocation, joined by `parent_rollout_id`. The root row
519
+ * carries `role: 'supervisor'`; every spawned worker carries `role: 'worker'`
520
+ * with the root as its parent.
521
+ */
522
+ interface SupervisorRunTree {
523
+ readonly rootId: string | null;
524
+ readonly nodes: readonly RolloutLine[];
525
+ /** Why a node could not be recovered, in read order. */
526
+ readonly gaps: readonly string[];
527
+ }
528
+
529
+ /**
530
+ * The pure analyzer. Takes already-read bytes (`SupervisorRunSources`) and
531
+ * returns the report — every metric derivable from a synthetic journal string
532
+ * with no filesystem, no process, and no network. All I/O lives in a reader
533
+ * (`loops-reader.ts` is one).
534
+ */
535
+
536
+ interface Tokens {
537
+ input: number;
538
+ output: number;
539
+ cacheRead: number;
540
+ cacheWrite: number;
541
+ /** False when the event carried no cache counters at all — not "zero cached". */
542
+ hasCache: boolean;
543
+ }
544
+ interface SpendLike {
545
+ tokens: Tokens;
546
+ usd: number;
547
+ }
548
+ interface SpawnRow {
549
+ id: string;
550
+ parent: string | null;
551
+ label: string;
552
+ at: number | null;
553
+ }
554
+ interface CloseRow {
555
+ id: string;
556
+ kind: 'settled' | 'cancelled';
557
+ status: string | null;
558
+ verdict: string | null;
559
+ at: number | null;
560
+ spend: SpendLike;
561
+ /** False when the close event carried no spend object — not "spent nothing". */
562
+ hasSpend: boolean;
563
+ }
564
+ interface WorkerLogFacts {
565
+ started: number | null;
566
+ /** True once a `finished` event was seen — independent of whether its `at` parsed. */
567
+ finished: boolean;
568
+ finishedAt: number | null;
569
+ passed: boolean | null;
570
+ /** `patchBytes` as reported by the finished event (not the patch file's size). */
571
+ finishedPatchBytes: number | null;
572
+ evidenceBytes: number;
573
+ steersQueued: number;
574
+ steersDelivered: number;
575
+ questions: number;
576
+ }
577
+ /**
578
+ * The tree + timeline the report is computed from, exposed because the rollout-row
579
+ * minter needs exactly the same parse (one parser, two consumers).
580
+ */
581
+ interface SupervisorTreeFacts {
582
+ readonly rootId: string | null;
583
+ readonly spawns: readonly SpawnRow[];
584
+ readonly closes: readonly CloseRow[];
585
+ readonly workerSpawns: readonly SpawnRow[];
586
+ readonly workerCloses: readonly CloseRow[];
587
+ readonly brain: {
588
+ tokensIn: number;
589
+ tokensOut: number;
590
+ cacheRead: number;
591
+ cacheWrite: number;
592
+ /** False when no metered event carried cache counters — not "nothing cached". */
593
+ hasCache: boolean;
594
+ usd: number;
595
+ meteredCount: number;
596
+ };
597
+ readonly workerLogs: ReadonlyMap<string, WorkerLogFacts>;
598
+ readonly startedAt: number | null;
599
+ readonly completedAt: number | null;
600
+ }
601
+ declare function parseSupervisorTree(src: SupervisorRunSources): SupervisorTreeFacts;
602
+ /**
603
+ * Analyze already-read supervisor-run bytes. Pure and synchronous: same bytes
604
+ * in, same report out (modulo `generatedAt`, which `now` pins in tests).
605
+ */
606
+ declare function analyzeSupervisorRunSources(src: SupervisorRunSources, now?: () => number): SupervisorRunReport;
607
+ /** Unified-diff stats. Counts `+++ b/<path>` targets, body +/- lines, and test-file touches. */
608
+ declare function parsePatch(text: string): PatchStats;
609
+ /**
610
+ * Aggregate many supervisor-run reports. A metric no run could measure stays
611
+ * `unavailable` rather than becoming a 0-valued mean, and cells whose steer
612
+ * count was unavailable are counted separately from cells that measured zero.
613
+ */
614
+ declare function rollupSupervisorRuns(reports: readonly SupervisorRunReport[]): SupervisorRunRollup;
615
+
616
+ /**
617
+ * Supervision-tree reader over a THIRD-PARTY harness: Claude Code.
618
+ *
619
+ * `loops-reader.ts` reads a supervisor we wrote, whose journal was designed
620
+ * for this analysis. This reader reads a harness we do not control, whose
621
+ * transcript was designed for replaying a chat — and recovers the same tree
622
+ * from it. If both produce a `SupervisorRunSources`, the tree model is a
623
+ * property of multi-agent runs, not of our journal format.
624
+ *
625
+ * ## Where the tree hides in a Claude Code transcript
626
+ *
627
+ * | Tree fact | Claude Code evidence |
628
+ * |---|---|
629
+ * | spawn | assistant `tool_use` (`Agent` / `Task`), answered by a `tool_result` whose `toolUseResult.agentId` names the child |
630
+ * | settle | a `<task-notification>` block in a later user line: `<task-id>` = agentId, `<status>` |
631
+ * | steer | assistant `tool_use` (`SendMessage`) with `input.to` = agentId — mid-task, to a LIVE child |
632
+ * | delivered | that steer's `tool_result` carrying `success` / `resumedAgentId` |
633
+ * | cancel | assistant `tool_use` (`TaskStop`) targeting an agentId |
634
+ * | brain spend| `message.usage` on the main thread's assistant lines |
635
+ * | worker spend| `message.usage` inside `<session>/subagents/agent-<id>.jsonl` |
636
+ * | depth | a child transcript that itself contains `Agent` tool_use lines |
637
+ *
638
+ * Every one of those is read through `parseClaudeEntries` — the SAME line
639
+ * parser `src/rollout/readers/claude-jsonl.ts` uses for solo rollouts. There
640
+ * is no second transcript parser.
641
+ *
642
+ * ## What Claude Code cannot say
643
+ *
644
+ * It records tokens but never a price, runs no per-worker verify, and keeps no
645
+ * per-worker patch. Those are declared once in `limits`, so the analyzer
646
+ * reports `unavailable — <reason>` instead of the $0 / 0-accepted that summing
647
+ * an empty field would produce. See `SourceLimits`.
648
+ *
649
+ * ## Metric coverage vs the loops journal
650
+ *
651
+ * Measured on a real 52-agent session (fixture:
652
+ * `tests/fixtures/supervisor-run/claude-code-session-*`).
653
+ *
654
+ * | Metric | loops | Claude Code | Why |
655
+ * |---|---|---|---|
656
+ * | workersSpawned / Settled / Cancelled | full | full | spawn tool_use + task-notification + TaskStop |
657
+ * | steers / steersDelivered / steersByWorker | full | full | `SendMessage`; delivery from its tool_result |
658
+ * | waves / waveSizes / maxConcurrency | full | full | derived from spawn/settle instants |
659
+ * | respawns / repeatedLabels | full | full | same derivation |
660
+ * | delegationDepth | full | full | a child transcript's own spawn calls |
661
+ * | timeToFirstSpawn / supervisorWall | full | full | transcript instants |
662
+ * | idleMs / idlePct / workerUtilization | full | PARTIAL | an agent that never notifies is counted live to the end of the transcript |
663
+ * | observeThenRespawn / respawnWithoutEvidence | full | full | ordering of spawn vs settle instants |
664
+ * | workerEvidenceBytes | full | PARTIAL | the child's closing message; 0 for pruned transcripts |
665
+ * | brain tokens in/out + cache | full | full | main-thread `message.usage` |
666
+ * | worker tokens in/out + cache | via harness join | PARTIAL | only for retained subagent transcripts |
667
+ * | perWorker wall | full | full | spawn → settle instants |
668
+ * | accepted / rejected / emptyPass / settledVerdicts | full | NONE | no per-worker verify step exists |
669
+ * | brain/worker/total usd, costPerAcceptedPatch | full | NONE | transcripts carry no price |
670
+ * | patch stats, delivered, verifyPass/Rc | full | NONE | no diff is handed back |
671
+ * | judgeResolved / Score / Passed / Total | full | NONE | no judge in the loop |
672
+ * | driverSteerCalls, brainTruncations | full | NONE | no outer driver log, no per-call finish_reason tap |
673
+ */
674
+
675
+ /** Tool names that spawn a child agent. `Task` is the older name for `Agent`. */
676
+ declare const DEFAULT_SPAWN_TOOLS: readonly ["Agent", "Task"];
677
+ /** Tool names that deliver a message to an ALREADY-RUNNING child agent. */
678
+ declare const DEFAULT_STEER_TOOLS: readonly ["SendMessage"];
679
+ /** Tool names that stop a running child agent. */
680
+ declare const DEFAULT_CANCEL_TOOLS: readonly ["TaskStop", "KillAgent"];
681
+ interface ClaudeCodeReaderOptions {
682
+ /** The main session transcript: `~/.claude/projects/<slug>/<sessionId>.jsonl`. */
683
+ readonly transcriptPath: string;
684
+ /**
685
+ * Directory of child transcripts. Defaults to `<transcript-dir>/<sessionId>/subagents`.
686
+ * `null` skips the join, and every per-worker token count becomes unavailable.
687
+ */
688
+ readonly subagentsDir?: string | null;
689
+ readonly runRef?: string;
690
+ readonly instanceId?: string | null;
691
+ readonly arm?: string | null;
692
+ readonly spawnTools?: readonly string[];
693
+ readonly steerTools?: readonly string[];
694
+ readonly cancelTools?: readonly string[];
695
+ }
696
+ /**
697
+ * Read a Claude Code session (plus its subagent transcripts) as supervision-tree
698
+ * source bytes. Never throws on a missing artifact.
699
+ */
700
+ declare function readClaudeCodeSupervisorRun(opts: ClaudeCodeReaderOptions): Promise<SupervisorRunSources>;
701
+ /** A `SupervisorRunReader` over a Claude Code session — the same contract loops implements. */
702
+ declare function claudeCodeSupervisorRunReader(opts: ClaudeCodeReaderOptions): SupervisorRunReader;
703
+
704
+ /**
705
+ * ONE implementation of `SupervisorRunReader`: the on-disk layout the loops
706
+ * supervisor writes — `<runDir>/ws/.loops/supervisor/<id>/{journal.jsonl,
707
+ * state.json, progress.ndjson, workers/*.ndjson}` alongside the run's
708
+ * `result.json` / `judge.json` / `driver.log` / delivered patch.
709
+ *
710
+ * Nothing in `analyze.ts` knows this layout exists. A different store (an
711
+ * archive, an object bucket, a database) implements the same interface and
712
+ * gets the same report.
713
+ *
714
+ * Worker token recovery reuses the rollout module's opencode reader rather
715
+ * than opening a second sqlite path — one store client, one corruption policy.
716
+ */
717
+
718
+ /** Locate the (single) supervisor run dir under `<ws>/.loops/supervisor`. */
719
+ declare function findSupervisorRunDirIn(ws: string): Promise<string | null>;
720
+ interface LoopsReaderOptions {
721
+ /** Override the workspace dir (default `<runDir>/ws`). */
722
+ readonly ws?: string;
723
+ /** Delivered patch path (default: `patchPath` from result.json). */
724
+ readonly patchPath?: string;
725
+ /** opencode sqlite store; set to `null` to skip the worker-token join entirely. */
726
+ readonly opencodeDb?: string | null;
727
+ /** Ledger to fall back to when the run has no `judge.json` (matched on iid + arm + runDir). */
728
+ readonly ledgerPath?: string;
729
+ }
730
+ /**
731
+ * Read a loops supervisor run directory into source bytes. Never throws on a
732
+ * missing artifact — an absent file becomes a `null` field, which is what makes
733
+ * the dependent metric `unavailable` instead of 0.
734
+ */
735
+ declare function readLoopsSupervisorRun(runDir: string, opts?: LoopsReaderOptions): Promise<SupervisorRunSources>;
736
+ /** The loops on-disk layout, as a `SupervisorRunReader`. */
737
+ declare function loopsSupervisorRunReader(runDir: string, opts?: LoopsReaderOptions): SupervisorRunReader;
738
+ /**
739
+ * Analyze a supervisor run. Accepts a run directory (read through the loops
740
+ * reader), any `SupervisorRunReader`, or already-read source bytes — so a
741
+ * caller with its own store never has to touch the filesystem layout.
742
+ */
743
+ declare function analyzeSupervisorRun(input: string | SupervisorRunReader | SupervisorRunSources, opts?: LoopsReaderOptions): Promise<SupervisorRunReport>;
744
+ interface WriteSupervisorRunOptions extends LoopsReaderOptions {
745
+ /** Append the headline block here (the experiment's run log). */
746
+ readonly appendHeadlineTo?: string;
747
+ /** Also console.log the headline (default true). */
748
+ readonly echo?: boolean;
749
+ /**
750
+ * Write `run-report.{json,md}` here instead of into the run dir. Set when
751
+ * reporting over a run directory that must stay READ-ONLY (a live run, an
752
+ * archived generation).
753
+ */
754
+ readonly reportDir?: string;
755
+ }
756
+ /**
757
+ * Read a completed run, write `run-report.json` + `run-report.md` beside its
758
+ * artifacts, and append the headline block to the run log. Never throws on a
759
+ * missing artifact — a run that produced nothing still yields a report whose
760
+ * every metric says why.
761
+ */
762
+ declare function writeSupervisorRunReport(runDir: string, opts?: WriteSupervisorRunOptions): Promise<SupervisorRunReport>;
763
+ /**
764
+ * File stem for out-of-tree reports. Built from the run path's identifying
765
+ * segments — candidate tag (the segment under `arm-runs/`), rep, instance, arm
766
+ * — so two runs of the same instance from different candidates/reps never
767
+ * overwrite each other.
768
+ */
769
+ declare function supervisorReportStem(runDir: string): string;
770
+ /**
771
+ * Best-effort wrapper for a hot path: a reporting failure must never kill a run
772
+ * that already produced real work. Returns null and logs the reason instead.
773
+ */
774
+ declare function writeSupervisorRunReportSafe(runDir: string, opts?: WriteSupervisorRunOptions): Promise<SupervisorRunReport | null>;
775
+ /**
776
+ * Report every run under an experiment `outDir` (any depth of
777
+ * `runs/<iid>/<arm>`), write each run's report, and write the rollup at
778
+ * `<outDir>/run-report-round.{json,md}`.
779
+ */
780
+ declare function reportSupervisorRound(outDir: string, opts?: WriteSupervisorRunOptions & {
781
+ title?: string;
782
+ }): Promise<SupervisorRunRollup>;
783
+ /** Every `<...>/runs/<iid>/<arm>` directory under `root`. */
784
+ declare function findSupervisorRunDirs(root: string): Promise<string[]>;
785
+
786
+ /**
787
+ * Human-readable renderings of a supervisor-run report. Zero and unavailable
788
+ * render differently on purpose (`0` vs `unavailable — <reason>`), because the
789
+ * two have driven opposite conclusions about the same architecture.
790
+ */
791
+
792
+ /**
793
+ * The block appended to a run log after every run — the answers an operator asks
794
+ * for, in the log tail, with no extra command.
795
+ */
796
+ declare function renderSupervisorRunHeadline(r: SupervisorRunReport): string;
797
+ declare function renderSupervisorRunMarkdown(r: SupervisorRunReport): string;
798
+ declare function renderSupervisorRollupMarkdown(rollup: SupervisorRunRollup, title?: string): string;
799
+
800
+ /**
801
+ * The supervision tree as `tangle.rollout.v1` rows.
802
+ *
803
+ * A supervisor run IS a tree of rollouts, so its nodes are not a new shape:
804
+ * the root becomes one `RolloutLine` with `role: 'supervisor'`, every spawned
805
+ * worker becomes a `RolloutLine` with `role: 'worker'` and
806
+ * `parent_rollout_id` pointing at its spawner. The rows append to the same
807
+ * ledger as solo-agent rollouts and join to them with the same keys.
808
+ *
809
+ * What the journal CANNOT supply is the transcript: a worker's messages live
810
+ * in its harness store (opencode sqlite, Claude Code jsonl), which the
811
+ * `src/rollout/readers/*` intake readers own. Rows minted here are therefore
812
+ * GAP lines (`messages: []`, `provenance.gap` set) carrying identity,
813
+ * structure, outcome and cost; hydrating them with messages is the readers'
814
+ * job, keyed on `artifacts.transcript_ref`.
815
+ *
816
+ * Timing lives in `outcome.metrics` (`spawned_at` / `settled_at` / `wall_ms`)
817
+ * rather than a schema field: `tangle.rollout.v1` describes ONE invocation,
818
+ * and the inter-invocation event timeline — which is what waves, concurrency,
819
+ * idle and utilization are computed from — is a property of the journal, not
820
+ * of any single row. The analyzer reads that timeline; these rows carry the
821
+ * per-node facts.
822
+ */
823
+
824
+ interface SupervisorRolloutOptions {
825
+ /** Benchmark/suite id for `task.suite`. Defaults to `'supervisor-run'`. */
826
+ readonly suite?: string;
827
+ /** `task.split`. Defaults to `'search'` (the trainable pool). */
828
+ readonly split?: RolloutSplit;
829
+ /** Replicate index. Defaults to 0. */
830
+ readonly rep?: number;
831
+ /** Sampling seed the campaign pinned. Defaults to null (not recorded). */
832
+ readonly seed?: number | null;
833
+ /** `run_id` for every node. Defaults to the supervisor root id, else `runRef`. */
834
+ readonly runId?: string;
835
+ /** Harness that drove the supervisor. */
836
+ readonly supervisorHarness?: string | null;
837
+ /** Harness that drove the workers. */
838
+ readonly workerHarness?: string | null;
839
+ /** Model the supervisor ran on. */
840
+ readonly supervisorModel?: string | null;
841
+ /** Model the workers ran on. */
842
+ readonly workerModel?: string | null;
843
+ readonly experimentId?: string | null;
844
+ readonly candidateId?: string | null;
845
+ readonly generation?: number | null;
846
+ readonly candidateIndex?: number | null;
847
+ /** Pins `provenance.captured_at`; defaults to now. */
848
+ readonly capturedAt?: string;
849
+ }
850
+ /**
851
+ * Mint the supervision tree as rollout rows. Returns the rows plus the gaps
852
+ * that made any of them incomplete — same unavailable-vs-zero discipline as
853
+ * the report: a row with no transcript says WHY, it never pretends to be empty.
854
+ */
855
+ declare function supervisorRunRolloutLines(src: SupervisorRunSources, opts?: SupervisorRolloutOptions): SupervisorRunTree;
856
+
857
+ export { type ClaudeCodeReaderOptions, type CloseRow, DEFAULT_CANCEL_TOOLS, DEFAULT_SPAWN_TOOLS, DEFAULT_STEER_TOOLS, type DecisionMetrics, type EconomicsMetrics, type LoopsReaderOptions, type Measured, NO_SOURCE_LIMITS, type OrchestrationMetrics, type OutcomeMetrics, type PatchStats, type PerWorkerRow, type RoleSpend, type RollupCellRow, SUPERVISOR_RUN_ROLLUP_SCHEMA, SUPERVISOR_RUN_SCHEMA, type SourceLimits, type SpawnRow, type SteerBreakdown, type SupervisorRolloutOptions, type SupervisorRunReader, type SupervisorRunReport, type SupervisorRunRollup, type SupervisorRunSources, type SupervisorRunTree, type SupervisorTreeFacts, type Unavailable, type WallDistribution, type WorkerLogFacts, type WorkerLogSource, type WriteSupervisorRunOptions, analyzeSupervisorRun, analyzeSupervisorRunSources, claudeCodeSupervisorRunReader, findSupervisorRunDirIn, findSupervisorRunDirs, isUnavailable, loopsSupervisorRunReader, parsePatch, parseSupervisorTree, readClaudeCodeSupervisorRun, readLoopsSupervisorRun, renderSupervisorRollupMarkdown, renderSupervisorRunHeadline, renderSupervisorRunMarkdown, reportSupervisorRound, rollupSupervisorRuns, showMeasured, supervisorReportStem, supervisorRunRolloutLines, unavailable, writeSupervisorRunReport, writeSupervisorRunReportSafe };