@tangle-network/agent-eval 0.136.0 → 0.138.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/CHANGELOG.md +86 -1
  2. package/README.md +37 -2
  3. package/dist/{agent-profile-cell-OhuTee9n.js → agent-profile-cell-CbfBm2g6.js} +2 -2
  4. package/dist/{agent-profile-cell-OhuTee9n.js.map → agent-profile-cell-CbfBm2g6.js.map} +1 -1
  5. package/dist/{agent-profile-cell-CCm3l2v2.d.ts → agent-profile-cell-Cw0PVwDr.d.ts} +2 -2
  6. package/dist/{agent-profile-cell-CCm3l2v2.d.ts.map → agent-profile-cell-Cw0PVwDr.d.ts.map} +1 -1
  7. package/dist/analyst/index.d.ts +574 -18
  8. package/dist/analyst/index.d.ts.map +1 -1
  9. package/dist/analyst/index.js +25 -5
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/{analyze-runs-jjCmF8pU.js → analyze-runs-BScZvqMV.js} +6 -6
  12. package/dist/{analyze-runs-jjCmF8pU.js.map → analyze-runs-BScZvqMV.js.map} +1 -1
  13. package/dist/{analyze-runs-Cda5Xkj1.d.ts → analyze-runs-CPYxfPWT.d.ts} +6 -6
  14. package/dist/{analyze-runs-Cda5Xkj1.d.ts.map → analyze-runs-CPYxfPWT.d.ts.map} +1 -1
  15. package/dist/{baseline-BUeFcgrn.js → baseline-C-GocmIW.js} +2 -2
  16. package/dist/{baseline-BUeFcgrn.js.map → baseline-C-GocmIW.js.map} +1 -1
  17. package/dist/benchmark-D8dkki-J.js +554 -0
  18. package/dist/benchmark-D8dkki-J.js.map +1 -0
  19. package/dist/benchmark-DlQgU_XI.d.ts +236 -0
  20. package/dist/benchmark-DlQgU_XI.d.ts.map +1 -0
  21. package/dist/benchmark-command-CMqVqReF.js +4332 -0
  22. package/dist/benchmark-command-CMqVqReF.js.map +1 -0
  23. package/dist/benchmarks/index.d.ts +1 -1
  24. package/dist/benchmarks/index.js +1 -1
  25. package/dist/{benchmarks-Dfgm9ts5.js → benchmarks-BJ_xK5rQ.js} +4 -3
  26. package/dist/{benchmarks-Dfgm9ts5.js.map → benchmarks-BJ_xK5rQ.js.map} +1 -1
  27. package/dist/builder-eval/index.js +2 -2
  28. package/dist/campaign/index.d.ts +6 -6
  29. package/dist/campaign/index.js +4 -4
  30. package/dist/{campaign-Dz8uQnhC.js → campaign-BIBS-NHV.js} +219 -78
  31. package/dist/campaign-BIBS-NHV.js.map +1 -0
  32. package/dist/cli.js +9 -2
  33. package/dist/cli.js.map +1 -1
  34. package/dist/client-BwPKohkJ.d.ts +202 -0
  35. package/dist/client-BwPKohkJ.d.ts.map +1 -0
  36. package/dist/completion-verifier-B4-IMYcS.d.ts +240 -0
  37. package/dist/completion-verifier-B4-IMYcS.d.ts.map +1 -0
  38. package/dist/contract/index.d.ts +10 -9
  39. package/dist/contract/index.d.ts.map +1 -1
  40. package/dist/contract/index.js +13 -13
  41. package/dist/control.d.ts +2 -2
  42. package/dist/control.js +1 -1
  43. package/dist/{cost-ledger-fGS_u_O1.d.ts → cost-ledger-B1D3COAc.d.ts} +6 -5
  44. package/dist/{cost-ledger-fGS_u_O1.d.ts.map → cost-ledger-B1D3COAc.d.ts.map} +1 -1
  45. package/dist/{cost-ledger-DHAjwNj7.js → cost-ledger-CHDLA0Ss.js} +91 -46
  46. package/dist/cost-ledger-CHDLA0Ss.js.map +1 -0
  47. package/dist/{dataset-BvtnC8Dc.d.ts → dataset-v_Y5902-.d.ts} +2 -2
  48. package/dist/{dataset-BvtnC8Dc.d.ts.map → dataset-v_Y5902-.d.ts.map} +1 -1
  49. package/dist/{default-registry-Brxr728w.d.ts → default-registry-PUhIVRWz.d.ts} +77 -138
  50. package/dist/default-registry-PUhIVRWz.d.ts.map +1 -0
  51. package/dist/{default-registry-CHmdy2An.js → default-registry-lp5R0lve.js} +1617 -291
  52. package/dist/default-registry-lp5R0lve.js.map +1 -0
  53. package/dist/{errors-8YnH8WlF.js → errors-D-LKuDhb.js} +8 -2
  54. package/dist/errors-D-LKuDhb.js.map +1 -0
  55. package/dist/{errors-CEk209JS.d.ts → errors-DkfjIDvD.d.ts} +9 -3
  56. package/dist/errors-DkfjIDvD.d.ts.map +1 -0
  57. package/dist/{eval-campaign-Cc8WZJ6b.js → eval-campaign-9MozgKL7.js} +6 -6
  58. package/dist/{eval-campaign-Cc8WZJ6b.js.map → eval-campaign-9MozgKL7.js.map} +1 -1
  59. package/dist/exact-types-Dpw2LeHA.d.ts +234 -0
  60. package/dist/exact-types-Dpw2LeHA.d.ts.map +1 -0
  61. package/dist/{extract-usage-DIQpN-ww.js → extract-usage-CS391dOE.js} +3 -3
  62. package/dist/{extract-usage-DIQpN-ww.js.map → extract-usage-CS391dOE.js.map} +1 -1
  63. package/dist/{feedback-trajectory-CVaeREXV.d.ts → feedback-trajectory-CoNep7rl.d.ts} +91 -3
  64. package/dist/feedback-trajectory-CoNep7rl.d.ts.map +1 -0
  65. package/dist/fuzz.d.ts +1 -1
  66. package/dist/fuzz.js +2 -2
  67. package/dist/hosted/index.d.ts +3 -2
  68. package/dist/hosted/index.d.ts.map +1 -1
  69. package/dist/{index-AbhwHp0V.d.ts → index-B2-IxCMB.d.ts} +2 -2
  70. package/dist/{index-AbhwHp0V.d.ts.map → index-B2-IxCMB.d.ts.map} +1 -1
  71. package/dist/index-BipJlj-C.d.ts +316 -0
  72. package/dist/index-BipJlj-C.d.ts.map +1 -0
  73. package/dist/{index-CQsJcqch.d.ts → index-CjVYlVBK.d.ts} +5 -5
  74. package/dist/{index-CQsJcqch.d.ts.map → index-CjVYlVBK.d.ts.map} +1 -1
  75. package/dist/{index-B4Fjfo5U.d.ts → index-D0cxAdaV.d.ts} +89 -317
  76. package/dist/index-D0cxAdaV.d.ts.map +1 -0
  77. package/dist/{index-DuhJaaiH.d.ts → index-DEb46kc6.d.ts} +2 -2
  78. package/dist/index-DEb46kc6.d.ts.map +1 -0
  79. package/dist/{index-C2fkZhv_.d.ts → index-sMN_hI4E.d.ts} +3 -3
  80. package/dist/{index-C2fkZhv_.d.ts.map → index-sMN_hI4E.d.ts.map} +1 -1
  81. package/dist/index.d.ts +30 -70
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +175 -35
  84. package/dist/index.js.map +1 -1
  85. package/dist/{client-DcvgkaZi.d.ts → insight-report-CXd8VBDR.d.ts} +5 -203
  86. package/dist/insight-report-CXd8VBDR.d.ts.map +1 -0
  87. package/dist/{integrity-rmVhXWA7.d.ts → integrity-B-MLFz0I.d.ts} +3 -3
  88. package/dist/{integrity-rmVhXWA7.d.ts.map → integrity-B-MLFz0I.d.ts.map} +1 -1
  89. package/dist/integrity-CCXTftiL.js +1360 -0
  90. package/dist/integrity-CCXTftiL.js.map +1 -0
  91. package/dist/{integrity-BzRbCHzi.js → integrity-fdt8XPAv.js} +2 -2
  92. package/dist/{integrity-BzRbCHzi.js.map → integrity-fdt8XPAv.js.map} +1 -1
  93. package/dist/ledger-core/index.d.ts +1 -1
  94. package/dist/ledger-core/index.js +1 -1
  95. package/dist/{ledger-core-DAKFKRzi.js → ledger-core-C0Yx1I14.js} +303 -110
  96. package/dist/ledger-core-C0Yx1I14.js.map +1 -0
  97. package/dist/{llm-client-DHx8pzyJ.js → llm-client-Cj3c7PEm.js} +6 -6
  98. package/dist/llm-client-Cj3c7PEm.js.map +1 -0
  99. package/dist/meta-eval/index.d.ts +2 -2
  100. package/dist/meta-eval/index.js +3 -3
  101. package/dist/{mint-DyRUc9k6.js → mint-Ctwk079K.js} +4 -4
  102. package/dist/{mint-DyRUc9k6.js.map → mint-Ctwk079K.js.map} +1 -1
  103. package/dist/multishot/index.d.ts +2 -2
  104. package/dist/openapi.json +1 -1
  105. package/dist/{paired-arms-BbFKrAU-.js → paired-arms-iZ08VFMN.js} +3 -3
  106. package/dist/{paired-arms-BbFKrAU-.js.map → paired-arms-iZ08VFMN.js.map} +1 -1
  107. package/dist/pipelines/index.js +2 -2
  108. package/dist/profile-cell.d.ts +1 -1
  109. package/dist/profile-cell.js +1 -1
  110. package/dist/{proposal-findings-DCawte-y.js → proposal-findings-2GIUo1et.js} +2 -68
  111. package/dist/proposal-findings-2GIUo1et.js.map +1 -0
  112. package/dist/{propose-review-control-SQ-n9-We.js → propose-review-control-DLXz4FCX.js} +2 -2
  113. package/dist/{propose-review-control-SQ-n9-We.js.map → propose-review-control-DLXz4FCX.js.map} +1 -1
  114. package/dist/registry-C4yJTza7.d.ts +178 -0
  115. package/dist/registry-C4yJTza7.d.ts.map +1 -0
  116. package/dist/{release-report-DooPguBc.js → release-report-B5XPBvAU.js} +4 -4
  117. package/dist/{release-report-DooPguBc.js.map → release-report-B5XPBvAU.js.map} +1 -1
  118. package/dist/{release-report-DpBxGGI1.d.ts → release-report-CoyvyLBs.d.ts} +4 -4
  119. package/dist/{release-report-DpBxGGI1.d.ts.map → release-report-CoyvyLBs.d.ts.map} +1 -1
  120. package/dist/{replay-C6wRg47C.js → replay-Cb-4Vf0k.js} +249 -8
  121. package/dist/replay-Cb-4Vf0k.js.map +1 -0
  122. package/dist/{replay-BRfMIs81.d.ts → replay-DbIYwso6.d.ts} +227 -52
  123. package/dist/replay-DbIYwso6.d.ts.map +1 -0
  124. package/dist/reporting.d.ts +4 -4
  125. package/dist/reporting.js +4 -4
  126. package/dist/{researcher-Doo95b50.d.ts → researcher-BCeOEjtR.d.ts} +6 -7
  127. package/dist/researcher-BCeOEjtR.d.ts.map +1 -0
  128. package/dist/{reward-hacking-a-kYs0-i.js → reward-hacking-GyN0kMd8.js} +3 -3
  129. package/dist/{reward-hacking-a-kYs0-i.js.map → reward-hacking-GyN0kMd8.js.map} +1 -1
  130. package/dist/{reward-hacking-D-QqXvg-.d.ts → reward-hacking-sE2l_NV6.d.ts} +2 -2
  131. package/dist/{reward-hacking-D-QqXvg-.d.ts.map → reward-hacking-sE2l_NV6.d.ts.map} +1 -1
  132. package/dist/rl.d.ts +6 -6
  133. package/dist/rl.js +9 -9
  134. package/dist/rollout/index.d.ts +1 -1
  135. package/dist/rollout/index.js +3 -3
  136. package/dist/{rollout-DLSUIWLu.js → rollout-DQFl0UXA.js} +2 -2
  137. package/dist/{rollout-DLSUIWLu.js.map → rollout-DQFl0UXA.js.map} +1 -1
  138. package/dist/{rubric-predictive-validity-BJf-8ejY.js → rubric-predictive-validity-BRR632r1.js} +2 -2
  139. package/dist/{rubric-predictive-validity-BJf-8ejY.js.map → rubric-predictive-validity-BRR632r1.js.map} +1 -1
  140. package/dist/{rubric-predictive-validity-C1dCLcvb.d.ts → rubric-predictive-validity-w2klGv1u.d.ts} +2 -2
  141. package/dist/{rubric-predictive-validity-C1dCLcvb.d.ts.map → rubric-predictive-validity-w2klGv1u.d.ts.map} +1 -1
  142. package/dist/{run-evidence-DokQtX0-.d.ts → run-evidence-CbE0A8Xg.d.ts} +3 -3
  143. package/dist/{run-evidence-DokQtX0-.d.ts.map → run-evidence-CbE0A8Xg.d.ts.map} +1 -1
  144. package/dist/{run-record-DcObtIGh.d.ts → run-record-DwHMk1Ai.d.ts} +4 -4
  145. package/dist/{run-record-DcObtIGh.d.ts.map → run-record-DwHMk1Ai.d.ts.map} +1 -1
  146. package/dist/{run-record-BIwU2wdV.js → run-record-vRgqWmJw.js} +3 -3
  147. package/dist/{run-record-BIwU2wdV.js.map → run-record-vRgqWmJw.js.map} +1 -1
  148. package/dist/{semantic-concept-judge-Btozx3Vc.js → semantic-concept-judge-DYXDPZW0.js} +12 -6
  149. package/dist/semantic-concept-judge-DYXDPZW0.js.map +1 -0
  150. package/dist/{server-Bz3WQJs6.js → server-DLEvyW2z.js} +3 -3
  151. package/dist/{server-Bz3WQJs6.js.map → server-DLEvyW2z.js.map} +1 -1
  152. package/dist/single-run-lock-D_bS5xhj.js +318 -0
  153. package/dist/single-run-lock-D_bS5xhj.js.map +1 -0
  154. package/dist/{skill-usage-BDQVPIG1.d.ts → skill-usage-Bv3G4VkA.d.ts} +36 -48
  155. package/dist/skill-usage-Bv3G4VkA.d.ts.map +1 -0
  156. package/dist/{skillopt-optimization-method-0UmPD6aP.js → skillopt-optimization-method-CjKMZy0d.js} +10 -185
  157. package/dist/skillopt-optimization-method-CjKMZy0d.js.map +1 -0
  158. package/dist/{skillopt-optimization-method-CwSYkv35.d.ts → skillopt-optimization-method-CzfnA8O-.d.ts} +11 -12
  159. package/dist/skillopt-optimization-method-CzfnA8O-.d.ts.map +1 -0
  160. package/dist/{statistics-CnGCLLqc.js → statistics-ByxzSiOM.js} +2 -2
  161. package/dist/{statistics-CnGCLLqc.js.map → statistics-ByxzSiOM.js.map} +1 -1
  162. package/dist/{statistics-CKOqre5S.d.ts → statistics-mf70aXKp.d.ts} +2 -2
  163. package/dist/{statistics-CKOqre5S.d.ts.map → statistics-mf70aXKp.d.ts.map} +1 -1
  164. package/dist/store-otlp-BenKynPE.js +1688 -0
  165. package/dist/store-otlp-BenKynPE.js.map +1 -0
  166. package/dist/{summary-report-BEk8OFLs.js → summary-report-9A5y7EsK.js} +4 -4
  167. package/dist/{summary-report-BEk8OFLs.js.map → summary-report-9A5y7EsK.js.map} +1 -1
  168. package/dist/{summary-report-CPMINBqs.d.ts → summary-report-BKinV4yD.d.ts} +3 -3
  169. package/dist/{summary-report-CPMINBqs.d.ts.map → summary-report-BKinV4yD.d.ts.map} +1 -1
  170. package/dist/supervisor-run/index.d.ts +3 -2
  171. package/dist/supervisor-run/index.js +3 -2
  172. package/dist/{supervisor-run-Dr5HnTup.js → supervisor-run-B2EWUmQY.js} +28 -454
  173. package/dist/supervisor-run-B2EWUmQY.js.map +1 -0
  174. package/dist/{test-graded-scenario-BsqWLmPt.js → test-graded-scenario-JHcKQNpq.js} +2 -2
  175. package/dist/{test-graded-scenario-BsqWLmPt.js.map → test-graded-scenario-JHcKQNpq.js.map} +1 -1
  176. package/dist/tools-DZGdROtG.js +255 -0
  177. package/dist/tools-DZGdROtG.js.map +1 -0
  178. package/dist/traces.d.ts +6 -7
  179. package/dist/traces.js +6 -6
  180. package/dist/types-5q2T25iW.d.ts +804 -0
  181. package/dist/types-5q2T25iW.d.ts.map +1 -0
  182. package/dist/{types-DVjczBM9.d.ts → types-BtJhn8v6.d.ts} +260 -6
  183. package/dist/types-BtJhn8v6.d.ts.map +1 -0
  184. package/dist/{index-CyC1BTmn.d.ts → types-Dea6tiVI.d.ts} +16 -238
  185. package/dist/types-Dea6tiVI.d.ts.map +1 -0
  186. package/dist/{types-DiWLru6Z.d.ts → types-zFYez3PK.d.ts} +5 -5
  187. package/dist/{types-DiWLru6Z.d.ts.map → types-zFYez3PK.d.ts.map} +1 -1
  188. package/dist/wire/index.d.ts +3 -3
  189. package/dist/wire/index.js +1 -1
  190. package/docs/feedback-trajectories.md +100 -1
  191. package/docs/trace-analysis.md +494 -58
  192. package/package.json +9 -3
  193. package/dist/analyst-BkTS3C58.d.ts +0 -89
  194. package/dist/analyst-BkTS3C58.d.ts.map +0 -1
  195. package/dist/analyst-j5je5J7c.js +0 -152
  196. package/dist/analyst-j5je5J7c.js.map +0 -1
  197. package/dist/campaign-Dz8uQnhC.js.map +0 -1
  198. package/dist/client-DcvgkaZi.d.ts.map +0 -1
  199. package/dist/concurrency-MUjT7VjM.js +0 -109
  200. package/dist/concurrency-MUjT7VjM.js.map +0 -1
  201. package/dist/cost-ledger-DHAjwNj7.js.map +0 -1
  202. package/dist/default-registry-Brxr728w.d.ts.map +0 -1
  203. package/dist/default-registry-CHmdy2An.js.map +0 -1
  204. package/dist/errors-8YnH8WlF.js.map +0 -1
  205. package/dist/errors-CEk209JS.d.ts.map +0 -1
  206. package/dist/feedback-trajectory-CVaeREXV.d.ts.map +0 -1
  207. package/dist/index-B4Fjfo5U.d.ts.map +0 -1
  208. package/dist/index-CyC1BTmn.d.ts.map +0 -1
  209. package/dist/index-DuhJaaiH.d.ts.map +0 -1
  210. package/dist/ledger-core-DAKFKRzi.js.map +0 -1
  211. package/dist/llm-client-BiK4HW0u.d.ts +0 -290
  212. package/dist/llm-client-BiK4HW0u.d.ts.map +0 -1
  213. package/dist/llm-client-DHx8pzyJ.js.map +0 -1
  214. package/dist/proposal-findings-DCawte-y.js.map +0 -1
  215. package/dist/raw-provider-sink-BU29Sh8h.d.ts +0 -134
  216. package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +0 -1
  217. package/dist/replay-BRfMIs81.d.ts.map +0 -1
  218. package/dist/replay-C6wRg47C.js.map +0 -1
  219. package/dist/researcher-Doo95b50.d.ts.map +0 -1
  220. package/dist/semantic-concept-judge-Btozx3Vc.js.map +0 -1
  221. package/dist/skill-usage-BDQVPIG1.d.ts.map +0 -1
  222. package/dist/skillopt-optimization-method-0UmPD6aP.js.map +0 -1
  223. package/dist/skillopt-optimization-method-CwSYkv35.d.ts.map +0 -1
  224. package/dist/store-CxJry_cs.d.ts +0 -229
  225. package/dist/store-CxJry_cs.d.ts.map +0 -1
  226. package/dist/supervisor-run-Dr5HnTup.js.map +0 -1
  227. package/dist/tools-D8yTtNSN.js +0 -1190
  228. package/dist/tools-D8yTtNSN.js.map +0 -1
  229. package/dist/types-Cc3qbqzj.d.ts +0 -387
  230. package/dist/types-Cc3qbqzj.d.ts.map +0 -1
  231. package/dist/types-DVjczBM9.d.ts.map +0 -1
