@tangle-network/agent-eval 0.202.1 → 0.203.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 (109) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/analyst/index.d.ts +5 -5
  4. package/dist/analyst/index.js +1 -1
  5. package/dist/benchmarks/index.d.ts +4 -4
  6. package/dist/campaign/index.d.ts +5 -5
  7. package/dist/campaign/index.js +2 -2
  8. package/dist/{claude-jsonl-CxZZrDJ3.js → claude-jsonl-DoQJBCVR.js} +49 -15
  9. package/dist/claude-jsonl-DoQJBCVR.js.map +1 -0
  10. package/dist/cli.js +2 -2
  11. package/dist/contract/index.d.ts +7 -7
  12. package/dist/contract/index.js +1 -1
  13. package/dist/{default-registry-D1rNS2yB.d.ts → default-registry-B-utjsmX.d.ts} +3 -3
  14. package/dist/{default-registry-D1rNS2yB.d.ts.map → default-registry-B-utjsmX.d.ts.map} +1 -1
  15. package/dist/{default-registry-D4qXx2aG.js → default-registry-CpswV_S2.js} +2 -2
  16. package/dist/{default-registry-D4qXx2aG.js.map → default-registry-CpswV_S2.js.map} +1 -1
  17. package/dist/{define-agent-eval-CNkCzx6h.d.ts → define-agent-eval-MAc6BQrq.d.ts} +5 -5
  18. package/dist/{define-agent-eval-CNkCzx6h.d.ts.map → define-agent-eval-MAc6BQrq.d.ts.map} +1 -1
  19. package/dist/{engine-DlKIzDKo.d.ts → engine-4_Q4oujc.d.ts} +2 -2
  20. package/dist/{engine-DlKIzDKo.d.ts.map → engine-4_Q4oujc.d.ts.map} +1 -1
  21. package/dist/evaluation.d.ts +1 -1
  22. package/dist/experiment/index.d.ts +1 -1
  23. package/dist/{exporters-XMCYJlqT.d.ts → exporters-ChTnR90l.d.ts} +2 -2
  24. package/dist/{exporters-XMCYJlqT.d.ts.map → exporters-ChTnR90l.d.ts.map} +1 -1
  25. package/dist/{exporters-Coiv-qO2.js → exporters-X4xwla8A.js} +10 -4
  26. package/dist/{exporters-Coiv-qO2.js.map → exporters-X4xwla8A.js.map} +1 -1
  27. package/dist/{hf-dataset-kjIfIK_e.js → hf-dataset-BR2yhuNn.js} +3 -3
  28. package/dist/{hf-dataset-kjIfIK_e.js.map → hf-dataset-BR2yhuNn.js.map} +1 -1
  29. package/dist/{index-D4pC7Tvd.d.ts → index-BoVEyQwH.d.ts} +18 -14
  30. package/dist/{index-D4pC7Tvd.d.ts.map → index-BoVEyQwH.d.ts.map} +1 -1
  31. package/dist/{index-BzSeeKNp.d.ts → index-CAtNOBQY.d.ts} +16 -5
  32. package/dist/index-CAtNOBQY.d.ts.map +1 -0
  33. package/dist/{index-DWDvp-6z.d.ts → index-Cuhxk05B.d.ts} +6 -6
  34. package/dist/{index-DWDvp-6z.d.ts.map → index-Cuhxk05B.d.ts.map} +1 -1
  35. package/dist/{index-Bi2fLITd.d.ts → index-DBk_4UPs.d.ts} +4 -4
  36. package/dist/{index-Bi2fLITd.d.ts.map → index-DBk_4UPs.d.ts.map} +1 -1
  37. package/dist/index.d.ts +12 -12
  38. package/dist/index.js +3 -3
  39. package/dist/{integrity-uwK7XC-8.js → integrity-BV1ZDf42.js} +38 -6
  40. package/dist/{integrity-uwK7XC-8.js.map → integrity-BV1ZDf42.js.map} +1 -1
  41. package/dist/{jev-protocol-CpKI7XSu.d.ts → jev-protocol-BQLxwbqD.d.ts} +24 -7
  42. package/dist/jev-protocol-BQLxwbqD.d.ts.map +1 -0
  43. package/dist/jev-protocol.d.ts +2 -2
  44. package/dist/jev-protocol.js +19 -4
  45. package/dist/jev-protocol.js.map +1 -1
  46. package/dist/{jev-review-D4ynCORp.d.ts → jev-review-DX6MI_jq.d.ts} +2 -2
  47. package/dist/{jev-review-D4ynCORp.d.ts.map → jev-review-DX6MI_jq.d.ts.map} +1 -1
  48. package/dist/jev.d.ts +4 -4
  49. package/dist/jev.js +2 -2
  50. package/dist/{matrix--IZKROxD.d.ts → matrix-BucOjLF1.d.ts} +2 -2
  51. package/dist/{matrix--IZKROxD.d.ts.map → matrix-BucOjLF1.d.ts.map} +1 -1
  52. package/dist/{mint-C9Lojt1V.d.ts → mint-C1W8w5wo.d.ts} +10 -2
  53. package/dist/mint-C1W8w5wo.d.ts.map +1 -0
  54. package/dist/{mint-vlRckJEX.js → mint-CWG-s2mI.js} +26 -7
  55. package/dist/mint-CWG-s2mI.js.map +1 -0
  56. package/dist/multishot/golden/index.d.ts +1 -1
  57. package/dist/multishot/index.d.ts +2 -2
  58. package/dist/openapi.json +1 -1
  59. package/dist/{report-command-DzPpFgjB.js → report-command-D0XL2Cvi.js} +128 -15
  60. package/dist/report-command-D0XL2Cvi.js.map +1 -0
  61. package/dist/rl.d.ts +6 -6
  62. package/dist/rl.js +3 -3
  63. package/dist/rollout/index.d.ts +5 -5
  64. package/dist/rollout/index.js +6 -6
  65. package/dist/{rollout-BUQixCoc.js → rollout-BdCoWV9n.js} +41 -21
  66. package/dist/{rollout-BUQixCoc.js.map → rollout-BdCoWV9n.js.map} +1 -1
  67. package/dist/{schema-DAMp77zB.js → schema-BuiujZ-g.js} +37 -1
  68. package/dist/schema-BuiujZ-g.js.map +1 -0
  69. package/dist/{schema-B5LtYvn9.d.ts → schema-C-ziyJD7.d.ts} +40 -5
  70. package/dist/schema-C-ziyJD7.d.ts.map +1 -0
  71. package/dist/search/index.d.ts +2 -2
  72. package/dist/{search-kernel-C9CXvFR7.d.ts → search-kernel-B8RC6BlK.d.ts} +2 -2
  73. package/dist/{search-kernel-C9CXvFR7.d.ts.map → search-kernel-B8RC6BlK.d.ts.map} +1 -1
  74. package/dist/{statistical-heldout-HswMvzbP.d.ts → statistical-heldout-DJtQAUZB.d.ts} +2 -2
  75. package/dist/{statistical-heldout-HswMvzbP.d.ts.map → statistical-heldout-DJtQAUZB.d.ts.map} +1 -1
  76. package/dist/{store-tool-spans-Dv9x4XYG.d.ts → store-tool-spans-fkNF7Q9Y.d.ts} +3 -3
  77. package/dist/{store-tool-spans-Dv9x4XYG.d.ts.map → store-tool-spans-fkNF7Q9Y.d.ts.map} +1 -1
  78. package/dist/supervisor-run/index.d.ts +2 -2
  79. package/dist/supervisor-run/index.d.ts.map +1 -1
  80. package/dist/supervisor-run/index.js +23 -15
  81. package/dist/supervisor-run/index.js.map +1 -1
  82. package/dist/terminal-record-BHocwFw1.js.map +1 -1
  83. package/dist/{tool-groups-BY1MdSIE.d.ts → tool-groups-Zm84Pqpk.d.ts} +2 -2
  84. package/dist/tool-groups-Zm84Pqpk.d.ts.map +1 -0
  85. package/dist/{trace-questions-DnqdmwyV.d.ts → trace-questions--lnJTaou.d.ts} +2 -2
  86. package/dist/{trace-questions-DnqdmwyV.d.ts.map → trace-questions--lnJTaou.d.ts.map} +1 -1
  87. package/dist/trace-repair/index.d.ts +1 -1
  88. package/dist/traces.d.ts +2 -2
  89. package/dist/{types-C4hH69a9.d.ts → types-B6JadxWL.d.ts} +2 -2
  90. package/dist/{types-C4hH69a9.d.ts.map → types-B6JadxWL.d.ts.map} +1 -1
  91. package/dist/{types-DfvQOe91.d.ts → types-khIUQ0O5.d.ts} +2 -2
  92. package/dist/{types-DfvQOe91.d.ts.map → types-khIUQ0O5.d.ts.map} +1 -1
  93. package/dist/{types-DRNlLbBR.d.ts → types-v6nRcIqg.d.ts} +11 -3
  94. package/dist/types-v6nRcIqg.d.ts.map +1 -0
  95. package/docs/campaign-coverage.md +20 -0
  96. package/docs/changes/jev-recorded-evidence.md +24 -0
  97. package/docs/jev-replay.md +50 -0
  98. package/docs/rollout.md +35 -1
  99. package/package.json +1 -1
  100. package/dist/claude-jsonl-CxZZrDJ3.js.map +0 -1
  101. package/dist/index-BzSeeKNp.d.ts.map +0 -1
  102. package/dist/jev-protocol-CpKI7XSu.d.ts.map +0 -1
  103. package/dist/mint-C9Lojt1V.d.ts.map +0 -1
  104. package/dist/mint-vlRckJEX.js.map +0 -1
  105. package/dist/report-command-DzPpFgjB.js.map +0 -1
  106. package/dist/schema-B5LtYvn9.d.ts.map +0 -1
  107. package/dist/schema-DAMp77zB.js.map +0 -1
  108. package/dist/tool-groups-BY1MdSIE.d.ts.map +0 -1
  109. package/dist/types-DRNlLbBR.d.ts.map +0 -1
@@ -242,12 +242,47 @@ interface GatedEvidence {
242
242
  */
243
243
  steps?: unknown;
244
244
  }
