@tangle-network/agent-eval 0.207.4 → 0.209.1

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 (209) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-CEhxR_I3.d.ts → agent-profile-BGyt2z8U.d.ts} +3 -3
  4. package/dist/{agent-profile-CEhxR_I3.d.ts.map → agent-profile-BGyt2z8U.d.ts.map} +1 -1
  5. package/dist/{agent-profile-cell-BHcB-mZX.d.ts → agent-profile-cell-BNp-Js9F.d.ts} +2 -3
  6. package/dist/agent-profile-cell-BNp-Js9F.d.ts.map +1 -0
  7. package/dist/{agent-profile-cell-DcFW4vOc.js → agent-profile-cell-BYc0bxsL.js} +2 -2
  8. package/dist/agent-profile-cell-BYc0bxsL.js.map +1 -0
  9. package/dist/analyst/index.d.ts +12 -12
  10. package/dist/analyst/index.js +5 -5
  11. package/dist/{analyze-runs-GZ0VSwui.js → analyze-runs-0cdYMgob.js} +5 -5
  12. package/dist/{analyze-runs-GZ0VSwui.js.map → analyze-runs-0cdYMgob.js.map} +1 -1
  13. package/dist/{analyze-runs-CTJyUplR.d.ts → analyze-runs-BlslTkOJ.d.ts} +4 -4
  14. package/dist/{analyze-runs-CTJyUplR.d.ts.map → analyze-runs-BlslTkOJ.d.ts.map} +1 -1
  15. package/dist/{benchmark-command-DiFof9bz.js → benchmark-command-Cve7mHNC.js} +8 -8
  16. package/dist/{benchmark-command-DiFof9bz.js.map → benchmark-command-Cve7mHNC.js.map} +1 -1
  17. package/dist/benchmarks/index.d.ts +5 -7
  18. package/dist/benchmarks/index.d.ts.map +1 -1
  19. package/dist/benchmarks/index.js +4 -4
  20. package/dist/builder-eval/index.js +1 -1
  21. package/dist/campaign/index.d.ts +7 -7
  22. package/dist/campaign/index.js +10 -10
  23. package/dist/{campaign-B8MqboM0.js → campaign-CvhmiLKa.js} +15 -15
  24. package/dist/{campaign-B8MqboM0.js.map → campaign-CvhmiLKa.js.map} +1 -1
  25. package/dist/{campaign-evidence-DW3Krxov.js → campaign-evidence-B5qsCHEn.js} +3 -3
  26. package/dist/{campaign-evidence-DW3Krxov.js.map → campaign-evidence-B5qsCHEn.js.map} +1 -1
  27. package/dist/cli.js +7 -7
  28. package/dist/contract/index.d.ts +9 -9
  29. package/dist/contract/index.js +8 -8
  30. package/dist/{default-registry-DZFWY2_E.d.ts → default-registry-Crk3QEy1.d.ts} +6 -6
  31. package/dist/{default-registry-DZFWY2_E.d.ts.map → default-registry-Crk3QEy1.d.ts.map} +1 -1
  32. package/dist/{default-registry-DX5R7_n9.js → default-registry-DF4Yp7HQ.js} +2 -2
  33. package/dist/{default-registry-DX5R7_n9.js.map → default-registry-DF4Yp7HQ.js.map} +1 -1
  34. package/dist/{define-agent-eval-BpRdb_Oa.js → define-agent-eval-Csd47ur_.js} +8 -8
  35. package/dist/{define-agent-eval-BpRdb_Oa.js.map → define-agent-eval-Csd47ur_.js.map} +1 -1
  36. package/dist/{define-agent-eval-Bmc4AYiB.d.ts → define-agent-eval-_nyV5nev.d.ts} +7 -7
  37. package/dist/{define-agent-eval-Bmc4AYiB.d.ts.map → define-agent-eval-_nyV5nev.d.ts.map} +1 -1
  38. package/dist/diagnosis/index.d.ts +2 -5
  39. package/dist/diagnosis/index.d.ts.map +1 -1
  40. package/dist/diagnosis/index.js +2 -26
  41. package/dist/diagnosis/index.js.map +1 -1
  42. package/dist/{dspy-rlm-engine-AJqjFUUr.js → dspy-rlm-engine-BpaKVKJA.js} +3 -3
  43. package/dist/{dspy-rlm-engine-AJqjFUUr.js.map → dspy-rlm-engine-BpaKVKJA.js.map} +1 -1
  44. package/dist/{engine-DProXJ7A.d.ts → engine-D-YZ32ZJ.d.ts} +5 -12
  45. package/dist/engine-D-YZ32ZJ.d.ts.map +1 -0
  46. package/dist/{eval-campaign-DU_p8qVt.js → eval-campaign-C31Qbv77.js} +4 -4
  47. package/dist/{eval-campaign-DU_p8qVt.js.map → eval-campaign-C31Qbv77.js.map} +1 -1
  48. package/dist/evaluation.d.ts +2 -2
  49. package/dist/{exact-types-Cq6xXNVR.d.ts → exact-types-DjhfZglz.d.ts} +2 -2
  50. package/dist/{exact-types-Cq6xXNVR.d.ts.map → exact-types-DjhfZglz.d.ts.map} +1 -1
  51. package/dist/experiment/index.d.ts +2 -2
  52. package/dist/experiment/index.js +5 -5
  53. package/dist/{external-optimizer-process-Bemjoy8y.js → external-optimizer-process-D2Txd-7D.js} +2 -2
  54. package/dist/{external-optimizer-process-Bemjoy8y.js.map → external-optimizer-process-D2Txd-7D.js.map} +1 -1
  55. package/dist/{external-optimizer-subprocess-d_EQrcTS.js → external-optimizer-subprocess-C0EsxEbI.js} +11 -3
  56. package/dist/{external-optimizer-subprocess-d_EQrcTS.js.map → external-optimizer-subprocess-C0EsxEbI.js.map} +1 -1
  57. package/dist/{feedback-trajectory-C6Z8PRoF.d.ts → feedback-trajectory-CX01700m.d.ts} +3 -3
  58. package/dist/{feedback-trajectory-C6Z8PRoF.d.ts.map → feedback-trajectory-CX01700m.d.ts.map} +1 -1
  59. package/dist/hosted/index.js +1 -1
  60. package/dist/{index-LAFht3x_.d.ts → index-BHh9Z9El.d.ts} +9 -9
  61. package/dist/{index-LAFht3x_.d.ts.map → index-BHh9Z9El.d.ts.map} +1 -1
  62. package/dist/{index-B9mXrS0W.d.ts → index-Ddi5M-TQ.d.ts} +8 -8
  63. package/dist/{index-B9mXrS0W.d.ts.map → index-Ddi5M-TQ.d.ts.map} +1 -1
  64. package/dist/{index-CbBfavbT.d.ts → index-H-u7f-w3.d.ts} +2 -2
  65. package/dist/{index-CbBfavbT.d.ts.map → index-H-u7f-w3.d.ts.map} +1 -1
  66. package/dist/{index-DkucR0KJ.d.ts → index-UxNTvn-w.d.ts} +6 -6
  67. package/dist/{index-DkucR0KJ.d.ts.map → index-UxNTvn-w.d.ts.map} +1 -1
  68. package/dist/index.d.ts +27 -36
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +25 -87
  71. package/dist/index.js.map +1 -1
  72. package/dist/{kind-factory-Cn1lbsAd.js → kind-factory-ivTx6koH.js} +2 -11
  73. package/dist/{kind-factory-Cn1lbsAd.js.map → kind-factory-ivTx6koH.js.map} +1 -1
  74. package/dist/{llm-judge-DBrxRG2D.js → llm-judge-C0256VT_.js} +8 -8
  75. package/dist/{llm-judge-DBrxRG2D.js.map → llm-judge-C0256VT_.js.map} +1 -1
  76. package/dist/{matrix-Cqkk7eYI.d.ts → matrix-jHTsHEkR.d.ts} +2 -2
  77. package/dist/{matrix-Cqkk7eYI.d.ts.map → matrix-jHTsHEkR.d.ts.map} +1 -1
  78. package/dist/meta-eval/index.d.ts +1 -1
  79. package/dist/meta-eval/index.js +1 -1
  80. package/dist/{mint-C1W8w5wo.d.ts → mint-CDy-brUR.d.ts} +2 -2
  81. package/dist/{mint-C1W8w5wo.d.ts.map → mint-CDy-brUR.d.ts.map} +1 -1
  82. package/dist/{mint-CWG-s2mI.js → mint-Csor1BLJ.js} +2 -2
  83. package/dist/{mint-CWG-s2mI.js.map → mint-Csor1BLJ.js.map} +1 -1
  84. package/dist/multishot/golden/index.d.ts +1 -1
  85. package/dist/multishot/index.d.ts +2 -2
  86. package/dist/openapi.json +1 -1
  87. package/dist/{paired-arms-CgWT7sHy.js → paired-arms-B5v-X7No.js} +2 -4
  88. package/dist/{paired-arms-CgWT7sHy.js.map → paired-arms-B5v-X7No.js.map} +1 -1
  89. package/dist/pipelines/index.d.ts +1 -1
  90. package/dist/pipelines/index.js +2 -2
  91. package/dist/{prime-protocol-Csr9kcOM.d.ts → prime-protocol-B7et3tI7.d.ts} +2 -2
  92. package/dist/{prime-protocol-Csr9kcOM.d.ts.map → prime-protocol-B7et3tI7.d.ts.map} +1 -1
  93. package/dist/{produced-state-DyTuvglz.js → produced-state-CgB9g0VX.js} +3 -3
  94. package/dist/{produced-state-DyTuvglz.js.map → produced-state-CgB9g0VX.js.map} +1 -1
  95. package/dist/profile-cell.d.ts +2 -2
  96. package/dist/profile-cell.js +2 -2
  97. package/dist/{query-DlV0pdx4.js → query-B1D1qp2Z.js} +2 -2
  98. package/dist/{query-DlV0pdx4.js.map → query-B1D1qp2Z.js.map} +1 -1
  99. package/dist/{query-DBUQhehH.d.ts → query-DK1nWcmp.d.ts} +2 -3
  100. package/dist/{query-DBUQhehH.d.ts.map → query-DK1nWcmp.d.ts.map} +1 -1
  101. package/dist/{registry-DMkmhBQ5.d.ts → registry-BL7H33tj.d.ts} +3 -3
  102. package/dist/{registry-DMkmhBQ5.d.ts.map → registry-BL7H33tj.d.ts.map} +1 -1
  103. package/dist/{release-confidence-CkoXFx9I.d.ts → release-confidence-C4kI7lQi.d.ts} +4 -12
  104. package/dist/release-confidence-C4kI7lQi.d.ts.map +1 -0
  105. package/dist/{release-confidence-CiFg1EPq.js → release-confidence-Dbe9AS_X.js} +2 -2
  106. package/dist/{release-confidence-CiFg1EPq.js.map → release-confidence-Dbe9AS_X.js.map} +1 -1
  107. package/dist/{report-command-pXtxg5YK.js → report-command-CtIIsQKP.js} +3 -28
  108. package/dist/{report-command-pXtxg5YK.js.map → report-command-CtIIsQKP.js.map} +1 -1
  109. package/dist/reporting.d.ts +3 -3
  110. package/dist/reporting.js +3 -3
  111. package/dist/{researcher-CZFZjj-u.d.ts → researcher-DuIJ9IaA.d.ts} +4 -4
  112. package/dist/{researcher-CZFZjj-u.d.ts.map → researcher-DuIJ9IaA.d.ts.map} +1 -1
  113. package/dist/{reward-hacking-Cyk-QHk9.d.ts → reward-hacking-C6Kp54Av.d.ts} +2 -2
  114. package/dist/{reward-hacking-Cyk-QHk9.d.ts.map → reward-hacking-C6Kp54Av.d.ts.map} +1 -1
  115. package/dist/reward-nw2xZGZG.js.map +1 -1
  116. package/dist/rl.d.ts +10 -29
  117. package/dist/rl.d.ts.map +1 -1
  118. package/dist/rl.js +6 -6
  119. package/dist/rl.js.map +1 -1
  120. package/dist/rollout/index.d.ts +2 -2
  121. package/dist/rollout/index.js +2 -2
  122. package/dist/{rollout-l9w3Gdvh.js → rollout-BZqQc0YY.js} +2 -2
  123. package/dist/{rollout-l9w3Gdvh.js.map → rollout-BZqQc0YY.js.map} +1 -1
  124. package/dist/{rubric-predictive-validity-DIUwJJ9Y.d.ts → rubric-predictive-validity-BiNNEjpG.d.ts} +2 -2
  125. package/dist/{rubric-predictive-validity-DIUwJJ9Y.d.ts.map → rubric-predictive-validity-BiNNEjpG.d.ts.map} +1 -1
  126. package/dist/{run-record-BRlM99rX.js → run-record-DlTZ_lqe.js} +3 -13
  127. package/dist/run-record-DlTZ_lqe.js.map +1 -0
  128. package/dist/{run-record-BB290Y9A.js → run-record-ES07wfz9.js} +2 -2
  129. package/dist/{run-record-BB290Y9A.js.map → run-record-ES07wfz9.js.map} +1 -1
  130. package/dist/{run-record-DF-fuu31.d.ts → run-record-p2AYTrCn.d.ts} +3 -7
  131. package/dist/run-record-p2AYTrCn.d.ts.map +1 -0
  132. package/dist/search/index.d.ts +2 -24
  133. package/dist/search/index.d.ts.map +1 -1
  134. package/dist/search/index.js +3 -3
  135. package/dist/{search-kernel-mzeNuzr8.js → search-kernel-Bfe3kzRk.js} +45 -3
  136. package/dist/search-kernel-Bfe3kzRk.js.map +1 -0
  137. package/dist/{search-kernel-CzTWtv5d.d.ts → search-kernel-ah2GESe3.d.ts} +19 -4
  138. package/dist/search-kernel-ah2GESe3.d.ts.map +1 -0
  139. package/dist/{search-ledger-CXQPwdWz.js → search-ledger-aMTNQn_m.js} +2 -2
  140. package/dist/{search-ledger-CXQPwdWz.js.map → search-ledger-aMTNQn_m.js.map} +1 -1
  141. package/dist/{search-shipper-DhhofkDX.js → search-shipper-DKXWuLnp.js} +2 -2
  142. package/dist/{search-shipper-DhhofkDX.js.map → search-shipper-DKXWuLnp.js.map} +1 -1
  143. package/dist/{search-summary-CDURlgZR.js → search-summary-DK1bwTAf.js} +2 -2
  144. package/dist/{search-summary-CDURlgZR.js.map → search-summary-DK1bwTAf.js.map} +1 -1
  145. package/dist/{semantic-concept-judge-DDxUiWIz.js → semantic-concept-judge-BQxZyXdN.js} +3 -3
  146. package/dist/{semantic-concept-judge-DDxUiWIz.js.map → semantic-concept-judge-BQxZyXdN.js.map} +1 -1
  147. package/dist/{sequential-DMqr3sni.js → sequential-BOzBND4t.js} +2 -2
  148. package/dist/{sequential-DMqr3sni.js.map → sequential-BOzBND4t.js.map} +1 -1
  149. package/dist/{skillopt-optimization-method-D0-bMRGu.js → skillopt-optimization-method-BCojvoP1.js} +6 -6
  150. package/dist/{skillopt-optimization-method-D0-bMRGu.js.map → skillopt-optimization-method-BCojvoP1.js.map} +1 -1
  151. package/dist/{statistical-heldout-DFKtp-Qm.d.ts → statistical-heldout-D0rX_IDl.d.ts} +4 -5
  152. package/dist/statistical-heldout-D0rX_IDl.d.ts.map +1 -0
  153. package/dist/{store-otlp-BA7G1Du-.js → store-otlp-__ebQ6Hn.js} +2 -2
  154. package/dist/{store-otlp-BA7G1Du-.js.map → store-otlp-__ebQ6Hn.js.map} +1 -1
  155. package/dist/{store-tool-spans-DKoVbE-w.js → store-tool-spans-TbRBuIM7.js} +3 -3
  156. package/dist/{store-tool-spans-DKoVbE-w.js.map → store-tool-spans-TbRBuIM7.js.map} +1 -1
  157. package/dist/{store-tool-spans-9YJNMP-z.d.ts → store-tool-spans-wQ9idsnn.d.ts} +5 -5
  158. package/dist/{store-tool-spans-9YJNMP-z.d.ts.map → store-tool-spans-wQ9idsnn.d.ts.map} +1 -1
  159. package/dist/{summary-report-fXurE2TR.js → summary-report-BsaEFEwA.js} +3 -3
  160. package/dist/{summary-report-fXurE2TR.js.map → summary-report-BsaEFEwA.js.map} +1 -1
  161. package/dist/{summary-report-DvvesgR_.d.ts → summary-report-CK0ueoJd.d.ts} +2 -2
  162. package/dist/{summary-report-DvvesgR_.d.ts.map → summary-report-CK0ueoJd.d.ts.map} +1 -1
  163. package/dist/supervisor-run/index.d.ts +0 -8
  164. package/dist/supervisor-run/index.d.ts.map +1 -1
  165. package/dist/supervisor-run/index.js +2 -2
  166. package/dist/{systemone-review-Bt4JcxMc.d.ts → systemone-review-BReh3mvm.d.ts} +2 -2
  167. package/dist/{systemone-review-Bt4JcxMc.d.ts.map → systemone-review-BReh3mvm.d.ts.map} +1 -1
  168. package/dist/systemone.d.ts +3 -3
  169. package/dist/{tool-groups-j19pmOfP.d.ts → tool-groups-v28A-ZAF.d.ts} +3 -3
  170. package/dist/tool-groups-v28A-ZAF.d.ts.map +1 -0
  171. package/dist/{tool-waste-x_E8h9Ih.js → tool-waste-BYt5rdt8.js} +2 -2
  172. package/dist/{tool-waste-x_E8h9Ih.js.map → tool-waste-BYt5rdt8.js.map} +1 -1
  173. package/dist/{tool-waste-DxlebQkx.d.ts → tool-waste-Wi4g6Ekb.d.ts} +2 -2
  174. package/dist/{tool-waste-DxlebQkx.d.ts.map → tool-waste-Wi4g6Ekb.d.ts.map} +1 -1
  175. package/dist/{trace-questions-dRvmsbTk.d.ts → trace-questions-C26UvI3D.d.ts} +3 -3
  176. package/dist/{trace-questions-dRvmsbTk.d.ts.map → trace-questions-C26UvI3D.d.ts.map} +1 -1
  177. package/dist/trace-repair/index.d.ts +2 -9
  178. package/dist/trace-repair/index.d.ts.map +1 -1
  179. package/dist/trace-repair/index.js +1 -1
  180. package/dist/traces.d.ts +6 -8
  181. package/dist/traces.d.ts.map +1 -1
  182. package/dist/traces.js +6 -6
  183. package/dist/trajectory-replay/index.d.ts +0 -2
  184. package/dist/trajectory-replay/index.d.ts.map +1 -1
  185. package/dist/trajectory-replay/index.js +1 -1
  186. package/dist/{tree-CN8mlzUO.js → tree-CZ78tiPg.js} +4 -24
  187. package/dist/tree-CZ78tiPg.js.map +1 -0
  188. package/dist/{types-CFCUZk0B.d.ts → types-Dv9sYwBB.d.ts} +4 -4
  189. package/dist/{types-CFCUZk0B.d.ts.map → types-Dv9sYwBB.d.ts.map} +1 -1
  190. package/dist/{types-DAPpAkd4.d.ts → types-KEkKkETv.d.ts} +2 -2
  191. package/dist/{types-DAPpAkd4.d.ts.map → types-KEkKkETv.d.ts.map} +1 -1
  192. package/dist/{types-BlSBUNRd.d.ts → types-tWFY6bON.d.ts} +3 -3
  193. package/dist/{types-BlSBUNRd.d.ts.map → types-tWFY6bON.d.ts.map} +1 -1
  194. package/dist/wire/index.d.ts +1 -1
  195. package/docs/public-api.md +399 -424
  196. package/docs/quickstart-external.md +268 -0
  197. package/docs/search-ledger.md +4 -1
  198. package/package.json +3 -3
  199. package/dist/agent-profile-cell-BHcB-mZX.d.ts.map +0 -1
  200. package/dist/agent-profile-cell-DcFW4vOc.js.map +0 -1
  201. package/dist/engine-DProXJ7A.d.ts.map +0 -1
  202. package/dist/release-confidence-CkoXFx9I.d.ts.map +0 -1
  203. package/dist/run-record-BRlM99rX.js.map +0 -1
  204. package/dist/run-record-DF-fuu31.d.ts.map +0 -1
  205. package/dist/search-kernel-CzTWtv5d.d.ts.map +0 -1
  206. package/dist/search-kernel-mzeNuzr8.js.map +0 -1
  207. package/dist/statistical-heldout-DFKtp-Qm.d.ts.map +0 -1
  208. package/dist/tool-groups-j19pmOfP.d.ts.map +0 -1
  209. package/dist/tree-CN8mlzUO.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tool-waste-x_E8h9Ih.js","names":["prev"],"sources":["../src/statistics/agreement-irr.ts","../src/pipelines/budget-breach.ts","../src/pipelines/failure-cluster.ts","../src/pipelines/judge-agreement.ts","../src/tool-use-metrics.ts","../src/pipelines/tool-waste.ts"],"sourcesContent":["import { ValidationError } from '../errors'\nimport {\n type ContinuousAgreement,\n type ContinuousAgreementOptions,\n continuousAgreement,\n} from '../judge-calibration'\nimport type { JudgeScore } from '../types'\n\n/**\n * Inter-rater reliability — Krippendorff's α under the squared-difference\n * metric, pooled across dimensions.\n *\n * Each inner array is one judge's scores. Items are matched by position\n * WITHIN a dimension: the k-th score a judge supplies carrying dimension\n * `d` is item k of `d`, and the ratings compared against each other are\n * the ones different judges gave to the same item. Every judge that scores\n * a dimension at all must supply the same number of scores for it —\n * ragged input cannot be aligned into items and throws rather than\n * comparing mismatched items.\n *\n * α = 1 − D_observed / D_expected: D_observed averages the squared\n * difference over within-item judge pairs, D_expected over every pair of\n * ratings irrespective of item. α = 1 is perfect agreement, 0 is chance,\n * negative is systematic disagreement.\n */\nexport function interRaterReliability(judgeScores: JudgeScore[][]): number {\n if (judgeScores.length < 2) return 1\n\n // dimension → one score sequence per judge, in that judge's supplied order.\n const perDimension = new Map<string, number[][]>()\n for (let judgeIndex = 0; judgeIndex < judgeScores.length; judgeIndex++) {\n for (const s of judgeScores[judgeIndex]!) {\n let byJudge = perDimension.get(s.dimension)\n if (byJudge === undefined) {\n byJudge = Array.from({ length: judgeScores.length }, () => [] as number[])\n perDimension.set(s.dimension, byJudge)\n }\n byJudge[judgeIndex]!.push(s.score)\n }\n }\n\n const allValues: number[] = []\n const pairDiffs: number[] = []\n\n for (const [dimension, byJudge] of perDimension) {\n const scoring = byJudge.filter((scores) => scores.length > 0)\n if (scoring.length < 2) continue\n const itemCount = scoring[0]!.length\n if (scoring.some((scores) => scores.length !== itemCount)) {\n throw new ValidationError(\n `interRaterReliability: dimension '${dimension}' has judges supplying ` +\n `${scoring.map((scores) => scores.length).join('/')} scores — items cannot be aligned`,\n )\n }\n for (let item = 0; item < itemCount; item++) {\n const ratings = scoring.map((scores) => scores[item]!)\n for (const v of ratings) allValues.push(v)\n for (let i = 0; i < ratings.length; i++) {\n for (let j = i + 1; j < ratings.length; j++) {\n pairDiffs.push((ratings[i]! - ratings[j]!) ** 2)\n }\n }\n }\n }\n\n if (pairDiffs.length === 0 || allValues.length < 2) return 1\n\n const observedDisagreement = pairDiffs.reduce((a, b) => a + b, 0) / pairDiffs.length\n\n // Expected disagreement from all possible pairings of values\n let expectedDisagreement = 0\n let expectedCount = 0\n for (let i = 0; i < allValues.length; i++) {\n for (let j = i + 1; j < allValues.length; j++) {\n expectedDisagreement += (allValues[i]! - allValues[j]!) ** 2\n expectedCount++\n }\n }\n expectedDisagreement = expectedCount > 0 ? expectedDisagreement / expectedCount : 0\n\n if (expectedDisagreement === 0) return 1\n return 1 - observedDisagreement / expectedDisagreement\n}\n\n// ── Corpus-wide inter-rater agreement ──────────────────────────────\n//\n// `interRaterReliability(judgeScores)` computes a within-item\n// Krippendorff α — multiple judges score *the same item* and we ask\n// \"how much do their scores agree on that item?\" Useful for a single\n// scenario, but it cannot answer \"how reliable are these judges across\n// the whole evaluation corpus?\"\n//\n// `corpusInterRaterAgreement` does the corpus-wide question properly.\n// Inputs are flat per-(item, judge, dimension) score records. For each\n// dimension we pivot to a complete [n_items × n_judges] matrix and feed\n// it to the ICC(2,1) + κ_w machinery already validated in\n// `judge-calibration.ts`. An overall pooled metric averages the\n// per-dimension ICC/κ across dimensions.\n\nexport interface CorpusScoreRecord {\n /** Stable identifier for the rated item (scenario, span, turn, …). */\n itemId: string\n /** Identifier for the judge that produced this score. */\n judgeName: string\n /** Dimension name (matches `JudgeScore.dimension`). */\n dimension: string\n /** Numeric score; must be finite. */\n score: number\n}\n\nexport interface CorpusAgreementPerDimension extends ContinuousAgreement {\n dimension: string\n /** Item IDs that contributed to this dimension's matrix (every judge scored them). */\n itemIds: string[]\n /** Judge IDs that contributed to this dimension's matrix. */\n judgeIds: string[]\n}\n\nexport interface CorpusAgreementReport {\n /** Per-dimension ICC(2,1) + κ_w + Pearson + Spearman + bootstrap CIs. */\n perDimension: CorpusAgreementPerDimension[]\n /** Mean ICC across dimensions (NaN if no dimension yielded a finite ICC). */\n overallIcc: number\n /** Mean weighted κ across dimensions (NaN if none finite). */\n overallWeightedKappa: number\n /** Dimensions evaluated (sorted). */\n dimensions: string[]\n /** Judges seen across the corpus (sorted). */\n judgeIds: string[]\n}\n\nexport interface CorpusAgreementOptions extends ContinuousAgreementOptions {\n /**\n * Restrict the audit to these dimensions. Default = every dimension\n * that appears in the input. A dimension named here but absent from\n * the input throws — silent omission would corrupt the overall metric.\n */\n dimensions?: string[]\n /**\n * Restrict the audit to these judges. Default = every judge that\n * appears in the input. A judge named here but absent from a\n * dimension throws (see \"fail loud\" below).\n */\n judges?: string[]\n}\n\n/**\n * Corpus-wide inter-rater agreement across N items × M judges × D dimensions.\n *\n * For each dimension, builds the [n_items][n_judges] matrix of scores\n * (keeping only items every judge rated on that dimension), then runs\n * `continuousAgreement` to get ICC(2,1), κ_w, Pearson, Spearman, and\n * bootstrap CIs. Reports a pooled mean across dimensions as a single\n * \"is this judge panel reliable on this corpus?\" number.\n *\n * Fail-loud contract:\n * - Empty input throws.\n * - Fewer than 2 judges or fewer than 2 items per dimension throws.\n * - A judge present in some dimensions but with zero scored items on\n * another dimension throws (would silently shrink the matrix).\n * - Duplicate (itemId, judgeName, dimension) records throw.\n */\nexport function corpusInterRaterAgreement(\n records: CorpusScoreRecord[],\n opts: CorpusAgreementOptions = {},\n): CorpusAgreementReport {\n if (records.length === 0) {\n throw new ValidationError('corpusInterRaterAgreement: no score records supplied')\n }\n\n const judgesSeen = new Set<string>()\n const dimsSeen = new Set<string>()\n // dimension → judge → itemId → score\n const grid = new Map<string, Map<string, Map<string, number>>>()\n\n for (const r of records) {\n if (!Number.isFinite(r.score)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: non-finite score for (item=${r.itemId}, judge=${r.judgeName}, dim=${r.dimension})`,\n )\n }\n judgesSeen.add(r.judgeName)\n dimsSeen.add(r.dimension)\n const byJudge = grid.get(r.dimension) ?? new Map<string, Map<string, number>>()\n const byItem = byJudge.get(r.judgeName) ?? new Map<string, number>()\n if (byItem.has(r.itemId)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: duplicate record for (item=${r.itemId}, judge=${r.judgeName}, dim=${r.dimension})`,\n )\n }\n byItem.set(r.itemId, r.score)\n byJudge.set(r.judgeName, byItem)\n grid.set(r.dimension, byJudge)\n }\n\n const targetDims = opts.dimensions ?? [...dimsSeen].sort()\n for (const d of targetDims) {\n if (!dimsSeen.has(d)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: dimension '${d}' was requested but no records carry it`,\n )\n }\n }\n const targetJudges = opts.judges ? [...opts.judges] : [...judgesSeen].sort()\n for (const j of targetJudges) {\n if (!judgesSeen.has(j)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: judge '${j}' was requested but produced no records`,\n )\n }\n }\n if (targetJudges.length < 2) {\n throw new ValidationError(\n `corpusInterRaterAgreement: need ≥2 judges, got ${targetJudges.length}`,\n )\n }\n\n const perDimension: CorpusAgreementPerDimension[] = []\n const iccs: number[] = []\n const kappas: number[] = []\n\n for (const dim of targetDims) {\n const byJudge = grid.get(dim)!\n // Fail loud: every requested judge must have scored ≥1 item on this dim.\n const judgeItemCounts: Record<string, number> = {}\n for (const j of targetJudges) {\n const m = byJudge.get(j)\n judgeItemCounts[j] = m?.size ?? 0\n }\n const emptyJudges = targetJudges.filter((j) => judgeItemCounts[j] === 0)\n if (emptyJudges.length > 0) {\n throw new ValidationError(\n `corpusInterRaterAgreement: dimension '${dim}' has no scores from judge(s) ${emptyJudges.join(', ')} (counts: ${JSON.stringify(judgeItemCounts)})`,\n )\n }\n\n // Items rated by *every* requested judge on this dim.\n let commonItems: Set<string> | null = null\n for (const j of targetJudges) {\n const ids = new Set(byJudge.get(j)!.keys())\n if (commonItems === null) {\n commonItems = ids\n } else {\n const prev: Set<string> = commonItems\n commonItems = new Set([...prev].filter((x) => ids.has(x)))\n }\n }\n const sortedItems = [...(commonItems ?? new Set<string>())].sort()\n if (sortedItems.length < 2) {\n throw new ValidationError(\n `corpusInterRaterAgreement: dimension '${dim}' has ${sortedItems.length} item(s) rated by all ${targetJudges.length} judges (need ≥2)`,\n )\n }\n\n const matrix: number[][] = sortedItems.map((itemId) =>\n targetJudges.map((j) => byJudge.get(j)!.get(itemId)!),\n )\n const agreement = continuousAgreement(matrix, opts)\n perDimension.push({\n ...agreement,\n dimension: dim,\n itemIds: sortedItems,\n judgeIds: [...targetJudges],\n })\n if (Number.isFinite(agreement.icc)) iccs.push(agreement.icc)\n if (Number.isFinite(agreement.weightedKappa)) kappas.push(agreement.weightedKappa)\n }\n\n const mean = (xs: number[]) =>\n xs.length === 0 ? Number.NaN : xs.reduce((a, b) => a + b, 0) / xs.length\n return {\n perDimension,\n overallIcc: mean(iccs),\n overallWeightedKappa: mean(kappas),\n dimensions: targetDims,\n judgeIds: targetJudges,\n }\n}\n\n/**\n * Convenience adapter for `JudgeScore[]` data keyed externally by item.\n *\n * Use when you have per-item arrays of `JudgeScore[]` (e.g. one\n * `ScenarioResult.judgeScores` per scenario) and want corpus-wide\n * agreement without manually flattening. `itemId` must be unique per\n * row of `itemsScores`.\n */\nexport function corpusInterRaterAgreementFromJudgeScores(\n itemsScores: Array<{ itemId: string; scores: JudgeScore[] }>,\n opts: CorpusAgreementOptions = {},\n): CorpusAgreementReport {\n const records: CorpusScoreRecord[] = []\n const seen = new Set<string>()\n for (const { itemId, scores } of itemsScores) {\n if (seen.has(itemId)) {\n throw new ValidationError(\n `corpusInterRaterAgreementFromJudgeScores: duplicate itemId '${itemId}'`,\n )\n }\n seen.add(itemId)\n for (const s of scores) {\n records.push({\n itemId,\n judgeName: s.judgeName,\n dimension: s.dimension,\n score: s.score,\n })\n }\n }\n return corpusInterRaterAgreement(records, opts)\n}\n","/**\n * BudgetBreachView — aggregates breach events across the corpus.\n *\n * Answers: which dimensions get hit most often? Which scenarios are\n * underbudgeted? Which variants trigger the most breaches?\n */\n\nimport type { BudgetSpec } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface BudgetBreachFinding {\n runId: string\n scenarioId: string\n variantId?: string\n dimension: keyof BudgetSpec\n limit: number\n consumed: number\n excessRatio: number\n timestamp: number\n}\n\nexport interface BudgetBreachReport {\n findings: BudgetBreachFinding[]\n byDimension: Record<string, number>\n byScenario: Record<string, number>\n byVariant: Record<string, number>\n totalRuns: number\n breachedRunRatio: number\n}\n\nexport async function budgetBreachView(\n store: TraceStore,\n options: { scenarioId?: string; variantId?: string } = {},\n): Promise<BudgetBreachReport> {\n const runs = await store.listRuns({\n scenarioId: options.scenarioId,\n variantId: options.variantId,\n })\n const findings: BudgetBreachFinding[] = []\n const byDimension: Record<string, number> = {}\n const byScenario: Record<string, number> = {}\n const byVariant: Record<string, number> = {}\n\n for (const run of runs) {\n const entries = await store.budget(run.runId)\n for (const e of entries) {\n if (!e.breached) continue\n const excessRatio = e.limit > 0 ? e.consumed / e.limit : Infinity\n findings.push({\n runId: run.runId,\n scenarioId: run.scenarioId,\n variantId: run.variantId,\n dimension: e.dimension,\n limit: e.limit,\n consumed: e.consumed,\n excessRatio,\n timestamp: e.timestamp,\n })\n byDimension[e.dimension] = (byDimension[e.dimension] ?? 0) + 1\n byScenario[run.scenarioId] = (byScenario[run.scenarioId] ?? 0) + 1\n if (run.variantId) byVariant[run.variantId] = (byVariant[run.variantId] ?? 0) + 1\n }\n }\n\n const breachedRuns = new Set(findings.map((f) => f.runId))\n return {\n findings,\n byDimension,\n byScenario,\n byVariant,\n totalRuns: runs.length,\n breachedRunRatio: runs.length > 0 ? breachedRuns.size / runs.length : 0,\n }\n}\n","/**\n * FailureClusterView — groups failed runs by (failureClass, triggerTool,\n * argHash-prefix) so weekly reviews can prioritize the top-N clusters.\n *\n * Each cluster includes: N runs, scenarios affected, representative\n * error message, a proposed mitigation hint (rule → action table).\n */\n\nimport { classifyFailure, DEFAULT_RULES, type FailureRule } from '../failure-taxonomy'\nimport { argHash, hasCapturedToolArgs, toolSpans } from '../trace/query'\nimport type { FailureClass, Span } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface FailureCluster {\n failureClass: FailureClass\n /** Tool name when the trigger was a tool span, else undefined. */\n toolName?: string\n /** First 16 chars of argHash — clusters similar args. */\n argPrefix?: string\n /**\n * Source dimension when the trigger was a judge span (e.g. `'format'`,\n * `'safety'`, `'correctness'`). Lets cross-template aggregators\n * group failures by the dimension that fired without overloading\n * `argPrefix`. Optional — clusters without this field deserialize cleanly.\n */\n dimension?: string\n runCount: number\n scenarioIds: string[]\n exampleError?: string\n exampleRunId: string\n}\n\nexport interface FailureClusterReport {\n clusters: FailureCluster[]\n totalFailures: number\n totalRuns: number\n}\n\nexport async function failureClusterView(\n store: TraceStore,\n options: { rules?: FailureRule[]; minClusterSize?: number } = {},\n): Promise<FailureClusterReport> {\n const rules = options.rules ?? DEFAULT_RULES\n const minSize = options.minClusterSize ?? 1\n const runs = await store.listRuns()\n\n type Key = string\n const clusters = new Map<Key, FailureCluster>()\n let totalFailures = 0\n\n for (const run of runs) {\n if (run.status === 'completed' && run.outcome?.pass !== false) continue\n totalFailures++\n const spans = await store.spans({ runId: run.runId })\n const events = await store.events({ runId: run.runId })\n const cls = classifyFailure({ run, spans, events }, rules)\n\n let toolName: string | undefined\n let argPrefix: string | undefined\n let dimension: string | undefined\n if (cls.triggerSpanId) {\n const trig = spans.find((s) => s.spanId === cls.triggerSpanId)\n if (trig?.kind === 'tool') {\n toolName = trig.toolName\n if (hasCapturedToolArgs(trig)) argPrefix = argHash(trig.args).slice(0, 16)\n } else if (trig?.kind === 'judge') {\n dimension = trig.dimension\n }\n }\n // Fallback: look at the last errored tool span\n if (!toolName) {\n const ts = await toolSpans(store, run.runId)\n const errored = ts.filter((t) => t.status === 'error').pop()\n if (errored) {\n toolName = errored.toolName\n if (hasCapturedToolArgs(errored)) argPrefix = argHash(errored.args).slice(0, 16)\n }\n }\n // Secondary signal: any judge span on the failed run carries a\n // dimension. Useful when the rule classified by judge score but\n // didn't surface the trigger span (or surfaced a non-judge span).\n if (!dimension) {\n const judge = spans.find((s) => s.kind === 'judge' && typeof s.dimension === 'string')\n if (judge?.kind === 'judge') dimension = judge.dimension\n }\n\n const key = `${cls.failureClass}|${toolName ?? ''}|${argPrefix ?? ''}|${dimension ?? ''}`\n let cluster = clusters.get(key)\n if (!cluster) {\n cluster = {\n failureClass: cls.failureClass,\n toolName,\n argPrefix,\n dimension,\n runCount: 0,\n scenarioIds: [],\n exampleRunId: run.runId,\n exampleError: firstErrorMessage(spans) ?? cls.reason,\n }\n clusters.set(key, cluster)\n }\n cluster.runCount++\n if (!cluster.scenarioIds.includes(run.scenarioId)) cluster.scenarioIds.push(run.scenarioId)\n }\n\n const arr = [...clusters.values()]\n .filter((c) => c.runCount >= minSize)\n .sort((a, b) => b.runCount - a.runCount)\n\n return { clusters: arr, totalFailures, totalRuns: runs.length }\n}\n\nfunction firstErrorMessage(spans: Span[]): string | undefined {\n const errored = spans.find((s) => s.status === 'error')\n return errored?.error\n}\n","/**\n * JudgeAgreementView — pairwise agreement between judges across the\n * corpus, grouped by dimension.\n *\n * Output drives two workflows:\n * - Judge robustness audit: \"does Claude agree with GPT at κ ≥ 0.6?\"\n * - Calibration tracking: κ vs golden human labels over time (by\n * providing a `humanGoldenJudgeId`).\n */\n\nimport { interRaterReliability, pearsonR } from '../statistics'\nimport type { JudgeSpan } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface JudgePair {\n judgeA: string\n judgeB: string\n dimension: string\n /** Number of (targetSpanId, dimension) tuples both judges scored. */\n commonItems: number\n pearson: number\n krippendorff: number\n}\n\nexport interface JudgeAgreementReport {\n pairs: JudgePair[]\n dimensions: string[]\n judgeIds: string[]\n}\n\nexport async function judgeAgreementView(store: TraceStore): Promise<JudgeAgreementReport> {\n const all = (await store.spans({ kind: 'judge' })).filter(\n (s): s is JudgeSpan => s.kind === 'judge',\n )\n if (all.length === 0) return { pairs: [], dimensions: [], judgeIds: [] }\n\n const byDimension = new Map<string, JudgeSpan[]>()\n for (const s of all) {\n const arr = byDimension.get(s.dimension) ?? []\n arr.push(s)\n byDimension.set(s.dimension, arr)\n }\n\n const judgeIds = [...new Set(all.map((s) => s.judgeId))].sort()\n const pairs: JudgePair[] = []\n for (const [dim, spans] of byDimension) {\n const byJudge = new Map<string, Map<string, number>>()\n for (const s of spans) {\n const m = byJudge.get(s.judgeId) ?? new Map<string, number>()\n m.set(s.targetSpanId, s.score)\n byJudge.set(s.judgeId, m)\n }\n const judgesHere = [...byJudge.keys()]\n for (let i = 0; i < judgesHere.length; i++) {\n for (let j = i + 1; j < judgesHere.length; j++) {\n const judgeI = judgesHere[i]!\n const judgeJ = judgesHere[j]!\n const a = byJudge.get(judgeI)!\n const b = byJudge.get(judgeJ)!\n const common: Array<[number, number]> = []\n for (const [target, scoreA] of a) {\n const scoreB = b.get(target)\n if (scoreB !== undefined) common.push([scoreA, scoreB])\n }\n if (common.length < 2) continue\n const judgeScores = common.map(\n ([scoreA, scoreB]) =>\n [\n { judgeName: judgeI, dimension: dim, score: scoreA, reasoning: '' },\n { judgeName: judgeJ, dimension: dim, score: scoreB, reasoning: '' },\n ] as const,\n )\n const k = interRaterReliability(\n judgeScores[0]!.map((_, k2) => judgeScores.map((pair) => pair[k2]!)),\n )\n pairs.push({\n judgeA: judgeI,\n judgeB: judgeJ,\n dimension: dim,\n commonItems: common.length,\n pearson: pearsonR(\n common.map((c) => c[0]),\n common.map((c) => c[1]),\n ),\n krippendorff: k,\n })\n }\n }\n }\n\n return {\n pairs: pairs.sort((a, b) => b.commonItems - a.commonItems),\n dimensions: [...byDimension.keys()].sort(),\n judgeIds,\n }\n}\n","/**\n * Tool-use metrics — derived purely from trace data.\n *\n * No scoring assumptions: consumers supply optional ground-truth tool\n * selections per turn + optional \"information used downstream\" signals.\n * Without those, we still compute descriptive metrics (error rate,\n * retry rate, duplicate-call rate) that are useful on their own.\n */\n\nimport { argHash, groupBy, hasCapturedToolArgs, toolSpans } from './trace/query'\nimport type { Span } from './trace/schema'\nimport type { TraceStore } from './trace/store'\n\nexport interface ToolUseMetrics {\n runId: string\n totalCalls: number\n /** Calls whose arguments were captured and can be compared for duplication. */\n callsWithCapturedArgs: number\n byTool: Record<string, ToolStats>\n errorRate: number\n /** Ratio of captured-argument calls already seen with the same tool name and arguments. */\n duplicateRate: number\n /** Ratio of error calls followed by ≥1 retry on same tool. */\n retryRate: number\n /** Optional: of the calls agent made, fraction the evaluator marked as \"correct selection\". */\n selectionAccuracy?: number\n}\n\nexport interface ToolStats {\n calls: number\n callsWithCapturedArgs: number\n errors: number\n avgLatencyMs: number\n duplicates: number\n}\n\nexport interface ToolUseOptions {\n /** Map of spanId → whether the evaluator judged the tool selection correct. Optional. */\n selectionLabels?: Record<string, boolean>\n}\n\nexport async function computeToolUseMetrics(\n store: TraceStore,\n runId: string,\n options: ToolUseOptions = {},\n): Promise<ToolUseMetrics> {\n const tools = await toolSpans(store, runId)\n if (tools.length === 0) {\n return {\n runId,\n totalCalls: 0,\n callsWithCapturedArgs: 0,\n byTool: {},\n errorRate: 0,\n duplicateRate: 0,\n retryRate: 0,\n }\n }\n\n const byTool: Record<string, ToolStats> = {}\n let totalErrors = 0\n let totalDuplicates = 0\n let callsWithCapturedArgs = 0\n const sortedTools = [...tools].sort((a, b) => a.startedAt - b.startedAt)\n const seenSignatures = new Set<string>()\n\n // duplicate detection + per-tool aggregation\n for (const t of sortedTools) {\n byTool[t.toolName] ??= {\n calls: 0,\n callsWithCapturedArgs: 0,\n errors: 0,\n avgLatencyMs: 0,\n duplicates: 0,\n }\n const stat = byTool[t.toolName]!\n stat.calls += 1\n if (t.status === 'error') {\n stat.errors += 1\n totalErrors += 1\n }\n if (typeof t.latencyMs === 'number') stat.avgLatencyMs += t.latencyMs\n if (hasCapturedToolArgs(t)) {\n callsWithCapturedArgs += 1\n stat.callsWithCapturedArgs += 1\n const sig = `${t.toolName}|${argHash(t.args)}`\n if (seenSignatures.has(sig)) {\n stat.duplicates += 1\n totalDuplicates += 1\n }\n seenSignatures.add(sig)\n }\n }\n\n for (const stat of Object.values(byTool)) {\n stat.avgLatencyMs = stat.calls > 0 ? stat.avgLatencyMs / stat.calls : 0\n }\n\n // retry detection: per-tool chronological adjacency where error → next same-tool call\n let retryOpportunities = 0\n let retriesFollowed = 0\n for (const [, arr] of groupBy(sortedTools, (t) => t.toolName)) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]!.status !== 'error') continue\n retryOpportunities += 1\n if (arr[i + 1]) retriesFollowed += 1\n }\n }\n const retryRate = retryOpportunities > 0 ? retriesFollowed / retryOpportunities : 0\n\n let selectionAccuracy: number | undefined\n if (options.selectionLabels) {\n const labeled = sortedTools.filter((t) => t.spanId in options.selectionLabels!)\n if (labeled.length > 0) {\n selectionAccuracy =\n labeled.filter((t) => options.selectionLabels![t.spanId]).length / labeled.length\n }\n }\n\n return {\n runId,\n totalCalls: sortedTools.length,\n callsWithCapturedArgs,\n byTool,\n errorRate: totalErrors / sortedTools.length,\n duplicateRate: callsWithCapturedArgs > 0 ? totalDuplicates / callsWithCapturedArgs : 0,\n retryRate,\n selectionAccuracy,\n }\n}\n\nexport type { Span }\n","/**\n * ToolWasteView — fraction of tool calls whose results weren't used\n * downstream. Without a \"used\" signal we fall back to structural\n * proxies: error calls, duplicate calls, and tool calls followed by\n * zero subsequent LLM spans are all considered waste.\n *\n * Consumers can pass a `usageOracle` that inspects a tool span and\n * returns true iff the tool's result appears in a later LLM message,\n * artifact, or state mutation — that's the canonical definition; the\n * default heuristic is a reasonable fallback.\n */\n\nimport { computeToolUseMetrics } from '../tool-use-metrics'\nimport { llmSpans, toolSpans } from '../trace/query'\nimport type { LlmSpan, ToolSpan } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface ToolWasteFinding {\n runId: string\n wastedCalls: number\n totalCalls: number\n wasteRate: number\n}\n\nexport interface ToolWasteReport {\n byRun: ToolWasteFinding[]\n overallWasteRate: number\n}\n\nexport interface ToolWasteOptions {\n runId?: string\n usageOracle?: (tool: ToolSpan, later: { llm: Awaited<ReturnType<typeof llmSpans>> }) => boolean\n}\n\nexport async function toolWasteView(\n store: TraceStore,\n options: ToolWasteOptions = {},\n): Promise<ToolWasteReport> {\n const runs = options.runId ? [options.runId] : (await store.listRuns()).map((r) => r.runId)\n\n const byRun: ToolWasteFinding[] = []\n let totalCalls = 0\n let totalWasted = 0\n for (const runId of runs) {\n const tools = await toolSpans(store, runId)\n if (tools.length === 0) {\n byRun.push({ runId, wastedCalls: 0, totalCalls: 0, wasteRate: 0 })\n continue\n }\n const llms = await llmSpans(store, runId)\n // Sort LLM spans once by start time, then build a suffix index of the\n // concatenated message text. `suffixText[i]` is the haystack of every\n // string message content in spans[i..]. Per tool we binary-search the\n // first span started strictly after the tool, then test that one suffix\n // — turning the per-tool O(llms × messages × content) scan into a single\n // O(log llms) lookup over precomputed text.\n const sortedLlm = [...llms].sort((a, b) => a.startedAt - b.startedAt)\n const startTimes = sortedLlm.map((l) => l.startedAt)\n const suffixText = buildSuffixText(sortedLlm)\n let wasted = 0\n for (const t of tools) {\n if (t.status === 'error') {\n wasted++\n continue\n }\n // First LLM span started strictly after this tool (upper-bound search).\n const cutoff = upperBound(startTimes, t.startedAt)\n if (options.usageOracle) {\n if (!options.usageOracle(t, { llm: sortedLlm.slice(cutoff) })) wasted++\n } else {\n // Default heuristic: a tool whose result is NOT mentioned in any\n // later LLM input message is likely wasted. An empty/null result has\n // no payload to propagate downstream — there is nothing to find in a\n // later message, so it is not evidence of waste; skip it.\n const resultStr = stringify(t.result)\n if (resultStr === '') continue\n const haystack = suffixText[cutoff] ?? ''\n const used = haystack.includes(resultStr.slice(0, 120))\n if (!used) wasted++\n }\n }\n const wasteRate = wasted / tools.length\n byRun.push({ runId, wastedCalls: wasted, totalCalls: tools.length, wasteRate })\n totalCalls += tools.length\n totalWasted += wasted\n }\n return { byRun, overallWasteRate: totalCalls > 0 ? totalWasted / totalCalls : 0 }\n}\n\n/**\n * Build per-position suffix haystacks: result[i] is the concatenation of every\n * string message content in spans[i..end]. Built back-to-front so each entry\n * reuses the next one — O(total message text) rather than O(spans²).\n */\nfunction buildSuffixText(spans: LlmSpan[]): string[] {\n const result = new Array<string>(spans.length + 1)\n result[spans.length] = ''\n for (let i = spans.length - 1; i >= 0; i--) {\n const own = spans[i]!.messages.map((m) =>\n typeof m.content === 'string' ? m.content : '',\n ).join('\\n')\n result[i] = `${own}\\n${result[i + 1]}`\n }\n return result\n}\n\n/** Index of the first element strictly greater than `target` in a sorted array. */\nfunction upperBound(sorted: number[], target: number): number {\n let lo = 0\n let hi = sorted.length\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (sorted[mid]! <= target) lo = mid + 1\n else hi = mid\n }\n return lo\n}\n\nfunction stringify(v: unknown): string {\n if (v === null || v === undefined) return ''\n if (typeof v === 'string') return v\n try {\n return JSON.stringify(v)\n } catch {\n return String(v)\n }\n}\n\n// Re-export for convenience in consumers that want both descriptive and usage metrics.\nexport { computeToolUseMetrics }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAAsB,aAAqC;CACzE,IAAI,YAAY,SAAS,GAAG,OAAO;CAGnC,MAAM,+BAAe,IAAI,IAAwB;CACjD,KAAK,IAAI,aAAa,GAAG,aAAa,YAAY,QAAQ,cACxD,KAAK,MAAM,KAAK,YAAY,aAAc;EACxC,IAAI,UAAU,aAAa,IAAI,EAAE,SAAS;EAC1C,IAAI,YAAY,KAAA,GAAW;GACzB,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,OAAO,SAAS,CAAC,CAAa;GACzE,aAAa,IAAI,EAAE,WAAW,OAAO;EACvC;EACA,QAAQ,WAAW,CAAE,KAAK,EAAE,KAAK;CACnC;CAGF,MAAM,YAAsB,CAAC;CAC7B,MAAM,YAAsB,CAAC;CAE7B,KAAK,MAAM,CAAC,WAAW,YAAY,cAAc;EAC/C,MAAM,UAAU,QAAQ,QAAQ,WAAW,OAAO,SAAS,CAAC;EAC5D,IAAI,QAAQ,SAAS,GAAG;EACxB,MAAM,YAAY,QAAQ,EAAE,CAAE;EAC9B,IAAI,QAAQ,MAAM,WAAW,OAAO,WAAW,SAAS,GACtD,MAAM,IAAI,gBACR,qCAAqC,UAAU,yBAC1C,QAAQ,KAAK,WAAW,OAAO,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,kCACxD;EAEF,KAAK,IAAI,OAAO,GAAG,OAAO,WAAW,QAAQ;GAC3C,MAAM,UAAU,QAAQ,KAAK,WAAW,OAAO,KAAM;GACrD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AO,KAAK,UAAU,CAAC;CACzB,QAAQ;EACN,OAAO,OAAO,CAAC;CACjB;AACF"}
1
+ {"version":3,"file":"tool-waste-BYt5rdt8.js","names":["prev"],"sources":["../src/statistics/agreement-irr.ts","../src/pipelines/budget-breach.ts","../src/pipelines/failure-cluster.ts","../src/pipelines/judge-agreement.ts","../src/tool-use-metrics.ts","../src/pipelines/tool-waste.ts"],"sourcesContent":["import { ValidationError } from '../errors'\nimport {\n type ContinuousAgreement,\n type ContinuousAgreementOptions,\n continuousAgreement,\n} from '../judge-calibration'\nimport type { JudgeScore } from '../types'\n\n/**\n * Inter-rater reliability — Krippendorff's α under the squared-difference\n * metric, pooled across dimensions.\n *\n * Each inner array is one judge's scores. Items are matched by position\n * WITHIN a dimension: the k-th score a judge supplies carrying dimension\n * `d` is item k of `d`, and the ratings compared against each other are\n * the ones different judges gave to the same item. Every judge that scores\n * a dimension at all must supply the same number of scores for it —\n * ragged input cannot be aligned into items and throws rather than\n * comparing mismatched items.\n *\n * α = 1 − D_observed / D_expected: D_observed averages the squared\n * difference over within-item judge pairs, D_expected over every pair of\n * ratings irrespective of item. α = 1 is perfect agreement, 0 is chance,\n * negative is systematic disagreement.\n */\nexport function interRaterReliability(judgeScores: JudgeScore[][]): number {\n if (judgeScores.length < 2) return 1\n\n // dimension → one score sequence per judge, in that judge's supplied order.\n const perDimension = new Map<string, number[][]>()\n for (let judgeIndex = 0; judgeIndex < judgeScores.length; judgeIndex++) {\n for (const s of judgeScores[judgeIndex]!) {\n let byJudge = perDimension.get(s.dimension)\n if (byJudge === undefined) {\n byJudge = Array.from({ length: judgeScores.length }, () => [] as number[])\n perDimension.set(s.dimension, byJudge)\n }\n byJudge[judgeIndex]!.push(s.score)\n }\n }\n\n const allValues: number[] = []\n const pairDiffs: number[] = []\n\n for (const [dimension, byJudge] of perDimension) {\n const scoring = byJudge.filter((scores) => scores.length > 0)\n if (scoring.length < 2) continue\n const itemCount = scoring[0]!.length\n if (scoring.some((scores) => scores.length !== itemCount)) {\n throw new ValidationError(\n `interRaterReliability: dimension '${dimension}' has judges supplying ` +\n `${scoring.map((scores) => scores.length).join('/')} scores — items cannot be aligned`,\n )\n }\n for (let item = 0; item < itemCount; item++) {\n const ratings = scoring.map((scores) => scores[item]!)\n for (const v of ratings) allValues.push(v)\n for (let i = 0; i < ratings.length; i++) {\n for (let j = i + 1; j < ratings.length; j++) {\n pairDiffs.push((ratings[i]! - ratings[j]!) ** 2)\n }\n }\n }\n }\n\n if (pairDiffs.length === 0 || allValues.length < 2) return 1\n\n const observedDisagreement = pairDiffs.reduce((a, b) => a + b, 0) / pairDiffs.length\n\n // Expected disagreement from all possible pairings of values\n let expectedDisagreement = 0\n let expectedCount = 0\n for (let i = 0; i < allValues.length; i++) {\n for (let j = i + 1; j < allValues.length; j++) {\n expectedDisagreement += (allValues[i]! - allValues[j]!) ** 2\n expectedCount++\n }\n }\n expectedDisagreement = expectedCount > 0 ? expectedDisagreement / expectedCount : 0\n\n if (expectedDisagreement === 0) return 1\n return 1 - observedDisagreement / expectedDisagreement\n}\n\n// ── Corpus-wide inter-rater agreement ──────────────────────────────\n//\n// `interRaterReliability(judgeScores)` computes a within-item\n// Krippendorff α — multiple judges score *the same item* and we ask\n// \"how much do their scores agree on that item?\" Useful for a single\n// scenario, but it cannot answer \"how reliable are these judges across\n// the whole evaluation corpus?\"\n//\n// `corpusInterRaterAgreement` does the corpus-wide question properly.\n// Inputs are flat per-(item, judge, dimension) score records. For each\n// dimension we pivot to a complete [n_items × n_judges] matrix and feed\n// it to the ICC(2,1) + κ_w machinery already validated in\n// `judge-calibration.ts`. An overall pooled metric averages the\n// per-dimension ICC/κ across dimensions.\n\nexport interface CorpusScoreRecord {\n /** Stable identifier for the rated item (scenario, span, turn, …). */\n itemId: string\n /** Identifier for the judge that produced this score. */\n judgeName: string\n /** Dimension name (matches `JudgeScore.dimension`). */\n dimension: string\n /** Numeric score; must be finite. */\n score: number\n}\n\nexport interface CorpusAgreementPerDimension extends ContinuousAgreement {\n dimension: string\n /** Item IDs that contributed to this dimension's matrix (every judge scored them). */\n itemIds: string[]\n /** Judge IDs that contributed to this dimension's matrix. */\n judgeIds: string[]\n}\n\nexport interface CorpusAgreementReport {\n /** Per-dimension ICC(2,1) + κ_w + Pearson + Spearman + bootstrap CIs. */\n perDimension: CorpusAgreementPerDimension[]\n /** Mean ICC across dimensions (NaN if no dimension yielded a finite ICC). */\n overallIcc: number\n /** Mean weighted κ across dimensions (NaN if none finite). */\n overallWeightedKappa: number\n /** Dimensions evaluated (sorted). */\n dimensions: string[]\n /** Judges seen across the corpus (sorted). */\n judgeIds: string[]\n}\n\nexport interface CorpusAgreementOptions extends ContinuousAgreementOptions {\n /**\n * Restrict the audit to these dimensions. Default = every dimension\n * that appears in the input. A dimension named here but absent from\n * the input throws — silent omission would corrupt the overall metric.\n */\n dimensions?: string[]\n /**\n * Restrict the audit to these judges. Default = every judge that\n * appears in the input. A judge named here but absent from a\n * dimension throws (see \"fail loud\" below).\n */\n judges?: string[]\n}\n\n/**\n * Corpus-wide inter-rater agreement across N items × M judges × D dimensions.\n *\n * For each dimension, builds the [n_items][n_judges] matrix of scores\n * (keeping only items every judge rated on that dimension), then runs\n * `continuousAgreement` to get ICC(2,1), κ_w, Pearson, Spearman, and\n * bootstrap CIs. Reports a pooled mean across dimensions as a single\n * \"is this judge panel reliable on this corpus?\" number.\n *\n * Fail-loud contract:\n * - Empty input throws.\n * - Fewer than 2 judges or fewer than 2 items per dimension throws.\n * - A judge present in some dimensions but with zero scored items on\n * another dimension throws (would silently shrink the matrix).\n * - Duplicate (itemId, judgeName, dimension) records throw.\n */\nexport function corpusInterRaterAgreement(\n records: CorpusScoreRecord[],\n opts: CorpusAgreementOptions = {},\n): CorpusAgreementReport {\n if (records.length === 0) {\n throw new ValidationError('corpusInterRaterAgreement: no score records supplied')\n }\n\n const judgesSeen = new Set<string>()\n const dimsSeen = new Set<string>()\n // dimension → judge → itemId → score\n const grid = new Map<string, Map<string, Map<string, number>>>()\n\n for (const r of records) {\n if (!Number.isFinite(r.score)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: non-finite score for (item=${r.itemId}, judge=${r.judgeName}, dim=${r.dimension})`,\n )\n }\n judgesSeen.add(r.judgeName)\n dimsSeen.add(r.dimension)\n const byJudge = grid.get(r.dimension) ?? new Map<string, Map<string, number>>()\n const byItem = byJudge.get(r.judgeName) ?? new Map<string, number>()\n if (byItem.has(r.itemId)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: duplicate record for (item=${r.itemId}, judge=${r.judgeName}, dim=${r.dimension})`,\n )\n }\n byItem.set(r.itemId, r.score)\n byJudge.set(r.judgeName, byItem)\n grid.set(r.dimension, byJudge)\n }\n\n const targetDims = opts.dimensions ?? [...dimsSeen].sort()\n for (const d of targetDims) {\n if (!dimsSeen.has(d)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: dimension '${d}' was requested but no records carry it`,\n )\n }\n }\n const targetJudges = opts.judges ? [...opts.judges] : [...judgesSeen].sort()\n for (const j of targetJudges) {\n if (!judgesSeen.has(j)) {\n throw new ValidationError(\n `corpusInterRaterAgreement: judge '${j}' was requested but produced no records`,\n )\n }\n }\n if (targetJudges.length < 2) {\n throw new ValidationError(\n `corpusInterRaterAgreement: need ≥2 judges, got ${targetJudges.length}`,\n )\n }\n\n const perDimension: CorpusAgreementPerDimension[] = []\n const iccs: number[] = []\n const kappas: number[] = []\n\n for (const dim of targetDims) {\n const byJudge = grid.get(dim)!\n // Fail loud: every requested judge must have scored ≥1 item on this dim.\n const judgeItemCounts: Record<string, number> = {}\n for (const j of targetJudges) {\n const m = byJudge.get(j)\n judgeItemCounts[j] = m?.size ?? 0\n }\n const emptyJudges = targetJudges.filter((j) => judgeItemCounts[j] === 0)\n if (emptyJudges.length > 0) {\n throw new ValidationError(\n `corpusInterRaterAgreement: dimension '${dim}' has no scores from judge(s) ${emptyJudges.join(', ')} (counts: ${JSON.stringify(judgeItemCounts)})`,\n )\n }\n\n // Items rated by *every* requested judge on this dim.\n let commonItems: Set<string> | null = null\n for (const j of targetJudges) {\n const ids = new Set(byJudge.get(j)!.keys())\n if (commonItems === null) {\n commonItems = ids\n } else {\n const prev: Set<string> = commonItems\n commonItems = new Set([...prev].filter((x) => ids.has(x)))\n }\n }\n const sortedItems = [...(commonItems ?? new Set<string>())].sort()\n if (sortedItems.length < 2) {\n throw new ValidationError(\n `corpusInterRaterAgreement: dimension '${dim}' has ${sortedItems.length} item(s) rated by all ${targetJudges.length} judges (need ≥2)`,\n )\n }\n\n const matrix: number[][] = sortedItems.map((itemId) =>\n targetJudges.map((j) => byJudge.get(j)!.get(itemId)!),\n )\n const agreement = continuousAgreement(matrix, opts)\n perDimension.push({\n ...agreement,\n dimension: dim,\n itemIds: sortedItems,\n judgeIds: [...targetJudges],\n })\n if (Number.isFinite(agreement.icc)) iccs.push(agreement.icc)\n if (Number.isFinite(agreement.weightedKappa)) kappas.push(agreement.weightedKappa)\n }\n\n const mean = (xs: number[]) =>\n xs.length === 0 ? Number.NaN : xs.reduce((a, b) => a + b, 0) / xs.length\n return {\n perDimension,\n overallIcc: mean(iccs),\n overallWeightedKappa: mean(kappas),\n dimensions: targetDims,\n judgeIds: targetJudges,\n }\n}\n\n/**\n * Convenience adapter for `JudgeScore[]` data keyed externally by item.\n *\n * Use when you have per-item arrays of `JudgeScore[]` (e.g. one\n * `ScenarioResult.judgeScores` per scenario) and want corpus-wide\n * agreement without manually flattening. `itemId` must be unique per\n * row of `itemsScores`.\n */\nexport function corpusInterRaterAgreementFromJudgeScores(\n itemsScores: Array<{ itemId: string; scores: JudgeScore[] }>,\n opts: CorpusAgreementOptions = {},\n): CorpusAgreementReport {\n const records: CorpusScoreRecord[] = []\n const seen = new Set<string>()\n for (const { itemId, scores } of itemsScores) {\n if (seen.has(itemId)) {\n throw new ValidationError(\n `corpusInterRaterAgreementFromJudgeScores: duplicate itemId '${itemId}'`,\n )\n }\n seen.add(itemId)\n for (const s of scores) {\n records.push({\n itemId,\n judgeName: s.judgeName,\n dimension: s.dimension,\n score: s.score,\n })\n }\n }\n return corpusInterRaterAgreement(records, opts)\n}\n","/**\n * BudgetBreachView — aggregates breach events across the corpus.\n *\n * Answers: which dimensions get hit most often? Which scenarios are\n * underbudgeted? Which variants trigger the most breaches?\n */\n\nimport type { BudgetSpec } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface BudgetBreachFinding {\n runId: string\n scenarioId: string\n variantId?: string\n dimension: keyof BudgetSpec\n limit: number\n consumed: number\n excessRatio: number\n timestamp: number\n}\n\nexport interface BudgetBreachReport {\n findings: BudgetBreachFinding[]\n byDimension: Record<string, number>\n byScenario: Record<string, number>\n byVariant: Record<string, number>\n totalRuns: number\n breachedRunRatio: number\n}\n\nexport async function budgetBreachView(\n store: TraceStore,\n options: { scenarioId?: string; variantId?: string } = {},\n): Promise<BudgetBreachReport> {\n const runs = await store.listRuns({\n scenarioId: options.scenarioId,\n variantId: options.variantId,\n })\n const findings: BudgetBreachFinding[] = []\n const byDimension: Record<string, number> = {}\n const byScenario: Record<string, number> = {}\n const byVariant: Record<string, number> = {}\n\n for (const run of runs) {\n const entries = await store.budget(run.runId)\n for (const e of entries) {\n if (!e.breached) continue\n const excessRatio = e.limit > 0 ? e.consumed / e.limit : Infinity\n findings.push({\n runId: run.runId,\n scenarioId: run.scenarioId,\n variantId: run.variantId,\n dimension: e.dimension,\n limit: e.limit,\n consumed: e.consumed,\n excessRatio,\n timestamp: e.timestamp,\n })\n byDimension[e.dimension] = (byDimension[e.dimension] ?? 0) + 1\n byScenario[run.scenarioId] = (byScenario[run.scenarioId] ?? 0) + 1\n if (run.variantId) byVariant[run.variantId] = (byVariant[run.variantId] ?? 0) + 1\n }\n }\n\n const breachedRuns = new Set(findings.map((f) => f.runId))\n return {\n findings,\n byDimension,\n byScenario,\n byVariant,\n totalRuns: runs.length,\n breachedRunRatio: runs.length > 0 ? breachedRuns.size / runs.length : 0,\n }\n}\n","/**\n * FailureClusterView — groups failed runs by (failureClass, triggerTool,\n * argHash-prefix) so weekly reviews can prioritize the top-N clusters.\n *\n * Each cluster includes: N runs, scenarios affected, representative\n * error message, a proposed mitigation hint (rule → action table).\n */\n\nimport { classifyFailure, DEFAULT_RULES, type FailureRule } from '../failure-taxonomy'\nimport { argHash, hasCapturedToolArgs, toolSpans } from '../trace/query'\nimport type { FailureClass, Span } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface FailureCluster {\n failureClass: FailureClass\n /** Tool name when the trigger was a tool span, else undefined. */\n toolName?: string\n /** First 16 chars of argHash — clusters similar args. */\n argPrefix?: string\n /**\n * Source dimension when the trigger was a judge span (e.g. `'format'`,\n * `'safety'`, `'correctness'`). Lets cross-template aggregators\n * group failures by the dimension that fired without overloading\n * `argPrefix`. Optional — clusters without this field deserialize cleanly.\n */\n dimension?: string\n runCount: number\n scenarioIds: string[]\n exampleError?: string\n exampleRunId: string\n}\n\nexport interface FailureClusterReport {\n clusters: FailureCluster[]\n totalFailures: number\n totalRuns: number\n}\n\nexport async function failureClusterView(\n store: TraceStore,\n options: { rules?: FailureRule[]; minClusterSize?: number } = {},\n): Promise<FailureClusterReport> {\n const rules = options.rules ?? DEFAULT_RULES\n const minSize = options.minClusterSize ?? 1\n const runs = await store.listRuns()\n\n type Key = string\n const clusters = new Map<Key, FailureCluster>()\n let totalFailures = 0\n\n for (const run of runs) {\n if (run.status === 'completed' && run.outcome?.pass !== false) continue\n totalFailures++\n const spans = await store.spans({ runId: run.runId })\n const events = await store.events({ runId: run.runId })\n const cls = classifyFailure({ run, spans, events }, rules)\n\n let toolName: string | undefined\n let argPrefix: string | undefined\n let dimension: string | undefined\n if (cls.triggerSpanId) {\n const trig = spans.find((s) => s.spanId === cls.triggerSpanId)\n if (trig?.kind === 'tool') {\n toolName = trig.toolName\n if (hasCapturedToolArgs(trig)) argPrefix = argHash(trig.args).slice(0, 16)\n } else if (trig?.kind === 'judge') {\n dimension = trig.dimension\n }\n }\n // Fallback: look at the last errored tool span\n if (!toolName) {\n const ts = await toolSpans(store, run.runId)\n const errored = ts.filter((t) => t.status === 'error').pop()\n if (errored) {\n toolName = errored.toolName\n if (hasCapturedToolArgs(errored)) argPrefix = argHash(errored.args).slice(0, 16)\n }\n }\n // Secondary signal: any judge span on the failed run carries a\n // dimension. Useful when the rule classified by judge score but\n // didn't surface the trigger span (or surfaced a non-judge span).\n if (!dimension) {\n const judge = spans.find((s) => s.kind === 'judge' && typeof s.dimension === 'string')\n if (judge?.kind === 'judge') dimension = judge.dimension\n }\n\n const key = `${cls.failureClass}|${toolName ?? ''}|${argPrefix ?? ''}|${dimension ?? ''}`\n let cluster = clusters.get(key)\n if (!cluster) {\n cluster = {\n failureClass: cls.failureClass,\n toolName,\n argPrefix,\n dimension,\n runCount: 0,\n scenarioIds: [],\n exampleRunId: run.runId,\n exampleError: firstErrorMessage(spans) ?? cls.reason,\n }\n clusters.set(key, cluster)\n }\n cluster.runCount++\n if (!cluster.scenarioIds.includes(run.scenarioId)) cluster.scenarioIds.push(run.scenarioId)\n }\n\n const arr = [...clusters.values()]\n .filter((c) => c.runCount >= minSize)\n .sort((a, b) => b.runCount - a.runCount)\n\n return { clusters: arr, totalFailures, totalRuns: runs.length }\n}\n\nfunction firstErrorMessage(spans: Span[]): string | undefined {\n const errored = spans.find((s) => s.status === 'error')\n return errored?.error\n}\n","/**\n * JudgeAgreementView — pairwise agreement between judges across the\n * corpus, grouped by dimension.\n *\n * Output drives two workflows:\n * - Judge robustness audit: \"does Claude agree with GPT at κ ≥ 0.6?\"\n * - Calibration tracking: κ vs golden human labels over time (by\n * providing a `humanGoldenJudgeId`).\n */\n\nimport { interRaterReliability, pearsonR } from '../statistics'\nimport type { JudgeSpan } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface JudgePair {\n judgeA: string\n judgeB: string\n dimension: string\n /** Number of (targetSpanId, dimension) tuples both judges scored. */\n commonItems: number\n pearson: number\n krippendorff: number\n}\n\nexport interface JudgeAgreementReport {\n pairs: JudgePair[]\n dimensions: string[]\n judgeIds: string[]\n}\n\nexport async function judgeAgreementView(store: TraceStore): Promise<JudgeAgreementReport> {\n const all = (await store.spans({ kind: 'judge' })).filter(\n (s): s is JudgeSpan => s.kind === 'judge',\n )\n if (all.length === 0) return { pairs: [], dimensions: [], judgeIds: [] }\n\n const byDimension = new Map<string, JudgeSpan[]>()\n for (const s of all) {\n const arr = byDimension.get(s.dimension) ?? []\n arr.push(s)\n byDimension.set(s.dimension, arr)\n }\n\n const judgeIds = [...new Set(all.map((s) => s.judgeId))].sort()\n const pairs: JudgePair[] = []\n for (const [dim, spans] of byDimension) {\n const byJudge = new Map<string, Map<string, number>>()\n for (const s of spans) {\n const m = byJudge.get(s.judgeId) ?? new Map<string, number>()\n m.set(s.targetSpanId, s.score)\n byJudge.set(s.judgeId, m)\n }\n const judgesHere = [...byJudge.keys()]\n for (let i = 0; i < judgesHere.length; i++) {\n for (let j = i + 1; j < judgesHere.length; j++) {\n const judgeI = judgesHere[i]!\n const judgeJ = judgesHere[j]!\n const a = byJudge.get(judgeI)!\n const b = byJudge.get(judgeJ)!\n const common: Array<[number, number]> = []\n for (const [target, scoreA] of a) {\n const scoreB = b.get(target)\n if (scoreB !== undefined) common.push([scoreA, scoreB])\n }\n if (common.length < 2) continue\n const judgeScores = common.map(\n ([scoreA, scoreB]) =>\n [\n { judgeName: judgeI, dimension: dim, score: scoreA, reasoning: '' },\n { judgeName: judgeJ, dimension: dim, score: scoreB, reasoning: '' },\n ] as const,\n )\n const k = interRaterReliability(\n judgeScores[0]!.map((_, k2) => judgeScores.map((pair) => pair[k2]!)),\n )\n pairs.push({\n judgeA: judgeI,\n judgeB: judgeJ,\n dimension: dim,\n commonItems: common.length,\n pearson: pearsonR(\n common.map((c) => c[0]),\n common.map((c) => c[1]),\n ),\n krippendorff: k,\n })\n }\n }\n }\n\n return {\n pairs: pairs.sort((a, b) => b.commonItems - a.commonItems),\n dimensions: [...byDimension.keys()].sort(),\n judgeIds,\n }\n}\n","/**\n * Tool-use metrics — derived purely from trace data.\n *\n * No scoring assumptions: consumers supply optional ground-truth tool\n * selections per turn + optional \"information used downstream\" signals.\n * Without those, we still compute descriptive metrics (error rate,\n * retry rate, duplicate-call rate) that are useful on their own.\n */\n\nimport { argHash, groupBy, hasCapturedToolArgs, toolSpans } from './trace/query'\nimport type { Span } from './trace/schema'\nimport type { TraceStore } from './trace/store'\n\nexport interface ToolUseMetrics {\n runId: string\n totalCalls: number\n /** Calls whose arguments were captured and can be compared for duplication. */\n callsWithCapturedArgs: number\n byTool: Record<string, ToolStats>\n errorRate: number\n /** Ratio of captured-argument calls already seen with the same tool name and arguments. */\n duplicateRate: number\n /** Ratio of error calls followed by ≥1 retry on same tool. */\n retryRate: number\n /** Optional: of the calls agent made, fraction the evaluator marked as \"correct selection\". */\n selectionAccuracy?: number\n}\n\nexport interface ToolStats {\n calls: number\n callsWithCapturedArgs: number\n errors: number\n avgLatencyMs: number\n duplicates: number\n}\n\nexport interface ToolUseOptions {\n /** Map of spanId → whether the evaluator judged the tool selection correct. Optional. */\n selectionLabels?: Record<string, boolean>\n}\n\nexport async function computeToolUseMetrics(\n store: TraceStore,\n runId: string,\n options: ToolUseOptions = {},\n): Promise<ToolUseMetrics> {\n const tools = await toolSpans(store, runId)\n if (tools.length === 0) {\n return {\n runId,\n totalCalls: 0,\n callsWithCapturedArgs: 0,\n byTool: {},\n errorRate: 0,\n duplicateRate: 0,\n retryRate: 0,\n }\n }\n\n const byTool: Record<string, ToolStats> = {}\n let totalErrors = 0\n let totalDuplicates = 0\n let callsWithCapturedArgs = 0\n const sortedTools = [...tools].sort((a, b) => a.startedAt - b.startedAt)\n const seenSignatures = new Set<string>()\n\n // duplicate detection + per-tool aggregation\n for (const t of sortedTools) {\n byTool[t.toolName] ??= {\n calls: 0,\n callsWithCapturedArgs: 0,\n errors: 0,\n avgLatencyMs: 0,\n duplicates: 0,\n }\n const stat = byTool[t.toolName]!\n stat.calls += 1\n if (t.status === 'error') {\n stat.errors += 1\n totalErrors += 1\n }\n if (typeof t.latencyMs === 'number') stat.avgLatencyMs += t.latencyMs\n if (hasCapturedToolArgs(t)) {\n callsWithCapturedArgs += 1\n stat.callsWithCapturedArgs += 1\n const sig = `${t.toolName}|${argHash(t.args)}`\n if (seenSignatures.has(sig)) {\n stat.duplicates += 1\n totalDuplicates += 1\n }\n seenSignatures.add(sig)\n }\n }\n\n for (const stat of Object.values(byTool)) {\n stat.avgLatencyMs = stat.calls > 0 ? stat.avgLatencyMs / stat.calls : 0\n }\n\n // retry detection: per-tool chronological adjacency where error → next same-tool call\n let retryOpportunities = 0\n let retriesFollowed = 0\n for (const [, arr] of groupBy(sortedTools, (t) => t.toolName)) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]!.status !== 'error') continue\n retryOpportunities += 1\n if (arr[i + 1]) retriesFollowed += 1\n }\n }\n const retryRate = retryOpportunities > 0 ? retriesFollowed / retryOpportunities : 0\n\n let selectionAccuracy: number | undefined\n if (options.selectionLabels) {\n const labeled = sortedTools.filter((t) => t.spanId in options.selectionLabels!)\n if (labeled.length > 0) {\n selectionAccuracy =\n labeled.filter((t) => options.selectionLabels![t.spanId]).length / labeled.length\n }\n }\n\n return {\n runId,\n totalCalls: sortedTools.length,\n callsWithCapturedArgs,\n byTool,\n errorRate: totalErrors / sortedTools.length,\n duplicateRate: callsWithCapturedArgs > 0 ? totalDuplicates / callsWithCapturedArgs : 0,\n retryRate,\n selectionAccuracy,\n }\n}\n\nexport type { Span }\n","/**\n * ToolWasteView — fraction of tool calls whose results weren't used\n * downstream. Without a \"used\" signal we fall back to structural\n * proxies: error calls, duplicate calls, and tool calls followed by\n * zero subsequent LLM spans are all considered waste.\n *\n * Consumers can pass a `usageOracle` that inspects a tool span and\n * returns true iff the tool's result appears in a later LLM message,\n * artifact, or state mutation — that's the canonical definition; the\n * default heuristic is a reasonable fallback.\n */\n\nimport { computeToolUseMetrics } from '../tool-use-metrics'\nimport { llmSpans, toolSpans } from '../trace/query'\nimport type { LlmSpan, ToolSpan } from '../trace/schema'\nimport type { TraceStore } from '../trace/store'\n\nexport interface ToolWasteFinding {\n runId: string\n wastedCalls: number\n totalCalls: number\n wasteRate: number\n}\n\nexport interface ToolWasteReport {\n byRun: ToolWasteFinding[]\n overallWasteRate: number\n}\n\nexport interface ToolWasteOptions {\n runId?: string\n usageOracle?: (tool: ToolSpan, later: { llm: Awaited<ReturnType<typeof llmSpans>> }) => boolean\n}\n\nexport async function toolWasteView(\n store: TraceStore,\n options: ToolWasteOptions = {},\n): Promise<ToolWasteReport> {\n const runs = options.runId ? [options.runId] : (await store.listRuns()).map((r) => r.runId)\n\n const byRun: ToolWasteFinding[] = []\n let totalCalls = 0\n let totalWasted = 0\n for (const runId of runs) {\n const tools = await toolSpans(store, runId)\n if (tools.length === 0) {\n byRun.push({ runId, wastedCalls: 0, totalCalls: 0, wasteRate: 0 })\n continue\n }\n const llms = await llmSpans(store, runId)\n // Sort LLM spans once by start time, then build a suffix index of the\n // concatenated message text. `suffixText[i]` is the haystack of every\n // string message content in spans[i..]. Per tool we binary-search the\n // first span started strictly after the tool, then test that one suffix\n // — turning the per-tool O(llms × messages × content) scan into a single\n // O(log llms) lookup over precomputed text.\n const sortedLlm = [...llms].sort((a, b) => a.startedAt - b.startedAt)\n const startTimes = sortedLlm.map((l) => l.startedAt)\n const suffixText = buildSuffixText(sortedLlm)\n let wasted = 0\n for (const t of tools) {\n if (t.status === 'error') {\n wasted++\n continue\n }\n // First LLM span started strictly after this tool (upper-bound search).\n const cutoff = upperBound(startTimes, t.startedAt)\n if (options.usageOracle) {\n if (!options.usageOracle(t, { llm: sortedLlm.slice(cutoff) })) wasted++\n } else {\n // Default heuristic: a tool whose result is NOT mentioned in any\n // later LLM input message is likely wasted. An empty/null result has\n // no payload to propagate downstream — there is nothing to find in a\n // later message, so it is not evidence of waste; skip it.\n const resultStr = stringify(t.result)\n if (resultStr === '') continue\n const haystack = suffixText[cutoff] ?? ''\n const used = haystack.includes(resultStr.slice(0, 120))\n if (!used) wasted++\n }\n }\n const wasteRate = wasted / tools.length\n byRun.push({ runId, wastedCalls: wasted, totalCalls: tools.length, wasteRate })\n totalCalls += tools.length\n totalWasted += wasted\n }\n return { byRun, overallWasteRate: totalCalls > 0 ? totalWasted / totalCalls : 0 }\n}\n\n/**\n * Build per-position suffix haystacks: result[i] is the concatenation of every\n * string message content in spans[i..end]. Built back-to-front so each entry\n * reuses the next one — O(total message text) rather than O(spans²).\n */\nfunction buildSuffixText(spans: LlmSpan[]): string[] {\n const result = new Array<string>(spans.length + 1)\n result[spans.length] = ''\n for (let i = spans.length - 1; i >= 0; i--) {\n const own = spans[i]!.messages.map((m) =>\n typeof m.content === 'string' ? m.content : '',\n ).join('\\n')\n result[i] = `${own}\\n${result[i + 1]}`\n }\n return result\n}\n\n/** Index of the first element strictly greater than `target` in a sorted array. */\nfunction upperBound(sorted: number[], target: number): number {\n let lo = 0\n let hi = sorted.length\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (sorted[mid]! <= target) lo = mid + 1\n else hi = mid\n }\n return lo\n}\n\nfunction stringify(v: unknown): string {\n if (v === null || v === undefined) return ''\n if (typeof v === 'string') return v\n try {\n return JSON.stringify(v)\n } catch {\n return String(v)\n }\n}\n\n// Re-export for convenience in consumers that want both descriptive and usage metrics.\nexport { computeToolUseMetrics }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAAsB,aAAqC;CACzE,IAAI,YAAY,SAAS,GAAG,OAAO;CAGnC,MAAM,+BAAe,IAAI,IAAwB;CACjD,KAAK,IAAI,aAAa,GAAG,aAAa,YAAY,QAAQ,cACxD,KAAK,MAAM,KAAK,YAAY,aAAc;EACxC,IAAI,UAAU,aAAa,IAAI,EAAE,SAAS;EAC1C,IAAI,YAAY,KAAA,GAAW;GACzB,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,OAAO,SAAS,CAAC,CAAa;GACzE,aAAa,IAAI,EAAE,WAAW,OAAO;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AAK,GAAG,KAAK;EAC1C,MAAM,MAAM,MAAM,EAAE,CAAE,SAAS,KAAK,MAClC,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU,EAC9C,CAAC,CAAC,KAAK,IAAI;EACX,OAAO,KAAK,GAAG,IAAI,IAAI,OAAO,IAAI;CACpC;CACA,OAAO;AACT;;AAGA,SAAS,WAAW,QAAkB,QAAwB;CAC5D,IAAI,KAAK;CACT,IAAI,KAAK,OAAO;CAChB,OAAO,KAAK,IAAI;EACd,MAAM,MAAO,KAAK,OAAQ;EAC1B,IAAI,OAAO,QAAS,QAAQ,KAAK,MAAM;OAClC,KAAK;CACZ;CACA,OAAO;AACT;AAEA,SAAS,UAAU,GAAoB;CACrC,IAAI,MAAM,QAAQ,MAAM,KAAA,GAAW,OAAO;CAC1C,IAAI,OAAO,MAAM,UAAU,OAAO;CAClC,IAAI;EACF,OAAO,KAAK,UAAU,CAAC;CACzB,QAAQ;EACN,OAAO,OAAO,CAAC;CACjB;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { C as ToolSpan, r as BudgetSpec } from "./schema-2g7trUwH.js";
2
2
  import { s as TraceStore } from "./store-C4avFjIi.js";
3
- import { l as llmSpans } from "./query-DBUQhehH.js";
3
+ import { c as llmSpans } from "./query-DK1nWcmp.js";
4
4
  //#region src/baseline.d.ts
5
5
  interface MetricVerdict {
6
6
  metric: string;
@@ -165,4 +165,4 @@ interface ToolWasteOptions {
165
165
  declare function toolWasteView(store: TraceStore, options?: ToolWasteOptions): Promise<ToolWasteReport>;
166
166
  //#endregion
167
167
  export { WelchTestResult as _, ToolStats as a, welchsTTest as b, computeToolUseMetrics as c, judgeAgreementView as d, BudgetBreachFinding as f, BaselineReport as g, BaselineOptions as h, toolWasteView as i, JudgeAgreementReport as l, budgetBreachView as m, ToolWasteOptions as n, ToolUseMetrics as o, BudgetBreachReport as p, ToolWasteReport as r, ToolUseOptions as s, ToolWasteFinding as t, JudgePair as u, WelchTestStatus as v, iqr as y };
168
- //# sourceMappingURL=tool-waste-DxlebQkx.d.ts.map
168
+ //# sourceMappingURL=tool-waste-Wi4g6Ekb.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-waste-DxlebQkx.d.ts","names":[],"sources":["../src/baseline.ts","../src/pipelines/budget-breach.ts","../src/pipelines/judge-agreement.ts","../src/tool-use-metrics.ts","../src/pipelines/tool-waste.ts"],"mappings":";;;;UA6BiB;EACf;EACA;EACA;EACA;;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EACA;;UAGe;EACf,SAAS;;EAET;;EAEA;;UAGe;;EAEf;;EAEA;;EAEA;;KAGU;;;;;;;;;UAUF;EACR;EACA;EACA;;KAGU,mBACP;EACC;EACA;EACA;EACA;EACA;EACA;EACA;MAED;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;;iBA6EU,IAAI;;;;;;;;;iBAcJ,YAAY,aAAa,cAAc;;;UCjLtC;EACf;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;;UAGe;EACf,UAAU;EACV,aAAa;EACb,YAAY;EACZ,WAAW;EACX;EACA;;iBAGoB,iBACpB,OAAO,YACP;EAAW;EAAqB;IAC/B,QAAQ;;;UCnBM;EACf;EACA;EACA;;EAEA;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;;iBAGoB,mBAAmB,OAAO,aAAa,QAAQ;;;UCjBpD;EACf;EACA;;EAEA;EACA,QAAQ,eAAe;EACvB;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;;EAEf,kBAAkB;;iBAGE,sBACpB,OAAO,YACP,eACA,UAAS,iBACR,QAAQ;;;UC5BM;EACf;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP;;UAGe;EACf;EACA,eAAe,MAAM,UAAU;IAAS,KAAK,QAAQ,kBAAkB;;;iBAGnD,cACpB,OAAO,YACP,UAAS,mBACR,QAAQ"}
1
+ {"version":3,"file":"tool-waste-Wi4g6Ekb.d.ts","names":[],"sources":["../src/baseline.ts","../src/pipelines/budget-breach.ts","../src/pipelines/judge-agreement.ts","../src/tool-use-metrics.ts","../src/pipelines/tool-waste.ts"],"mappings":";;;;UA6BiB;EACf;EACA;EACA;EACA;;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EACA;;UAGe;EACf,SAAS;;EAET;;EAEA;;UAGe;;EAEf;;EAEA;;EAEA;;KAGU;;;;;;;;;UAUF;EACR;EACA;EACA;;KAGU,mBACP;EACC;EACA;EACA;EACA;EACA;EACA;EACA;MAED;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;;iBA6EU,IAAI;;;;;;;;;iBAcJ,YAAY,aAAa,cAAc;;;UCjLtC;EACf;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;;UAGe;EACf,UAAU;EACV,aAAa;EACb,YAAY;EACZ,WAAW;EACX;EACA;;iBAGoB,iBACpB,OAAO,YACP;EAAW;EAAqB;IAC/B,QAAQ;;;UCnBM;EACf;EACA;EACA;;EAEA;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;;iBAGoB,mBAAmB,OAAO,aAAa,QAAQ;;;UCjBpD;EACf;EACA;;EAEA;EACA,QAAQ,eAAe;EACvB;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;;EAEf,kBAAkB;;iBAGE,sBACpB,OAAO,YACP,eACA,UAAS,iBACR,QAAQ;;;UC5BM;EACf;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP;;UAGe;EACf;EACA,eAAe,MAAM,UAAU;IAAS,KAAK,QAAQ,kBAAkB;;;iBAGnD,cACpB,OAAO,YACP,UAAS,mBACR,QAAQ"}
@@ -1,6 +1,6 @@
1
1
  import { c as CostLedgerHandle } from "./cost-ledger-DbQdN3nO.js";
2
- import { O as TraceAnalysisStore } from "./types-DAPpAkd4.js";
3
- import { a as TraceAnalystLimits, l as RawAnalystFinding, n as TraceAnalysisEngine } from "./engine-DProXJ7A.js";
2
+ import { O as TraceAnalysisStore } from "./types-KEkKkETv.js";
3
+ import { a as TraceAnalystLimits, l as RawAnalystFinding, n as TraceAnalysisEngine } from "./engine-D-YZ32ZJ.js";
4
4
  //#region src/analyst/trace-questions.d.ts
5
5
  /** One question to ask of the store. */
6
6
  interface TraceQuestionSpec {
@@ -65,4 +65,4 @@ declare function askTraceQuestions(opts: AskTraceQuestionsOptions): Promise<Trac
65
65
  declare function citedSpansOnly(store: TraceAnalysisStore, allowed: ReadonlyMap<string, ReadonlySet<string>>): TraceAnalysisStore;
66
66
  //#endregion
67
67
  export { askTraceQuestions as a, VerifiedTraceFinding as i, TraceQuestionOutcome as n, citedSpansOnly as o, TraceQuestionSpec as r, AskTraceQuestionsOptions as t };
68
- //# sourceMappingURL=trace-questions-dRvmsbTk.d.ts.map
68
+ //# sourceMappingURL=trace-questions-C26UvI3D.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace-questions-dRvmsbTk.d.ts","names":[],"sources":["../src/analyst/trace-questions.ts"],"mappings":";;;;;UA6BiB;;WAEN;WACA;;WAEA;;UAGM;WACN,oBAAoB;WACpB,OAAO;WACP,QAAQ;;WAER,YAAY;;WAEZ;;WAEA;;WAEA;;WAEA;;WAEA;WACA,SAAS,QAAQ;WACjB,SAAS;WACT,OAAO,iBAAiB,SAAS;;;UAI3B;WACN,SAAS;;WAET;;WAEA;;WAEA;;UAGM;WACN;WACA;WACA;WACA;;WAEA;WACA,mBAAmB;;WAEnB;WACA;;;;;;;iBAyBW,kBACpB,MAAM,2BACL,QAAQ;;;;;iBA2JK,eACd,OAAO,oBACP,SAAS,oBAAoB,uBAC5B"}
1
+ {"version":3,"file":"trace-questions-C26UvI3D.d.ts","names":[],"sources":["../src/analyst/trace-questions.ts"],"mappings":";;;;;UA6BiB;;WAEN;WACA;;WAEA;;UAGM;WACN,oBAAoB;WACpB,OAAO;WACP,QAAQ;;WAER,YAAY;;WAEZ;;WAEA;;WAEA;;WAEA;;WAEA;WACA,SAAS,QAAQ;WACjB,SAAS;WACT,OAAO,iBAAiB,SAAS;;;UAI3B;WACN,SAAS;;WAET;;WAEA;;WAEA;;UAGM;WACN;WACA;WACA;WACA;;WAEA;WACA,mBAAmB;;WAEnB;WACA;;;;;;;iBAyBW,kBACpB,MAAM,2BACL,QAAQ;;;;;iBA2JK,eACd,OAAO,oBACP,SAAS,oBAAoB,uBAC5B"}
@@ -1,8 +1,8 @@
1
1
  import { r as CaptureIntegrityError } from "../errors-DEE6u6ot.js";
2
2
  import { b as CustomTokenPricing, c as CostLedgerHandle, p as CostProvenance } from "../cost-ledger-DbQdN3nO.js";
3
- import { d as RunTokenUsage } from "../run-record-DF-fuu31.js";
3
+ import { d as RunTokenUsage } from "../run-record-p2AYTrCn.js";
4
4
  import { t as DefaultVerdict } from "../verdict-E4eRNf7-.js";
5
- import { a as TraceAnalystLimits, n as TraceAnalysisEngine } from "../engine-DProXJ7A.js";
5
+ import { a as TraceAnalystLimits, n as TraceAnalysisEngine } from "../engine-D-YZ32ZJ.js";
6
6
  import { t as PrimeBridgeTransport } from "../prime-bridge-transport-6feEglLf.js";
7
7
  import { a as RecordedTrajectoryStep, h as isRecordedTimeout } from "../steps-Bg5-KVx1.js";
8
8
  //#region src/trace-repair/mini-swe-scaffold.d.ts
@@ -93,13 +93,6 @@ interface InterventionBudget {
93
93
  }
94
94
  /** The scaffold's own per-action budget, pre-registered for the campaign. */
95
95
  export declare const SCAFFOLD_INTERVENTION_BUDGET: InterventionBudget;
96
- /**
97
- * Actions whose only effect is to consume a turn. They are rejected before a
98
- * container opens: an intervention that changes nothing is measurably
99
- * identical to the no-op control, and paying rollouts to rediscover that
100
- * wastes the corpus.
101
- */
102
- export declare const NO_OP_ACTIONS: readonly string[];
103
96
  /**
104
97
  * Split a shell script into top-level statements and count its heredocs.
105
98
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["RepairArm"],"sources":["../../src/trace-repair/mini-swe-scaffold.ts","../../src/trace-repair/action-budget.ts","../../src/trace-repair/continuation-records.ts","../../src/trace-repair/control-policy.ts","../../src/trace-repair/admission-records.ts","../../src/trace-repair/continuation-policy.ts","../../src/trace-repair/oracle-determinism.ts","../../src/trace-repair/admission.ts","../../src/trace-repair/admission-contract.ts","../../src/trace-repair/admission-report.ts","../../src/trace-repair/analyst-response.ts","../../src/trace-repair/blinding.ts","../../src/trace-repair/analyst-arm.ts","../../src/trace-repair/arm-completion.ts","../../src/trace-repair/arm-dspy.ts","../../src/trace-repair/degenerate-strategies.ts","../../src/trace-repair/ports.ts","../../src/trace-repair/funnel.ts","../../src/trace-repair/grade.ts","../../src/trace-repair/delta-repair.ts","../../src/trace-repair/docker-environment.ts","../../src/trace-repair/repair-prompt.ts","../../src/trace-repair/test-oracle.ts"],"mappings":";;;;;;;;;qBAyBa;;qBAGA;qBAKA;UAiBI;;EAEf;;;;;EAKA;;;wBAIc,sBAAsB,OAAO;KAiFjC;EACN;EAAgB;;EAChB;EAAsB;;;;;;;wBASZ,YAAY,2BAA2B;UAMtC;EACf;EACA;;EAEA;;;;;;;wBAQc,kBAAkB,QAAQ;;wBAsB1B,yBAAyB,iBAAiB;;wBAS1C,6BAA6B;;;;;;wBAyB7B,aAAa,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;KCxMzB;UAEK;;WAEN;;WAEA;;WAEA;;;qBAIE,8BAA8B;;;;;;;qBAY9B;;;;;;;;;;wBAgCG,gBAAgB;EAAmB;EAAsB;;;;wBA8QzD,sBAAsB,iBAAiB;;;KAM3C;UAQK;EACf;EACA;EACA;;EAEA,SAAS;;EAET,UAAU;;KAGA;WACG;WAA2B,aAAa;;WAExC;WACA,WAAW;WACX;WACA,aAAa;;;;;;;;;;;;;;;wBAqBZ,wBACd,gBACA,cAAc,mBACd,SAAQ,qBACP;;;;;;wBA8Da,6BAA6B;;;;KCtcjC;;UAGK;EACf;EACA;;;KAIU;UAOK;EACf;EACA;;EAEA;EACA;EACA;;UAGe;;EAEf;EACA;EACA;;EAEA,OAAO;;EAEP;EACA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d,qBAAqB,mBACrB,UAAS,qBACR;;;wBAwKa,wBAAwB,QAAQ;;;UCtO/B;EACf;;EAEA;;UAGe;;EAEf;EACA;;EAEA;;;KAIU,iBAAiB,SAAS,mBAAmB,QAAQ;;;;;;qBAOpD,mBAAmB;UAuDf;;EAEf;;EAEA;;EAEA,MAAM;;EAEN;;EAEA;EACA,YAAY;;EAEZ;;;;;;;;wBAqBc,cAAc;EAC5B;EACA;EACA;EACA;EACA;;wBAmBc,oCACd,SAAS,uCACR;;;qBCxIU;;;;;wBAOG,iBACd,SAAQ;;qBAkBG;;;qBAgBA;;wBASG,uBAAuB,QAAQ;wBAc/B,uBAAuB,QAAQ;;;wBAM/B,qBACd,QAAQ,yBACR,SAAQ;;;;;;;;;wBAkBM,qBACd,SAAQ;;;;;;;;;wBAsBM,sBACd,QAAQ,oBACR;;;;qBC5GW,+BAA+B;;qBAG/B,wBAAwB;UAEpB;;WAEN;WACA;;WAEA;;UAGM;;WAEN,gBAAgB;;WAEhB;;;WAGA;WACA;WACA;;;;;;wBAUK,gBAAgB,gBAAgB;wBAWhC,mBAAmB,SAAS,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","names":["RepairArm"],"sources":["../../src/trace-repair/mini-swe-scaffold.ts","../../src/trace-repair/action-budget.ts","../../src/trace-repair/continuation-records.ts","../../src/trace-repair/control-policy.ts","../../src/trace-repair/admission-records.ts","../../src/trace-repair/continuation-policy.ts","../../src/trace-repair/oracle-determinism.ts","../../src/trace-repair/admission.ts","../../src/trace-repair/admission-contract.ts","../../src/trace-repair/admission-report.ts","../../src/trace-repair/analyst-response.ts","../../src/trace-repair/blinding.ts","../../src/trace-repair/analyst-arm.ts","../../src/trace-repair/arm-completion.ts","../../src/trace-repair/arm-dspy.ts","../../src/trace-repair/degenerate-strategies.ts","../../src/trace-repair/ports.ts","../../src/trace-repair/funnel.ts","../../src/trace-repair/grade.ts","../../src/trace-repair/delta-repair.ts","../../src/trace-repair/docker-environment.ts","../../src/trace-repair/rep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,yBACR,SAAQ;;;;;;;;;wBAkBM,qBACd,SAAQ;;;;;;;;;wBAsBM,sBACd,QAAQ,oBACR;;;;qBC5GW,+BAA+B;;qBAG/B,wBAAwB;UAEpB;;WAEN;WACA;;WAEA;;UAGM;;WAEN,gBAAgB;;WAEhB;;;WAGA;WACA;WACA;;;;;;wBAUK,gBAAgB,gBAAgB;wBAWhC,mBAAmB,SAAS,4BAA4B"}
@@ -3886,6 +3886,6 @@ function shellQuote(value) {
3886
3886
  return `'${value.replaceAll("'", `'\\''`)}'`;
3887
3887
  }
3888
3888
  //#endregion
3889
- export { ADMISSION_CONFIG_DEFAULTS, ADMISSION_EXCLUSION_MEANING, ADMISSION_EXCLUSION_ORDER, ADMISSION_STRATA, AdmissionDenominatorError, AdmissionIndependenceError, BLINDED_FIELDS, CONTROL_SCREENING_MODES, CREDIT_TERMS, ContinuationPolicyViolationError, ContinuationSymmetryError, DEGENERATE_STRATEGIES, DSPY_REPAIR_SIGNATURE, DSPY_REPAIR_TASK_TOKEN, MINI_SWE_SYSTEM_MESSAGE, NO_DECISIVE_FAILURE, NO_OP_ACTIONS, NondeterministicOracleError, OUTPUT_ELISION_THRESHOLD, REPAIR_CONTRACT_LINES, REPAIR_QUESTION, REPAIR_REPAIR_CONTRACT_LINES, SCAFFOLD_INTERVENTION_BUDGET, SUBMIT_SENTINEL, SUITE_REWARD_UNIT, TB_REPAIR_ADMISSION_CRITERIA, TestOracleError, TestSuiteTamperedError, UncalibratedControlError, admissionArtifact, admitRow, admittedCount, admittedRowIds, askRepairArm, assertAnalystIndependent, assertArmSymmetry, assertChainReconciles, assertControlCalibrated, assertDenominatorIntact, assertDeterministicOracle, assertDspyRepairEngine, blindTrajectory, buildDenominatorChain, checkInterventionBudget, classifyActionPayload, continuationPolicyDigest, continuationSeed, controlCanRescue, countFunnel, createCompletionRepairArm, createDockerContinuationEnvironment, createDspyRepairArm, defineControlPolicy, definePinnedContinuationPolicy, deltaRepair, dockerRunArgs, dspyRepairInstructions, gradeRepairRow, injectedTestOracle, isRecordedTimeout, noOpInjectionStep, nodeProcessRunner, normalizeActionForComparison, oracleDeterminism, parseAction, parseAnalystResponse, parseTaskOracleRegistry, renderAdmissionReport, renderDeltaRepairReport, renderFormatErrorObservation, renderInstanceMessage, renderObservation, renderRepairTrajectory, renderTimeoutObservation, repairArmAsymmetries, repairArmPromptSha256, repairArmResponse, repairCredit, repairFinding, repairQuestionSha256, repairTaskDefinition, repairTaskPolicy, repairTrajectoryHeader, resolveAdmissionConfig, rolloutDigest, rolloutRecordedSteps, runAdmission, runContinuation, scanShellAction, stratumOf, submissionOf, taskOracleRegistry, testSuiteDigest, toRecordedSteps, totalCost, totalUsage };
3889
+ export { ADMISSION_CONFIG_DEFAULTS, ADMISSION_EXCLUSION_MEANING, ADMISSION_EXCLUSION_ORDER, ADMISSION_STRATA, AdmissionDenominatorError, AdmissionIndependenceError, BLINDED_FIELDS, CONTROL_SCREENING_MODES, CREDIT_TERMS, ContinuationPolicyViolationError, ContinuationSymmetryError, DEGENERATE_STRATEGIES, DSPY_REPAIR_SIGNATURE, DSPY_REPAIR_TASK_TOKEN, MINI_SWE_SYSTEM_MESSAGE, NO_DECISIVE_FAILURE, NondeterministicOracleError, OUTPUT_ELISION_THRESHOLD, REPAIR_CONTRACT_LINES, REPAIR_QUESTION, REPAIR_REPAIR_CONTRACT_LINES, SCAFFOLD_INTERVENTION_BUDGET, SUBMIT_SENTINEL, SUITE_REWARD_UNIT, TB_REPAIR_ADMISSION_CRITERIA, TestOracleError, TestSuiteTamperedError, UncalibratedControlError, admissionArtifact, admitRow, admittedCount, admittedRowIds, askRepairArm, assertAnalystIndependent, assertArmSymmetry, assertChainReconciles, assertControlCalibrated, assertDenominatorIntact, assertDeterministicOracle, assertDspyRepairEngine, blindTrajectory, buildDenominatorChain, checkInterventionBudget, classifyActionPayload, continuationPolicyDigest, continuationSeed, controlCanRescue, countFunnel, createCompletionRepairArm, createDockerContinuationEnvironment, createDspyRepairArm, defineControlPolicy, definePinnedContinuationPolicy, deltaRepair, dockerRunArgs, dspyRepairInstructions, gradeRepairRow, injectedTestOracle, isRecordedTimeout, noOpInjectionStep, nodeProcessRunner, normalizeActionForComparison, oracleDeterminism, parseAction, parseAnalystResponse, parseTaskOracleRegistry, renderAdmissionReport, renderDeltaRepairReport, renderFormatErrorObservation, renderInstanceMessage, renderObservation, renderRepairTrajectory, renderTimeoutObservation, repairArmAsymmetries, repairArmPromptSha256, repairArmResponse, repairCredit, repairFinding, repairQuestionSha256, repairTaskDefinition, repairTaskPolicy, repairTrajectoryHeader, resolveAdmissionConfig, rolloutDigest, rolloutRecordedSteps, runAdmission, runContinuation, scanShellAction, stratumOf, submissionOf, taskOracleRegistry, testSuiteDigest, toRecordedSteps, totalCost, totalUsage };
3890
3890
 
3891
3891
  //# sourceMappingURL=index.js.map
package/dist/traces.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { c as ValidationError, o as LimitExceededError, r as CaptureIntegrityError, s as NotFoundError, t as AgentEvalError } from "./errors-DEE6u6ot.js";
2
2
  import { C as ToolSpan, D as isToolSpan, E as isLlmSpan, S as TRACE_SCHEMA_VERSION, T as isJudgeSpan, _ as SandboxSpan, a as FAILURE_CLASSES, b as SpanKind, c as JudgeSpan, d as RetrievalSpan, f as Run, g as RunStatus, h as RunOutcome, i as EventKind, l as LlmSpan, m as RunLayer, n as BudgetLedgerEntry, o as FailureClass, p as RunCaptureReport, r as BudgetSpec, s as GenericSpan, t as Artifact, u as Message, v as Span, w as TraceEvent, x as SpanStatus, y as SpanBase } from "./schema-2g7trUwH.js";
3
- import { a as RunRecord, c as RunSplitTag, d as RunTokenUsage, u as RunTerminalOutcome } from "./run-record-DF-fuu31.js";
4
- import { A as DEFAULT_TRACE_ANALYST_BUDGETS, B as TraceAnalystSpan, C as BoundedTraceAnalysisStoreOptions, D as TRACE_ANALYSIS_LIMITS, E as SpanSourceReader, F as SearchTraceResult, G as ViewTraceOversized, H as TraceAnalystSpanStatus, I as SpanMatchRecord, K as ViewTraceResult, L as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, M as ErrorCluster, N as QueryTracesPage, O as TraceAnalysisStore, P as SearchSpanResult, R as TraceAnalystByteBudgets, S as createBoundedTraceAnalysisStore, T as ReadSpanSourceResult, U as TraceAnalystTraceSummary, V as TraceAnalystSpanKind, W as ViewSpansResult, j as DatasetOverview, k as TraceAnalysisStoreContext, w as ReadSpanSourceInput, z as TraceAnalystFilters } from "./types-DAPpAkd4.js";
3
+ import { a as RunRecord, c as RunSplitTag, d as RunTokenUsage, u as RunTerminalOutcome } from "./run-record-p2AYTrCn.js";
4
+ import { A as DEFAULT_TRACE_ANALYST_BUDGETS, B as TraceAnalystSpan, C as BoundedTraceAnalysisStoreOptions, D as TRACE_ANALYSIS_LIMITS, E as SpanSourceReader, F as SearchTraceResult, G as ViewTraceOversized, H as TraceAnalystSpanStatus, I as SpanMatchRecord, K as ViewTraceResult, L as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, M as ErrorCluster, N as QueryTracesPage, O as TraceAnalysisStore, P as SearchSpanResult, R as TraceAnalystByteBudgets, S as createBoundedTraceAnalysisStore, T as ReadSpanSourceResult, U as TraceAnalystTraceSummary, V as TraceAnalystSpanKind, W as ViewSpansResult, j as DatasetOverview, k as TraceAnalysisStoreContext, w as ReadSpanSourceInput, z as TraceAnalystFilters } from "./types-KEkKkETv.js";
5
5
  import { $ as NoopRawProviderSink, Q as InMemoryRawProviderSinkOptions, X as FileSystemRawProviderSinkOptions, Y as FileSystemRawProviderSink, Z as InMemoryRawProviderSink, at as defaultProviderRedactor, et as ProviderRedactor, it as RawProviderSinkFilter, nt as RawProviderEvent, ot as providerFromBaseUrl, rt as RawProviderSink, tt as RawProviderDirection } from "./types-Lub7o6bN.js";
6
6
  import { a as RunFilter, i as InMemoryTraceStore, n as FileSystemTraceStore, o as SpanFilter, r as FileSystemTraceStoreOptions, s as TraceStore, t as EventFilter } from "./store-C4avFjIi.js";
7
- import { _ as buildTraceAnalysisToolDescriptors, g as UNTRUSTED_TRACE_TEXT, h as TraceAnalysisToolDescriptor, m as TRACE_ANALYST_TOOL_NAMESPACE, p as BuildTraceAnalysisToolsOptions, v as traceAnalystFunctionGroup } from "./engine-DProXJ7A.js";
7
+ import { _ as buildTraceAnalysisToolDescriptors, g as UNTRUSTED_TRACE_TEXT, h as TraceAnalysisToolDescriptor, m as TRACE_ANALYST_TOOL_NAMESPACE, p as BuildTraceAnalysisToolsOptions } from "./engine-D-YZ32ZJ.js";
8
8
  import { a as SpanHandle, i as RunCompleteHookContext, n as CaptureWrite, o as TraceEmitter, r as RunCompleteHook, s as TraceEmitterOptions, t as CaptureErrorHandler } from "./emitter-HcCmFQl_.js";
9
9
  import { S as shareAllowed, _ as emptyRedactionReport, a as RedactionFinding, b as redactForShare, c as SafetyCategory, d as ShareSafetyVerdict, f as assessShareSafety, g as detectPersonalData, h as detectCredential, i as RedactOptions, l as ShareSafetyFinding, m as combineVerdicts, n as REDACTION_PROFILES, o as RedactionProfile, p as classifyKey, r as REDACTION_VERSION, s as RedactionReport, t as AssessOptions, u as ShareSafetyStatus, v as normalizeKey, x as redactText, y as redact } from "./redact-Cveoq6fJ.js";
10
10
  import { C as TOOL_LATENCY_MS, D as asNumber, E as applyLlmSpanOtlpAttributes, O as contextInputTokens, S as TOOL_ARGS_CAPTURED, T as TOOL_NAME_ATTR_KEYS, _ as LlmSpanOtlpInput, a as LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, b as RUN_COST_ATTR_KEYS, c as LLM_COST_USD, d as LLM_MODEL_ATTR_KEYS, f as LLM_MODEL_NAME, g as LLM_REASONING_TOKEN_ATTR_KEYS, h as LLM_REASONING_TOKENS, i as LLM_CACHE_WRITE_TOKENS, k as firstNumberAttr, l as LLM_INPUT_TOKENS, m as LLM_OUTPUT_TOKEN_ATTR_KEYS, n as LLM_CACHED_TOKENS, o as LLM_CONTEXT_TOKENS, p as LLM_OUTPUT_TOKENS, r as LLM_CACHED_TOKEN_ATTR_KEYS, s as LLM_COST_ATTR_KEYS, t as INPUT_VALUE, u as LLM_INPUT_TOKEN_ATTR_KEYS, v as OPENINFERENCE_SPAN_KIND, w as TOOL_NAME, x as SPAN_KIND_ATTR_KEYS, y as OUTPUT_VALUE } from "./attribute-vocabulary-CcXqHODT.js";
11
- import { A as scoreTraceInsightReadiness, B as OtlpSpan, C as describeTraceInsightScope, D as isTraceInsightAttribution, E as isTraceInsightArtifact, F as analyzeTraces, G as ExtractUsageFromSseOptions, H as CaptureFetchContext, I as OtlpFlatLine, J as extractUsage, K as ExtractedUsage, L as OTEL_AGENT_EVAL_SCOPE, M as AnalyzeTracesInput, N as AnalyzeTracesOptions, O as isTraceInsightEvidence, P as AnalyzeTracesResult, R as OtlpExport, S as defaultTraceInsightPanel, T as inferDomainKeywords, U as CaptureFetchOptions, V as exportRunAsOtlp, W as captureFetchToRawSink, X as extractUsageFromSse, Y as extractUsageFromResponse, _ as TraceInsightReadiness, a as SpanRecordsToTraceAnalysisStoreOptions, b as buildTraceInsightContext, c as spanRecordsToTraceAnalysisStore, d as TraceInsightEvidence, f as TraceInsightFinding, g as TraceInsightQuestion, h as TraceInsightQualityGate, i as OtlpFileTraceStoreOptions, j as tokenizeDomainWords, k as planTraceInsightQuestions, l as TraceInsightAttribution, m as TraceInsightPromptInput, n as toolSpansToTraceAnalysisStore, o as ToolSpansToTraceAnalysisStoreOptions, p as TraceInsightPanelRole, q as SseUsageMode, r as OtlpFileTraceStore, s as otlpTextToTraceAnalysisStore, t as ToolTraceMissingError, u as TraceInsightContext, v as TraceInsightSuite, w as domainEvidencePattern, x as buildTraceInsightPrompt, y as TraceInsightTask, z as OtlpResourceSpans } from "./store-tool-spans-9YJNMP-z.js";
11
+ import { A as scoreTraceInsightReadiness, B as OtlpSpan, C as describeTraceInsightScope, D as isTraceInsightAttribution, E as isTraceInsightArtifact, F as analyzeTraces, G as ExtractUsageFromSseOptions, H as CaptureFetchContext, I as OtlpFlatLine, J as extractUsage, K as ExtractedUsage, L as OTEL_AGENT_EVAL_SCOPE, M as AnalyzeTracesInput, N as AnalyzeTracesOptions, O as isTraceInsightEvidence, P as AnalyzeTracesResult, R as OtlpExport, S as defaultTraceInsightPanel, T as inferDomainKeywords, U as CaptureFetchOptions, V as exportRunAsOtlp, W as captureFetchToRawSink, X as extractUsageFromSse, Y as extractUsageFromResponse, _ as TraceInsightReadiness, a as SpanRecordsToTraceAnalysisStoreOptions, b as buildTraceInsightContext, c as spanRecordsToTraceAnalysisStore, d as TraceInsightEvidence, f as TraceInsightFinding, g as TraceInsightQuestion, h as TraceInsightQualityGate, i as OtlpFileTraceStoreOptions, j as tokenizeDomainWords, k as planTraceInsightQuestions, l as TraceInsightAttribution, m as TraceInsightPromptInput, n as toolSpansToTraceAnalysisStore, o as ToolSpansToTraceAnalysisStoreOptions, p as TraceInsightPanelRole, q as SseUsageMode, r as OtlpFileTraceStore, s as otlpTextToTraceAnalysisStore, t as ToolTraceMissingError, u as TraceInsightContext, v as TraceInsightSuite, w as domainEvidencePattern, x as buildTraceInsightPrompt, y as TraceInsightTask, z as OtlpResourceSpans } from "./store-tool-spans-wQ9idsnn.js";
12
12
  import { a as RunIntegrityReport, i as RunIntegrityIssueCode, n as RunIntegrityExpectations, o as assertRunCaptured, r as RunIntegrityIssue, s as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-zloavsM_.js";
13
- import { a as groupBy, c as judgeSpans, d as runMetricExtractor, f as runsForScenario, i as argHash, l as llmSpans, n as RunMetric, o as hasCapturedToolArgs, p as toolSpans, r as aggregateLlm, s as isRunMetric, t as RUN_METRICS, u as runFailureClass } from "./query-DBUQhehH.js";
13
+ import { a as groupBy, c as llmSpans, d as runsForScenario, f as toolSpans, i as argHash, l as runFailureClass, n as RunMetric, o as hasCapturedToolArgs, r as aggregateLlm, s as judgeSpans, t as RUN_METRICS, u as runMetricExtractor } from "./query-DK1nWcmp.js";
14
14
  import { SpanKind as SpanKind$1 } from "@tangle-network/agent-trace-contract";
15
15
  //#region src/trace-analyst/errors.d.ts
16
16
  /** Invalid trace-tool arguments, including malformed filters and regexes. */
@@ -321,13 +321,11 @@ export declare function otlpToRunRecords(otlpJsonl: string, opts: OtlpToRunRecor
321
321
  export declare function otlpRowsToRunRecords(rows: Iterable<object>, opts: OtlpToRunRecordsOptions): RunRecord[];
322
322
  /** As {@link otlpToRunRecords} but returns the prompt/completion text too. */
323
323
  export declare function otlpToTraceRunRecords(otlpJsonl: string, opts: OtlpToRunRecordsOptions): OtlpTraceRunRecord[];
324
- /** Parsed-row counterpart to {@link otlpToTraceRunRecords}. */
325
- export declare function otlpRowsToTraceRunRecords(rows: Iterable<object>, opts: OtlpToRunRecordsOptions): OtlpTraceRunRecord[];
326
324
  //#endregion
327
325
  //#region src/trace-analyst/prompts.d.ts
328
326
  /** General policy for recursive, evidence-backed trace analysis. */
329
327
  export declare const TRACE_ANALYST_ACTOR_DESCRIPTION = "Answer the question by inspecting the OTLP trace dataset with the available tools.\n\n1. Call getDatasetOverview first. Use its real trace ids and dataset size to plan the investigation.\n2. Narrow with queryTraces and countTraces before scanning large payloads.\n3. For a small trace, use viewTrace. For a large trace, use searchTrace and then viewSpans or searchSpan.\n4. Never invent a trace id, span id, tool result, error, frequency, or final outcome.\n5. When a search reports has_more, refine the query before drawing a conclusion.\n6. Use llm_query only over evidence already loaded. A recursive query cannot inspect traces itself.\n7. Cite exact evidence URIs returned by the tools. Include a short exact excerpt when it supports the claim.\n8. Return no finding when the available evidence cannot support one.\n\nThe prose answer must directly answer the question and state important uncertainty.\nThe findings array contains only actionable or decision-relevant claims supported by inspected evidence.";
330
328
  export declare const TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION = "trace-analyst-research-v1-2026-07-30";
331
329
  //#endregion
332
- export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, Artifact, AssessOptions, type BoundedTraceAnalysisStoreOptions, BudgetLedgerEntry, BudgetSpec, type BuildTraceAnalysisToolsOptions, CaptureErrorHandler, CaptureFetchContext, CaptureFetchOptions, CaptureWrite, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, EventFilter, EventKind, ExtractUsageFromSseOptions, ExtractedUsage, FAILURE_CLASSES, FailureClass, FileSystemRawProviderSink, FileSystemRawProviderSinkOptions, FileSystemTraceStore, FileSystemTraceStoreOptions, type FlattenOtlpOptions, GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, InMemoryRawProviderSinkOptions, InMemoryTraceStore, JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, LlmSpan, LlmSpanOtlpInput, Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, OtlpResourceSpans, OtlpSpan, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, ProviderRedactor, type QueryTracesPage, REDACTION_PROFILES, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RUN_METRICS, RawProviderDirection, RawProviderEvent, RawProviderSink, RawProviderSinkFilter, type ReadSpanSourceInput, type ReadSpanSourceResult, RedactOptions, RedactionFinding, RedactionProfile, RedactionReport, RetrievalSpan, Run, RunCaptureReport, RunCompleteHook, RunCompleteHookContext, RunFilter, RunIntegrityError, RunIntegrityExpectations, RunIntegrityIssue, RunIntegrityIssueCode, RunIntegrityReport, RunLayer, RunMetric, RunOutcome, RunStatus, SPAN_KIND_ATTR_KEYS, SafetyCategory, SandboxSpan, type SearchSpanResult, type SearchTraceResult, ShareSafetyFinding, ShareSafetyStatus, ShareSafetyVerdict, Span, SpanBase, SpanFilter, SpanHandle, SpanKind, type SpanMatchRecord, type SpanRecordsToTraceAnalysisStoreOptions, type SpanSourceReader, SpanStatus, SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolSpan, type ToolSpansToTraceAnalysisStoreOptions, ToolTraceMissingError, type TraceAggregate, type TraceAnalysisStore, type TraceAnalysisStoreContext, type TraceAnalysisToolDescriptor, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, TraceEmitterOptions, TraceEvent, type TraceInsightAttribution, type TraceInsightContext, type TraceInsightEvidence, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceStore, UNTRUSTED_TRACE_TEXT, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, argHash, asNumber, assertRunCaptured, assessShareSafety, buildTraceAnalysisToolDescriptors, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyKey, combineVerdicts, contextInputTokens, createBoundedTraceAnalysisStore, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, detectCredential, detectPersonalData, domainEvidencePattern, emptyRedactionReport, exportRunAsOtlp, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, groupBy, hasCapturedToolArgs, inferDomainKeywords, isJudgeSpan, isLlmSpan, isRunMetric, isToolSpan, isTraceInsightArtifact, isTraceInsightAttribution, isTraceInsightEvidence, judgeSpans, llmSpans, normalizeKey, otlpTextToTraceAnalysisStore, planTraceInsightQuestions, providerFromBaseUrl, redact, redactForShare, redactText, runFailureClass, runMetricExtractor, runsForScenario, scoreTraceInsightReadiness, shareAllowed, spanRecordsToTraceAnalysisStore, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup };
330
+ export { type AnalyzeTracesInput, type AnalyzeTracesOptions, type AnalyzeTracesResult, Artifact, AssessOptions, type BoundedTraceAnalysisStoreOptions, BudgetLedgerEntry, BudgetSpec, type BuildTraceAnalysisToolsOptions, CaptureErrorHandler, CaptureFetchContext, CaptureFetchOptions, CaptureWrite, DEFAULT_TRACE_ANALYST_BUDGETS, type DatasetOverview, type ErrorCluster, EventFilter, EventKind, ExtractUsageFromSseOptions, ExtractedUsage, FAILURE_CLASSES, FailureClass, FileSystemRawProviderSink, FileSystemRawProviderSinkOptions, FileSystemTraceStore, FileSystemTraceStoreOptions, type FlattenOtlpOptions, GenericSpan, INPUT_VALUE, InMemoryRawProviderSink, InMemoryRawProviderSinkOptions, InMemoryTraceStore, JudgeSpan, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, LlmSpan, LlmSpanOtlpInput, Message, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtlpExport, OtlpFileTraceStore, type OtlpFileTraceStoreOptions, type OtlpFlatLine, OtlpResourceSpans, OtlpSpan, type OtlpToRunRecordsOptions, type OtlpTraceRunRecord, type ProjectedOtlpSpan, ProviderRedactor, type QueryTracesPage, REDACTION_PROFILES, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RUN_METRICS, RawProviderDirection, RawProviderEvent, RawProviderSink, RawProviderSinkFilter, type ReadSpanSourceInput, type ReadSpanSourceResult, RedactOptions, RedactionFinding, RedactionProfile, RedactionReport, RetrievalSpan, Run, RunCaptureReport, RunCompleteHook, RunCompleteHookContext, RunFilter, RunIntegrityError, RunIntegrityExpectations, RunIntegrityIssue, RunIntegrityIssueCode, RunIntegrityReport, RunLayer, RunMetric, RunOutcome, RunStatus, SPAN_KIND_ATTR_KEYS, SafetyCategory, SandboxSpan, type SearchSpanResult, type SearchTraceResult, ShareSafetyFinding, ShareSafetyStatus, ShareSafetyVerdict, Span, SpanBase, SpanFilter, SpanHandle, SpanKind, type SpanMatchRecord, type SpanRecordsToTraceAnalysisStoreOptions, type SpanSourceReader, SpanStatus, SseUsageMode, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolSpan, type ToolSpansToTraceAnalysisStoreOptions, ToolTraceMissingError, type TraceAggregate, type TraceAnalysisStore, type TraceAnalysisStoreContext, type TraceAnalysisToolDescriptor, type TraceAnalystByteBudgets, type TraceAnalystFilters, type TraceAnalystHookOptions, type TraceAnalystSpan, type TraceAnalystSpanKind, type TraceAnalystSpanStatus, type TraceAnalystTraceSummary, TraceEmitter, TraceEmitterOptions, TraceEvent, type TraceInsightAttribution, type TraceInsightContext, type TraceInsightEvidence, type TraceInsightFinding, type TraceInsightPanelRole, type TraceInsightPromptInput, type TraceInsightQualityGate, type TraceInsightQuestion, type TraceInsightReadiness, type TraceInsightSuite, type TraceInsightTask, TraceStore, UNTRUSTED_TRACE_TEXT, type ViewSpansResult, type ViewTraceOversized, type ViewTraceResult, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, argHash, asNumber, assertRunCaptured, assessShareSafety, buildTraceAnalysisToolDescriptors, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyKey, combineVerdicts, contextInputTokens, createBoundedTraceAnalysisStore, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, detectCredential, detectPersonalData, domainEvidencePattern, emptyRedactionReport, exportRunAsOtlp, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, groupBy, hasCapturedToolArgs, inferDomainKeywords, isJudgeSpan, isLlmSpan, isToolSpan, isTraceInsightArtifact, isTraceInsightAttribution, isTraceInsightEvidence, judgeSpans, llmSpans, normalizeKey, otlpTextToTraceAnalysisStore, planTraceInsightQuestions, providerFromBaseUrl, redact, redactForShare, redactText, runFailureClass, runMetricExtractor, runsForScenario, scoreTraceInsightReadiness, shareAllowed, spanRecordsToTraceAnalysisStore, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore };
333
331
  //# sourceMappingURL=traces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traces.d.ts","names":["SpanKind"],"sources":["../src/trace-analyst/errors.ts","../src/trace/otlp-attributes.ts","../src/trace/store-to-otlp.ts","../src/trace-analyst/hook.ts","../src/trace-analyst/otlp-flatten.ts","../src/trace-analyst/otlp-span.ts","../src/trace-analyst/otlp-to-run-records.ts","../src/trace-analyst/prompts.ts"],"mappings":";;;;;;;;;;;;;;;;qBASa,qCAAqC;WAC/B;;;qBAIN,gCAAgC;WAC1B;WACR;WACA;WACA;EAET,YAAY,mBAAmB,gBAAgB,eAAe;;;qBASnD,wCAAwC;WAClC;WACR;EAET,YAAY,mBAAmB,iBAAiB;I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;;;EASA,wBAAwB;;;;;;;;;EASxB,iBAAiB,eAAe,MAAM;;;;;EAKtC,yBAAyB,kBAAkB;;;;;;UAO5B;EACf,QAAQ;;EAER;;EAEA;;;UAIe;EACf;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;;EAEZ;EACA;EACA;EACA;EACA;;EAEA,iBAAiB;;;;;;;wBAeH,iBAAiB,mBAAmB,MAAM,0BAA0B;;;;;;wBASpE,qBACd,MAAM,kBACN,MAAM,0BACL;;wBAKa,sBACd,mBACA,MAAM,0BACL;;wBAQa,0BACd,MAAM,kBACN,MAAM,0BACL;;;;qBC5MU;qBAcA"}
1
+ {"version":3,"file":"traces.d.ts","names":["SpanKind"],"sources":["../src/trace-analyst/errors.ts","../src/trace/otlp-attributes.ts","../src/trace/store-to-otlp.ts","../src/trace-analyst/hook.ts","../src/trace-analyst/otlp-flatten.ts","../src/trace-analyst/otlp-span.ts","../src/trace-analyst/otlp-to-run-records.ts","../src/trace-analyst/prompts.ts"],"mappings":";;;;;;;;;;;;;;;;qBASa,qCAAqC;WAC/B;;;qBAIN,gCAAgC;WAC1B;WACR;WACA;WACA;EAET,YAAY,mBAAmB,gBAAgB,eAAe;;;qBASnD,wCAAwC;WAClC;WACR;EAET,YAAY,mBAAmB,iBAAiB;IAAY;;;qBAMjD,8BAA8B;WACxB;WACR;EAET,YAAY;;qBAMD,+BAA+B;WACjC;WACA;WACA;EAET,YAAY,cAAc,oBAAoB;;qBAcnC,gCAAgC;WAClC;WACA;WACA;EAET,YAAY,cAAc,qBAAqB,qBAAqB;;qBAQzD,2BAA2B;WACrB;WACR;EAET,YAAY;;qBAMD,0BAA0B;WACpB;WACR;WACA;EAET,YAAY,kBAAkB;;;;YC1EpB,oBAAoB,KAC9B;wBAkBc,4BACd,YAAY,yBACZ,MAAM;;;;;;wBAWQ,iCAAiC,eAAeA;;;iBCjB/C;;EAEf;;EAEA;;EAEA;;;EAGA;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}
package/dist/traces.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { a as isToolSpan, i as isLlmSpan, n as TRACE_SCHEMA_VERSION, r as isJudgeSpan, t as FAILURE_CLASSES } from "./schema-CSf6qWgZ.js";
2
- import { a as hasCapturedToolArgs, c as llmSpans, d as runsForScenario, f as toolSpans, i as groupBy, l as runFailureClass, n as aggregateLlm, o as isRunMetric, r as argHash, s as judgeSpans, t as RUN_METRICS, u as runMetricExtractor } from "./query-DlV0pdx4.js";
3
- import { i as modelHasSnapshot, u as validateRunRecord } from "./run-record-BRlM99rX.js";
2
+ import { a as hasCapturedToolArgs, c as runFailureClass, d as toolSpans, i as groupBy, l as runMetricExtractor, n as aggregateLlm, o as judgeSpans, r as argHash, s as llmSpans, t as RUN_METRICS, u as runsForScenario } from "./query-B1D1qp2Z.js";
3
+ import { c as validateRunRecord, i as modelHasSnapshot } from "./run-record-DlTZ_lqe.js";
4
4
  import { a as combineVerdicts, c as emptyRedactionReport, d as redactForShare, f as redactText, i as classifyKey, l as normalizeKey, n as REDACTION_VERSION, o as detectCredential, p as shareAllowed, r as assessShareSafety, s as detectPersonalData, t as REDACTION_PROFILES, u as redact } from "./redact-Dk1ZdJEm.js";
5
5
  import { t as TraceEmitter } from "./emitter-DbMXUIVP.js";
6
- import { A as projectOtlpFlatLine, C as TraceFileMissingError, D as compareSpanTime, E as asString, M as stringField, O as extractOtlpAttributes, S as TraceFileMalformedError, T as TraceNotFoundError, _ as TRACE_ANALYSIS_LIMITS, a as TRACE_ANALYST_TOOL_NAMESPACE, b as TraceAnalysisStoreContractError, c as traceAnalystFunctionGroup, g as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, h as DEFAULT_TRACE_ANALYST_BUDGETS, j as spanEpochMillis, k as firstStringAttr, o as UNTRUSTED_TRACE_TEXT, s as buildTraceAnalysisToolDescriptors, u as createBoundedTraceAnalysisStore, v as SpanNotFoundError, w as TraceFileTooLargeError, x as TraceAnalysisValidationError, y as TraceAnalysisLimitError } from "./kind-factory-Cn1lbsAd.js";
6
+ import { A as spanEpochMillis, C as TraceFileTooLargeError, D as extractOtlpAttributes, E as compareSpanTime, O as firstStringAttr, S as TraceFileMissingError, T as asString, _ as SpanNotFoundError, a as TRACE_ANALYST_TOOL_NAMESPACE, b as TraceAnalysisValidationError, g as TRACE_ANALYSIS_LIMITS, h as TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, j as stringField, k as projectOtlpFlatLine, l as createBoundedTraceAnalysisStore, m as DEFAULT_TRACE_ANALYST_BUDGETS, o as UNTRUSTED_TRACE_TEXT, s as buildTraceAnalysisToolDescriptors, v as TraceAnalysisLimitError, w as TraceNotFoundError, x as TraceFileMalformedError, y as TraceAnalysisStoreContractError } from "./kind-factory-ivTx6koH.js";
7
7
  import { INPUT_VALUE, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, OPENINFERENCE_SPAN_KIND, OUTPUT_VALUE, RUN_COST_ATTR_KEYS, SPAN_KIND_ATTR_KEYS, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, applyLlmSpanOtlpAttributes, asNumber, contextInputTokens, firstNumberAttr } from "./trace-attributes.js";
8
8
  import { n as extractUsageFromResponse, r as extractUsageFromSse, t as extractUsage } from "./extract-usage-BrnzRJ6H.js";
9
9
  import { a as providerFromBaseUrl, i as defaultProviderRedactor, n as InMemoryRawProviderSink, r as NoopRawProviderSink, t as FileSystemRawProviderSink } from "./raw-provider-sink-rB2DYxr6.js";
10
- import { C as spanIdForWire, S as exportRunAsOtlp, T as captureFetchToRawSink, _ as tokenizeDomainWords, a as spanStatusToOtlp, b as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, c as defaultTraceInsightPanel, d as inferDomainKeywords, f as isTraceInsightArtifact, g as scoreTraceInsightReadiness, h as planTraceInsightQuestions, i as epochMillisToIso, l as describeTraceInsightScope, m as isTraceInsightEvidence, n as toolSpansToTraceAnalysisStore, o as buildTraceInsightContext, p as isTraceInsightAttribution, r as createOtlpFlatLine, s as buildTraceInsightPrompt, t as ToolTraceMissingError, u as domainEvidencePattern, v as analyzeTraces, w as traceIdForWire, x as OTEL_AGENT_EVAL_SCOPE, y as TRACE_ANALYST_ACTOR_DESCRIPTION } from "./store-tool-spans-DKoVbE-w.js";
10
+ import { C as spanIdForWire, S as exportRunAsOtlp, T as captureFetchToRawSink, _ as tokenizeDomainWords, a as spanStatusToOtlp, b as TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, c as defaultTraceInsightPanel, d as inferDomainKeywords, f as isTraceInsightArtifact, g as scoreTraceInsightReadiness, h as planTraceInsightQuestions, i as epochMillisToIso, l as describeTraceInsightScope, m as isTraceInsightEvidence, n as toolSpansToTraceAnalysisStore, o as buildTraceInsightContext, p as isTraceInsightAttribution, r as createOtlpFlatLine, s as buildTraceInsightPrompt, t as ToolTraceMissingError, u as domainEvidencePattern, v as analyzeTraces, w as traceIdForWire, x as OTEL_AGENT_EVAL_SCOPE, y as TRACE_ANALYST_ACTOR_DESCRIPTION } from "./store-tool-spans-TbRBuIM7.js";
11
11
  import { n as assertRunCaptured, r as throwIfRunIncomplete, t as RunIntegrityError } from "./integrity-BvnVARVl.js";
12
12
  import { n as traceSpanKindToOpenInferenceKind, t as applyToolSpanOtlpAttributes } from "./otlp-attributes-D9ptWaIJ.js";
13
13
  import { n as InMemoryTraceStore, t as FileSystemTraceStore } from "./store-BhNuLdJw.js";
14
- import { a as spanRecordsToTraceAnalysisStore, i as otlpTextToTraceAnalysisStore, n as OtlpFileTraceStore } from "./store-otlp-BA7G1Du-.js";
14
+ import { a as spanRecordsToTraceAnalysisStore, i as otlpTextToTraceAnalysisStore, n as OtlpFileTraceStore } from "./store-otlp-__ebQ6Hn.js";
15
15
  import { i as summarizeTraceErrors, n as recordAggregateMeasurements, r as summarizeExecutionMeasurements, t as readTaskFailureLabels } from "./task-failure-attributes-DngaLdE4.js";
16
16
  import { readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
17
17
  import { join } from "node:path";
@@ -803,6 +803,6 @@ function ensureSnapshot(model, fallbackModel) {
803
803
  return `${model}${fallbackModel.includes("@") ? fallbackModel.slice(fallbackModel.indexOf("@")) : "@otlp"}`;
804
804
  }
805
805
  //#endregion
806
- export { DEFAULT_TRACE_ANALYST_BUDGETS, FAILURE_CLASSES, FileSystemRawProviderSink, FileSystemTraceStore, INPUT_VALUE, InMemoryRawProviderSink, InMemoryTraceStore, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtlpFileTraceStore, REDACTION_PROFILES, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RUN_METRICS, RunIntegrityError, SPAN_KIND_ATTR_KEYS, SpanNotFoundError, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolTraceMissingError, TraceAnalysisLimitError, TraceAnalysisStoreContractError, TraceAnalysisValidationError, TraceEmitter, TraceFileMalformedError, TraceFileMissingError, TraceFileTooLargeError, TraceNotFoundError, UNTRUSTED_TRACE_TEXT, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, assessShareSafety, buildTraceAnalysisToolDescriptors, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyKey, combineVerdicts, contextInputTokens, convertTraceStoresToOtlp, createBoundedTraceAnalysisStore, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, detectCredential, detectPersonalData, domainEvidencePattern, emptyRedactionReport, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, isJudgeSpan, isLlmSpan, isRunMetric, isToolSpan, isTraceInsightArtifact, isTraceInsightAttribution, isTraceInsightEvidence, judgeSpans, llmSpans, normalizeKey, otlpRowsToRunRecords, otlpRowsToTraceRunRecords, otlpTextToTraceAnalysisStore, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, redact, redactForShare, redactText, runFailureClass, runMetricExtractor, runsForScenario, scoreTraceInsightReadiness, shareAllowed, spanRecordsToTraceAnalysisStore, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
806
+ export { DEFAULT_TRACE_ANALYST_BUDGETS, FAILURE_CLASSES, FileSystemRawProviderSink, FileSystemTraceStore, INPUT_VALUE, InMemoryRawProviderSink, InMemoryTraceStore, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_CACHE_WRITE_TOKENS, LLM_CACHE_WRITE_TOKEN_ATTR_KEYS, LLM_CONTEXT_TOKENS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, LLM_REASONING_TOKENS, LLM_REASONING_TOKEN_ATTR_KEYS, NoopRawProviderSink, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OUTPUT_VALUE, OtlpFileTraceStore, REDACTION_PROFILES, REDACTION_VERSION, RUN_COST_ATTR_KEYS, RUN_METRICS, RunIntegrityError, SPAN_KIND_ATTR_KEYS, SpanNotFoundError, TOOL_ARGS_CAPTURED, TOOL_LATENCY_MS, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYSIS_LIMITS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_TOOL_NAMESPACE, TRACE_ANALYST_TRUNCATION_MARKER_PREFIX, TRACE_SCHEMA_VERSION, ToolTraceMissingError, TraceAnalysisLimitError, TraceAnalysisStoreContractError, TraceAnalysisValidationError, TraceEmitter, TraceFileMalformedError, TraceFileMissingError, TraceFileTooLargeError, TraceNotFoundError, UNTRUSTED_TRACE_TEXT, aggregateLlm, analyzeTraces, applyLlmSpanOtlpAttributes, applyToolSpanOtlpAttributes, argHash, asNumber, asString, assertRunCaptured, assessShareSafety, buildTraceAnalysisToolDescriptors, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, classifyKey, combineVerdicts, contextInputTokens, convertTraceStoresToOtlp, createBoundedTraceAnalysisStore, defaultProviderRedactor, defaultTraceInsightPanel, describeTraceInsightScope, detectCredential, detectPersonalData, domainEvidencePattern, emptyRedactionReport, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, groupBy, hasCapturedToolArgs, inferDomainKeywords, isJudgeSpan, isLlmSpan, isToolSpan, isTraceInsightArtifact, isTraceInsightAttribution, isTraceInsightEvidence, judgeSpans, llmSpans, normalizeKey, otlpRowsToRunRecords, otlpTextToTraceAnalysisStore, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, providerFromBaseUrl, redact, redactForShare, redactText, runFailureClass, runMetricExtractor, runsForScenario, scoreTraceInsightReadiness, shareAllowed, spanRecordsToTraceAnalysisStore, stringField, throwIfRunIncomplete, tokenizeDomainWords, toolSpans, toolSpansToTraceAnalysisStore, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind };
807
807
 
808
808
  //# sourceMappingURL=traces.js.map
@@ -50,7 +50,6 @@ interface LabelEntry {
50
50
  readonly incorrect_step_ids?: readonly number[];
51
51
  }[];
52
52
  }
53
- export declare function readLabelEntries(labelsPath: string): LabelEntry[];
54
53
  export declare function goldIncorrectSteps(entry: LabelEntry): number[];
55
54
  type ResourceResolution = {
56
55
  readonly resolved: true;
@@ -457,7 +456,6 @@ interface ReplayBatchReport {
457
456
  }
458
457
  export declare function seededSample<T>(items: readonly T[], size: number, seed: number): Set<T>;
459
458
  export declare function runReplayBatch(options: ReplayBatchOptions): Promise<ReplayBatchReport>;
460
- export declare function renderBatchReport(report: ReplayBatchReport): string;
461
459
  //#endregion
462
460
  //#region src/trajectory-replay/verify.d.ts
463
461
  interface IngestedTrajectory {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/trajectory-replay/corpus.ts","../../src/trajectory-replay/exec.ts","../../src/trajectory-replay/fix.ts","../../src/trajectory-replay/fix-loop.ts","../../src/trajectory-replay/image-preparer.ts","../../src/trajectory-replay/batch.ts","../../src/trajectory-replay/verify.ts","../../src/trajectory-replay/findings.ts","../../src/trajectory-replay/wire.ts"],"mappings":";;;;;;UAyBiB;WACN;WACA;WACA;;;wBAIK,gBAAgB,gBAAgB;KAYpC;UAYK;WACN;WACA;WACA,QAAQ;WACR;;KAGC;;UAGK;WACN;WACA;WACA;WACA,gBAAgB;WAChB;WACA;WACA;WACA,WAAW;;WAEX;;UAGM,uBAAuB;;WAE7B;;;;WAIA;;WAEA;;WAEA;;UAGD;WACC;WACA;aAAuC;;;wBAGlC,iBAAiB,qBAAqB;wBAWtC,mBAAmB,OAAO;KAuD9B;WACG;WAAyB,WAAW;;WACpC;WAA0B,QAAQ;WAAgC;;;;;;wBAMjE,qBAAqB,QAAQ,YAAY,iBAAiB;UAiEzD;WACN,YAAY;WACZ,UAAU;WACV;;;;;;;;;;wBAWK,yBAAyB,kBAAkB,eAAe;;;;;;;;;;;;UChPzD;EACf;EACA;EACA;;UAGe;EACf,KAAK,iBAAiB,oBAAoB,QAAQ;EAClD,SAAS;;UAGM;;EAEf,QAAQ,QAAQ;;;;;KAMN,4BAA4B,kBAAkB;;;;;;;wBAQ1C,kBAAkB,gBAAgB;;;UCrBjC;WACN;WACA;;KAGC;WACG;WAA0B;IAAS;IAAiB,OAAO;;;WAC3D;WAA2B;;UAEzB;EACf,SAAS,gBAAgB,eAAe,QAAQ;;UAGjC;WACN;WACA,gBAAgB;;WAEhB;;WAEA;;;wBAIK,SAAS,cAAc;wBAuCvB,eAAe,OAAO;EAAmB;EAAgB;;;UAiBxD;WACN;;WAEA;WACA;WACA;WACA;WACA;;;;;;;wBA4BK,oBACd,OAAO,gBACP,wBAAwB,oBACxB;EACG;EAAgB;;;wBAwBL,oBAAoB;;wBAMpB,kBAAkB;KAQtB;WACG;WAA0B;IAAS;IAAiB,OAAO;;;WAC3D;WAA2B;;wBAEpB,mBACpB,QAAQ,sBACR,OAAO,iBACN,QAAQ;;;;UCvJM;WAC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,oBAAoB,SAAS;;;;;;;;;;KAoBjC;WAEG;WACA;WACA;WACA;WACA;;WAGA;WACA,kBAAkB;WAClB,WAAW;;UAGT;WACN;WACA;;WAEA;WACA;;WAEA;WACA;WACA;;KAGC;WACG;WAA2B,UAAU;;WACrC;WAA4B;;;;;;;wBAiC3B,4BACd,SAAS,mBACT,QAAQ,sBACP;KAmFS;UAMK;WACN;WACA;WACA;;WAEA;WACA,UAAU;;WAEV;;WAEA;WACA;;WAEA;;;;;;;;UASM,0BAA0B;WAChC;WACA,wBAAwB;WACxB,QAAQ,SAAS,OAAO;;WAExB;;UAGM;WACN,QAAQ;;WAER;;WAEA;WACA;WACA;;WAEA,gBAAgB;;;WAGhB,kBAAkB;WAClB,cAAc;;;;;;;;wBAST,gBAAgB,SAAS,gBAAgB;;;;;;;wBAyGnC,eACpB,mBAAmB,qBACnB,SAAS,wBACR,QAAQ;;wBAwNK,8BAA8B,KAAK;;;;;;wBAmCnC,iBAAiB,eAAe;;;UCvoB/B;WACN;WACA;WACA;WACA;;;wBAMK,2BAA2B,kBAAkB;UAW5C;WACN;WACA;;UAGM;WACN,WAAW;WACX,SAAS;;WAET;;;;;;;;wBASK,yBACd,SAAS,sBACT,kBAAkB,eACjB;UAuCc;WACN,kBAAkB;WAClB;;WAEA,YAAY;;WAEZ;WACA;WACA;;WAEA,gBAAgB;WAChB,cAAc;;UAGR;WACN,YAAY;WACZ;WACA,SAAS;;;;;;;wBAQE,oBACpB,SAAS,sBACT,SAAS,uBACR,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/trajectory-replay/corpus.ts","../../src/trajectory-replay/exec.ts","../../src/trajectory-replay/fix.ts","../../src/trajectory-replay/fix-loop.ts","../../src/trajectory-replay/image-preparer.ts","../../src/trajectory-replay/batch.ts","../../src/trajectory-replay/verify.ts","../../src/trajectory-replay/findings.ts","../../src/trajectory-replay/wire.ts"],"mappings":";;;;;;UAyBiB;WACN;WACA;WACA;;;wBAIK,gBAA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S,mBACT,QAAQ,sBACP;KAmFS;UAMK;WACN;WACA;WACA;;WAEA;WACA,UAAU;;WAEV;;WAEA;WACA;;WAEA;;;;;;;;UASM,0BAA0B;WAChC;WACA,wBAAwB;WACxB,QAAQ,SAAS,OAAO;;WAExB;;UAGM;WACN,QAAQ;;WAER;;WAEA;WACA;WACA;;WAEA,gBAAgB;;;WAGhB,kBAAkB;WAClB,cAAc;;;;;;;;wBAST,gBAAgB,SAAS,gBAAgB;;;;;;;wBAyGnC,eACpB,mBAAmB,qBACnB,SAAS,wBACR,QAAQ;;wBAwNK,8BAA8B,KAAK;;;;;;wBAmCnC,iBAAiB,eAAe;;;UCvoB/B;WACN;WACA;WACA;WACA;;;wBAMK,2BAA2B,kBAAkB;UAW5C;WACN;WACA;;UAGM;WACN,WAAW;WACX,SAAS;;WAET;;;;;;;;wBASK,yBACd,SAAS,sBACT,kBAAkB,eACjB;UAuCc;WACN,kBAAkB;WAClB;;WAEA,YAAY;;WAEZ;WACA;WACA;;WAEA,gBAAgB;WAChB,cAAc;;UAGR;WACN,YAAY;WACZ;WACA,SAAS;;;;;;;wBAQE,oBACpB,SAAS,sBACT,SAAS,uBACR,QAAQ"}
@@ -2154,6 +2154,6 @@ function readFindingsFile(path) {
2154
2154
  return array;
2155
2155
  }
2156
2156
  //#endregion
2157
- export { FORMAT_ERROR_OBSERVATION_PREFIX, PREFIX_DIVERGENCE_TOLERANCE_PCT, SUBMIT_ACTION_SIGNATURE, SandboxCounterfactualRunner, TIMEOUT_OBSERVATION_MARKER, assertReplayableTrajectory, buildFixPrompt, buildRetryFixPrompt, classifyObservation, classifyPrefixStep, classifyVerdict, clipText, countScriptCommands, decodeRecordedTurns, deriveFailureSignature, derivedImageTag, dockerImagePreparer, enumerateReplayableCases, extractFixCommand, finalRecordedOutcome, findingReplayStep, findingTrajectoryId, generateFixCommand, goldIncorrectSteps, ingestRecordedTrajectory, isElidedField, isRecordedTimeout, isSubmitAction, isSubmitOnlyAction, parseCorpusFlag, parseIncorrectStepsSubject, parseObservationOutput, parseRecordedReturncode, readFindingsFile, readLabelEntries, renderBatchReport, renderVerifiedFindingsSection, replayVerify, replayVerifyFinding, resolveCaseResources, resolveFindingInvocation, resolveFindingReplayability, runFixLoop, runReplayBatch, seededSample, summarizePrefixReplay, unreadableExitCount, verifyFindings, wrapActionForExec };
2157
+ export { FORMAT_ERROR_OBSERVATION_PREFIX, PREFIX_DIVERGENCE_TOLERANCE_PCT, SUBMIT_ACTION_SIGNATURE, SandboxCounterfactualRunner, TIMEOUT_OBSERVATION_MARKER, assertReplayableTrajectory, buildFixPrompt, buildRetryFixPrompt, classifyObservation, classifyPrefixStep, classifyVerdict, clipText, countScriptCommands, decodeRecordedTurns, deriveFailureSignature, derivedImageTag, dockerImagePreparer, enumerateReplayableCases, extractFixCommand, finalRecordedOutcome, findingReplayStep, findingTrajectoryId, generateFixCommand, goldIncorrectSteps, ingestRecordedTrajectory, isElidedField, isRecordedTimeout, isSubmitAction, isSubmitOnlyAction, parseCorpusFlag, parseIncorrectStepsSubject, parseObservationOutput, parseRecordedReturncode, readFindingsFile, renderVerifiedFindingsSection, replayVerify, replayVerifyFinding, resolveCaseResources, resolveFindingInvocation, resolveFindingReplayability, runFixLoop, runReplayBatch, seededSample, summarizePrefixReplay, unreadableExitCount, verifyFindings, wrapActionForExec };
2158
2158
 
2159
2159
  //# sourceMappingURL=index.js.map