@@ -1,21 +1,22 @@
1
- import { s as ValidationError, t as AgentEvalError } from "./errors-8YnH8WlF.js";
2
- import { p as canonicalize, s as buildAgentProfileCell } from "./agent-profile-cell-OhuTee9n.js";
3
- import { i as CostLedger } from "./cost-ledger-DHAjwNj7.js";
4
- import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, u as costReceiptFromLlmError } from "./llm-client-DHx8pzyJ.js";
5
- import { $ as SEARCH_LEDGER_FILE_CONTEXT, B as surfaceContentHash, E as pairHoldout, Et as contentHash, F as assertCodeSurfaceIdentity, J as planCampaignRun, Pt as recoverTruncatedJson, Ut as summarizeBackendIntegrity, Vt as assertRealBackend, Wt as JudgeParseError, Y as runCampaign, et as SearchLedgerConflictError, h as labelTrustRank, nt as SearchLedgerIntegrityError, tt as SearchLedgerError } from "./skillopt-optimization-method-0UmPD6aP.js";
6
- import { C as mulberry32, E as pairedBootstrap, m as eProcess } from "./statistics-CnGCLLqc.js";
7
- import { t as comparePairedArms } from "./paired-arms-BbFKrAU-.js";
8
- import { o as runTaskScore, r as modelHasSnapshot, s as validateRunRecord } from "./run-record-BIwU2wdV.js";
9
- import { t as analyzeTraces } from "./analyst-j5je5J7c.js";
10
- import { c as campaignCellToRunRecord } from "./reward-hacking-a-kYs0-i.js";
11
- import { d as canonicalString, t as FileLedgerJournal } from "./ledger-core-DAKFKRzi.js";
1
+ import { c as ValidationError, t as AgentEvalError } from "./errors-D-LKuDhb.js";
2
+ import { p as canonicalize, s as buildAgentProfileCell } from "./agent-profile-cell-CbfBm2g6.js";
3
+ import { i as CostLedger, t as CostAccountingIncompleteError } from "./cost-ledger-CHDLA0Ss.js";
4
+ import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, u as costReceiptFromLlmError } from "./llm-client-Cj3c7PEm.js";
5
+ import { a as SEARCH_LEDGER_FILE_CONTEXT, c as SearchLedgerIntegrityError, o as SearchLedgerConflictError, s as SearchLedgerError } from "./single-run-lock-D_bS5xhj.js";
6
+ import { _ as canonicalString, t as FileLedgerJournal } from "./ledger-core-C0Yx1I14.js";
7
+ import { E as pairHoldout, Et as recoverTruncatedJson, Ft as summarizeBackendIntegrity, It as JudgeParseError, J as runCampaign, Nt as assertRealBackend, P as assertCodeSurfaceIdentity, h as labelTrustRank, q as planCampaignRun, vt as contentHash, z as surfaceContentHash } from "./skillopt-optimization-method-CjKMZy0d.js";
8
+ import { C as mulberry32, E as pairedBootstrap, m as eProcess } from "./statistics-ByxzSiOM.js";
9
+ import { t as comparePairedArms } from "./paired-arms-iZ08VFMN.js";
10
+ import { o as runTaskScore, r as modelHasSnapshot, s as validateRunRecord } from "./run-record-vRgqWmJw.js";
11
+ import { a as scoreAnalystFindings } from "./benchmark-D8dkki-J.js";
12
+ import { c as campaignCellToRunRecord } from "./reward-hacking-GyN0kMd8.js";
12
13
  import { z } from "zod";