245
+ interface RolloutEvidenceAttempt {
246
+ executionId: string;
247
+ ordinal: number;
248
+ providerSessionId: string | null;
249
+ nativeSessionIds: string[];
250
+ processIds: string[];
251
+ outcome: 'succeeded' | 'failed' | 'cancelled' | 'unknown';
252
+ missingReasons: string[];
253
+ }
254
+ /** One Runtime result blob and its unmodified provider capture receipt. */
255
+ interface RolloutWorkspaceCapture {
256
+ readonly outRef: string | null;
257
+ readonly blobPath: string | null;
258
+ /** JSON pointer to the receipt within its Runtime result. */
259
+ readonly receiptPointer: string | null;
260
+ readonly receipt: unknown | null;
261
+ readonly attempts: readonly unknown[] | null;
262
+ /** The provider's claim, not an Eval verification of the archive bytes. */
263
+ readonly coverageComplete: boolean | null;
264
+ readonly incompleteReason: string | null;
265
+ readonly projectionGap: string | null;
266
+ }
245
267
  interface RolloutProvenance {
246
268
  captured_at: string;
247
269
  capture: RolloutCapture;
270
+ /** Exact search-cell attempt; absent outside a search. */
271
+ search?: {
272
+ searchId: string;
273
+ nodeId: string;
274
+ cellId: string;
275
+ attempt: number;
276
+ };
277
+ /** Run-bound provider attempts; absent means this source was not observed. */
278
+ attempts?: RolloutEvidenceAttempt[];
279
+ /** Exact per-result receipts in source order. Null means Runtime had no result evidence. */
280
+ workspace_captures?: readonly RolloutWorkspaceCapture[] | null;
281
+ /** A known lossy semantic projection. Training sinks refuse this line. */
282
+ lossy_projection?: true;
248
283
  /**
249
- * Why this line is incomplete. Required when `messages` is empty (the
250
- * transcript could not be recovered); also set by interchange importers to
284
+ * Why this line is incomplete. Required when `messages` is empty and set
285
+ * for lossy last-context or capped-step projections. Importers also use it to
251
286
  * name a MISSING LABEL — an imported trajectory carries no verdict, so
252
287
  * `outcome.reward` is null and this says why.
253
288
  */
@@ -278,7 +313,7 @@ interface RolloutLine {
278
313
  role: RolloutRole;
279
314
  task: RolloutTask;
280
315
  policy: RolloutPolicy;
281
- /** Full transcript, inline. [] = gap line (see provenance.gap). */
316
+ /** Inline conversation projection. Check provenance.gap before treating it as complete. */
282
317
  messages: ChatMessage[];
283
318
  tool_defs: ToolDef[];
284
319
  /** Trace-span projections, when minted from a trace. */
@@ -403,5 +438,5 @@ declare function assertMinted(value: unknown, context?: string): MintedRolloutLi
403
438
  /** `assertMinted` over a batch, naming the offending index in the error. */
404
439
  declare function assertMintedLines(values: readonly unknown[], context?: string): MintedRolloutLine[];
405
440
  //#endregion
406
- export { assertMinted as C, isRolloutLine as D, gateGamedOutcome as E, isTrainableSplit as O, ToolDef as S, assertRolloutLine as T, RolloutProvenance as _, MintedRolloutLine as a, RolloutStep as b, ROLLOUT_ROLES as c, RolloutArtifacts as d, RolloutCapture as f, RolloutPolicy as g, RolloutOutcome as h, GatedEvidence as i, validateRolloutLine as k, ROLLOUT_SCHEMA as l, RolloutLine as m, ChatRole as n, MintedRolloutOutcome as o, RolloutCostBlock as p, ChatToolCall as r, ROLLOUT_CAPTURES as s, ChatMessage as t, ROLLOUT_SPLITS as u, RolloutRole as v, assertMintedLines as w, RolloutTask as x, RolloutSplit as y };
407
- //# sourceMappingURL=schema-B5LtYvn9.d.ts.map
441
+ export { isTrainableSplit as A, RolloutWorkspaceCapture as C, assertRolloutLine as D, assertMintedLines as E, gateGamedOutcome as O, RolloutTask as S, assertMinted as T, RolloutPolicy as _, MintedRolloutLine as a, RolloutSplit as b, ROLLOUT_ROLES as c, RolloutArtifacts as d, RolloutCapture as f, RolloutOutcome as g, RolloutLine as h, GatedEvidence as i, validateRolloutLine as j, isRolloutLine as k, ROLLOUT_SCHEMA as l, RolloutEvidenceAttempt as m, ChatRole as n, MintedRolloutOutcome as o, RolloutCostBlock as p, ChatToolCall as r, ROLLOUT_CAPTURES as s, ChatMessage as t, ROLLOUT_SPLITS as u, RolloutProvenance as v, ToolDef as w, RolloutStep as x, RolloutRole as y };
442
+ //# sourceMappingURL=schema-C-ziyJD7.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-C-ziyJD7.d.ts","names":[],"sources":["../src/rollout/schema.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa;;KAGD;cACC,wBAAwB;;KAUzB;cACC,yBAAyB;iBAItB,iBAAiB,OAAO;;KAK5B;cACC,2BAA2B;KAM5B;UAGK;EACf;EACA;EACA;IACE;;IAEA;;;UAIa;EACf,MAAM;EACN;;EAEA;EACA,aAAa;;EAEb;EACA;;;;;;;;EAQA;;UAGe;EACf;EACA;IACE;IACA;IACA,aAAa;;;;;;;;UASA;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;;;EAUA;;EAEA;;EAEA;;;;;;EAMA;;UAOe;;EAEf;EACA;EACA,OAAO;;EAEP;;EAEA;;UAGe;;EAEf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,UAAU;;UAGK;;;;;EAKf;;EAEA;;EAEA;;EAEA,SAAS;EACT;EACA;EACA;;;;;;;;;;;;;EAaA;;;;;;;;;;;;;;;;;;;;;EAqBA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;EAKA;;UAGe;EACf;EACA;;;EAGA;;;;;;;UAQe;;EAEf,UAAU;;EAEV;;;;;;;;;EASA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;UAIe;WACN;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;;UAGM;EACf;EACA,SAAS;;EAET;IAAW;IAAkB;IAAgB;IAAgB;;;EAE7D,WAAW;;EAEX,8BAA8B;;EAE9B;;;;;;;EAOA;;;;;;;EAOA,iBAAiB;;UAGF;EACf,eAAe;EACf;;;EAGA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,MAAM;EACN,MAAM;EACN,QAAQ;;EAER,UAAU;EACV,WAAW;;EAEX,QAAQ;EACR,SAAS;EACT,MAAM;EACN,WAAW;EACX,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6GE,iBAAiB,MAAM,cAAc;iBAqDrC,oBAAoB;iBAgTpB,kBACd,gBACA,2BACS,SAAS;iBAOJ,cAAc,iBAAiB,SAAS;;;;;;cAa1C;;;;;;UAOG,6BAA6B;EAC5C;;;;;;;;;;;;;;;;;;;;;;KAuBU,oBAAoB,KAAK;YACzB;EACV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCK,aAAa,gBAAgB,mBAA2B;;iBAiBxD,kBACd,4BACA,mBACC"}
@@ -1,6 +1,6 @@
1
1
  import { A as SearchLedgerHash, C as SearchEdgeOperator, G as SearchSplit, H as SearchProposerKind, I as SearchNodeStatus, L as SearchOpenedEvent, T as SearchEstimateMethod, W as SearchSourceRef, i as SearchArtifactRef, j as SearchModelIdentity, l as SearchCandidateSurface, m as SearchClaim, t as NodeEstimate, y as SearchCloseReason } from "../search-ledger-types-p2xKfiDJ.js";
2
- import { $ as SearchNode, it as SearchStateView } from "../types-DfvQOe91.js";
3
- import { $ as EXPANSION_OPERATORS, L as SearchPolicy, M as SearchUnitExtension, at as OperatorYieldRow, ct as LensResult, dt as rankingSplit, et as ExpansionOperator, ft as summarizeSamples, it as OperatorYieldOptions, lt as LensSignal, nt as OperatorOutcomeCounts, ot as OperatorYieldSignal, p as SearchRunResult, r as SearchArtifactCodec, rt as OperatorYieldData, s as SearchLane, st as operatorYield, t as RunSearchOptions, tt as MIN_OUTCOMES_FOR_WEIGHT, ut as SampleSummary, z as SearchPolicyView } from "../search-kernel-C9CXvFR7.js";
2
+ import { $ as SearchNode, it as SearchStateView } from "../types-khIUQ0O5.js";
3
+ import { $ as EXPANSION_OPERATORS, L as SearchPolicy, M as SearchUnitExtension, at as OperatorYieldRow, ct as LensResult, dt as rankingSplit, et as ExpansionOperator, ft as summarizeSamples, it as OperatorYieldOptions, lt as LensSignal, nt as OperatorOutcomeCounts, ot as OperatorYieldSignal, p as SearchRunResult, r as SearchArtifactCodec, rt as OperatorYieldData, s as SearchLane, st as operatorYield, t as RunSearchOptions, tt as MIN_OUTCOMES_FOR_WEIGHT, ut as SampleSummary, z as SearchPolicyView } from "../search-kernel-B8RC6BlK.js";
4
4
  import { AgentProfileResourceRef } from "@tangle-network/agent-interface";
5
5
  //#region src/search/lenses/edit-credit.d.ts
6
6
  /** Signal name a policy reads. */
@@ -2,7 +2,7 @@ import { o as CostLedger } from "./cost-ledger-DbQdN3nO.js";
2
2
  import { a as RunRecord } from "./run-record-DF-fuu31.js";
3
3
  import { A as SearchLedgerHash, C as SearchEdgeOperator, E as SearchExecutionIdentity, G as SearchSplit, H as SearchProposerKind, I as SearchNodeStatus, L as SearchOpenedEvent, N as SearchNodeDecision, O as SearchLedgerEntry, P as SearchNodeRef, Q as SearchTaskOutcome, R as SearchOperationKind, S as SearchEdgeAttribution, U as SearchReservation, V as SearchProposer, W as SearchSourceRef, Y as SearchSurfaceEvidence, Z as SearchTask, _ as SearchClaimPower, a as SearchAttemptAccounting, et as SearchTraceRef, i as SearchArtifactRef, j as SearchModelIdentity, k as SearchLedgerEvent, l as SearchCandidateSurface, m as SearchClaim, nt as EvaluationClaim, o as SearchAudit, p as SearchCellStage, t as NodeEstimate, tt as SearchUnknown, y as SearchCloseReason, z as SearchOperationRecordedEvent } from "./search-ledger-types-p2xKfiDJ.js";
4
4
  import { b as LedgerTrustedHeadRemoval, f as LedgerLineContext, h as LedgerTextStore, y as LedgerTrustedHead } from "./index-Bj96W0jZ.js";
5
- import { $ as SearchNode, at as SearchUnitScore, it as SearchStateView, j as MutableSurface, tt as SearchScoredCell } from "./types-DfvQOe91.js";
5
+ import { $ as SearchNode, at as SearchUnitScore, it as SearchStateView, j as MutableSurface, tt as SearchScoredCell } from "./types-khIUQ0O5.js";
6
6
  //#region src/campaign/storage.d.ts
7
7
  /**
8
8
  * `CampaignStorage` — the filesystem seam `runCampaign` writes through
@@ -1187,4 +1187,4 @@ declare function searchDivergence(state: SearchStateView, nodeId: string): {
1187
1187
  } | null;
1188
1188
  //#endregion
1189
1189
  export { EXPANSION_OPERATORS as $, SearchCellPlan as A, SearchHistoryCoverageRow as At, aide as B, FileSearchLedger as Bt, decideSearchClaim as C, searchEdgeId as Ct, AshaOptions as D, SearchHistoryAdmissionOptions as Dt, verifySearchClaim as E, CreateSearchHistoryReceiptInput as Et, AideOptions as F, assertSearchHistoryMatchesState as Ft, EstimateNodeCellsInput as G, openSearchLedger as Gt, crowdedFrontierParent as H, SearchLedger as Ht, SearchExpansion as I, createSearchHistoryReceipt as It, SearchPosterior as J, validateSearchLedgerEvent as Jt, NodePosterior as K, parseSearchLedgerLine as Kt, SearchPolicy as L, searchHistoryCoverageRow as Lt, SearchUnitExtension as M, SearchHistoryReceipt as Mt, asha as N, SearchHistoryRequiredError as Nt, SearchAllocationView as O, SearchHistoryAuditSummary as Ot, uniform as P, assertCompleteSearchHistory as Pt, searchPosterior as Q, inMemoryCampaignStorage as Qt, SearchPolicyNode as R, verifySearchHistoryArtifact as Rt, SearchClaimVerification as S, developmentClaim as St, searchClaimReserveUsd as T, surfaceNode as Tt, incumbent as U, SearchLedgerAppendResult as Ut, beam as V, OpenSearchLedgerOptions as Vt, incumbentWithOperatorBandit as W, SearchLedgerTrustedHeadMode as Wt, estimateNodeFromCells as X, createRunCostLedger as Xt, estimateNode as Y, CampaignStorage as Yt, searchCellSetDigest as Z, fsCampaignStorage as Zt, searchPolicyView as _, SearchOpening as _t, SearchCellWork as a, OperatorYieldRow as at, SearchClaimDecision as b, SearchRunIdentity as bt, SearchProposalBlob as c, LensResult as ct, SearchProposedChild as d, rankingSplit as dt, ExpansionOperator as et, SearchProposerPort as f, summarizeSamples as ft, searchExpansionIndex as g, SearchLedgerBinding as gt, searchDivergence as h, RegisterSearchNodeInput as ht, SearchCellResult as i, OperatorYieldOptions as it, SearchRungDecision as j, SearchHistoryPolicy as jt, SearchAllocator as k, SearchHistoryCoverage as kt, SearchProposalRequest as l, LensSignal as lt, runSearch as m, RecordSearchEdgeInput as mt, SEARCH_KERNEL_SOURCE as n, OperatorOutcomeCounts as nt, SearchExecutor as o, OperatorYieldSignal as ot, SearchRunResult as p, AllocateSearchCellInput as pt, SEARCH_ESTIMATOR as q, replaySearchLedgerText as qt, SearchArtifactCodec as r, OperatorYieldData as rt, SearchLane as s, operatorYield as st, RunSearchOptions as t, MIN_OUTCOMES_FOR_WEIGHT as tt, SearchProposalResult as u, SampleSummary as ut, PlanSearchClaimInput as v, SearchRecorder as vt, planSearchClaim as w, surfaceDiff as wt, SearchClaimPlan as x, SettleSearchCellInput as xt, SEARCH_CLAIM_RULE as y, SearchRecorderOptions as yt, SearchPolicyView as z, verifySearchHistoryReceipt as zt };
1190
- //# sourceMappingURL=search-kernel-C9CXvFR7.d.ts.map
1190
+ //# sourceMappingURL=search-kernel-B8RC6BlK.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-kernel-C9CXvFR7.d.ts","names":[],"sources":["../src/campaign/storage.ts","../src/campaign/search-ledger.ts","../src/campaign/search-history-receipt.ts","../src/campaign/search-ledger-recording.ts","../src/search/lenses/shared.ts","../src/search/lenses/operator-yield.ts","../src/campaign/estimate-node.ts","../src/campaign/search-policy.ts","../src/campaign/allocation.ts","../src/campaign/search-claim.ts","../src/campaign/search-kernel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAoBiB;;;;WAIN;;EAET,UAAU;;EAEV,OAAO;;EAEP,KAAK;;EAEL,MAAM,cAAc,kBAAkB;;;EAGtC,OAAO,cAAc,iBAAiB;;;;;;;;;iBAUxB,qBAAqB;;;;iBA2CrB,2BAA2B;;iBAoC3B,oBAAoB;EAClC,SAAS;EACT;EACA;;EAEA;IACE;;;;;iBC2ZY,0BAA0B,iBAAiB;;;;;;;;;;;;;;KAqB/C;UAEK;EACf;EACA;EACA,cAAc;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;UAGe;;EAEf,OAAO;;;EAGP;EACA,QAAQ;;EAER,OAAO;;;;EAIP,mBAAmB;;;iBAIC,UAAU,WAC9B,SAAS,iBAAiB,aACzB,QAAQ;;iBAKK,qBAAqB;;UAyBpB;EACf;EACA,UAAU;EACV;EACA;IAAa;IAAc,UAAU;;EACrC,UAAU;IACR,MAAM;IACN,OAAO,MAAM,oBAAoB;IACjC;IACA;IACA,aAAa,SAAS;IACtB;;;;;;;;;;;iBA2mCY,iBACd,OAAO,iBACP;EACE;EACA;EACA;EACA;IAED;;;;;;;;iBA4Fa,iBACd,OAAO,iBACP;EACG,OAAO;EAAc"}
1
+ {"version":3,"file":"search-kernel-B8RC6BlK.d.ts","names":[],"sources":["../src/campaign/storage.ts","../src/campaign/search-ledger.ts","../src/campaign/search-history-receipt.ts","../src/campaign/search-ledger-recording.ts","../src/search/lenses/shared.ts","../src/search/lenses/operator-yield.ts","../src/campaign/estimate-node.ts","../src/campaign/search-policy.ts","../src/campaign/allocation.ts","../src/campaign/search-claim.ts","../src/campaign/search-kernel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAoBiB;;;;WAIN;;EAET,UAAU;;EAEV,OAAO;;EAEP,KAAK;;EAEL,MAAM,cAAc,kBAAkB;;;EAGtC,OAAO,cAAc,iBAAiB;;;;;;;;;iBAUxB,qBAAqB;;;;iBA2CrB,2BAA2B;;iBAoC3B,oBAAoB;EAClC,SAAS;EACT;EACA;;EAEA;IACE;;;;;iBC2ZY,0BAA0B,iBAAiB;;;;;;;;;;;;;;KAqB/C;UAEK;EACf;EACA;EACA,cAAc;;;;;;;EAOd,QAAQ;;UAGO;EACf,OAAO;;EAEP;EACA,OAAO;;UAGQ;WACN;WACA;;WAEA;EACT,OAAO,OAAO,oBAAoB,QAAQ;;EAE1C,SAAS,QAAQ;;EAEjB,eAAe,QAAQ;;EAEvB,kBAAkB,QAAQ;;;EAG1B,oBAAoB,QAAQ;;;;iBAKd,iBAAiB,SAAS,0BAA0B;;;iBA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IACA;IACA,aAAa,SAAS;IACtB;;;;;;;;;;;iBA2mCY,iBACd,OAAO,iBACP;EACE;EACA;EACA;EACA;IAED;;;;;;;;iBA4Fa,iBACd,OAAO,iBACP;EACG,OAAO;EAAc"}
@@ -1,7 +1,7 @@
1
1
  import { a as RunRecord } from "./run-record-DF-fuu31.js";
2
2
  import { a as PairedPromotionDecision, d as PairedBootstrapResult, i as PairedMcNemarEvidence, r as PairedDecisionStatistic, t as PairedDecisionMethod, u as PairedBootstrapOptions } from "./paired-promotion-decision-DPKz8ZnF.js";
3
3
  import { r as LedgerHash } from "./canonical-CFpojCN5.js";
4
- import { R as Scenario, a as CampaignResult, b as GenerationRecord, h as GateContext, j as MutableSurface, p as Gate, v as GateResult, w as JudgeScore } from "./types-DfvQOe91.js";
4
+ import { R as Scenario, a as CampaignResult, b as GenerationRecord, h as GateContext, j as MutableSurface, p as Gate, v as GateResult, w as JudgeScore } from "./types-khIUQ0O5.js";
5
5
  import { z } from "zod";
6
6
  //#region src/statistics/paired-binary.d.ts
7
7
  /** A binomial proportion estimate with a confidence interval. */
@@ -1306,4 +1306,4 @@ declare function dimensionRegressions(candidate: Map<string, Record<string, Judg
1306
1306
  }): DimensionRegression[];
1307
1307
  //#endregion
1308
1308
  export { paretoSignificanceGate as $, PairArmsOptions as A, FinalEvidenceReservation as At, PowerPreflight as B, RiskDifferenceResult as Bt, hashJson as C, verifyAttestation as Ct, ComparePairedArmsOptions as D, FinalEvidenceMeasurement as Dt, verifyManifest as E, FinalEvidenceLedger as Et, PairedCorrectness as F, EProcessStep as Ft, BuildEvidenceVectorOptions as G, pairedRiskDifference as Gt, powerPreflight as H, isBinaryOutcomeVector as Ht, PairedMetricDelta as I, eProcess as It, ParetoSignificanceGateOptions as J, passAtK as Jt, EvidenceVector as K, pairedRiskDifferenceExact as Kt, comparePairedArms as L, ExactRiskDifferenceResult as Lt, PairRunRecordsResult as M, EProcess as Mt, PairedArmRow as N, EProcessOptions as Nt, MatchedPair as O, FinalEvidenceOutcome as Ot, PairedArmsComparison as P, EProcessState as Pt, paretoPolicy as Q, pairArms as R, McNemarResult as Rt, evaluateHypothesis as S, attest as St, signManifest as T, FinalEvidenceError as Tt, AxisEvidence as U, mcnemar as Ut, PowerPreflightOptions as V, ScoreRiskDifferenceResult as Vt, AxisVerdict as W, pairedBinaryScale as Wt, PromotionPolicy as X, PromotionObjective as Y, wilson as Yt, buildEvidenceVector as Z, sequentialPairedGate as _, verifyEvidenceReceipt as _t, detectScale as a, createCampaignEvidenceReceipt as at, SignedManifest as b, AttestationVerification as bt, pairHoldout as c, EVIDENCE_RECEIPT_VERSION as ct, SequentialDecision as d, EvidenceBinding as dt, Objective as et, SequentialObservation as f, EvidenceReceipt as ft, sequentialDecide as g, isIndependentEvidence as gt, SequentialStreamState as h, createEvidenceReceipt as ht, PairedHoldout as i, CampaignEvidenceContext as it, PairArmsResult as j, openFinalEvidenceLedger as jt, MatchedRunRecordPair as k, FinalEvidenceRecord as kt, SequentialDecideFn as l, EvidenceAuthority as lt, SequentialPairedGateOptions as m, INDEPENDENT_EVIDENCE_AUTHORITY_KINDS as mt, HeldoutSignificance as n, dominates as nt, dimensionRegressions as o, CreateEvidenceReceiptInput as ot, SequentialPairedGate as p, EvidenceReceiptVerification as pt, ObjectiveSource as q, pairedRiskDifferenceScore as qt, HeldoutSignificanceOptions as r, paretoFrontier as rt, heldoutSignificance as s, EVIDENCE_AUTHORITY_KINDS as st, DimensionRegression as t, ParetoResult as tt, SequentialDecideOptions as u, EvidenceAuthorityKind as ut, HypothesisManifest as v, ATTESTATION_ALGORITHM as vt, manifestContentDigest as w, FinalEvidenceConflictError as wt, SignedManifestAlgo as x, AttestedReport as xt, HypothesisResult as y, AttestationProvenance as yt, pairRunRecords as z, ProportionInterval as zt };
1309
- //# sourceMappingURL=statistical-heldout-HswMvzbP.d.ts.map
1309
+ //# sourceMappingURL=statistical-heldout-DJtQAUZB.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"statistical-heldout-HswMvzbP.d.ts","names":["_$__evidence_receipt0.EvidenceReceipt"],"sources":["../src/statistics/paired-binary.ts","../src/statistics/sequential-eprocess.ts","../src/experiment/final-evidence.ts","../src/attestation.ts","../src/experiment/evidence-receipt.ts","../src/experiment/campaign-evidence.ts","../src/pareto.ts","../src/campaign/gates/promotion-policy.ts","../src/campaign/gates/power-preflight.ts","../src/paired-arms.ts","../src/pre-registration.ts","../src/campaign/gates/sequential.ts","../src/campaign/gates/statistical-heldout.ts"],"mappings":";;;;;;;UAgBiB;;EAEf;;EAEA;;EAEA;;;;;;;;;iBAUc,OAAO,mBAAmB,WAAW,sBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CzD,sBAAsB,QAAQ;;UAU7B;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;iBAec,QACd,SAAS,6BACT,WAAW,8BACV;;UAmBc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;iBAkBc,qBACd,SAAS,6BACT,WAAW,6BACX,sBACC;;;;UAkCc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+Bc,0BACd,SAAS,6BACT,WAAW,6BACX,sBACC;;;UAyEc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Dc,0BACd,SAAS,6BACT,WAAW,6BACX,sBACC;;;;;;;;;;;;;;;;;;;;iBAiFa,kBACd,QAAQ,mBACR,OAAO;;;;;;;;;;;iBA0BO,QAAQ,WAAW,WAAW;;;UCrgB7B;;;EAGf;;;;EAIA;;;;EAIA;;;;;;;;EAQA,SAAS;;UAGM;;EAEf;;EAEA;;EAEA;;;;;;;;;;UAWe,sBAAsB;EACrC;EACA;EACA;;EAEA;;EAEA;;EAEA;;;EAGA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-heldout-DJtQAUZB.d.ts","names":["_$__evidence_receipt0.EvidenceReceipt"],"sources":["../src/statistics/paired-binary.ts","../src/statistics/sequential-eprocess.ts","../src/experiment/final-evidence.ts","../src/attestation.ts","../src/experiment/evidence-receipt.ts","../src/experiment/campaign-evidence.ts","../src/pareto.ts","../src/campaign/gates/promotion-policy.ts","../src/campaign/gates/power-preflight.ts","../src/paired-arms.ts","../src/pre-registration.ts","../src/campaign/gates/sequential.ts","../src/campaign/gates/statistical-heldout.ts"],"mappings":";;;;;;;UAgBiB;;EAEf;;EAEA;;EAEA;;;;;;;;;iBAUc,OAAO,mBAAmB,WAAW,sBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CzD,sBAAsB,QAAQ;;UAU7B;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;iBAec,QACd,SAAS,6BACT,WAAW,8BACV;;UAmBc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;iBAkBc,qBACd,SAAS,6BACT,WAAW,6BACX,sBACC;;;;UAkCc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+Bc,0BACd,SAAS,6BACT,WAAW,6BACX,sBACC;;;UAyEc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Dc,0BACd,SAAS,6BACT,WAAW,6BACX,sBACC;;;;;;;;;;;;;;;;;;;;iBAiFa,kBACd,QAAQ,mBACR,OAAO;;;;;;;;;;;iBA0BO,QAAQ,WAAW,WAAW;;;UCrgB7B;;;EAGf;;;;EAIA;;;;EAIA;;;;;;;;EAQA,SAAS;;UAGM;;EAEf;;EAEA;;EAEA;;;;;;;;;;UAWe,sBAAsB;EACrC;EACA;EACA;;EAEA;;EAEA;;EAEA;;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 @@ import { E as SpanSourceReader, F as SearchTraceResult, K as ViewTraceResult, N
6
6
  import { et as ProviderRedactor, rt as RawProviderSink } from "./types-C0bWoSKC.js";
7
7
  import { i as SearchArtifactRef } from "./search-ledger-types-p2xKfiDJ.js";
8
8
  import { s as TraceStore } from "./store-C4avFjIi.js";
9
- import { a as TraceAnalystLimits, i as TraceAnalysisEngineResult, n as TraceAnalysisEngine } from "./engine-DlKIzDKo.js";
10
- import { t as TraceToolGroupName } from "./tool-groups-BY1MdSIE.js";
9
+ import { a as TraceAnalystLimits, i as TraceAnalysisEngineResult, n as TraceAnalysisEngine } from "./engine-4_Q4oujc.js";
10
+ import { t as TraceToolGroupName } from "./tool-groups-Zm84Pqpk.js";
11
11
  //#region src/trace/extract-usage.d.ts
12
12
  type ExtractedUsage = RunTokenUsage;
13
13
  type SseUsageMode = 'cumulative' | 'delta';
@@ -407,4 +407,4 @@ declare class ToolTraceMissingError extends CaptureIntegrityError {
407
407
  declare function toolSpansToTraceAnalysisStore(spans: readonly ToolSpan[] | null | undefined, options?: ToolSpansToTraceAnalysisStoreOptions): TraceAnalysisStore;
408
408
  //#endregion
409
409
  export { AnalyzeTracesInput as A, CaptureFetchContext as B, inferDomainKeywords as C, planTraceInsightQuestions as D, isTraceInsightEvidence as E, OTEL_AGENT_EVAL_SCOPE as F, SseUsageMode as G, captureFetchToRawSink as H, OtlpExport as I, extractUsageFromSse as J, extractUsage as K, OtlpResourceSpans as L, AnalyzeTracesResult as M, analyzeTraces as N, scoreTraceInsightReadiness as O, OtlpFlatLine as P, OtlpSpan as R, domainEvidencePattern as S, isTraceInsightAttribution as T, ExtractUsageFromSseOptions as U, CaptureFetchOptions as V, ExtractedUsage as W, TraceInsightTask as _, ToolSpansToTraceAnalysisStoreOptions as a, defaultTraceInsightPanel as b, TraceInsightContext as c, TraceInsightPanelRole as d, TraceInsightPromptInput as f, TraceInsightSuite as g, TraceInsightReadiness as h, OtlpFileTraceStoreOptions as i, AnalyzeTracesOptions as j, tokenizeDomainWords as k, TraceInsightEvidence as l, TraceInsightQuestion as m, toolSpansToTraceAnalysisStore as n, otlpTextToTraceAnalysisStore as o, TraceInsightQualityGate as p, extractUsageFromResponse as q, OtlpFileTraceStore as r, TraceInsightAttribution as s, ToolTraceMissingError as t, TraceInsightFinding as u, buildTraceInsightContext as v, isTraceInsightArtifact as w, describeTraceInsightScope as x, buildTraceInsightPrompt as y, exportRunAsOtlp as z };
410
- //# sourceMappingURL=store-tool-spans-Dv9x4XYG.d.ts.map
410
+ //# sourceMappingURL=store-tool-spans-fkNF7Q9Y.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-tool-spans-Dv9x4XYG.d.ts","names":[],"sources":["../src/trace/extract-usage.ts","../src/trace/capture-fetch.ts","../src/trace/otel.ts","../src/trace/otlp-flat.ts","../src/trace-analyst/analyst.ts","../src/trace-analyst/insights.ts","../src/trace-analyst/store-otlp.ts","../src/trace-analyst/store-tool-spans.ts"],"mappings":";;;;;;;;;;;KAgBY,iBAAiB;KACjB;UAEK;;EAEf,OAAO;;;;;;;iBAuDO,aAAa,gBAAgB;;;;;;iBA6C7B,oBACd,cACA,UAAS,6BACR;;;;;;;iBA4DmB,yBACpB,UAAU,UACV,aAAa,6BACZ,QAAQ;;;UCrKM;;;EAGf;;EAEA;;;EAGA;;EAEA;;EAEA;;UAGe;;EAEf,WAAW;;;EAGX;;;EAGA;;;;;;;;EAQA,WAAW,OAAO,gBAAgB,KAAK;;EAEvC,eAAe;;iBAkDD,sBACd,cAAc,WAAW,OACzB,MAAM,iBACN,KAAK,qBACL,OAAM,6BACE,WAAW;;;cCxFR;EAA0B;EAAoC;;UAE1D;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;IACV;IACA;MAAS;MAAsB;MAAmB;MAAsB;;;EAE1E,SAAS;IAAQ;IAAsB;IAAc,aAAa;;EAClE;IAAW;IAAc;;;UAGV;EACf;IAAY,YAAY;;EACxB,YAAY;IAAQ,cAAc;IAAuB,OA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uCACR"}
1
+ {"version":3,"file":"store-tool-spans-fkNF7Q9Y.d.ts","names":[],"sources":["../src/trace/extract-usage.ts","../src/trace/capture-fetch.ts","../src/trace/otel.ts","../src/trace/otlp-flat.ts","../src/trace-analyst/analyst.ts","../src/trace-analyst/insights.ts","../src/trace-analyst/store-otlp.ts","../src/trace-analyst/store-tool-spans.ts"],"mappings":";;;;;;;;;;;KAgBY,iBAAiB;KACjB;UAEK;;EAEf,OAAO;;;;;;;iBAuDO,aAAa,gBAAgB;;;;;;iBA6C7B,oBACd,cACA,UAAS,6BACR;;;;;;;iBA4DmB,yBACpB,UAAU,UACV,aAAa,6BACZ,QAAQ;;;UCrKM;;;EAGf;;EAEA;;;EAGA;;EAEA;;EAEA;;UAGe;;EAEf,WAAW;;;EAGX;;;EAGA;;;;;;;;EAQA,WAAW,OAAO,gBAAgB,KAAK;;EAEvC,eAAe;;iBAkDD,sBACd,cAAc,WAAW,OACzB,MAAM,iBACN,KAAK,qBACL,OAAM,6BACE,WAAW;;;cCxFR;EAA0B;EAAoC;;UAE1D;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;IACV;IACA;MAAS;MAAsB;MAAmB;MAAsB;;;EAE1E,SAAS;IAAQ;IAAsB;IAAc,aAAa;;EAClE;IAAW;IAAc;;;UAGV;EACf;IAAY,YAAY;;EACxB,YAAY;IAAQ,cAAc;IAAuB,OAAO;;;UAGjD;EACf,eAAe;;;iBAIK,gBACpB,OAAO,YACP,eACA,gBAAe,4CACd,QAAQ;;;KClDC;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACE,MAAM;IACN;;EAEF;IAAY,YAAY;;EACxB,YAAY;EACZ,SAAS;IAAQ;IAAc;IAAuB,aAAa;;;;;UCNpD;EACf;EACA;EACA;EACA;;KAGU,sBAAsB;UAEjB;;EAEf,iBAAiB;;EAEjB,QAAQ;;EAER;;EAEA,YAAY;EACZ,SAAS,QAAQ;EACjB;EACA;EACA,aAAa;EACb;EAC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ACtC,iBAAiB;mBACT;mBACA;mBACA;mBACA;UACT;UACA;UACA;UACA;EAER,YAAY,MAAM;EA+BZ,SAAS,kBAAkB,UAAU,4BAA4B;EAOjE,SACJ;IAAQ;IAAkB;KAC1B,UAAU,4BACT;EAeG,YACJ,UAAU,qBACV,UAAU,4BACT,QAAQ;EAoDL,YACJ;IAAQ,UAAU;IAAqB;IAAe;KACtD,UAAU,4BACT,QAAQ;EAmBL,YACJ,UAAU,qBACV,UAAU,4BACT;EAMG,UACJ;IAAQ;IAAkB;KAC1B,UAAU,4BACT,QAAQ;EAuCL,UACJ;IAAQ;IAAkB;IAA6B;KACvD,UAAU,4BACT,QAAQ;EAsFL,YACJ;IAAQ;IAAkB;IAAuB;KACjD,UAAU,4BACT,QAAQ;EA4CL,WACJ;IAAQ;IAAkB;IAAiB;IAAuB;KAClE,UAAU,4BACT,QAAQ;;;EA6CL,cAAc,UAAU,4BAA4B;UAI5C;qBAmBK,WAAW,SAAS,cAAc,QAAQ;qBAE1C;UAEL;UAmBA;UAsHA;UA+DN;UAkBA;UAwDA;UAmBM;;cA+CH,2BAA2B;mBACrB;mBACA;EAEjB,YAAY,MAAM;;;YAYF,WAAW,SAAS,cAAc,QAAQ;YAkBhD;;;iBAwBI,6BACd,cACA,OAAM,uCACL;;;;cC18BU,8BAA8B;EACzC;;;;;;iBASc,8BACd,gBAAgB,+BAChB,UAAS,uCACR"}
@@ -1,5 +1,5 @@
1
- import { y as RolloutSplit } from "../schema-B5LtYvn9.js";
2
- import { A as WallDistribution, C as SupervisorRunSources, D as SupervisorStatusSource, E as SupervisorRunTreeGapCode, F as showMeasured, I as unavailable, M as WorkerNativeSession, N as WorkerTurnCoverage, O as TerminalFailure, P as isUnavailable, S as SupervisorRunRollup, T as SupervisorRunTreeGap, _ as SpendMeasurements, a as NamedResourceReceipt, b as SupervisorRunReader, c as PatchStats, d as RoleSpend, f as RollupCellRow, g as SpendMeasurement, h as SourceLimits, i as NO_SOURCE_LIMITS, j as WorkerLogSource, k as Unavailable, l as PerWorkerRow, m as SUPERVISOR_RUN_SCHEMA, n as EconomicsMetrics, o as OrchestrationMetrics, p as SUPERVISOR_RUN_ROLLUP_SCHEMA, r as Measured, s as OutcomeMetrics, t as DecisionMetrics, u as ResourceSpendRecord, v as SteerBreakdown, w as SupervisorRunTree, x as SupervisorRunReport, y as SupervisorRunNodeRole } from "../types-DRNlLbBR.js";
1
+ import { b as RolloutSplit } from "../schema-C-ziyJD7.js";
2
+ import { A as WallDistribution, C as SupervisorRunSources, D as SupervisorStatusSource, E as SupervisorRunTreeGapCode, F as showMeasured, I as unavailable, M as WorkerNativeSession, N as WorkerTurnCoverage, O as TerminalFailure, P as isUnavailable, S as SupervisorRunRollup, T as SupervisorRunTreeGap, _ as SpendMeasurements, a as NamedResourceReceipt, b as SupervisorRunReader, c as PatchStats, d as RoleSpend, f as RollupCellRow, g as SpendMeasurement, h as SourceLimits, i as NO_SOURCE_LIMITS, j as WorkerLogSource, k as Unavailable, l as PerWorkerRow, m as SUPERVISOR_RUN_SCHEMA, n as EconomicsMetrics, o as OrchestrationMetrics, p as SUPERVISOR_RUN_ROLLUP_SCHEMA, r as Measured, s as OutcomeMetrics, t as DecisionMetrics, u as ResourceSpendRecord, v as SteerBreakdown, w as SupervisorRunTree, x as SupervisorRunReport, y as SupervisorRunNodeRole } from "../types-v6nRcIqg.js";
3
3
  //#region src/supervisor-run/source-facts.d.ts
4
4
  interface Tokens {
5
5
  input: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/supervisor-run/source-facts.ts","../../src/supervisor-run/analyze.ts","../../src/supervisor-run/claude-code-reader.ts","../../src/supervisor-run/integrity-types.ts","../../src/supervisor-run/integrity.ts","../../src/supervisor-run/reader.ts","../../src/supervisor-run/render.ts","../../src/supervisor-run/report-command.ts","../../src/supervisor-run/rollout-nodes.ts","../../src/supervisor-run/runtime-reader.ts","../../src/supervisor-run/terminal-record.ts"],"mappings":";;;UA+BU;EACR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AAe;WACf;WACA;WACA,MAAM;WACN,iBAAiB;;UAGX;;WAEN;;;;;;;;wBC9BK,8BACd,OAAO,uBAAuB,mBAC9B,UAAS,gCACR;;;;;;;;wBCnBmB,qBACpB,gBAAgB,sBAAsB,uBACrC,QAAQ;UAYM;;WAEN;;WAEA;;;;;;WAMA;;;;;;;;wBASW,yBACpB,gBACA,OAAM,4BACL,QAAQ;;;;;wBAwCW,6BACpB,gBACA,OAAM,4BACL,QAAQ;;;;;;wBAgBW,sBACpB,gBACA,OAAM;EAA8B;IACnC,QAAQ;;;;;;;wBA+BW,sBAAsB,eAAe;;;;;;;wBCzI3C,4BAA4B,GAAG;wBA8E/B,4BAA4B,GAAG;wBAsL/B,+BACd,QAAQ,qBACR;;;;;;;;;;;;;KC3QU;;UAQK;WACN,SAAS;WACT,SAAS;;;;;;wBA4DE,wBACpB,yBACA,KAAI,yBACH;;;UChDc;;WAEN;;WAEA,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;;;;;;;wBAwBK,0BACd,KAAK,sBACL,OAAM,2BACL;;;UCqfc;;;;;;WAMN;;;;;;;;;;;;;;;;;;;wBAyEW,yBACpB,gBACA,OAAM,uBACL,QAAQ;;wBA4EK,2BACd,gBACA,OAAM,uBACL;;;;;;wBASmB,0BAA0B,iBAAiB;;;;qBCtuBpD;;qBAIA;UAEI;;WAEN,OAAO;;WAEP,QAAQ;;;;;WAKR,SAAS;;UAGH;WACN,WAAW;WACX,iBAAiB,SAAS;;;;;WAK1B,WAAW;;WAEX,SAAS,SAAS;;;;;WAKlB;;wBAuBK,mBAAmB,OAAO,sBAAsB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/supervisor-run/source-facts.ts","../../src/supervisor-run/analyze.ts","../../src/supervisor-run/claude-code-reader.ts","../../src/supervisor-run/integrity-types.ts","../../src/supervisor-run/integrity.ts","../../src/supervisor-run/reader.ts","../../src/supervisor-run/render.ts","../../src/supervisor-run/report-command.ts","../../src/supervisor-run/rollout-nodes.ts","../../src/supervisor-run/runtime-reader.ts","../../src/supervisor-run/terminal-record.ts"],"mappings":";;;UA+BU;EACR;EACA;EACA;EACA;;EAEA;;;;;;EAMA;;UAGe;WACN,YAAY,kBAAkB;EACvC,QAAQ;;;;;;EAMR;EACA;;;;;;EAMA;;UA6Ge;;EAEf;EACA;EACA;EACA;;EAEA,MAAM;;EAEN;;EAEA;EACA;;EAEA;EACA;;UAGe;EACf;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA,OAAO;;EAEP;;UAGe;;EAEf;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;EAEA;EACA;;EAEA;;EAEA;EACA;EACA;EACA;EACA,eAAe;EACf,uBAAuB;;UAGR;;EAEf;EACA;;UAGe;;EAEf;;EAEA;EACA;;;;;;UAOe;WACN,2BAA2B;WAC3B;WACA,iBAAiB;WACjB,iBAAiB;WACjB,uBAAuB;WACvB,uBAAuB;WACvB;;;;;;;IAOP;IACA;IACA;IACA;;IAEA;;IAEA;;IAEA;IACA;;IAEA;;IAEA;IACA;;IAEA;;WAEO,YAAY,oBAAoB;;WAEhC,wBAAwB;;WAExB;;;;;;;;;WASA;;WAEA;;;;;;WAMA,0BAA0B,SAAS;;;;;;;WAOnC;;WAEA,gBAAgB;;WAEhB,OAAO;WACP;WACA;;;;;;WAMA;WACA;;;;;;;;;;;;;;;;;;KAmDC;wBAiFI,oBAAoB,KAAK,uBAAuB;;;;;;;wBChZhD,4BACd,KAAK,sBACL,qBACC;;wBAu4Ba,WAAW,eAAe;;;;;;wBA+C1B,qBAAqB,kBAAkB,wBAAwB;;;UCx6B9D;;WAEN;;;;;WAKA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;wBAsOW,4BACpB,MAAM,0BACL,QAAQ;;wBAuVK,8BAA8B,MAAM,0BAA0B;;;qBC5pBjE;KAED;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../claude-jsonl-CxZZrDJ3.js";
2
- import { n as supervisorRunRolloutLines, r as SUPERVISOR_RUN_INTEGRITY_SCHEMA, t as analyzeSupervisorRunIntegrity } from "../integrity-uwK7XC-8.js";
1
+ import { i as parseClaudeEntries, o as transcriptFromEntries } from "../claude-jsonl-DoQJBCVR.js";
2
+ import { n as supervisorRunRolloutLines, r as SUPERVISOR_RUN_INTEGRITY_SCHEMA, t as analyzeSupervisorRunIntegrity } from "../integrity-BV1ZDf42.js";
3
3
  import { d as SUPERVISOR_RUN_SCHEMA, f as isUnavailable, l as NO_SOURCE_LIMITS, m as unavailable, n as RUNTIME_FAILED_STATUS, p as showMeasured, r as readTerminalRecord, s as parseSupervisorTree, t as NO_TERMINAL_RECORD, u as SUPERVISOR_RUN_ROLLUP_SCHEMA } from "../terminal-record-BHocwFw1.js";
4
- import { a as writeSupervisorRunReport, c as readRuntimeSupervisorRun, d as renderSupervisorRunHeadline, f as renderSupervisorRunMarkdown, h as rollupSupervisorRuns, i as reportSupervisorRound, l as runtimeSupervisorRunReader, m as parsePatch, n as analyzeSupervisorRun, o as writeSupervisorRunReportSafe, p as analyzeSupervisorRunSources, r as findSupervisorRunDirs, s as isRuntimeSupervisorRunDir, t as runSupervisorRunCommand, u as renderSupervisorRollupMarkdown } from "../report-command-DzPpFgjB.js";
4
+ import { a as writeSupervisorRunReport, c as readRuntimeSupervisorRun, d as renderSupervisorRunHeadline, f as renderSupervisorRunMarkdown, h as rollupSupervisorRuns, i as reportSupervisorRound, l as runtimeSupervisorRunReader, m as parsePatch, n as analyzeSupervisorRun, o as writeSupervisorRunReportSafe, p as analyzeSupervisorRunSources, r as findSupervisorRunDirs, s as isRuntimeSupervisorRunDir, t as runSupervisorRunCommand, u as renderSupervisorRollupMarkdown } from "../report-command-D0XL2Cvi.js";
5
5
  import { basename, dirname, join } from "node:path";
6
6
  import { readFile, readdir } from "node:fs/promises";
7
7
  //#region src/supervisor-run/claude-code-reader.ts
@@ -181,8 +181,12 @@ async function readChildren(dir) {
181
181
  const path = join(dir, name);
182
182
  const raw = await readFile(path, "utf8").catch(() => null);
183
183
  if (raw === null) continue;
184
- const entries = parseClaudeEntries(raw);
185
- const projected = transcriptFromEntries(entries, { includeSidechain: true });
184
+ const sourceGaps = [];
185
+ const entries = parseClaudeEntries(raw, (gap) => sourceGaps.push(gap));
186
+ const projected = transcriptFromEntries(entries, {
187
+ includeSidechain: true,
188
+ sourceGaps
189
+ });
186
190
  const metaRaw = await readFile(path.replace(/\.jsonl$/, ".meta.json"), "utf8").catch(() => null);
187
191
  let meta = {};
188
192
  if (metaRaw !== null) try {
@@ -203,6 +207,7 @@ async function readChildren(dir) {
203
207
  tokensOut: projected.usage.tokensOut,
204
208
  cacheRead: projected.usage.cacheRead,
205
209
  cacheWrite: projected.usage.cacheWrite,
210
+ gaps: projected.gaps,
206
211
  firstAt: projected.startedAt,
207
212
  lastAt: projected.endedAt,
208
213
  model: projected.model,
@@ -258,9 +263,10 @@ async function readClaudeCodeSupervisorRun(opts) {
258
263
  },
259
264
  traceCommand
260
265
  };
261
- const allEntries = parseClaudeEntries(raw);
266
+ const mainSourceGaps = [];
267
+ const allEntries = parseClaudeEntries(raw, (gap) => mainSourceGaps.push(gap));
262
268
  const main = threadCalls(allEntries.filter((e) => !e.isSidechain));
263
- const mainTranscript = transcriptFromEntries(allEntries);
269
+ const mainTranscript = transcriptFromEntries(allEntries, { sourceGaps: mainSourceGaps });
264
270
  const subagentsDir = opts.subagentsDir === void 0 ? join(dirname(opts.transcriptPath), sessionId, "subagents") : opts.subagentsDir;
265
271
  const children = subagentsDir === null ? [] : await readChildren(subagentsDir);
266
272
  const childByAgentId = new Map(children.map((c) => [c.agentId, c]));
@@ -364,7 +370,7 @@ async function readClaudeCodeSupervisorRun(opts) {
364
370
  reason: "stopped by supervisor",
365
371
  at: c.at
366
372
  }));
367
- journalLines.push(line({
373
+ if (mainTranscript.gaps.length === 0 && mainTranscript.usage.tokensIn !== null && mainTranscript.usage.tokensOut !== null && mainTranscript.usage.cacheRead !== null && mainTranscript.usage.cacheWrite !== null) journalLines.push(line({
368
374
  kind: "metered",
369
375
  id: sessionId,
370
376
  spend: { tokens: {
@@ -429,16 +435,17 @@ async function readClaudeCodeSupervisorRun(opts) {
429
435
  });
430
436
  }
431
437
  const joined = children.length;
432
- const harnessWorkerTokens = joined === 0 ? null : {
438
+ const missingChildren = spawns.filter((spawn) => !childByAgentId.has(spawn.agentId)).length;
439
+ const incompleteChildren = children.filter((child) => child.gaps.length > 0 || child.tokensIn === null || child.tokensOut === null || child.cacheRead === null || child.cacheWrite === null).length;
440
+ const harnessMissingReason = subagentsDir === null ? "subagent transcript join disabled" : joined === 0 ? `no subagent transcripts under ${subagentsDir}` : missingChildren > 0 ? `${missingChildren}/${spawns.length} spawned agents have no retained transcript under ${subagentsDir}` : incompleteChildren > 0 ? `${incompleteChildren}/${joined} subagent transcripts have malformed lines or unknown usage` : null;
441
+ const harnessWorkerTokens = joined === 0 || incompleteChildren > 0 ? null : {
433
442
  store: "claude-code subagent transcripts",
434
443
  sessions: joined,
435
- input: children.reduce((a, c) => a + c.tokensIn, 0),
436
- output: children.reduce((a, c) => a + c.tokensOut, 0),
437
- cacheRead: children.reduce((a, c) => a + c.cacheRead, 0),
438
- cacheWrite: children.reduce((a, c) => a + c.cacheWrite, 0)
444
+ input: children.reduce((a, child) => a + (child.tokensIn ?? 0), 0),
445
+ output: children.reduce((a, child) => a + (child.tokensOut ?? 0), 0),
446
+ cacheRead: children.reduce((a, child) => a + (child.cacheRead ?? 0), 0),
447
+ cacheWrite: children.reduce((a, child) => a + (child.cacheWrite ?? 0), 0)
439
448
  };
440
- const missingChildren = spawns.filter((s) => !childByAgentId.has(s.agentId)).length;
441
- const harnessMissingReason = subagentsDir === null ? "subagent transcript join disabled" : joined === 0 ? `no subagent transcripts under ${subagentsDir}` : missingChildren === 0 ? null : `${missingChildren}/${spawns.length} spawned agents have no retained transcript under ${subagentsDir} (Claude Code prunes them; their tokens are unrecoverable)`;
442
449
  const liveWorkers = spawns.filter((s) => !lastNotification.has(s.agentId) && !cancelledIds.has(s.agentId)).length;
443
450
  const state = JSON.stringify({
444
451
  id: sessionId,
@@ -467,6 +474,7 @@ async function readClaudeCodeSupervisorRun(opts) {
467
474
  harnessMissingReason,
468
475
  limits: {
469
476
  ...limits,
477
+ managerTokens: mainTranscript.gaps.length > 0 ? `main transcript has ${mainTranscript.gaps.length} parse or usage gaps` : null,
470
478
  workerTokens: spawns.length === 0 ? null : harnessMissingReason,
471
479
  deliverables: NO_DELIVERABLES
472
480
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/supervisor-run/claude-code-reader.ts"],"sourcesContent":["/**\n * Supervision-tree reader over a THIRD-PARTY harness: Claude Code.\n *\n * The Runtime reader reads a supervisor journal designed for this analysis.\n * for this analysis. This reader reads a harness we do not control, whose\n * transcript was designed for replaying a chat — and recovers the same tree\n * from it. If both produce a `SupervisorRunSources`, the tree model is a\n * property of multi-agent runs, not of our journal format.\n *\n * ## Where the tree hides in a Claude Code transcript\n *\n * | Tree fact | Claude Code evidence |\n * |---|---|\n * | spawn | assistant `tool_use` (`Agent` / `Task`), answered by a `tool_result` whose `toolUseResult.agentId` names the child |\n * | settle | a `<task-notification>` block in a later user line: `<task-id>` = agentId, `<status>` |\n * | steer | assistant `tool_use` (`SendMessage`) with `input.to` = agentId — mid-task, to a LIVE child |\n * | delivered | that steer's `tool_result` carrying `success` / `resumedAgentId` |\n * | cancel | assistant `tool_use` (`TaskStop`) targeting an agentId |\n * | brain spend| `message.usage` on the main thread's assistant lines |\n * | worker spend| `message.usage` inside `<session>/subagents/agent-<id>.jsonl` |\n * | depth | a child transcript that itself contains `Agent` tool_use lines |\n *\n * Every one of those is read through `parseClaudeEntries` — the SAME line\n * parser `src/rollout/readers/claude-jsonl.ts` uses for solo rollouts. There\n * is no second transcript parser.\n *\n * ## What Claude Code cannot say\n *\n * It records tokens but never a price, runs no per-worker verify, and keeps no\n * per-worker patch. Those are declared once in `limits`, so the analyzer\n * reports `unavailable — <reason>` instead of the $0 / 0-accepted that summing\n * an empty field would produce. See `SourceLimits`.\n *\n * ## Metric coverage vs the Runtime journal\n *\n * Measured on a real 52-agent session (fixture:\n * `tests/fixtures/supervisor-run/claude-code-session-*`).\n *\n * | Metric | Runtime | Claude Code | Why |\n * |---|---|---|---|\n * | workersSpawned / Settled / Cancelled | full | full | spawn tool_use + task-notification + TaskStop |\n * | steers / steersDelivered / steersByWorker | full | full | `SendMessage`; delivery from its tool_result |\n * | waves / waveSizes / maxConcurrency | full | full | derived from spawn/settle instants |\n * | respawns / repeatedLabels | full | full | same derivation |\n * | delegationDepth | full | full | a child transcript's own spawn calls |\n * | timeToFirstSpawn / supervisorWall | full | full | transcript instants |\n * | idleMs / idlePct / workerUtilization | full | PARTIAL | an agent that never notifies is counted live to the end of the transcript |\n * | observeThenRespawn / respawnWithoutEvidence | full | full | ordering of spawn vs settle instants |\n * | workerEvidenceBytes | full | PARTIAL | the child's closing message; 0 for pruned transcripts |\n * | brain tokens in/out + cache | full | full | main-thread `message.usage` |\n * | worker tokens in/out + cache | via harness join | full or unavailable | totals are refused if any spawned transcript was pruned; retained per-worker rows remain available |\n * | perWorker wall | full | full | spawn → settle instants |\n * | accepted / rejected / emptyPass / settledVerdicts | full | NONE | no per-worker verify step exists |\n * | brain/worker/total usd, costPerAcceptedPatch | full | NONE | transcripts carry no price |\n * | patch stats, delivered, verifyPass/Rc | full | NONE | no diff is handed back |\n * | judgeResolved / Score / Passed / Total | full | NONE | no judge in the loop |\n * | driverSteerCalls, brainTruncations | full | NONE | no outer driver log, no per-call finish_reason tap |\n */\n\nimport { readdir, readFile } from 'node:fs/promises'\nimport { basename, dirname, join } from 'node:path'\nimport {\n type ClaudeEntry,\n parseClaudeEntries,\n transcriptFromEntries,\n} from '../rollout/readers/claude-jsonl'\nimport type { SupervisorRunReader, SupervisorRunSources, WorkerLogSource } from './types'\n\n/** Tool names that spawn a child agent. `Task` is the older name for `Agent`. */\nconst DEFAULT_SPAWN_TOOLS = ['Agent', 'Task'] as const\n/** Tool names that deliver a message to an ALREADY-RUNNING child agent. */\nconst DEFAULT_STEER_TOOLS = ['SendMessage'] as const\n/** Tool names that stop a running child agent. */\nconst DEFAULT_CANCEL_TOOLS = ['TaskStop', 'KillAgent'] as const\n\nconst SPEND_UNPRICED =\n 'Claude Code transcripts record token usage but never a price — usd is not in the store'\nconst NO_VERDICTS =\n 'Claude Code runs no per-worker verify step — a subagent reports prose, not pass/fail'\nconst NO_DELIVERABLES =\n 'Claude Code retains no per-worker patch — subagents commit to git, they do not hand back a diff'\n\nexport interface ClaudeCodeReaderOptions {\n /** The main session transcript: `~/.claude/projects/<slug>/<sessionId>.jsonl`. */\n readonly transcriptPath: string\n /**\n * Directory of child transcripts. Defaults to `<transcript-dir>/<sessionId>/subagents`.\n * `null` skips the join, and every per-worker token count becomes unavailable.\n */\n readonly subagentsDir?: string | null\n readonly runRef?: string\n readonly instanceId?: string | null\n readonly arm?: string | null\n readonly spawnTools?: readonly string[]\n readonly steerTools?: readonly string[]\n readonly cancelTools?: readonly string[]\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> =>\n typeof v === 'object' && v !== null && !Array.isArray(v)\n\nconst str = (v: unknown): string | null => (typeof v === 'string' ? v : null)\n\ninterface ToolUse {\n readonly id: string\n readonly name: string\n readonly input: Record<string, unknown>\n readonly at: string | null\n}\n\ninterface ToolResult {\n readonly id: string\n readonly at: string | null\n readonly structured: unknown\n readonly text: string\n}\n\n/** Every tool call and tool result on one thread, in order, with instants. */\ninterface ThreadCalls {\n readonly uses: ToolUse[]\n readonly results: Map<string, ToolResult>\n readonly notifications: TaskNotification[]\n readonly firstAt: string | null\n readonly lastAt: string | null\n}\n\ninterface TaskNotification {\n readonly taskId: string\n readonly toolUseId: string | null\n readonly status: string\n readonly summary: string | null\n readonly at: string | null\n}\n\nfunction blockText(content: unknown): string {\n if (typeof content === 'string') return content\n if (!Array.isArray(content)) return ''\n const parts: string[] = []\n for (const b of content) {\n if (isRecord(b) && b.type === 'text' && typeof b.text === 'string') parts.push(b.text)\n }\n return parts.join('\\n')\n}\n\nconst tag = (xml: string, name: string): string | null => {\n const m = xml.match(new RegExp(`<${name}>([\\\\s\\\\S]*?)</${name}>`))\n return m === null ? null : (m[1] as string)\n}\n\n/**\n * Task notifications are the settle instants. A notification fires each time an\n * agent stops, so a resumed agent produces several — they are kept in order and\n * the LAST one is the settle the analyzer sees, with the earlier ones acting as\n * the intermediate stops they actually were.\n */\nfunction parseNotifications(text: string, at: string | null): TaskNotification[] {\n const out: TaskNotification[] = []\n for (const m of text.matchAll(/<task-notification>[\\s\\S]*?<\\/task-notification>/g)) {\n const xml = m[0]\n const taskId = tag(xml, 'task-id')\n if (taskId === null) continue\n out.push({\n taskId: taskId.trim(),\n toolUseId: tag(xml, 'tool-use-id')?.trim() ?? null,\n status: tag(xml, 'status')?.trim() ?? 'unknown',\n summary: tag(xml, 'summary')?.trim() ?? null,\n at,\n })\n }\n return out\n}\n\n/** Project entries of ONE thread (main or a single sidechain) into tool traffic. */\nfunction threadCalls(entries: readonly ClaudeEntry[]): ThreadCalls {\n const uses: ToolUse[] = []\n const results = new Map<string, ToolResult>()\n const notifications: TaskNotification[] = []\n let firstAt: string | null = null\n let lastAt: string | null = null\n\n for (const entry of entries) {\n if (entry.timestamp !== null) {\n if (firstAt === null) firstAt = entry.timestamp\n lastAt = entry.timestamp\n }\n const content = entry.message.content\n if (entry.type === 'assistant') {\n if (!Array.isArray(content)) continue\n for (const block of content) {\n if (!isRecord(block) || block.type !== 'tool_use') continue\n const id = str(block.id)\n const name = str(block.name)\n if (id === null || name === null) continue\n uses.push({\n id,\n name,\n input: isRecord(block.input) ? block.input : {},\n at: entry.timestamp,\n })\n }\n continue\n }\n if (typeof content === 'string') {\n notifications.push(...parseNotifications(content, entry.timestamp))\n continue\n }\n if (!Array.isArray(content)) continue\n for (const block of content) {\n if (!isRecord(block)) continue\n if (block.type === 'tool_result' && typeof block.tool_use_id === 'string') {\n results.set(block.tool_use_id, {\n id: block.tool_use_id,\n at: entry.timestamp,\n structured: entry.toolUseResult,\n text: blockText(block.content),\n })\n } else if (block.type === 'text' && typeof block.text === 'string') {\n notifications.push(...parseNotifications(block.text, entry.timestamp))\n }\n }\n }\n return { uses, results, notifications, firstAt, lastAt }\n}\n\n/**\n * The agent id a spawn produced. Claude Code puts it in the structured\n * `toolUseResult`; the same id is echoed in the result text for transcripts\n * written before that field existed, so both are tried before giving up.\n */\nfunction spawnedAgentId(result: ToolResult | undefined): string | null {\n if (result === undefined) return null\n if (isRecord(result.structured)) {\n const id = str(result.structured.agentId)\n if (id !== null) return id\n }\n return result.text.match(/agentId:\\s*([A-Za-z0-9_-]+)/)?.[1] ?? null\n}\n\ninterface ChildTranscript {\n readonly agentId: string\n readonly path: string\n readonly description: string | null\n readonly spawnToolUseId: string | null\n readonly spawnDepth: number | null\n readonly entries: ClaudeEntry[]\n readonly tokensIn: number\n readonly tokensOut: number\n readonly cacheRead: number\n readonly cacheWrite: number\n readonly firstAt: string | null\n readonly lastAt: string | null\n readonly model: string | null\n /**\n * The child's closing assistant message — what it actually handed back. This\n * is the Claude Code analogue of a worker's `evidence` blob.\n */\n readonly finalReport: string | null\n}\n\nasync function readChildren(dir: string): Promise<ChildTranscript[]> {\n const names = await readdir(dir).catch(() => null)\n if (names === null) return []\n const out: ChildTranscript[] = []\n for (const name of names.filter((n) => n.endsWith('.jsonl')).sort()) {\n const path = join(dir, name)\n const raw = await readFile(path, 'utf8').catch(() => null)\n if (raw === null) continue\n const entries = parseClaudeEntries(raw)\n // A subagent transcript is sidechain end to end — that flag is what marks it\n // a separate invocation rather than a turn of the parent.\n const projected = transcriptFromEntries(entries, { includeSidechain: true })\n const metaRaw = await readFile(path.replace(/\\.jsonl$/, '.meta.json'), 'utf8').catch(() => null)\n let meta: Record<string, unknown> = {}\n if (metaRaw !== null) {\n try {\n const parsed: unknown = JSON.parse(metaRaw)\n if (isRecord(parsed)) meta = parsed\n } catch {\n meta = {}\n }\n }\n const agentId =\n entries.find((e) => e.agentId !== null)?.agentId ??\n name.replace(/^agent-/, '').replace(/\\.jsonl$/, '')\n out.push({\n agentId,\n path,\n description: str(meta.description),\n spawnToolUseId: str(meta.toolUseId),\n spawnDepth: typeof meta.spawnDepth === 'number' ? meta.spawnDepth : null,\n entries,\n tokensIn: projected.usage.tokensIn,\n tokensOut: projected.usage.tokensOut,\n cacheRead: projected.usage.cacheRead,\n cacheWrite: projected.usage.cacheWrite,\n firstAt: projected.startedAt,\n lastAt: projected.endedAt,\n model: projected.model,\n finalReport:\n [...projected.messages]\n .reverse()\n .find((m) => m.role === 'assistant' && typeof m.content === 'string')?.content ?? null,\n })\n }\n return out\n}\n\ninterface SpawnFact {\n readonly agentId: string\n readonly parentId: string\n readonly label: string\n readonly at: string | null\n readonly model: string | null\n}\n\n/** A journal line in the dialect `parseSupervisorTree` reads. */\nconst line = (obj: Record<string, unknown>): string => JSON.stringify(obj)\n\n/**\n * Read a Claude Code session (plus its subagent transcripts) as supervision-tree\n * source bytes. Never throws on a missing artifact.\n */\nexport async function readClaudeCodeSupervisorRun(\n opts: ClaudeCodeReaderOptions,\n): Promise<SupervisorRunSources> {\n const spawnTools = new Set(opts.spawnTools ?? DEFAULT_SPAWN_TOOLS)\n const steerTools = new Set(opts.steerTools ?? DEFAULT_STEER_TOOLS)\n const cancelTools = new Set(opts.cancelTools ?? DEFAULT_CANCEL_TOOLS)\n\n const raw = await readFile(opts.transcriptPath, 'utf8').catch(() => null)\n const sessionId = basename(opts.transcriptPath).replace(/\\.jsonl$/, '')\n const runRef = opts.runRef ?? opts.transcriptPath\n const limits = {\n managerTokens: null,\n workerTokens: null,\n spendUsd: SPEND_UNPRICED,\n workerVerdicts: NO_VERDICTS,\n deliverables: null,\n }\n const traceCommand = `npx --yes @tangle-network/traces@latest analyze --harness claude-code --session ${sessionId}`\n\n if (raw === null) {\n return {\n runRef,\n instanceId: opts.instanceId ?? sessionId,\n arm: opts.arm ?? null,\n supRunDir: null,\n journal: null,\n brainLog: null,\n state: null,\n progress: null,\n workers: null,\n workersMissingReason: `session transcript unreadable at ${opts.transcriptPath}`,\n result: null,\n judge: null,\n judgeSource: null,\n patch: null,\n driverLog: null,\n harnessWorkerTokens: null,\n harnessMissingReason: `session transcript unreadable at ${opts.transcriptPath}`,\n limits: {\n ...limits,\n managerTokens: `session transcript unreadable at ${opts.transcriptPath}`,\n workerTokens: `session transcript unreadable at ${opts.transcriptPath}`,\n deliverables: NO_DELIVERABLES,\n },\n traceCommand,\n }\n }\n\n const allEntries = parseClaudeEntries(raw)\n const main = threadCalls(allEntries.filter((e) => !e.isSidechain))\n const mainTranscript = transcriptFromEntries(allEntries)\n\n const subagentsDir =\n opts.subagentsDir === undefined\n ? join(dirname(opts.transcriptPath), sessionId, 'subagents')\n : opts.subagentsDir\n const children = subagentsDir === null ? [] : await readChildren(subagentsDir)\n const childByAgentId = new Map(children.map((c) => [c.agentId, c]))\n const childBySpawnToolUseId = new Map(\n children.filter((c) => c.spawnToolUseId !== null).map((c) => [c.spawnToolUseId as string, c]),\n )\n\n // Every thread that can spawn: the session itself, plus each child transcript\n // (a child that calls the spawn tool is a second delegation level).\n const threads: Array<{ id: string; calls: ThreadCalls }> = [{ id: sessionId, calls: main }]\n for (const child of children) {\n threads.push({ id: child.agentId, calls: threadCalls(child.entries) })\n }\n\n const spawns: SpawnFact[] = []\n const steersByTarget = new Map<\n string,\n Array<{ requestId: string; at: string | null; delivered: boolean }>\n >()\n const cancels: Array<{ agentId: string; at: string | null }> = []\n const settles: TaskNotification[] = []\n\n for (const thread of threads) {\n for (const use of thread.calls.uses) {\n if (spawnTools.has(use.name)) {\n const result = thread.calls.results.get(use.id)\n const agentId = spawnedAgentId(result) ?? childBySpawnToolUseId.get(use.id)?.agentId ?? null\n if (agentId === null) continue\n const label =\n str(use.input.description) ?? childByAgentId.get(agentId)?.description ?? agentId\n spawns.push({\n agentId,\n parentId: thread.id,\n label,\n // The spawn is complete when the launch call is answered; the tool_use\n // instant is the fallback for a call that never got a result line.\n at: result?.at ?? use.at,\n model: isRecord(result?.structured) ? str(result.structured.resolvedModel) : null,\n })\n continue\n }\n if (steerTools.has(use.name)) {\n const target = str(use.input.to) ?? str(use.input.recipient)\n if (target === null) continue\n const result = thread.calls.results.get(use.id)\n const structured = isRecord(result?.structured) ? result.structured : null\n // `success` is the harness confirming the message reached a live agent;\n // absent, the steer is counted queued but not delivered.\n const delivered = structured?.success === true || str(structured?.resumedAgentId) === target\n const rows = steersByTarget.get(target) ?? []\n rows.push({ requestId: use.id, at: use.at, delivered })\n steersByTarget.set(target, rows)\n continue\n }\n if (cancelTools.has(use.name)) {\n const target = str(use.input.agentId) ?? str(use.input.to) ?? str(use.input.taskId)\n if (target !== null) cancels.push({ agentId: target, at: use.at })\n }\n }\n settles.push(...thread.calls.notifications)\n }\n\n const spawnedIds = new Set(spawns.map((s) => s.agentId))\n const cancelledIds = new Set(\n cancels.filter((c) => spawnedIds.has(c.agentId)).map((c) => c.agentId),\n )\n const startedAt = main.firstAt\n const completedAt = main.lastAt\n\n const journalLines: string[] = [\n line({\n kind: 'spawned',\n id: sessionId,\n parent: null,\n label: `session:${sessionId}`,\n role: 'supervisor',\n at: startedAt,\n }),\n ]\n for (const s of spawns) {\n journalLines.push(\n line({\n kind: 'spawned',\n id: s.agentId,\n parent: s.parentId,\n label: s.label,\n role: 'worker',\n at: s.at,\n }),\n )\n }\n\n // Only the LAST notification per agent is its settle; an earlier one is a stop\n // the supervisor resumed from, which the steer count already records.\n const lastNotification = new Map<string, TaskNotification>()\n for (const n of settles) {\n if (!spawnedIds.has(n.taskId)) continue\n lastNotification.set(n.taskId, n)\n }\n for (const [agentId, n] of lastNotification) {\n if (cancelledIds.has(agentId)) continue\n journalLines.push(\n line({\n kind: 'settled',\n id: agentId,\n status: n.status,\n verdict: n.summary,\n at: n.at,\n // No `spent` key: Claude Code prices nothing, and a zeroed spend object\n // would read as a $0 worker. `limits.spendUsd` carries the reason.\n }),\n )\n }\n // One cancel per agent: Claude Code can emit a stop then a retry-stop for the\n // same agentId, and each raw entry would otherwise mint a duplicate `cancelled`\n // line that double-counts in `workersCancelled`. Keep the last, mirroring the\n // last-notification dedup the settle path already does.\n const lastCancel = new Map<string, { agentId: string; at: string | null }>()\n for (const c of cancels) {\n if (!spawnedIds.has(c.agentId)) continue\n lastCancel.set(c.agentId, c)\n }\n for (const c of lastCancel.values()) {\n journalLines.push(\n line({ kind: 'cancelled', id: c.agentId, reason: 'stopped by supervisor', at: c.at }),\n )\n }\n // `metered` carries the brain's own inference. The token counts are real; the\n // usd stays absent and `limits.spendUsd` explains why.\n journalLines.push(\n line({\n kind: 'metered',\n id: sessionId,\n spend: {\n tokens: {\n input: mainTranscript.usage.tokensIn,\n output: mainTranscript.usage.tokensOut,\n cacheRead: mainTranscript.usage.cacheRead,\n cacheWrite: mainTranscript.usage.cacheWrite,\n },\n },\n at: completedAt,\n }),\n )\n\n const settleAtByAgent = new Map(\n [...lastNotification.entries()].map(([id, n]) => [id, n.at] as const),\n )\n const spawnAtByAgent = new Map(spawns.map((s) => [s.agentId, s.at] as const))\n\n const workers: WorkerLogSource[] = []\n for (const spawn of spawns) {\n const { agentId, label } = spawn\n const events: string[] = []\n const inbox: string[] = []\n const child = childByAgentId.get(agentId) ?? null\n const startAt = child?.firstAt ?? spawnAtByAgent.get(agentId) ?? null\n const endAt = settleAtByAgent.get(agentId) ?? child?.lastAt ?? null\n if (startAt !== null) events.push(line({ kind: 'started', label, at: startAt, agentId }))\n for (const steer of steersByTarget.get(agentId) ?? []) {\n inbox.push(line({ id: steer.requestId, at: steer.at, worker: label, message: 'steer' }))\n events.push(\n line({\n kind: 'message',\n label,\n direction: 'down',\n at: steer.at,\n requestId: steer.requestId,\n delivered: steer.delivered,\n }),\n )\n }\n if (endAt !== null) {\n events.push(\n line({\n kind: 'finished',\n label,\n at: endAt,\n agentId,\n // No `passed` / `patchBytes`: this harness has neither. Emitting\n // `passed: false` here would invent a failed worker.\n // `evidence` is the child's closing message — what it handed back.\n ...(child?.finalReport === null || child?.finalReport === undefined\n ? {}\n : { evidence: child.finalReport }),\n }),\n )\n }\n workers.push({\n workerId: agentId,\n label,\n events: events.length === 0 ? '' : `${events.join('\\n')}\\n`,\n inbox: inbox.length === 0 ? '' : `${inbox.join('\\n')}\\n`,\n patchBytes: null,\n transcriptRef: child?.path ?? null,\n patchPath: null,\n tokensIn: child?.tokensIn ?? null,\n tokensOut: child?.tokensOut ?? null,\n cacheRead: child?.cacheRead ?? null,\n cacheWrite: child?.cacheWrite ?? null,\n })\n }\n\n const joined = children.length\n const harnessWorkerTokens =\n joined === 0\n ? null\n : {\n store: 'claude-code subagent transcripts',\n sessions: joined,\n input: children.reduce((a, c) => a + c.tokensIn, 0),\n output: children.reduce((a, c) => a + c.tokensOut, 0),\n cacheRead: children.reduce((a, c) => a + c.cacheRead, 0),\n cacheWrite: children.reduce((a, c) => a + c.cacheWrite, 0),\n }\n\n const missingChildren = spawns.filter((s) => !childByAgentId.has(s.agentId)).length\n const harnessMissingReason =\n subagentsDir === null\n ? 'subagent transcript join disabled'\n : joined === 0\n ? `no subagent transcripts under ${subagentsDir}`\n : missingChildren === 0\n ? null\n : `${missingChildren}/${spawns.length} spawned agents have no retained transcript under ${subagentsDir} (Claude Code prunes them; their tokens are unrecoverable)`\n\n const liveWorkers = spawns.filter(\n (s) => !lastNotification.has(s.agentId) && !cancelledIds.has(s.agentId),\n ).length\n const state = JSON.stringify({\n id: sessionId,\n // Derived, not asserted: a spawned agent with no notification and no stop\n // is still running, which is exactly what a live transcript looks like.\n status: liveWorkers > 0 ? 'running' : 'idle',\n startedAt,\n completedAt,\n result: { delivered: null },\n })\n\n return {\n runRef,\n instanceId: opts.instanceId ?? sessionId,\n arm: opts.arm ?? null,\n supRunDir: subagentsDir,\n journal: `${journalLines.join('\\n')}\\n`,\n brainLog: null,\n state,\n progress: null,\n workers,\n workersMissingReason: null,\n result: null,\n judge: null,\n judgeSource: null,\n patch: null,\n driverLog: null,\n harnessWorkerTokens,\n harnessMissingReason,\n limits: {\n ...limits,\n workerTokens: spawns.length === 0 ? null : harnessMissingReason,\n deliverables: NO_DELIVERABLES,\n },\n rootTranscriptRef: opts.transcriptPath,\n traceCommand,\n }\n}\n\n/** A `SupervisorRunReader` over a Claude Code session — the same contract Runtime implements. */\nexport function claudeCodeSupervisorRunReader(opts: ClaudeCodeReaderOptions): SupervisorRunReader {\n return {\n runRef: opts.runRef ?? opts.transcriptPath,\n read: () => readClaudeCodeSupervisorRun(opts),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,sBAAsB,CAAC,SAAS,MAAM;;AAE5C,MAAM,sBAAsB,CAAC,aAAa;;AAE1C,MAAM,uBAAuB,CAAC,YAAY,WAAW;AAErD,MAAM,iBACJ;AACF,MAAM,cACJ;AACF,MAAM,kBACJ;AAkBF,MAAM,YAAY,MAChB,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAEzD,MAAM,OAAO,MAA+B,OAAO,MAAM,WAAW,IAAI;AAiCxE,SAAS,UAAU,SAA0B;CAC3C,IAAI,OAAO,YAAY,UAAU,OAAO;CACxC,IAAI,CAAC,MAAM,QAAQ,OAAO,GAAG,OAAO;CACpC,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,KAAK,SACd,IAAI,SAAS,CAAC,KAAK,EAAE,SAAS,UAAU,OAAO,EAAE,SAAS,UAAU,MAAM,KAAK,EAAE,IAAI;CAEvF,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,MAAM,OAAO,KAAa,SAAgC;CACxD,MAAM,IAAI,IAAI,MAAM,IAAI,OAAO,IAAI,KAAK,iBAAiB,KAAK,EAAE,CAAC;CACjE,OAAO,MAAM,OAAO,OAAQ,EAAE;AAChC;;;;;;;AAQA,SAAS,mBA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C5B,CAAC;CAED,OAAO;EACL;EACA,YAAY,KAAK,cAAc;EAC/B,KAAK,KAAK,OAAO;EACjB,WAAW;EACX,SAAS,GAAG,aAAa,KAAK,IAAI,EAAE;EACpC,UAAU;EACV;EACA,UAAU;EACV;EACA,sBAAsB;EACtB,QAAQ;EACR,OAAO;EACP,aAAa;EACb,OAAO;EACP,WAAW;EACX;EACA;EACA,QAAQ;GACN,GAAG;GACH,cAAc,OAAO,WAAW,IAAI,OAAO;GAC3C,cAAc;EAChB;EACA,mBAAmB,KAAK;EACxB;CACF;AACF;;AAGA,SAAgB,8BAA8B,MAAoD;CAChG,OAAO;EACL,QAAQ,KAAK,UAAU,KAAK;EAC5B,YAAY,4BAA4B,IAAI;CAC9C;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/supervisor-run/claude-code-reader.ts"],"sourcesContent":["/**\n * Supervision-tree reader over a THIRD-PARTY harness: Claude Code.\n *\n * The Runtime reader reads a supervisor journal designed for this analysis.\n * for this analysis. This reader reads a harness we do not control, whose\n * transcript was designed for replaying a chat — and recovers the same tree\n * from it. If both produce a `SupervisorRunSources`, the tree model is a\n * property of multi-agent runs, not of our journal format.\n *\n * ## Where the tree hides in a Claude Code transcript\n *\n * | Tree fact | Claude Code evidence |\n * |---|---|\n * | spawn | assistant `tool_use` (`Agent` / `Task`), answered by a `tool_result` whose `toolUseResult.agentId` names the child |\n * | settle | a `<task-notification>` block in a later user line: `<task-id>` = agentId, `<status>` |\n * | steer | assistant `tool_use` (`SendMessage`) with `input.to` = agentId — mid-task, to a LIVE child |\n * | delivered | that steer's `tool_result` carrying `success` / `resumedAgentId` |\n * | cancel | assistant `tool_use` (`TaskStop`) targeting an agentId |\n * | brain spend| `message.usage` on the main thread's assistant lines |\n * | worker spend| `message.usage` inside `<session>/subagents/agent-<id>.jsonl` |\n * | depth | a child transcript that itself contains `Agent` tool_use lines |\n *\n * Every one of those is read through `parseClaudeEntries` — the SAME line\n * parser `src/rollout/readers/claude-jsonl.ts` uses for solo rollouts. There\n * is no second transcript parser.\n *\n * ## What Claude Code cannot say\n *\n * It records tokens but never a price, runs no per-worker verify, and keeps no\n * per-worker patch. Those are declared once in `limits`, so the analyzer\n * reports `unavailable — <reason>` instead of the $0 / 0-accepted that summing\n * an empty field would produce. See `SourceLimits`.\n *\n * ## Metric coverage vs the Runtime journal\n *\n * Measured on a real 52-agent session (fixture:\n * `tests/fixtures/supervisor-run/claude-code-session-*`).\n *\n * | Metric | Runtime | Claude Code | Why |\n * |---|---|---|---|\n * | workersSpawned / Settled / Cancelled | full | full | spawn tool_use + task-notification + TaskStop |\n * | steers / steersDelivered / steersByWorker | full | full | `SendMessage`; delivery from its tool_result |\n * | waves / waveSizes / maxConcurrency | full | full | derived from spawn/settle instants |\n * | respawns / repeatedLabels | full | full | same derivation |\n * | delegationDepth | full | full | a child transcript's own spawn calls |\n * | timeToFirstSpawn / supervisorWall | full | full | transcript instants |\n * | idleMs / idlePct / workerUtilization | full | PARTIAL | an agent that never notifies is counted live to the end of the transcript |\n * | observeThenRespawn / respawnWithoutEvidence | full | full | ordering of spawn vs settle instants |\n * | workerEvidenceBytes | full | PARTIAL | the child's closing message; 0 for pruned transcripts |\n * | brain tokens in/out + cache | full | full | main-thread `message.usage` |\n * | worker tokens in/out + cache | via harness join | full or unavailable | totals are refused if any spawned transcript was pruned; retained per-worker rows remain available |\n * | perWorker wall | full | full | spawn → settle instants |\n * | accepted / rejected / emptyPass / settledVerdicts | full | NONE | no per-worker verify step exists |\n * | brain/worker/total usd, costPerAcceptedPatch | full | NONE | transcripts carry no price |\n * | patch stats, delivered, verifyPass/Rc | full | NONE | no diff is handed back |\n * | judgeResolved / Score / Passed / Total | full | NONE | no judge in the loop |\n * | driverSteerCalls, brainTruncations | full | NONE | no outer driver log, no per-call finish_reason tap |\n */\n\nimport { readdir, readFile } from 'node:fs/promises'\nimport { basename, dirname, join } from 'node:path'\nimport {\n type ClaudeEntry,\n parseClaudeEntries,\n transcriptFromEntries,\n} from '../rollout/readers/claude-jsonl'\nimport type { SupervisorRunReader, SupervisorRunSources, WorkerLogSource } from './types'\n\n/** Tool names that spawn a child agent. `Task` is the older name for `Agent`. */\nconst DEFAULT_SPAWN_TOOLS = ['Agent', 'Task'] as const\n/** Tool names that deliver a message to an ALREADY-RUNNING child agent. */\nconst DEFAULT_STEER_TOOLS = ['SendMessage'] as const\n/** Tool names that stop a running child agent. */\nconst DEFAULT_CANCEL_TOOLS = ['TaskStop', 'KillAgent'] as const\n\nconst SPEND_UNPRICED =\n 'Claude Code transcripts record token usage but never a price — usd is not in the store'\nconst NO_VERDICTS =\n 'Claude Code runs no per-worker verify step — a subagent reports prose, not pass/fail'\nconst NO_DELIVERABLES =\n 'Claude Code retains no per-worker patch — subagents commit to git, they do not hand back a diff'\n\nexport interface ClaudeCodeReaderOptions {\n /** The main session transcript: `~/.claude/projects/<slug>/<sessionId>.jsonl`. */\n readonly transcriptPath: string\n /**\n * Directory of child transcripts. Defaults to `<transcript-dir>/<sessionId>/subagents`.\n * `null` skips the join, and every per-worker token count becomes unavailable.\n */\n readonly subagentsDir?: string | null\n readonly runRef?: string\n readonly instanceId?: string | null\n readonly arm?: string | null\n readonly spawnTools?: readonly string[]\n readonly steerTools?: readonly string[]\n readonly cancelTools?: readonly string[]\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> =>\n typeof v === 'object' && v !== null && !Array.isArray(v)\n\nconst str = (v: unknown): string | null => (typeof v === 'string' ? v : null)\n\ninterface ToolUse {\n readonly id: string\n readonly name: string\n readonly input: Record<string, unknown>\n readonly at: string | null\n}\n\ninterface ToolResult {\n readonly id: string\n readonly at: string | null\n readonly structured: unknown\n readonly text: string\n}\n\n/** Every tool call and tool result on one thread, in order, with instants. */\ninterface ThreadCalls {\n readonly uses: ToolUse[]\n readonly results: Map<string, ToolResult>\n readonly notifications: TaskNotification[]\n readonly firstAt: string | null\n readonly lastAt: string | null\n}\n\ninterface TaskNotification {\n readonly taskId: string\n readonly toolUseId: string | null\n readonly status: string\n readonly summary: string | null\n readonly at: string | null\n}\n\nfunction blockText(content: unknown): string {\n if (typeof content === 'string') return content\n if (!Array.isArray(content)) return ''\n const parts: string[] = []\n for (const b of content) {\n if (isRecord(b) && b.type === 'text' && typeof b.text === 'string') parts.push(b.text)\n }\n return parts.join('\\n')\n}\n\nconst tag = (xml: string, name: string): string | null => {\n const m = xml.match(new RegExp(`<${name}>([\\\\s\\\\S]*?)</${name}>`))\n return m === null ? null : (m[1] as string)\n}\n\n/**\n * Task notifications are the settle instants. A notification fires each time an\n * agent stops, so a resumed agent produces several — they are kept in order and\n * the LAST one is the settle the analyzer sees, with the earlier ones acting as\n * the intermediate stops they actually were.\n */\nfunction parseNotifications(text: string, at: string | null): TaskNotification[] {\n const out: TaskNotification[] = []\n for (const m of text.matchAll(/<task-notification>[\\s\\S]*?<\\/task-notification>/g)) {\n const xml = m[0]\n const taskId = tag(xml, 'task-id')\n if (taskId === null) continue\n out.push({\n taskId: taskId.trim(),\n toolUseId: tag(xml, 'tool-use-id')?.trim() ?? null,\n status: tag(xml, 'status')?.trim() ?? 'unknown',\n summary: tag(xml, 'summary')?.trim() ?? null,\n at,\n })\n }\n return out\n}\n\n/** Project entries of ONE thread (main or a single sidechain) into tool traffic. */\nfunction threadCalls(entries: readonly ClaudeEntry[]): ThreadCalls {\n const uses: ToolUse[] = []\n const results = new Map<string, ToolResult>()\n const notifications: TaskNotification[] = []\n let firstAt: string | null = null\n let lastAt: string | null = null\n\n for (const entry of entries) {\n if (entry.timestamp !== null) {\n if (firstAt === null) firstAt = entry.timestamp\n lastAt = entry.timestamp\n }\n const content = entry.message.content\n if (entry.type === 'assistant') {\n if (!Array.isArray(content)) continue\n for (const block of content) {\n if (!isRecord(block) || block.type !== 'tool_use') continue\n const id = str(block.id)\n const name = str(block.name)\n if (id === null || name === null) continue\n uses.push({\n id,\n name,\n input: isRecord(block.input) ? block.input : {},\n at: entry.timestamp,\n })\n }\n continue\n }\n if (typeof content === 'string') {\n notifications.push(...parseNotifications(content, entry.timestamp))\n continue\n }\n if (!Array.isArray(content)) continue\n for (const block of content) {\n if (!isRecord(block)) continue\n if (block.type === 'tool_result' && typeof block.tool_use_id === 'string') {\n results.set(block.tool_use_id, {\n id: block.tool_use_id,\n at: entry.timestamp,\n structured: entry.toolUseResult,\n text: blockText(block.content),\n })\n } else if (block.type === 'text' && typeof block.text === 'string') {\n notifications.push(...parseNotifications(block.text, entry.timestamp))\n }\n }\n }\n return { uses, results, notifications, firstAt, lastAt }\n}\n\n/**\n * The agent id a spawn produced. Claude Code puts it in the structured\n * `toolUseResult`; the same id is echoed in the result text for transcripts\n * written before that field existed, so both are tried before giving up.\n */\nfunction spawnedAgentId(result: ToolResult | undefined): string | null {\n if (result === undefined) return null\n if (isRecord(result.structured)) {\n const id = str(result.structured.agentId)\n if (id !== null) return id\n }\n return result.text.match(/agentId:\\s*([A-Za-z0-9_-]+)/)?.[1] ?? null\n}\n\ninterface ChildTranscript {\n readonly agentId: string\n readonly path: string\n readonly description: string | null\n readonly spawnToolUseId: string | null\n readonly spawnDepth: number | null\n readonly entries: ClaudeEntry[]\n readonly tokensIn: number | null\n readonly tokensOut: number | null\n readonly cacheRead: number | null\n readonly cacheWrite: number | null\n readonly gaps: readonly string[]\n readonly firstAt: string | null\n readonly lastAt: string | null\n readonly model: string | null\n /**\n * The child's closing assistant message — what it actually handed back. This\n * is the Claude Code analogue of a worker's `evidence` blob.\n */\n readonly finalReport: string | null\n}\n\nasync function readChildren(dir: string): Promise<ChildTranscript[]> {\n const names = await readdir(dir).catch(() => null)\n if (names === null) return []\n const out: ChildTranscript[] = []\n for (const name of names.filter((n) => n.endsWith('.jsonl')).sort()) {\n const path = join(dir, name)\n const raw = await readFile(path, 'utf8').catch(() => null)\n if (raw === null) continue\n const sourceGaps: string[] = []\n const entries = parseClaudeEntries(raw, (gap) => sourceGaps.push(gap))\n // A subagent transcript is sidechain end to end — that flag is what marks it\n // a separate invocation rather than a turn of the parent.\n const projected = transcriptFromEntries(entries, { includeSidechain: true, sourceGaps })\n const metaRaw = await readFile(path.replace(/\\.jsonl$/, '.meta.json'), 'utf8').catch(() => null)\n let meta: Record<string, unknown> = {}\n if (metaRaw !== null) {\n try {\n const parsed: unknown = JSON.parse(metaRaw)\n if (isRecord(parsed)) meta = parsed\n } catch {\n meta = {}\n }\n }\n const agentId =\n entries.find((e) => e.agentId !== null)?.agentId ??\n name.replace(/^agent-/, '').replace(/\\.jsonl$/, '')\n out.push({\n agentId,\n path,\n description: str(meta.description),\n spawnToolUseId: str(meta.toolUseId),\n spawnDepth: typeof meta.spawnDepth === 'number' ? meta.spawnDepth : null,\n entries,\n tokensIn: projected.usage.tokensIn,\n tokensOut: projected.usage.tokensOut,\n cacheRead: projected.usage.cacheRead,\n cacheWrite: projected.usage.cacheWrite,\n gaps: projected.gaps,\n firstAt: projected.startedAt,\n lastAt: projected.endedAt,\n model: projected.model,\n finalReport:\n [...projected.messages]\n .reverse()\n .find((m) => m.role === 'assistant' && typeof m.content === 'string')?.content ?? null,\n })\n }\n return out\n}\n\ninterface SpawnFact {\n readonly agentId: string\n readonly parentId: string\n readonly label: string\n readonly at: string | null\n readonly model: string | null\n}\n\n/** A journal line in the dialect `parseSupervisorTree` reads. */\nconst line = (obj: Record<string, unknown>): string => JSON.stringify(obj)\n\n/**\n * Read a Claude Code session (plus its subagent transcripts) as supervision-tree\n * source bytes. Never throws on a missing artifact.\n */\nexport async function readClaudeCodeSupervisorRun(\n opts: ClaudeCodeReaderOptions,\n): Promise<SupervisorRunSources> {\n const spawnTools = new Set(opts.spawnTools ?? DEFAULT_SPAWN_TOOLS)\n const steerTools = new Set(opts.steerTools ?? DEFAULT_STEER_TOOLS)\n const cancelTools = new Set(opts.cancelTools ?? DEFAULT_CANCEL_TOOLS)\n\n const raw = await readFile(opts.transcriptPath, 'utf8').catch(() => null)\n const sessionId = basename(opts.transcriptPath).replace(/\\.jsonl$/, '')\n const runRef = opts.runRef ?? opts.transcriptPath\n const limits = {\n managerTokens: null,\n workerTokens: null,\n spendUsd: SPEND_UNPRICED,\n workerVerdicts: NO_VERDICTS,\n deliverables: null,\n }\n const traceCommand = `npx --yes @tangle-network/traces@latest analyze --harness claude-code --session ${sessionId}`\n\n if (raw === null) {\n return {\n runRef,\n instanceId: opts.instanceId ?? sessionId,\n arm: opts.arm ?? null,\n supRunDir: null,\n journal: null,\n brainLog: null,\n state: null,\n progress: null,\n workers: null,\n workersMissingReason: `session transcript unreadable at ${opts.transcriptPath}`,\n result: null,\n judge: null,\n judgeSource: null,\n patch: null,\n driverLog: null,\n harnessWorkerTokens: null,\n harnessMissingReason: `session transcript unreadable at ${opts.transcriptPath}`,\n limits: {\n ...limits,\n managerTokens: `session transcript unreadable at ${opts.transcriptPath}`,\n workerTokens: `session transcript unreadable at ${opts.transcriptPath}`,\n deliverables: NO_DELIVERABLES,\n },\n traceCommand,\n }\n }\n\n const mainSourceGaps: string[] = []\n const allEntries = parseClaudeEntries(raw, (gap) => mainSourceGaps.push(gap))\n const main = threadCalls(allEntries.filter((e) => !e.isSidechain))\n const mainTranscript = transcriptFromEntries(allEntries, { sourceGaps: mainSourceGaps })\n\n const subagentsDir =\n opts.subagentsDir === undefined\n ? join(dirname(opts.transcriptPath), sessionId, 'subagents')\n : opts.subagentsDir\n const children = subagentsDir === null ? [] : await readChildren(subagentsDir)\n const childByAgentId = new Map(children.map((c) => [c.agentId, c]))\n const childBySpawnToolUseId = new Map(\n children.filter((c) => c.spawnToolUseId !== null).map((c) => [c.spawnToolUseId as string, c]),\n )\n\n // Every thread that can spawn: the session itself, plus each child transcript\n // (a child that calls the spawn tool is a second delegation level).\n const threads: Array<{ id: string; calls: ThreadCalls }> = [{ id: sessionId, calls: main }]\n for (const child of children) {\n threads.push({ id: child.agentId, calls: threadCalls(child.entries) })\n }\n\n const spawns: SpawnFact[] = []\n const steersByTarget = new Map<\n string,\n Array<{ requestId: string; at: string | null; delivered: boolean }>\n >()\n const cancels: Array<{ agentId: string; at: string | null }> = []\n const settles: TaskNotification[] = []\n\n for (const thread of threads) {\n for (const use of thread.calls.uses) {\n if (spawnTools.has(use.name)) {\n const result = thread.calls.results.get(use.id)\n const agentId = spawnedAgentId(result) ?? childBySpawnToolUseId.get(use.id)?.agentId ?? null\n if (agentId === null) continue\n const label =\n str(use.input.description) ?? childByAgentId.get(agentId)?.description ?? agentId\n spawns.push({\n agentId,\n parentId: thread.id,\n label,\n // The spawn is complete when the launch call is answered; the tool_use\n // instant is the fallback for a call that never got a result line.\n at: result?.at ?? use.at,\n model: isRecord(result?.structured) ? str(result.structured.resolvedModel) : null,\n })\n continue\n }\n if (steerTools.has(use.name)) {\n const target = str(use.input.to) ?? str(use.input.recipient)\n if (target === null) continue\n const result = thread.calls.results.get(use.id)\n const structured = isRecord(result?.structured) ? result.structured : null\n // `success` is the harness confirming the message reached a live agent;\n // absent, the steer is counted queued but not delivered.\n const delivered = structured?.success === true || str(structured?.resumedAgentId) === target\n const rows = steersByTarget.get(target) ?? []\n rows.push({ requestId: use.id, at: use.at, delivered })\n steersByTarget.set(target, rows)\n continue\n }\n if (cancelTools.has(use.name)) {\n const target = str(use.input.agentId) ?? str(use.input.to) ?? str(use.input.taskId)\n if (target !== null) cancels.push({ agentId: target, at: use.at })\n }\n }\n settles.push(...thread.calls.notifications)\n }\n\n const spawnedIds = new Set(spawns.map((s) => s.agentId))\n const cancelledIds = new Set(\n cancels.filter((c) => spawnedIds.has(c.agentId)).map((c) => c.agentId),\n )\n const startedAt = main.firstAt\n const completedAt = main.lastAt\n\n const journalLines: string[] = [\n line({\n kind: 'spawned',\n id: sessionId,\n parent: null,\n label: `session:${sessionId}`,\n role: 'supervisor',\n at: startedAt,\n }),\n ]\n for (const s of spawns) {\n journalLines.push(\n line({\n kind: 'spawned',\n id: s.agentId,\n parent: s.parentId,\n label: s.label,\n role: 'worker',\n at: s.at,\n }),\n )\n }\n\n // Only the LAST notification per agent is its settle; an earlier one is a stop\n // the supervisor resumed from, which the steer count already records.\n const lastNotification = new Map<string, TaskNotification>()\n for (const n of settles) {\n if (!spawnedIds.has(n.taskId)) continue\n lastNotification.set(n.taskId, n)\n }\n for (const [agentId, n] of lastNotification) {\n if (cancelledIds.has(agentId)) continue\n journalLines.push(\n line({\n kind: 'settled',\n id: agentId,\n status: n.status,\n verdict: n.summary,\n at: n.at,\n // No `spent` key: Claude Code prices nothing, and a zeroed spend object\n // would read as a $0 worker. `limits.spendUsd` carries the reason.\n }),\n )\n }\n // One cancel per agent: Claude Code can emit a stop then a retry-stop for the\n // same agentId, and each raw entry would otherwise mint a duplicate `cancelled`\n // line that double-counts in `workersCancelled`. Keep the last, mirroring the\n // last-notification dedup the settle path already does.\n const lastCancel = new Map<string, { agentId: string; at: string | null }>()\n for (const c of cancels) {\n if (!spawnedIds.has(c.agentId)) continue\n lastCancel.set(c.agentId, c)\n }\n for (const c of lastCancel.values()) {\n journalLines.push(\n line({ kind: 'cancelled', id: c.agentId, reason: 'stopped by supervisor', at: c.at }),\n )\n }\n // `metered` carries the brain's own inference. The token counts are real; the\n // usd stays absent and `limits.spendUsd` explains why.\n if (\n mainTranscript.gaps.length === 0 &&\n mainTranscript.usage.tokensIn !== null &&\n mainTranscript.usage.tokensOut !== null &&\n mainTranscript.usage.cacheRead !== null &&\n mainTranscript.usage.cacheWrite !== null\n ) {\n journalLines.push(\n line({\n kind: 'metered',\n id: sessionId,\n spend: {\n tokens: {\n input: mainTranscript.usage.tokensIn,\n output: mainTranscript.usage.tokensOut,\n cacheRead: mainTranscript.usage.cacheRead,\n cacheWrite: mainTranscript.usage.cacheWrite,\n },\n },\n at: completedAt,\n }),\n )\n }\n\n const settleAtByAgent = new Map(\n [...lastNotification.entries()].map(([id, n]) => [id, n.at] as const),\n )\n const spawnAtByAgent = new Map(spawns.map((s) => [s.agentId, s.at] as const))\n\n const workers: WorkerLogSource[] = []\n for (const spawn of spawns) {\n const { agentId, label } = spawn\n const events: string[] = []\n const inbox: string[] = []\n const child = childByAgentId.get(agentId) ?? null\n const startAt = child?.firstAt ?? spawnAtByAgent.get(agentId) ?? null\n const endAt = settleAtByAgent.get(agentId) ?? child?.lastAt ?? null\n if (startAt !== null) events.push(line({ kind: 'started', label, at: startAt, agentId }))\n for (const steer of steersByTarget.get(agentId) ?? []) {\n inbox.push(line({ id: steer.requestId, at: steer.at, worker: label, message: 'steer' }))\n events.push(\n line({\n kind: 'message',\n label,\n direction: 'down',\n at: steer.at,\n requestId: steer.requestId,\n delivered: steer.delivered,\n }),\n )\n }\n if (endAt !== null) {\n events.push(\n line({\n kind: 'finished',\n label,\n at: endAt,\n agentId,\n // No `passed` / `patchBytes`: this harness has neither. Emitting\n // `passed: false` here would invent a failed worker.\n // `evidence` is the child's closing message — what it handed back.\n ...(child?.finalReport === null || child?.finalReport === undefined\n ? {}\n : { evidence: child.finalReport }),\n }),\n )\n }\n workers.push({\n workerId: agentId,\n label,\n events: events.length === 0 ? '' : `${events.join('\\n')}\\n`,\n inbox: inbox.length === 0 ? '' : `${inbox.join('\\n')}\\n`,\n patchBytes: null,\n transcriptRef: child?.path ?? null,\n patchPath: null,\n tokensIn: child?.tokensIn ?? null,\n tokensOut: child?.tokensOut ?? null,\n cacheRead: child?.cacheRead ?? null,\n cacheWrite: child?.cacheWrite ?? null,\n })\n }\n\n const joined = children.length\n const missingChildren = spawns.filter((spawn) => !childByAgentId.has(spawn.agentId)).length\n const incompleteChildren = children.filter(\n (child) =>\n child.gaps.length > 0 ||\n child.tokensIn === null ||\n child.tokensOut === null ||\n child.cacheRead === null ||\n child.cacheWrite === null,\n ).length\n const harnessMissingReason =\n subagentsDir === null\n ? 'subagent transcript join disabled'\n : joined === 0\n ? `no subagent transcripts under ${subagentsDir}`\n : missingChildren > 0\n ? `${missingChildren}/${spawns.length} spawned agents have no retained transcript under ${subagentsDir}`\n : incompleteChildren > 0\n ? `${incompleteChildren}/${joined} subagent transcripts have malformed lines or unknown usage`\n : null\n const harnessWorkerTokens =\n joined === 0 || incompleteChildren > 0\n ? null\n : {\n store: 'claude-code subagent transcripts',\n sessions: joined,\n input: children.reduce((a, child) => a + (child.tokensIn ?? 0), 0),\n output: children.reduce((a, child) => a + (child.tokensOut ?? 0), 0),\n cacheRead: children.reduce((a, child) => a + (child.cacheRead ?? 0), 0),\n cacheWrite: children.reduce((a, child) => a + (child.cacheWrite ?? 0), 0),\n }\n\n const liveWorkers = spawns.filter(\n (s) => !lastNotification.has(s.agentId) && !cancelledIds.has(s.agentId),\n ).length\n const state = JSON.stringify({\n id: sessionId,\n // Derived, not asserted: a spawned agent with no notification and no stop\n // is still running, which is exactly what a live transcript looks like.\n status: liveWorkers > 0 ? 'running' : 'idle',\n startedAt,\n completedAt,\n result: { delivered: null },\n })\n\n return {\n runRef,\n instanceId: opts.instanceId ?? sessionId,\n arm: opts.arm ?? null,\n supRunDir: subagentsDir,\n journal: `${journalLines.join('\\n')}\\n`,\n brainLog: null,\n state,\n progress: null,\n workers,\n workersMissingReason: null,\n result: null,\n judge: null,\n judgeSource: null,\n patch: null,\n driverLog: null,\n harnessWorkerTokens,\n harnessMissingReason,\n limits: {\n ...limits,\n managerTokens:\n mainTranscript.gaps.length > 0\n ? `main transcript has ${mainTranscript.gaps.length} parse or usage gaps`\n : null,\n workerTokens: spawns.length === 0 ? null : harnessMissingReason,\n deliverables: NO_DELIVERABLES,\n },\n rootTranscriptRef: opts.transcriptPath,\n traceCommand,\n }\n}\n\n/** A `SupervisorRunReader` over a Claude Code session — the same contract Runtime implements. */\nexport function claudeCodeSupervisorRunReader(opts: ClaudeCodeReaderOptions): SupervisorRunReader {\n return {\n runRef: opts.runRef ?? opts.transcriptPath,\n read: () => readClaudeCodeSupervisorRun(opts),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,sBAAsB,CAAC,SAAS,MAAM;;AAE5C,MAAM,sBAAsB,CAAC,aAAa;;AAE1C,MAAM,uBAAuB,CAAC,YA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