13
14
  import { closeSync, constants, existsSync, fstatSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
14
15
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
15
16
  import { createHash, randomUUID } from "node:crypto";
17
+ import { harnessSupportsModel } from "@tangle-network/agent-interface";
16
18
  import { devNull, tmpdir } from "node:os";
17
19
  import { execFileSync } from "node:child_process";
18
- import { harnessSupportsModel } from "@tangle-network/agent-interface";
19
20
  //#region src/completion-verifier.ts
20
21
  /**
21
22
  * Completion verifier — the task-completion oracle.
@@ -623,78 +624,88 @@ function agentProfileHash(profile) {
623
624
  }
624
625
  //#endregion
625
626
  //#region src/campaign/analyst-surface.ts
626
- function surfaceToText(surface) {
627
- if (typeof surface === "string") return surface;
628
- throw new Error(`buildAnalystSurfaceDispatch: the analyst surface must be a string actorDescription, got a ${surface.kind}-tier surface. The analyst prompt is prompt-tier.`);
629
- }
630
- /**
631
- * Build the `dispatchWithSurface(surface, scenario, ctx)` the improvement loop
632
- * calls: run the analyst with `surface` as its actorDescription over the
633
- * scenario's trace corpus and return its findings.
634
- */
635
- function buildAnalystSurfaceDispatch(opts) {
636
- const analyze = opts.analyze ?? analyzeTraces;
637
- return async (surface, scenario, _ctx) => {
638
- const actorDescription = surfaceToText(surface);
639
- const res = await analyze({ question: scenario.question }, {
640
- ...opts.analystOptions,
641
- actorDescription,
642
- source: scenario.source
627
+ function buildTraceAnalystSurfaceDispatch(options) {
628
+ return async (surface, scenario, context) => {
629
+ if (typeof surface !== "string") throw new TypeError(`buildTraceAnalystSurfaceDispatch requires a string prompt, received ${surface.kind}`);
630
+ return options.analyze({
631
+ actorDescription: surface,
632
+ traceStore: scenario.traceStore,
633
+ runId: `${context.cellId}:${scenario.id}`,
634
+ signal: context.signal
643
635
  });
644
- return {
645
- answer: res.answer,
646
- findings: res.findings,
647
- actorPromptVersion: res.actorPromptVersion
648
- };
649
636
  };
650
637
  }
651
- /**
652
- * Deterministic, ground-truth judge for analyst findings. Composite =
653
- * recall of the scenario's `expectedFailureModes` (optionally blended with a
654
- * precision term that penalizes findings tripping `forbiddenCues`). No LLM —
655
- * the score is a function of the labels, so the analyst prompt is optimized
656
- * toward surfacing real failures, not toward a judge it can flatter.
657
- */
658
- function failureModeRecallJudge(opts = {}) {
659
- const recallWeight = opts.recallWeight ?? .5;
638
+ function traceAnalystQualityJudge() {
660
639
  return {
661
- name: "failure-mode-recall",
662
- dimensions: [{
663
- key: "recall",
664
- description: "fraction of ground-truth failure modes the analyst surfaced"
665
- }, {
666
- key: "precision",
667
- description: "1 − share of findings that named a failure/tool/error absent from this corpus"
668
- }],
669
- appliesTo: (s) => s.kind === "analyst-surface",
670
- score({ artifact, scenario }) {
671
- const modes = scenario.expectedFailureModes;
672
- if (modes.length === 0) throw new Error(`failureModeRecallJudge: scenario '${scenario.id}' has no expectedFailureModes — refusing to score (a vacuous 1.0 would corrupt the comparison)`);
673
- const hay = artifact.findings.join("\n").toLowerCase();
674
- const matched = modes.filter((m) => m.cues.some((c) => hay.includes(c.toLowerCase())));
675
- const recall = matched.length / modes.length;
676
- const forbidden = (scenario.forbiddenCues ?? []).map((c) => c.toLowerCase());
677
- let precision = 1;
678
- let hallucinated = 0;
679
- if (forbidden.length > 0) {
680
- const denom = Math.max(1, artifact.findings.length);
681
- hallucinated = artifact.findings.filter((f) => forbidden.some((c) => f.toLowerCase().includes(c))).length;
682
- precision = 1 - hallucinated / denom;
640
+ name: "trace-analyst-quality",
641
+ judgeVersion: "agent-eval:trace-analyst-quality:v3",
642
+ dimensions: [
643
+ {
644
+ key: "issue_recall",
645
+ description: "share of labeled issues found"
646
+ },
647
+ {
648
+ key: "finding_precision",
649
+ description: "share of findings tied to a labeled issue"
650
+ },
651
+ {
652
+ key: "f1",
653
+ description: "harmonic mean of issue recall and finding precision"
654
+ },
655
+ {
656
+ key: "critical_step_accuracy",
657
+ description: "share of labeled causal steps cited"
658
+ },
659
+ {
660
+ key: "citation_coverage",
661
+ description: "share of findings with evidence citations"
662
+ },
663
+ {
664
+ key: "citation_label_agreement",
665
+ description: "share of citations matching a labeled case location"
666
+ },
667
+ {
668
+ key: "clean",
669
+ description: "1 when a clean case produces no findings"
683
670
  }
684
- const composite = forbidden.length > 0 ? recallWeight * recall + (1 - recallWeight) * precision : recall;
685
- const missed = modes.filter((m) => !matched.includes(m)).map((m) => m.id);
686
- const notes = `matched ${matched.length}/${modes.length} failure modes` + (missed.length ? `; missed [${missed.join(", ")}]` : "") + (hallucinated ? `; ${hallucinated} out-of-corpus finding(s)` : "");
687
- return {
688
- dimensions: {
689
- recall,
690
- precision
691
- },
692
- composite,
693
- notes
694
- };
671
+ ],
672
+ appliesTo: (scenario) => scenario.kind === "trace-analyst" && scenario.labelState !== "unlabeled",
673
+ score({ artifact, scenario }) {
674
+ assertScorableScenario(scenario);
675
+ return traceAnalystJudgeScore(scoreAnalystFindings({
676
+ id: scenario.id,
677
+ expectedIssues: scenario.expectedIssues,
678
+ labeledEvidence: scenario.labeledEvidence
679
+ }, artifact.findings));
695
680
  }
696
681
  };
697
682
  }
683
+ function assertScorableScenario(scenario) {
684
+ if (scenario.labelState === "unlabeled") throw new TypeError(`trace analyst scenario '${scenario.id}' has no quality labels`);
685
+ if (scenario.labelState === "positive" && scenario.expectedIssues.length === 0) throw new TypeError(`positive trace analyst scenario '${scenario.id}' requires expected issues`);
686
+ if (scenario.labelState === "trusted-negative" && scenario.expectedIssues.length > 0) throw new TypeError(`trusted-negative trace analyst scenario '${scenario.id}' cannot contain expected issues`);
687
+ }
688
+ function traceAnalystJudgeScore(score) {
689
+ const dimensions = {
690
+ issue_recall: score.issueRecall,
691
+ finding_precision: score.findingPrecision,
692
+ f1: score.f1,
693
+ clean: score.predictionOnLabelEmptyCase ? 0 : 1
694
+ };
695
+ if (score.criticalStepAccuracy !== null) dimensions.critical_step_accuracy = score.criticalStepAccuracy;
696
+ if (score.citationCoverage !== null) dimensions.citation_coverage = score.citationCoverage;
697
+ if (score.citationLabelAgreement !== null) dimensions.citation_label_agreement = score.citationLabelAgreement;
698
+ const notes = [
699
+ `${score.matchedIssueIds.length}/${score.expectedIssueCount} issues found`,
700
+ `${score.supportedFindingIndexes.length}/${score.supportedFindingIndexes.length + score.unsupportedFindingIndexes.length} findings supported`,
701
+ `${score.unlabeledEvidence.length} citations outside labeled locations`
702
+ ].join("; ");
703
+ return {
704
+ dimensions,
705
+ composite: score.criticalStepAccuracy === null ? score.f1 : (score.f1 + score.criticalStepAccuracy) / 2,
706
+ notes
707
+ };
708
+ }
698
709
  //#endregion
699
710
  //#region src/campaign/cross-surface-context.ts
700
711
  function validateCrossSurfaceInput(input) {
@@ -3373,6 +3384,136 @@ function isTransientTransportFailure(message, opts = {}) {
3373
3384
  return false;
3374
3385
  }
3375
3386
  //#endregion
3387
+ //#region src/campaign/upstream-evaluators.ts
3388
+ function phoenixEvaluatorJudge(evaluator, options) {
3389
+ if ((evaluator.optimizationDirection === "MINIMIZE" || evaluator.optimizationDirection === "NEUTRAL") && !options.toComposite) throw new TypeError(`phoenixEvaluatorJudge requires toComposite for a ${evaluator.optimizationDirection} evaluator`);
3390
+ const paidCall = validatePaidEvaluation(evaluator.name, evaluator.kind, options.paidCall);
3391
+ return upstreamJudge({
3392
+ name: options.name ?? evaluator.name,
3393
+ dimension: options.dimension,
3394
+ judgeVersion: options.judgeVersion,
3395
+ appliesTo: options.appliesTo,
3396
+ toComposite: options.toComposite
3397
+ }, async (input) => {
3398
+ const result = await runUpstreamEvaluation({
3399
+ name: evaluator.name,
3400
+ kind: evaluator.kind,
3401
+ signal: input.signal,
3402
+ costLedger: input.costLedger,
3403
+ costPhase: input.costPhase,
3404
+ costTags: input.costTags,
3405
+ scenarioId: input.scenario.id,
3406
+ paidCall,
3407
+ execute: (context) => evaluator.evaluate(options.mapInput({
3408
+ artifact: input.artifact,
3409
+ scenario: input.scenario
3410
+ }), context)
3411
+ });
3412
+ if (result.score === void 0 || !Number.isFinite(result.score)) throw new Error(`${evaluator.name}: Phoenix evaluator returned no finite score`);
3413
+ return {
3414
+ score: result.score,
3415
+ notes: [result.label, result.explanation].filter(Boolean).join(": ") || evaluator.name
3416
+ };
3417
+ });
3418
+ }
3419
+ function autoevalsScorerJudge(scorer, options) {
3420
+ const paidCall = validatePaidEvaluation(options.name, options.kind, options.paidCall);
3421
+ return upstreamJudge(options, async (input) => {
3422
+ const result = await runUpstreamEvaluation({
3423
+ name: options.name,
3424
+ kind: options.kind,
3425
+ signal: input.signal,
3426
+ costLedger: input.costLedger,
3427
+ costPhase: input.costPhase,
3428
+ costTags: input.costTags,
3429
+ scenarioId: input.scenario.id,
3430
+ paidCall,
3431
+ execute: (context) => scorer(options.mapInput({
3432
+ artifact: input.artifact,
3433
+ scenario: input.scenario
3434
+ }), context)
3435
+ });
3436
+ if (result.score === null || !Number.isFinite(result.score)) throw new Error(`${options.name}: Autoevals scorer returned no finite score`);
3437
+ return {
3438
+ score: result.score,
3439
+ notes: result.metadata ? JSON.stringify(result.metadata) : result.name
3440
+ };
3441
+ });
3442
+ }
3443
+ function upstreamJudge(options, evaluate) {
3444
+ const dimension = options.dimension ?? options.name;
3445
+ return {
3446
+ name: options.name,
3447
+ judgeVersion: options.judgeVersion,
3448
+ dimensions: [{
3449
+ key: dimension,
3450
+ description: `Score from ${options.name}`
3451
+ }],
3452
+ appliesTo: options.appliesTo,
3453
+ async score(input) {
3454
+ const result = await evaluate(input);
3455
+ const composite = options.toComposite ? options.toComposite(result.score) : result.score;
3456
+ if (!Number.isFinite(composite)) throw new Error(`${options.name}: toComposite returned a non-finite score`);
3457
+ return {
3458
+ dimensions: { [dimension]: result.score },
3459
+ composite,
3460
+ notes: result.notes
3461
+ };
3462
+ }
3463
+ };
3464
+ }
3465
+ function validatePaidEvaluation(name, kind, paidCall) {
3466
+ if (kind === "CODE") {
3467
+ if (paidCall) throw new TypeError(`${name}: CODE evaluator cannot declare paidCall`);
3468
+ return;
3469
+ }
3470
+ if (!paidCall) throw new TypeError(`${name}: LLM evaluator requires paidCall cost and token capture`);
3471
+ if (!paidCall.model.trim()) throw new TypeError(`${name}: paidCall.model must be non-empty`);
3472
+ return paidCall;
3473
+ }
3474
+ async function runUpstreamEvaluation(input) {
3475
+ if (input.kind === "CODE") return abortableEvaluation(input.signal, () => input.execute({ signal: input.signal }));
3476
+ if (!input.paidCall) throw new CostAccountingIncompleteError(`${input.name}: missing paid-call configuration`);
3477
+ if (!input.costLedger) throw new CostAccountingIncompleteError(`${input.name}: LLM evaluator requires the campaign cost ledger`);
3478
+ const paid = await input.costLedger.runPaidCall({
3479
+ channel: "judge",
3480
+ phase: input.costPhase ?? "judge",
3481
+ actor: input.name,
3482
+ model: input.paidCall.model,
3483
+ ...input.paidCall.maximumCharge ? { maximumCharge: input.paidCall.maximumCharge } : {},
3484
+ tags: {
3485
+ ...input.costTags,
3486
+ scenarioId: input.scenarioId
3487
+ },
3488
+ signal: input.signal,
3489
+ execute: (signal, callId) => Promise.resolve(input.execute({
3490
+ signal,
3491
+ callId
3492
+ })),
3493
+ receipt: input.paidCall.receipt,
3494
+ ...input.paidCall.receiptFromError ? { receiptFromError: input.paidCall.receiptFromError } : {}
3495
+ });
3496
+ if (!paid.succeeded) throw paid.error;
3497
+ const recorded = input.costLedger.list().find((receipt) => receipt.callId === paid.callId);
3498
+ if (!recorded) throw new CostAccountingIncompleteError(`${input.name}: paid evaluator returned without a recorded cost receipt`);
3499
+ if (recorded.costUnknown || recorded.usageUnknown) throw new CostAccountingIncompleteError(`${input.name}: paid evaluator returned without complete cost and token usage`);
3500
+ return paid.value;
3501
+ }
3502
+ async function abortableEvaluation(signal, execute) {
3503
+ if (signal.aborted) throw signal.reason;
3504
+ let rejectAborted;
3505
+ const aborted = new Promise((_resolve, reject) => {
3506
+ rejectAborted = reject;
3507
+ });
3508
+ const onAbort = () => rejectAborted(signal.reason);
3509
+ signal.addEventListener("abort", onAbort, { once: true });
3510
+ try {
3511
+ return await Promise.race([Promise.resolve().then(execute), aborted]);
3512
+ } finally {
3513
+ signal.removeEventListener("abort", onAbort);
3514
+ }
3515
+ }
3516
+ //#endregion
3376
3517
  //#region src/campaign/worktree/index.ts
3377
3518
  /**
3378
3519
  * VCS-pluggable worktree adapter. One improvement = one worktree, PR-like
@@ -3894,6 +4035,6 @@ function resolveWorktreePath(surface, worktreeDir) {
3894
4035
  return verifyCodeSurface(surface, worktreeDir).path;
3895
4036
  }
3896
4037
  //#endregion
3897
- export { planEvalFixtureRun as A, harnessAxisOf as B, rolloutArgumentDiff as C, discoverEvalFixtures as D, neutralizationGate as E, HARNESS_NATIVE_MODEL as F, parseCorrectnessResponse as G, completionVerdict as H, agentProfileHash as I, verifyCompletion as K, agentProfileId as L, buildAnalystSurfaceDispatch as M, failureModeRecallJudge as N, loadEvalFixture as O, CODING_HARNESSES as P, agentProfileModelId as R, classifyUngroundedLiterals as S, sequentialPairedGate as T, createLlmCorrectnessChecker as U, extractProducedState as V, createTokenRecallChecker as W, scoreboardSummary as _, isTransientTransportFailure as a, FsLabeledScenarioStore as b, openSearchLedger as c, selectDiscriminative as d, ProfileMatrixError as f, scoreUserStory as g, renderScoreboardMarkdown as h, verifyCodeSurface as i, analyzeCrossSurfaceInteractions as j, loadEvalFixtureScenarios as k, validateSearchLedgerEvent as l, makePlaybackDispatch as m, gitWorktreeAdapter as n, FileSearchLedger as o, runProfileMatrix as p, resolveWorktreePath as r, SEARCH_LEDGER_SCHEMA as s, WorktreeAdapterError as t, scoreDiscrimination as u, userStoryScoreboard as v, sequentialDecide as w, LabeledScenarioStoreError as x, neutralizeText as y, expandProfileAxes as z };
4038
+ export { loadEvalFixture as A, agentProfileModelId as B, LabeledScenarioStoreError as C, sequentialPairedGate as D, sequentialDecide as E, traceAnalystQualityJudge as F, createLlmCorrectnessChecker as G, harnessAxisOf as H, CODING_HARNESSES as I, verifyCompletion as J, createTokenRecallChecker as K, HARNESS_NATIVE_MODEL as L, planEvalFixtureRun as M, analyzeCrossSurfaceInteractions as N, neutralizationGate as O, buildTraceAnalystSurfaceDispatch as P, agentProfileHash as R, FsLabeledScenarioStore as S, rolloutArgumentDiff as T, extractProducedState as U, expandProfileAxes as V, completionVerdict as W, renderScoreboardMarkdown as _, autoevalsScorerJudge as a, userStoryScoreboard as b, FileSearchLedger as c, validateSearchLedgerEvent as d, scoreDiscrimination as f, makePlaybackDispatch as g, runProfileMatrix as h, verifyCodeSurface as i, loadEvalFixtureScenarios as j, discoverEvalFixtures as k, SEARCH_LEDGER_SCHEMA as l, ProfileMatrixError as m, gitWorktreeAdapter as n, phoenixEvaluatorJudge as o, selectDiscriminative as p, parseCorrectnessResponse as q, resolveWorktreePath as r, isTransientTransportFailure as s, WorktreeAdapterError as t, openSearchLedger as u, scoreUserStory as v, classifyUngroundedLiterals as w, neutralizeText as x, scoreboardSummary as y, agentProfileId as z };
3898
4039
 
3899
- //# sourceMappingURL=campaign-Dz8uQnhC.js.map
4040
+ //# sourceMappingURL=campaign-BIBS-NHV.js.map