@tangle-network/agent-eval 0.128.2 → 0.130.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 (424) hide show
  1. package/CHANGELOG.md +279 -0
  2. package/README.md +19 -0
  3. package/dist/active-curriculum-C4mk67HP.js +214 -0
  4. package/dist/active-curriculum-C4mk67HP.js.map +1 -0
  5. package/dist/adversarial-smnADNFS.d.ts +21 -0
  6. package/dist/adversarial-smnADNFS.d.ts.map +1 -0
  7. package/dist/analyst/index.d.ts +83 -2932
  8. package/dist/analyst/index.d.ts.map +1 -0
  9. package/dist/analyst/index.js +319 -364
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/analyst-BkTS3C58.d.ts +89 -0
  12. package/dist/analyst-BkTS3C58.d.ts.map +1 -0
  13. package/dist/analyst-LsnNpSkm.js +152 -0
  14. package/dist/analyst-LsnNpSkm.js.map +1 -0
  15. package/dist/analyze-runs-C1CavBMk.js +1067 -0
  16. package/dist/analyze-runs-C1CavBMk.js.map +1 -0
  17. package/dist/analyze-runs-FsgYCinh.d.ts +72 -0
  18. package/dist/analyze-runs-FsgYCinh.d.ts.map +1 -0
  19. package/dist/attribute-vocabulary-DLJ6303h.d.ts +54 -0
  20. package/dist/attribute-vocabulary-DLJ6303h.d.ts.map +1 -0
  21. package/dist/authenticity/index.d.ts +81 -79
  22. package/dist/authenticity/index.d.ts.map +1 -0
  23. package/dist/authenticity/index.js +209 -193
  24. package/dist/authenticity/index.js.map +1 -1
  25. package/dist/baseline-HsBvw_dk.js +550 -0
  26. package/dist/baseline-HsBvw_dk.js.map +1 -0
  27. package/dist/baseline-hG3K85h4.d.ts +125 -0
  28. package/dist/baseline-hG3K85h4.d.ts.map +1 -0
  29. package/dist/belief-state/index.d.ts +448 -1205
  30. package/dist/belief-state/index.d.ts.map +1 -0
  31. package/dist/belief-state/index.js +1617 -1710
  32. package/dist/belief-state/index.js.map +1 -1
  33. package/dist/benchmarks/index.d.ts +2 -894
  34. package/dist/benchmarks/index.js +2 -59
  35. package/dist/benchmarks-DviOvUNr.js +754 -0
  36. package/dist/benchmarks-DviOvUNr.js.map +1 -0
  37. package/dist/builder-eval/index.d.ts +150 -662
  38. package/dist/builder-eval/index.d.ts.map +1 -0
  39. package/dist/builder-eval/index.js +356 -345
  40. package/dist/builder-eval/index.js.map +1 -1
  41. package/dist/calibration-CNWWA6K8.js +94 -0
  42. package/dist/calibration-CNWWA6K8.js.map +1 -0
  43. package/dist/campaign/index.d.ts +5 -6390
  44. package/dist/campaign/index.js +3 -212
  45. package/dist/campaign-CBKZvQ1H.js +3885 -0
  46. package/dist/campaign-CBKZvQ1H.js.map +1 -0
  47. package/dist/cli.d.ts +1 -1
  48. package/dist/cli.js +164 -174
  49. package/dist/cli.js.map +1 -1
  50. package/dist/client-C97NMzqi.d.ts +581 -0
  51. package/dist/client-C97NMzqi.d.ts.map +1 -0
  52. package/dist/client-CYzbdJOZ.js +637 -0
  53. package/dist/client-CYzbdJOZ.js.map +1 -0
  54. package/dist/code-agent-session-BjkMTQ7H.js +1390 -0
  55. package/dist/code-agent-session-BjkMTQ7H.js.map +1 -0
  56. package/dist/code-agent-session-DqqgOJaz.d.ts +143 -0
  57. package/dist/code-agent-session-DqqgOJaz.d.ts.map +1 -0
  58. package/dist/concurrency-DIxRZF_J.js +85 -0
  59. package/dist/concurrency-DIxRZF_J.js.map +1 -0
  60. package/dist/contract/index.d.ts +645 -5605
  61. package/dist/contract/index.d.ts.map +1 -0
  62. package/dist/contract/index.js +1730 -1937
  63. package/dist/contract/index.js.map +1 -1
  64. package/dist/control.d.ts +3 -1030
  65. package/dist/control.js +2 -32
  66. package/dist/cost-ledger-DIgQUFZZ.js +801 -0
  67. package/dist/cost-ledger-DIgQUFZZ.js.map +1 -0
  68. package/dist/cost-ledger-Dye6jCgg.d.ts +236 -0
  69. package/dist/cost-ledger-Dye6jCgg.d.ts.map +1 -0
  70. package/dist/dataset-BvtnC8Dc.d.ts +115 -0
  71. package/dist/dataset-BvtnC8Dc.d.ts.map +1 -0
  72. package/dist/default-registry-C-vFCSEc.js +2579 -0
  73. package/dist/default-registry-C-vFCSEc.js.map +1 -0
  74. package/dist/default-registry-CNPo-Vsb.d.ts +540 -0
  75. package/dist/default-registry-CNPo-Vsb.d.ts.map +1 -0
  76. package/dist/emitter-CPBAhxum.js +266 -0
  77. package/dist/emitter-CPBAhxum.js.map +1 -0
  78. package/dist/emitter-DGQGoLyj.d.ts +113 -0
  79. package/dist/emitter-DGQGoLyj.d.ts.map +1 -0
  80. package/dist/errors-8YnH8WlF.js +64 -0
  81. package/dist/errors-8YnH8WlF.js.map +1 -0
  82. package/dist/errors-CEk209JS.d.ts +76 -0
  83. package/dist/errors-CEk209JS.d.ts.map +1 -0
  84. package/dist/eval-campaign-DEm6c8ru.js +349 -0
  85. package/dist/eval-campaign-DEm6c8ru.js.map +1 -0
  86. package/dist/execution-tracks-CpgFPpS5.js +93 -0
  87. package/dist/execution-tracks-CpgFPpS5.js.map +1 -0
  88. package/dist/exporters-q9iL-2Jf.js +148 -0
  89. package/dist/exporters-q9iL-2Jf.js.map +1 -0
  90. package/dist/extract-usage-BrQ8mCLX.js +155 -0
  91. package/dist/extract-usage-BrQ8mCLX.js.map +1 -0
  92. package/dist/failure-cluster-CqcvCcdR.d.ts +59 -0
  93. package/dist/failure-cluster-CqcvCcdR.d.ts.map +1 -0
  94. package/dist/feedback-trajectory-CVaeREXV.d.ts +340 -0
  95. package/dist/feedback-trajectory-CVaeREXV.d.ts.map +1 -0
  96. package/dist/fuzz.d.ts +320 -646
  97. package/dist/fuzz.d.ts.map +1 -0
  98. package/dist/fuzz.js +670 -617
  99. package/dist/fuzz.js.map +1 -1
  100. package/dist/hf-dataset-DBJXXoY1.js +763 -0
  101. package/dist/hf-dataset-DBJXXoY1.js.map +1 -0
  102. package/dist/hosted/index.d.ts +11 -831
  103. package/dist/hosted/index.d.ts.map +1 -0
  104. package/dist/hosted/index.js +2 -37
  105. package/dist/index-2JJSA6-r2.d.ts +926 -0
  106. package/dist/index-2JJSA6-r2.d.ts.map +1 -0
  107. package/dist/index-6N0aYmpW.d.ts +217 -0
  108. package/dist/index-6N0aYmpW.d.ts.map +1 -0
  109. package/dist/index-BAvgST_9.d.ts +131 -0
  110. package/dist/index-BAvgST_9.d.ts.map +1 -0
  111. package/dist/index-BvnJuTGD.d.ts +68 -0
  112. package/dist/index-BvnJuTGD.d.ts.map +1 -0
  113. package/dist/index-C61Wi7yg.d.ts +547 -0
  114. package/dist/index-C61Wi7yg.d.ts.map +1 -0
  115. package/dist/index-CAPUUKaM.d.ts +335 -0
  116. package/dist/index-CAPUUKaM.d.ts.map +1 -0
  117. package/dist/index-DE5fb3EC.d.ts +2244 -0
  118. package/dist/index-DE5fb3EC.d.ts.map +1 -0
  119. package/dist/index-DSC51roc.d.ts +102 -0
  120. package/dist/index-DSC51roc.d.ts.map +1 -0
  121. package/dist/index.d.ts +3776 -15120
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +11185 -11191
  124. package/dist/index.js.map +1 -1
  125. package/dist/integrity-BzRbCHzi.js +424 -0
  126. package/dist/integrity-BzRbCHzi.js.map +1 -0
  127. package/dist/integrity-rmVhXWA7.d.ts +61 -0
  128. package/dist/integrity-rmVhXWA7.d.ts.map +1 -0
  129. package/dist/judge-calibration-DFtEMlde.d.ts +146 -0
  130. package/dist/judge-calibration-DFtEMlde.d.ts.map +1 -0
  131. package/dist/ledger-core/index.d.ts +2 -0
  132. package/dist/ledger-core/index.js +2 -0
  133. package/dist/ledger-core-DtZz1RG0.js +388 -0
  134. package/dist/ledger-core-DtZz1RG0.js.map +1 -0
  135. package/dist/llm-client--GR4JbZE.js +687 -0
  136. package/dist/llm-client--GR4JbZE.js.map +1 -0
  137. package/dist/llm-client-B_nIBlYo.d.ts +290 -0
  138. package/dist/llm-client-B_nIBlYo.d.ts.map +1 -0
  139. package/dist/matrix/index.d.ts +3 -155
  140. package/dist/matrix/index.js +2 -8
  141. package/dist/matrix-BzQnu2S6.js +270 -0
  142. package/dist/matrix-BzQnu2S6.js.map +1 -0
  143. package/dist/meta-eval/index.d.ts +4 -1027
  144. package/dist/meta-eval/index.js +393 -390
  145. package/dist/meta-eval/index.js.map +1 -1
  146. package/dist/metrics-C9YY1OcL.js +239 -0
  147. package/dist/metrics-C9YY1OcL.js.map +1 -0
  148. package/dist/mint-yN2M2eh0.js +201 -0
  149. package/dist/mint-yN2M2eh0.js.map +1 -0
  150. package/dist/multi-layer-verifier-BHY1gWAc.d.ts +138 -0
  151. package/dist/multi-layer-verifier-BHY1gWAc.d.ts.map +1 -0
  152. package/dist/multishot/index.d.ts +273 -481
  153. package/dist/multishot/index.d.ts.map +1 -0
  154. package/dist/multishot/index.js +595 -548
  155. package/dist/multishot/index.js.map +1 -1
  156. package/dist/off-policy-DvgzvtIx.js +220 -0
  157. package/dist/off-policy-DvgzvtIx.js.map +1 -0
  158. package/dist/off-policy-mskQw8Mb.d.ts +153 -0
  159. package/dist/off-policy-mskQw8Mb.d.ts.map +1 -0
  160. package/dist/openapi.json +1 -1
  161. package/dist/opencode-sqlite-BGrHeDu3.js +318 -0
  162. package/dist/opencode-sqlite-BGrHeDu3.js.map +1 -0
  163. package/dist/outcome-store-BYHIuO0e.d.ts +65 -0
  164. package/dist/outcome-store-BYHIuO0e.d.ts.map +1 -0
  165. package/dist/outcome-store-ChBKlTd_.js +75 -0
  166. package/dist/outcome-store-ChBKlTd_.js.map +1 -0
  167. package/dist/paired-arms-D9D0wXj2.js +260 -0
  168. package/dist/paired-arms-D9D0wXj2.js.map +1 -0
  169. package/dist/pipelines/index.d.ts +95 -532
  170. package/dist/pipelines/index.d.ts.map +1 -0
  171. package/dist/pipelines/index.js +497 -478
  172. package/dist/pipelines/index.js.map +1 -1
  173. package/dist/pre-registration-DakwTRXk.js +96 -0
  174. package/dist/pre-registration-DakwTRXk.js.map +1 -0
  175. package/dist/propose-review-control-LhIWGzHl.js +1458 -0
  176. package/dist/propose-review-control-LhIWGzHl.js.map +1 -0
  177. package/dist/query-CJ_DX8vl.d.ts +28 -0
  178. package/dist/query-CJ_DX8vl.d.ts.map +1 -0
  179. package/dist/query-Di7eEQ79.js +83 -0
  180. package/dist/query-Di7eEQ79.js.map +1 -0
  181. package/dist/raw-provider-sink-BQd7mzyT.js +201 -0
  182. package/dist/raw-provider-sink-BQd7mzyT.js.map +1 -0
  183. package/dist/raw-provider-sink-BU29Sh8h.d.ts +134 -0
  184. package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +1 -0
  185. package/dist/redact-7Aq1ukl-.js +107 -0
  186. package/dist/redact-7Aq1ukl-.js.map +1 -0
  187. package/dist/release-report-Cz9NKH39.js +603 -0
  188. package/dist/release-report-Cz9NKH39.js.map +1 -0
  189. package/dist/release-report-mvB2G4_J.d.ts +244 -0
  190. package/dist/release-report-mvB2G4_J.d.ts.map +1 -0
  191. package/dist/replay-GnyotH0J.js +1741 -0
  192. package/dist/replay-GnyotH0J.js.map +1 -0
  193. package/dist/replay-OoidtG1E.d.ts +749 -0
  194. package/dist/replay-OoidtG1E.d.ts.map +1 -0
  195. package/dist/reporting.d.ts +6 -1298
  196. package/dist/reporting.js +6 -50
  197. package/dist/researcher-CwTdwXG1.d.ts +314 -0
  198. package/dist/researcher-CwTdwXG1.d.ts.map +1 -0
  199. package/dist/reward-hacking-eAnOsynk.d.ts +224 -0
  200. package/dist/reward-hacking-eAnOsynk.d.ts.map +1 -0
  201. package/dist/reward-hacking-qipEpKvY.js +596 -0
  202. package/dist/reward-hacking-qipEpKvY.js.map +1 -0
  203. package/dist/reward-nw2xZGZG.js +137 -0
  204. package/dist/reward-nw2xZGZG.js.map +1 -0
  205. package/dist/rl.d.ts +916 -3596
  206. package/dist/rl.d.ts.map +1 -0
  207. package/dist/rl.js +2362 -1751
  208. package/dist/rl.js.map +1 -1
  209. package/dist/rolldown-runtime-8H4AJuhK.js +14 -0
  210. package/dist/rollout/index.d.ts +3 -1048
  211. package/dist/rollout/index.js +8 -110
  212. package/dist/rollout-BOYjemfR.js +624 -0
  213. package/dist/rollout-BOYjemfR.js.map +1 -0
  214. package/dist/rubric-predictive-validity-B3xmbmS1.js +141 -0
  215. package/dist/rubric-predictive-validity-B3xmbmS1.js.map +1 -0
  216. package/dist/rubric-predictive-validity-Ku_clp_1.d.ts +74 -0
  217. package/dist/rubric-predictive-validity-Ku_clp_1.d.ts.map +1 -0
  218. package/dist/run-evidence-ClRX_8A9.d.ts +225 -0
  219. package/dist/run-evidence-ClRX_8A9.d.ts.map +1 -0
  220. package/dist/run-record-BuoE80Dq.js +467 -0
  221. package/dist/run-record-BuoE80Dq.js.map +1 -0
  222. package/dist/run-record-CnZu_gjl.d.ts +357 -0
  223. package/dist/run-record-CnZu_gjl.d.ts.map +1 -0
  224. package/dist/run-score-iEEAWiBY.js +41 -0
  225. package/dist/run-score-iEEAWiBY.js.map +1 -0
  226. package/dist/runtime-trajectory-1gyaTOoC.js +93 -0
  227. package/dist/runtime-trajectory-1gyaTOoC.js.map +1 -0
  228. package/dist/runtime-trajectory-BvSZcCHD.d.ts +50 -0
  229. package/dist/runtime-trajectory-BvSZcCHD.d.ts.map +1 -0
  230. package/dist/schema-BtVldJ3T.d.ts +206 -0
  231. package/dist/schema-BtVldJ3T.d.ts.map +1 -0
  232. package/dist/schema-C6DW4ZHR.js +821 -0
  233. package/dist/schema-C6DW4ZHR.js.map +1 -0
  234. package/dist/schema-CRhEY1SO.js +69 -0
  235. package/dist/schema-CRhEY1SO.js.map +1 -0
  236. package/dist/schema-Cef2cFmb.d.ts +408 -0
  237. package/dist/schema-Cef2cFmb.d.ts.map +1 -0
  238. package/dist/semantic-concept-judge-B6cWNJ2K.js +725 -0
  239. package/dist/semantic-concept-judge-B6cWNJ2K.js.map +1 -0
  240. package/dist/sequential-Br0mAPHA.js +148 -0
  241. package/dist/sequential-Br0mAPHA.js.map +1 -0
  242. package/dist/sequential-CYwq6Ff_.d.ts +141 -0
  243. package/dist/sequential-CYwq6Ff_.d.ts.map +1 -0
  244. package/dist/series-convergence-CjO2QdRW.js +43 -0
  245. package/dist/series-convergence-CjO2QdRW.js.map +1 -0
  246. package/dist/series-convergence-ofsqPWhs.d.ts +35 -0
  247. package/dist/series-convergence-ofsqPWhs.d.ts.map +1 -0
  248. package/dist/server-m5D9cvnG.js +1040 -0
  249. package/dist/server-m5D9cvnG.js.map +1 -0
  250. package/dist/skill-usage-C_pXm7lP.d.ts +534 -0
  251. package/dist/skill-usage-C_pXm7lP.d.ts.map +1 -0
  252. package/dist/skillopt-optimization-method-B7wX7XkF.d.ts +1739 -0
  253. package/dist/skillopt-optimization-method-B7wX7XkF.d.ts.map +1 -0
  254. package/dist/skillopt-optimization-method-D4ODwFVV.js +7712 -0
  255. package/dist/skillopt-optimization-method-D4ODwFVV.js.map +1 -0
  256. package/dist/statistics-Cmj6nynr.d.ts +514 -0
  257. package/dist/statistics-Cmj6nynr.d.ts.map +1 -0
  258. package/dist/statistics-CnnxdpOg.js +1437 -0
  259. package/dist/statistics-CnnxdpOg.js.map +1 -0
  260. package/dist/store-CT9YIIve.d.ts +117 -0
  261. package/dist/store-CT9YIIve.d.ts.map +1 -0
  262. package/dist/store-CxJry_cs.d.ts +229 -0
  263. package/dist/store-CxJry_cs.d.ts.map +1 -0
  264. package/dist/storyboard/index.d.ts +84 -203
  265. package/dist/storyboard/index.d.ts.map +1 -0
  266. package/dist/storyboard/index.js +609 -542
  267. package/dist/storyboard/index.js.map +1 -1
  268. package/dist/summary-report-BNs5nmXI.js +862 -0
  269. package/dist/summary-report-BNs5nmXI.js.map +1 -0
  270. package/dist/summary-report-Cj9gdw4i.d.ts +407 -0
  271. package/dist/summary-report-Cj9gdw4i.d.ts.map +1 -0
  272. package/dist/supervisor-run/index.d.ts +2 -849
  273. package/dist/supervisor-run/index.js +2 -64
  274. package/dist/supervisor-run-_lnTLM3z.js +1679 -0
  275. package/dist/supervisor-run-_lnTLM3z.js.map +1 -0
  276. package/dist/task-failure-attributes-CQZlB3et.js +311 -0
  277. package/dist/task-failure-attributes-CQZlB3et.js.map +1 -0
  278. package/dist/test-graded-scenario-BsqWLmPt.js +318 -0
  279. package/dist/test-graded-scenario-BsqWLmPt.js.map +1 -0
  280. package/dist/test-graded-scenario-D1TaI2va.d.ts +141 -0
  281. package/dist/test-graded-scenario-D1TaI2va.d.ts.map +1 -0
  282. package/dist/tools-BmuN627J.js +1085 -0
  283. package/dist/tools-BmuN627J.js.map +1 -0
  284. package/dist/trace-attributes.d.ts +2 -52
  285. package/dist/trace-attributes.js +131 -61
  286. package/dist/trace-attributes.js.map +1 -1
  287. package/dist/traces.d.ts +12 -2365
  288. package/dist/traces.js +12 -251
  289. package/dist/trajectory-D_7rLrvE.js +56 -0
  290. package/dist/trajectory-D_7rLrvE.js.map +1 -0
  291. package/dist/types-DGsxbAEd.d.ts +387 -0
  292. package/dist/types-DGsxbAEd.d.ts.map +1 -0
  293. package/dist/types-k9tZGKUg.d.ts +640 -0
  294. package/dist/types-k9tZGKUg.d.ts.map +1 -0
  295. package/dist/verdict-Dps8_okt.d.ts +37 -0
  296. package/dist/verdict-Dps8_okt.d.ts.map +1 -0
  297. package/dist/wire/index.d.ts +702 -1174
  298. package/dist/wire/index.d.ts.map +1 -0
  299. package/dist/wire/index.js +2 -81
  300. package/docs/feature-guide.md +1 -1
  301. package/docs/rollout.md +116 -2
  302. package/package.json +18 -10
  303. package/dist/benchmarks/index.js.map +0 -1
  304. package/dist/campaign/index.js.map +0 -1
  305. package/dist/chunk-2JX3CFMB.js +0 -695
  306. package/dist/chunk-2JX3CFMB.js.map +0 -1
  307. package/dist/chunk-2MKQIFS4.js +0 -183
  308. package/dist/chunk-2MKQIFS4.js.map +0 -1
  309. package/dist/chunk-3RF76KTD.js +0 -84
  310. package/dist/chunk-3RF76KTD.js.map +0 -1
  311. package/dist/chunk-5DTSBUL2.js +0 -159
  312. package/dist/chunk-5DTSBUL2.js.map +0 -1
  313. package/dist/chunk-7ZZMD7UK.js +0 -386
  314. package/dist/chunk-7ZZMD7UK.js.map +0 -1
  315. package/dist/chunk-BOD4O7OF.js +0 -40
  316. package/dist/chunk-BOD4O7OF.js.map +0 -1
  317. package/dist/chunk-BYT7ELPS.js +0 -1553
  318. package/dist/chunk-BYT7ELPS.js.map +0 -1
  319. package/dist/chunk-DJKY2TSY.js +0 -2428
  320. package/dist/chunk-DJKY2TSY.js.map +0 -1
  321. package/dist/chunk-DPUHNQLN.js +0 -232
  322. package/dist/chunk-DPUHNQLN.js.map +0 -1
  323. package/dist/chunk-DRYIUNWY.js +0 -622
  324. package/dist/chunk-DRYIUNWY.js.map +0 -1
  325. package/dist/chunk-EJGRPCO3.js +0 -617
  326. package/dist/chunk-EJGRPCO3.js.map +0 -1
  327. package/dist/chunk-EOSZT7PL.js +0 -2001
  328. package/dist/chunk-EOSZT7PL.js.map +0 -1
  329. package/dist/chunk-EZJEIH2R.js +0 -1559
  330. package/dist/chunk-EZJEIH2R.js.map +0 -1
  331. package/dist/chunk-GGE4NNQT.js +0 -65
  332. package/dist/chunk-GGE4NNQT.js.map +0 -1
  333. package/dist/chunk-HHWE3POT.js +0 -94
  334. package/dist/chunk-HHWE3POT.js.map +0 -1
  335. package/dist/chunk-IHQDPH7D.js +0 -171
  336. package/dist/chunk-IHQDPH7D.js.map +0 -1
  337. package/dist/chunk-JHCHEVET.js +0 -274
  338. package/dist/chunk-JHCHEVET.js.map +0 -1
  339. package/dist/chunk-K4DBDHLK.js +0 -158
  340. package/dist/chunk-K4DBDHLK.js.map +0 -1
  341. package/dist/chunk-K6N6XJJX.js +0 -306
  342. package/dist/chunk-K6N6XJJX.js.map +0 -1
  343. package/dist/chunk-MA6HLL3S.js +0 -65
  344. package/dist/chunk-MA6HLL3S.js.map +0 -1
  345. package/dist/chunk-MAZ26DC7.js +0 -99
  346. package/dist/chunk-MAZ26DC7.js.map +0 -1
  347. package/dist/chunk-MHELPNRP.js +0 -1212
  348. package/dist/chunk-MHELPNRP.js.map +0 -1
  349. package/dist/chunk-NACAGYSY.js +0 -1040
  350. package/dist/chunk-NACAGYSY.js.map +0 -1
  351. package/dist/chunk-NKAGIDE2.js +0 -7633
  352. package/dist/chunk-NKAGIDE2.js.map +0 -1
  353. package/dist/chunk-NPCTHQIO.js +0 -91
  354. package/dist/chunk-NPCTHQIO.js.map +0 -1
  355. package/dist/chunk-NYLOYM6N.js +0 -332
  356. package/dist/chunk-NYLOYM6N.js.map +0 -1
  357. package/dist/chunk-ONWEPEDO.js +0 -57
  358. package/dist/chunk-ONWEPEDO.js.map +0 -1
  359. package/dist/chunk-P5W7RQKK.js +0 -576
  360. package/dist/chunk-P5W7RQKK.js.map +0 -1
  361. package/dist/chunk-P6FYH6K4.js +0 -1161
  362. package/dist/chunk-P6FYH6K4.js.map +0 -1
  363. package/dist/chunk-PBE2LOSS.js +0 -669
  364. package/dist/chunk-PBE2LOSS.js.map +0 -1
  365. package/dist/chunk-PC4UYEBM.js +0 -166
  366. package/dist/chunk-PC4UYEBM.js.map +0 -1
  367. package/dist/chunk-PXE2VKMX.js +0 -140
  368. package/dist/chunk-PXE2VKMX.js.map +0 -1
  369. package/dist/chunk-PZ5AY32C.js +0 -10
  370. package/dist/chunk-PZ5AY32C.js.map +0 -1
  371. package/dist/chunk-RZTMDUO7.js +0 -49
  372. package/dist/chunk-RZTMDUO7.js.map +0 -1
  373. package/dist/chunk-S5YLIBFX.js +0 -136
  374. package/dist/chunk-S5YLIBFX.js.map +0 -1
  375. package/dist/chunk-SZLVEKMJ.js +0 -1446
  376. package/dist/chunk-SZLVEKMJ.js.map +0 -1
  377. package/dist/chunk-T4SQEITX.js +0 -95
  378. package/dist/chunk-T4SQEITX.js.map +0 -1
  379. package/dist/chunk-TBL77AUT.js +0 -355
  380. package/dist/chunk-TBL77AUT.js.map +0 -1
  381. package/dist/chunk-TSN7JT6D.js +0 -1646
  382. package/dist/chunk-TSN7JT6D.js.map +0 -1
  383. package/dist/chunk-TT4KNT67.js +0 -124
  384. package/dist/chunk-TT4KNT67.js.map +0 -1
  385. package/dist/chunk-UB2LOJ6Q.js +0 -4461
  386. package/dist/chunk-UB2LOJ6Q.js.map +0 -1
  387. package/dist/chunk-UWZZKKU7.js +0 -237
  388. package/dist/chunk-UWZZKKU7.js.map +0 -1
  389. package/dist/chunk-VBQ3CRKH.js +0 -291
  390. package/dist/chunk-VBQ3CRKH.js.map +0 -1
  391. package/dist/chunk-VGRCHJON.js +0 -163
  392. package/dist/chunk-VGRCHJON.js.map +0 -1
  393. package/dist/chunk-VI2UW6B6.js +0 -162
  394. package/dist/chunk-VI2UW6B6.js.map +0 -1
  395. package/dist/chunk-VLOATJQ2.js +0 -908
  396. package/dist/chunk-VLOATJQ2.js.map +0 -1
  397. package/dist/chunk-VQMK5FMP.js +0 -247
  398. package/dist/chunk-VQMK5FMP.js.map +0 -1
  399. package/dist/chunk-VZSRQ272.js +0 -149
  400. package/dist/chunk-VZSRQ272.js.map +0 -1
  401. package/dist/chunk-WGXIEX7P.js +0 -116
  402. package/dist/chunk-WGXIEX7P.js.map +0 -1
  403. package/dist/chunk-WS3NZZQQ.js +0 -929
  404. package/dist/chunk-WS3NZZQQ.js.map +0 -1
  405. package/dist/chunk-XDWDC2MP.js +0 -695
  406. package/dist/chunk-XDWDC2MP.js.map +0 -1
  407. package/dist/chunk-XPRT64IE.js +0 -766
  408. package/dist/chunk-XPRT64IE.js.map +0 -1
  409. package/dist/chunk-YJBNWCAA.js +0 -1056
  410. package/dist/chunk-YJBNWCAA.js.map +0 -1
  411. package/dist/chunk-ZET2UAYW.js +0 -89
  412. package/dist/chunk-ZET2UAYW.js.map +0 -1
  413. package/dist/chunk-ZUUWPZCV.js +0 -752
  414. package/dist/chunk-ZUUWPZCV.js.map +0 -1
  415. package/dist/control.js.map +0 -1
  416. package/dist/hosted/index.js.map +0 -1
  417. package/dist/matrix/index.js.map +0 -1
  418. package/dist/reporting.js.map +0 -1
  419. package/dist/rollout/index.js.map +0 -1
  420. package/dist/run-campaign-ISHFZ7FJ.js +0 -17
  421. package/dist/run-campaign-ISHFZ7FJ.js.map +0 -1
  422. package/dist/supervisor-run/index.js.map +0 -1
  423. package/dist/traces.js.map +0 -1
  424. package/dist/wire/index.js.map +0 -1
@@ -1,766 +0,0 @@
1
- import {
2
- fsCampaignStorage,
3
- runCampaign
4
- } from "./chunk-EZJEIH2R.js";
5
- import {
6
- __export
7
- } from "./chunk-PZ5AY32C.js";
8
-
9
- // src/benchmarks/index.ts
10
- var benchmarks_exports = {};
11
- __export(benchmarks_exports, {
12
- BENCHMARK_SPLIT_SEED: () => BENCHMARK_SPLIT_SEED,
13
- buildStandardRetrievalItems: () => buildStandardRetrievalItems,
14
- calibrateBenchmarkMetric: () => calibrateBenchmarkMetric,
15
- createRetrievalIdBenchmarkAdapter: () => createRetrievalIdBenchmarkAdapter,
16
- deterministicSplit: () => deterministicSplit,
17
- evaluateStandardRetrieval: () => evaluateStandardRetrieval,
18
- normalizeRetrievedDocumentIds: () => normalizeRetrievedDocumentIds,
19
- parseBeirCorpusJsonl: () => parseBeirCorpusJsonl,
20
- parseBeirQueriesJsonl: () => parseBeirQueriesJsonl,
21
- parseJsonlRows: () => parseJsonlRows,
22
- parseQrels: () => parseQrels,
23
- parseTsvRows: () => parseTsvRows,
24
- renderBenchmarkReportMarkdown: () => renderBenchmarkReportMarkdown,
25
- retrievalMetricsAtCutoff: () => retrievalMetricsAtCutoff,
26
- routing: () => routing_exports,
27
- runBenchmarkAdapter: () => runBenchmarkAdapter,
28
- summarizeBenchmarkCampaign: () => summarizeBenchmarkCampaign
29
- });
30
-
31
- // src/benchmarks/calibration.ts
32
- async function calibrateBenchmarkMetric(options) {
33
- const weak = await options.adapter.evaluate(options.item, options.weakArtifact);
34
- const strong = await options.adapter.evaluate(options.item, options.strongArtifact);
35
- const weakScore = clamp01(weak.score);
36
- const strongScore = clamp01(strong.score);
37
- const maxWeakScore = options.maxWeakScore ?? 0.3;
38
- const minStrongScore = options.minStrongScore ?? 0.7;
39
- const minGap = options.minGap ?? 0.4;
40
- const gap = strongScore - weakScore;
41
- const reasons = [
42
- weakScore <= maxWeakScore ? void 0 : `weak score ${weakScore.toFixed(3)} exceeds max ${maxWeakScore.toFixed(3)}`,
43
- strongScore >= minStrongScore ? void 0 : `strong score ${strongScore.toFixed(3)} below min ${minStrongScore.toFixed(3)}`,
44
- gap >= minGap ? void 0 : `gap ${gap.toFixed(3)} below min ${minGap.toFixed(3)}`
45
- ].filter((reason) => Boolean(reason));
46
- return {
47
- passed: reasons.length === 0,
48
- weak,
49
- strong,
50
- weakScore,
51
- strongScore,
52
- gap,
53
- reasons
54
- };
55
- }
56
- function clamp01(value) {
57
- if (!Number.isFinite(value)) return 0;
58
- if (value < 0) return 0;
59
- if (value > 1) return 1;
60
- return value;
61
- }
62
-
63
- // src/benchmarks/routing/index.ts
64
- var routing_exports = {};
65
- __export(routing_exports, {
66
- ROUTING_DATASET: () => ROUTING_DATASET,
67
- RoutingAdapter: () => RoutingAdapter,
68
- assignSplit: () => assignSplit,
69
- evaluate: () => evaluate,
70
- extractRouteTokens: () => extractRouteTokens,
71
- loadDataset: () => loadDataset
72
- });
73
-
74
- // src/benchmarks/types.ts
75
- function fnv1a32(input) {
76
- let h = 2166136261;
77
- for (let i = 0; i < input.length; i++) {
78
- h ^= input.charCodeAt(i) & 255;
79
- h = h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24)) >>> 0;
80
- }
81
- return h >>> 0;
82
- }
83
- var BENCHMARK_SPLIT_SEED = "agent-eval-v1";
84
- function deterministicSplit(itemId, seed = BENCHMARK_SPLIT_SEED) {
85
- const h = fnv1a32(`${seed}::${itemId}`);
86
- const pos = h / 4294967296;
87
- if (pos < 0.6) return "search";
88
- if (pos < 0.8) return "dev";
89
- return "holdout";
90
- }
91
-
92
- // src/benchmarks/routing/dataset.ts
93
- var ROUTING_DATASET = [
94
- {
95
- id: "file_001",
96
- category: "file",
97
- prompt: "Save the meeting notes to /tmp/notes-2025-04.md as markdown.",
98
- route: "fs.write",
99
- synonyms: ["filesystem.write", "write_file"],
100
- hardNegatives: ["fs.read", "chat.reply"]
101
- },
102
- {
103
- id: "file_002",
104
- category: "file",
105
- prompt: "Read the contents of /etc/hosts and summarize the entries.",
106
- route: "fs.read",
107
- synonyms: ["filesystem.read", "read_file"],
108
- hardNegatives: ["fs.write", "search.web"]
109
- },
110
- {
111
- id: "file_003",
112
- category: "file",
113
- prompt: "List every Python file under src/ recursively.",
114
- route: "fs.list",
115
- synonyms: ["filesystem.list", "list_files"],
116
- hardNegatives: ["fs.read", "search.code"]
117
- },
118
- {
119
- id: "file_004",
120
- category: "file",
121
- prompt: "Delete the cached build at .turbo/cache.",
122
- route: "fs.delete",
123
- synonyms: ["filesystem.delete", "remove_file"],
124
- hardNegatives: ["fs.write", "fs.list"]
125
- },
126
- {
127
- id: "math_001",
128
- category: "math",
129
- prompt: "What is the integral of 3x^2 + 2x from 0 to 5?",
130
- route: "math.integral",
131
- synonyms: ["calculator.integral", "math.solve"],
132
- hardNegatives: ["math.derivative", "chat.reply"]
133
- },
134
- {
135
- id: "math_002",
136
- category: "math",
137
- prompt: "Compute the derivative of sin(x) * cos(x).",
138
- route: "math.derivative",
139
- synonyms: ["calculator.derivative", "math.solve"],
140
- hardNegatives: ["math.integral", "math.algebra"]
141
- },
142
- {
143
- id: "math_003",
144
- category: "math",
145
- prompt: "Solve 2x + 7 = 19 for x.",
146
- route: "math.algebra",
147
- synonyms: ["calculator.algebra", "math.solve"],
148
- hardNegatives: ["math.derivative", "math.integral"]
149
- },
150
- {
151
- id: "math_004",
152
- category: "math",
153
- prompt: "What is the prime factorization of 360?",
154
- route: "math.numbertheory",
155
- synonyms: ["calculator.factor", "math.solve"],
156
- hardNegatives: ["math.algebra", "search.web"]
157
- },
158
- {
159
- id: "search_001",
160
- category: "search",
161
- prompt: "Find recent papers on agent prompt optimization with held-out promotion gates.",
162
- route: "search.web",
163
- synonyms: ["web.search", "search.papers"],
164
- hardNegatives: ["search.code", "chat.reply"]
165
- },
166
- {
167
- id: "search_002",
168
- category: "search",
169
- prompt: "Search the codebase for every call site of `runProposeReview`.",
170
- route: "search.code",
171
- synonyms: ["code.search", "grep"],
172
- hardNegatives: ["search.web", "fs.read"]
173
- },
174
- {
175
- id: "search_003",
176
- category: "search",
177
- prompt: "What is the latest release of the Tangle network on GitHub?",
178
- route: "search.web",
179
- synonyms: ["web.search", "github.releases"],
180
- hardNegatives: ["search.code", "chat.reply"]
181
- },
182
- {
183
- id: "search_004",
184
- category: "search",
185
- prompt: "Find all TODO comments in the agent-eval src tree.",
186
- route: "search.code",
187
- synonyms: ["code.search", "grep"],
188
- hardNegatives: ["search.web", "fs.list"]
189
- },
190
- {
191
- id: "chat_001",
192
- category: "chat",
193
- prompt: "Hi there, how are you doing today?",
194
- route: "chat.reply",
195
- synonyms: ["conversation.reply"],
196
- hardNegatives: ["search.web", "fs.read"]
197
- },
198
- {
199
- id: "chat_002",
200
- category: "chat",
201
- prompt: "Please explain the difference between an LLM and a foundation model.",
202
- route: "chat.reply",
203
- synonyms: ["conversation.reply", "qa.answer"],
204
- hardNegatives: ["search.web", "math.algebra"]
205
- },
206
- {
207
- id: "chat_003",
208
- category: "chat",
209
- prompt: "Tell me a short joke about distributed systems.",
210
- route: "chat.reply",
211
- synonyms: ["conversation.reply"],
212
- hardNegatives: ["search.web", "fs.read"]
213
- },
214
- {
215
- id: "chat_004",
216
- category: "chat",
217
- prompt: "Acknowledge my last message with a thumbs up.",
218
- route: "chat.reply",
219
- synonyms: ["conversation.reply", "react"],
220
- hardNegatives: ["fs.write", "search.web"]
221
- }
222
- ];
223
-
224
- // src/benchmarks/routing/index.ts
225
- var RoutingAdapter = class {
226
- id = "first-party/routing";
227
- family = "first-party";
228
- taskKind = "routing";
229
- description = "Synthetic fixed-route classification smoke benchmark";
230
- defaultMetric = "route_exact_match";
231
- async loadDataset(split) {
232
- return ROUTING_DATASET.map((item) => ({ id: item.id, payload: item })).filter(
233
- (it) => assignSplitImpl(it.id) === split
234
- );
235
- }
236
- async evaluate(item, response) {
237
- const tokens = extractRouteTokens(response);
238
- const correct = new Set(
239
- [item.payload.route, ...item.payload.synonyms].map((s) => s.toLowerCase())
240
- );
241
- const hardNeg = new Set(item.payload.hardNegatives.map((s) => s.toLowerCase()));
242
- const firstMatch = tokens.find((t) => correct.has(t.toLowerCase())) ?? null;
243
- const firstHardNeg = tokens.find((t) => hardNeg.has(t.toLowerCase())) ?? null;
244
- const score = firstMatch ? 1 : 0;
245
- return {
246
- score,
247
- raw: {
248
- firstToken: tokens[0] ?? null,
249
- matchedRoute: firstMatch,
250
- hitHardNegative: Boolean(firstHardNeg),
251
- hardNegativeRoute: firstHardNeg,
252
- category: item.payload.category
253
- }
254
- };
255
- }
256
- assignSplit(itemId) {
257
- return assignSplitImpl(itemId);
258
- }
259
- };
260
- function assignSplitImpl(itemId) {
261
- return deterministicSplit(`routing::${itemId}`);
262
- }
263
- function extractRouteTokens(response) {
264
- const matches = response.match(/[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*/gi);
265
- return matches ?? [];
266
- }
267
- var adapter = new RoutingAdapter();
268
- var loadDataset = adapter.loadDataset.bind(adapter);
269
- var evaluate = adapter.evaluate.bind(adapter);
270
- var assignSplit = adapter.assignSplit.bind(adapter);
271
-
272
- // src/benchmarks/runner.ts
273
- import { join } from "path";
274
- async function runBenchmarkAdapter(options) {
275
- const storage = options.storage ?? fsCampaignStorage();
276
- const benchmarkId = benchmarkIdFor(options.adapter);
277
- const scenarios = await loadBenchmarkScenarios(options.adapter, options.splits);
278
- const judge = benchmarkAdapterJudge(options.adapter);
279
- const dispatch = async (scenario, context) => {
280
- return options.respond({ scenario, item: scenario.item, context });
281
- };
282
- const campaign = await runCampaign({
283
- scenarios,
284
- dispatch,
285
- dispatchRef: `benchmark:${benchmarkId}`,
286
- judges: [judge],
287
- seed: options.seed,
288
- reps: options.reps,
289
- resumable: options.resumable,
290
- costCeiling: options.costCeiling,
291
- maxConcurrency: options.maxConcurrency,
292
- dispatchTimeoutMs: options.dispatchTimeoutMs,
293
- expectUsage: options.expectUsage ?? "off",
294
- runDir: options.runDir,
295
- repo: options.repo,
296
- storage,
297
- now: options.now
298
- });
299
- const report = summarizeBenchmarkCampaign({
300
- adapter: options.adapter,
301
- scenarios,
302
- campaign
303
- });
304
- storage.ensureDir(campaign.runDir);
305
- const reportJsonPath = join(campaign.runDir, "benchmark-report.json");
306
- const reportMarkdownPath = join(campaign.runDir, "benchmark-report.md");
307
- storage.write(reportJsonPath, `${JSON.stringify(report, null, 2)}
308
- `);
309
- storage.write(reportMarkdownPath, renderBenchmarkReportMarkdown(report));
310
- return { scenarios, campaign, report, reportJsonPath, reportMarkdownPath };
311
- }
312
- async function loadBenchmarkScenarios(adapter2, splits = ["search", "dev", "holdout"]) {
313
- const benchmarkId = benchmarkIdFor(adapter2);
314
- const family = adapter2.family ?? "custom";
315
- const taskKind = adapter2.taskKind ?? "custom";
316
- const out = [];
317
- const seen = /* @__PURE__ */ new Set();
318
- for (const split of splits) {
319
- const items = await adapter2.loadDataset(split);
320
- for (const item of items) {
321
- const splitTag = item.split ?? adapter2.assignSplit(item.id);
322
- if (splitTag !== split) continue;
323
- const key = `${benchmarkId}:${item.id}`;
324
- if (seen.has(key)) continue;
325
- seen.add(key);
326
- out.push({
327
- id: key,
328
- kind: "benchmark",
329
- benchmarkId,
330
- family: item.family ?? family,
331
- taskKind: item.taskKind ?? taskKind,
332
- splitTag,
333
- tags: [.../* @__PURE__ */ new Set([splitTag, ...item.tags ?? []])],
334
- item
335
- });
336
- }
337
- }
338
- return out;
339
- }
340
- function benchmarkAdapterJudge(adapter2) {
341
- const benchmarkId = benchmarkIdFor(adapter2);
342
- return {
343
- name: `${benchmarkId}:score`,
344
- dimensions: [
345
- { key: "score", description: `Primary ${benchmarkId} benchmark score` },
346
- { key: "passed", description: "Binary pass projection for aggregate reporting" }
347
- ],
348
- appliesTo: (scenario) => {
349
- return scenario.kind === "benchmark" && scenario.id.startsWith(`${benchmarkId}:`);
350
- },
351
- async score({ artifact, scenario }) {
352
- const evaluation = await adapter2.evaluate(scenario.item, artifact);
353
- const dimensions = normalizeEvaluationDimensions(evaluation);
354
- return {
355
- dimensions,
356
- composite: clamp012(evaluation.score),
357
- notes: evaluation.notes ?? ""
358
- };
359
- }
360
- };
361
- }
362
- function summarizeBenchmarkCampaign(input) {
363
- const scenarioById = new Map(input.scenarios.map((scenario) => [scenario.id, scenario]));
364
- const rows = input.campaign.cells.map((cell) => {
365
- const scenario = scenarioById.get(cell.scenarioId);
366
- const judge = firstJudgeScore(cell.judgeScores);
367
- const score = judge?.composite ?? 0;
368
- return {
369
- cell,
370
- scenario,
371
- score,
372
- passed: (judge?.dimensions.passed ?? (score > 0 ? 1 : 0)) >= 1,
373
- dimensions: judge?.dimensions ?? {}
374
- };
375
- });
376
- const successful = rows.filter((row) => !row.cell.error);
377
- const scoreValues = successful.map((row) => row.score);
378
- return {
379
- benchmarkId: benchmarkIdFor(input.adapter),
380
- family: input.adapter.family ?? "custom",
381
- taskKind: input.adapter.taskKind ?? "custom",
382
- ...input.adapter.source ? { source: input.adapter.source } : {},
383
- runDir: input.campaign.runDir,
384
- manifestHash: input.campaign.manifestHash,
385
- seed: input.campaign.seed,
386
- startedAt: input.campaign.startedAt,
387
- endedAt: input.campaign.endedAt,
388
- durationMs: input.campaign.durationMs,
389
- totalItems: input.scenarios.length,
390
- totalCells: input.campaign.cells.length,
391
- cellsFailed: input.campaign.aggregates.cellsFailed,
392
- cellsCached: input.campaign.aggregates.cellsCached,
393
- totalCostUsd: input.campaign.aggregates.totalCostUsd,
394
- splits: summarizeSlices(successful, (row) => row.scenario?.splitTag ?? "unknown", [
395
- "search",
396
- "dev",
397
- "holdout"
398
- ]),
399
- tags: summarizeSlices(successful, (row) => row.scenario?.tags ?? []),
400
- dimensions: summarizeDimensions(successful.map((row) => row.dimensions)),
401
- score: distribution(scoreValues),
402
- costUsd: distribution(successful.map((row) => row.cell.costUsd)),
403
- latencyMs: distribution(successful.map((row) => row.cell.durationMs))
404
- };
405
- }
406
- function renderBenchmarkReportMarkdown(report) {
407
- const splitRows = Object.entries(report.splits).map(([split, summary]) => {
408
- return `| ${split} | ${summary.n} | ${fmt(summary.meanScore)} | ${fmt(summary.passRate)} | ${fmt(summary.score.p90)} | ${fmt(summary.costUsd.mean)} | ${fmt(summary.latencyMs.p90)} |`;
409
- }).join("\n");
410
- const dimRows = Object.entries(report.dimensions).sort(([a], [b]) => a.localeCompare(b)).map(([key, dist]) => `| ${key} | ${dist.n} | ${fmt(dist.mean)} | ${fmt(dist.p90)} |`).join("\n");
411
- return [
412
- `# Benchmark Report: ${report.benchmarkId}`,
413
- "",
414
- `- family: ${report.family}`,
415
- `- task kind: ${report.taskKind}`,
416
- `- run dir: ${report.runDir}`,
417
- `- manifest: ${report.manifestHash}`,
418
- `- cells: ${report.totalCells} total, ${report.cellsFailed} failed, ${report.cellsCached} cached`,
419
- `- cost: $${fmt(report.totalCostUsd)}`,
420
- `- score: mean ${fmt(report.score.mean)}, median ${fmt(report.score.median)}, p90 ${fmt(report.score.p90)}, n=${report.score.n}`,
421
- "",
422
- "## Splits",
423
- "",
424
- "| split | n | mean score | pass rate | score p90 | mean cost | latency p90 ms |",
425
- "| --- | ---: | ---: | ---: | ---: | ---: | ---: |",
426
- splitRows || "| none | 0 | 0 | 0 | 0 | 0 | 0 |",
427
- "",
428
- "## Dimensions",
429
- "",
430
- "| dimension | n | mean | p90 |",
431
- "| --- | ---: | ---: | ---: |",
432
- dimRows || "| none | 0 | 0 | 0 |",
433
- ""
434
- ].join("\n");
435
- }
436
- function benchmarkIdFor(adapter2) {
437
- return adapter2.id ?? `${adapter2.family ?? "custom"}/${adapter2.taskKind ?? "custom"}`;
438
- }
439
- function normalizeEvaluationDimensions(evaluation) {
440
- const dimensions = { score: clamp012(evaluation.score) };
441
- for (const [key, value] of Object.entries(evaluation.dimensions ?? {})) {
442
- if (Number.isFinite(value)) dimensions[key] = value;
443
- }
444
- dimensions.passed = evaluation.passed ?? evaluation.score > 0 ? 1 : 0;
445
- return dimensions;
446
- }
447
- function summarizeDimensions(rows) {
448
- const values = /* @__PURE__ */ new Map();
449
- for (const row of rows) {
450
- for (const [key, value] of Object.entries(row)) {
451
- if (!Number.isFinite(value)) continue;
452
- const list = values.get(key) ?? [];
453
- list.push(value);
454
- values.set(key, list);
455
- }
456
- }
457
- return Object.fromEntries([...values.entries()].map(([key, vals]) => [key, distribution(vals)]));
458
- }
459
- function summarizeSlices(rows, keyOf, knownKeys = []) {
460
- const grouped = /* @__PURE__ */ new Map();
461
- for (const key of knownKeys) grouped.set(key, []);
462
- for (const row of rows) {
463
- const keys = keyOf(row);
464
- for (const key of Array.isArray(keys) ? keys : [keys]) {
465
- const list = grouped.get(key) ?? [];
466
- list.push(row);
467
- grouped.set(key, list);
468
- }
469
- }
470
- const out = {};
471
- for (const [key, list] of grouped) {
472
- const withShape = list;
473
- out[key] = {
474
- n: list.length,
475
- meanScore: mean(withShape.map((row) => row.score)),
476
- passRate: mean(withShape.map((row) => row.passed ? 1 : 0)),
477
- score: distribution(withShape.map((row) => row.score)),
478
- costUsd: distribution(withShape.map((row) => row.cell.costUsd)),
479
- latencyMs: distribution(withShape.map((row) => row.cell.durationMs))
480
- };
481
- }
482
- return out;
483
- }
484
- function firstJudgeScore(judgeScores) {
485
- return Object.values(judgeScores)[0];
486
- }
487
- function distribution(values) {
488
- const finite = [...values].filter(Number.isFinite).sort((a, b) => a - b);
489
- if (finite.length === 0) return { n: 0, min: 0, mean: 0, median: 0, p90: 0, max: 0 };
490
- return {
491
- n: finite.length,
492
- min: finite[0],
493
- mean: mean(finite),
494
- median: percentile(finite, 0.5),
495
- p90: percentile(finite, 0.9),
496
- max: finite[finite.length - 1]
497
- };
498
- }
499
- function percentile(sortedValues, p) {
500
- if (sortedValues.length === 0) return 0;
501
- const index = Math.min(
502
- sortedValues.length - 1,
503
- Math.max(0, Math.ceil(p * sortedValues.length) - 1)
504
- );
505
- return sortedValues[index];
506
- }
507
- function mean(values) {
508
- const finite = values.filter(Number.isFinite);
509
- if (finite.length === 0) return 0;
510
- return finite.reduce((sum, value) => sum + value, 0) / finite.length;
511
- }
512
- function clamp012(value) {
513
- if (!Number.isFinite(value)) return 0;
514
- if (value < 0) return 0;
515
- if (value > 1) return 1;
516
- return value;
517
- }
518
- function fmt(value) {
519
- if (!Number.isFinite(value)) return "0";
520
- return value.toFixed(value === 0 || Math.abs(value) >= 10 ? 0 : 3);
521
- }
522
-
523
- // src/benchmarks/standard-formats.ts
524
- function parseJsonlRows(text) {
525
- return text.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((line, index) => {
526
- try {
527
- return JSON.parse(line);
528
- } catch (error) {
529
- throw new Error(`invalid JSONL row ${index + 1}: ${error.message}`);
530
- }
531
- });
532
- }
533
- function parseTsvRows(text) {
534
- return text.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).filter((line) => !line.startsWith("#")).map((line) => line.split(/\t|\s+/));
535
- }
536
- function parseQrels(text) {
537
- return parseTsvRows(text).flatMap((parts, index) => {
538
- if (parts.length < 3) return [];
539
- const [queryId, maybeZeroOrDocId, maybeDocIdOrScore, maybeScore] = parts;
540
- if (!queryId || !maybeZeroOrDocId || !maybeDocIdOrScore) return [];
541
- if (queryId.toLowerCase() === "query-id" || queryId.toLowerCase() === "qid") return [];
542
- const documentId = maybeScore === void 0 ? maybeZeroOrDocId : maybeDocIdOrScore;
543
- const scoreText = maybeScore === void 0 ? maybeDocIdOrScore : maybeScore;
544
- const score = Number(scoreText);
545
- if (!documentId || !Number.isFinite(score)) {
546
- throw new Error(`invalid qrels row ${index + 1}: expected query id, doc id, score`);
547
- }
548
- return [{ queryId, documentId, score }];
549
- });
550
- }
551
- function parseBeirCorpusJsonl(text) {
552
- return parseJsonlRows(text).map((row, index) => {
553
- const id = stringField(row, "_id") ?? stringField(row, "id");
554
- const body = stringField(row, "text") ?? stringField(row, "contents");
555
- if (!id || body === void 0) {
556
- throw new Error(`invalid BEIR corpus row ${index + 1}: expected _id/id and text/contents`);
557
- }
558
- return {
559
- id,
560
- title: stringField(row, "title"),
561
- text: body,
562
- metadata: stripKnown(row, ["_id", "id", "title", "text", "contents"])
563
- };
564
- });
565
- }
566
- function parseBeirQueriesJsonl(text) {
567
- return parseJsonlRows(text).map((row, index) => {
568
- const id = stringField(row, "_id") ?? stringField(row, "id") ?? stringField(row, "query_id");
569
- const query = stringField(row, "text") ?? stringField(row, "query");
570
- if (!id || !query) {
571
- throw new Error(`invalid BEIR query row ${index + 1}: expected _id/id and text/query`);
572
- }
573
- return {
574
- id,
575
- text: query,
576
- metadata: stripKnown(row, ["_id", "id", "query_id", "text", "query"])
577
- };
578
- });
579
- }
580
- function buildStandardRetrievalItems(options) {
581
- const qrelsByQuery = /* @__PURE__ */ new Map();
582
- for (const qrel of options.qrels) {
583
- if (qrel.score <= 0) continue;
584
- const list = qrelsByQuery.get(qrel.queryId) ?? [];
585
- list.push(qrel);
586
- qrelsByQuery.set(qrel.queryId, list);
587
- }
588
- const corpus = options.includeCorpusInPayload && options.corpus ? Object.fromEntries(options.corpus.map((document) => [document.id, document])) : void 0;
589
- return options.queries.flatMap((query) => {
590
- const qrels = qrelsByQuery.get(query.id) ?? [];
591
- if (qrels.length === 0) return [];
592
- const split = options.splitOf?.(query.id) ?? deterministicSplit(`${options.benchmarkId}:${query.id}`);
593
- return [
594
- {
595
- id: query.id,
596
- split,
597
- family: options.family,
598
- taskKind: "retrieval",
599
- tags: [.../* @__PURE__ */ new Set([...options.tags ?? [], split])],
600
- ...options.source ? { source: options.source } : {},
601
- ...query.metadata ? { metadata: query.metadata } : {},
602
- payload: {
603
- queryId: query.id,
604
- query: query.text,
605
- expectedDocumentIds: qrels.map((qrel) => qrel.documentId),
606
- expectedScores: Object.fromEntries(qrels.map((qrel) => [qrel.documentId, qrel.score])),
607
- ...corpus ? { corpus } : {},
608
- ...query.metadata ? { metadata: query.metadata } : {}
609
- }
610
- }
611
- ];
612
- });
613
- }
614
- function createRetrievalIdBenchmarkAdapter(options) {
615
- const items = buildStandardRetrievalItems(options);
616
- return {
617
- id: options.benchmarkId,
618
- family: options.family,
619
- taskKind: "retrieval",
620
- source: options.source,
621
- defaultMetric: options.primaryMetric ?? "ndcg@10",
622
- async loadDataset(split) {
623
- return items.filter((item) => item.split === split);
624
- },
625
- async evaluate(item, artifact) {
626
- return evaluateStandardRetrieval(item.payload, artifact, options);
627
- },
628
- assignSplit(itemId) {
629
- return options.splitOf?.(itemId) ?? deterministicSplit(`${options.benchmarkId}:${itemId}`);
630
- }
631
- };
632
- }
633
- function evaluateStandardRetrieval(payload, artifact, options = {}) {
634
- const rankedDocumentIds = normalizeRetrievedDocumentIds(
635
- artifact,
636
- options.responseIdPattern ?? /[A-Za-z0-9_.:/-]+/g
637
- );
638
- const cutoffs = normalizeCutoffs(options.cutoffs ?? [1, 3, 5, 10]);
639
- const dimensions = {
640
- expected_count: payload.expectedDocumentIds.length,
641
- returned_count: rankedDocumentIds.length
642
- };
643
- for (const cutoff of cutoffs) {
644
- Object.assign(
645
- dimensions,
646
- retrievalMetricsAtCutoff({
647
- rankedDocumentIds,
648
- expectedScores: payload.expectedScores,
649
- cutoff
650
- })
651
- );
652
- }
653
- const primaryMetric = options.primaryMetric ?? "ndcg@10";
654
- const passMetric = options.passMetric ?? "hit@10";
655
- const score = dimensions[primaryMetric] ?? dimensions[`ndcg@${cutoffs[cutoffs.length - 1]}`] ?? 0;
656
- const passScore = dimensions[passMetric] ?? dimensions[`hit@${cutoffs[cutoffs.length - 1]}`] ?? score;
657
- return {
658
- score,
659
- passed: passScore >= (options.passThreshold ?? 1),
660
- dimensions,
661
- raw: {
662
- rankedDocumentIds,
663
- expectedDocumentIds: payload.expectedDocumentIds,
664
- expectedScores: payload.expectedScores
665
- }
666
- };
667
- }
668
- function normalizeRetrievedDocumentIds(artifact, responseIdPattern = /[A-Za-z0-9_.:/-]+/g) {
669
- if (typeof artifact === "string") {
670
- return uniqueOrdered((artifact.match(responseIdPattern) ?? []).map((value) => value.trim()));
671
- }
672
- if (Array.isArray(artifact)) {
673
- const entries = artifact;
674
- return uniqueOrdered(
675
- entries.flatMap((entry) => {
676
- if (typeof entry === "string") return [entry];
677
- return [entry.documentId ?? entry.docId ?? entry.id ?? ""];
678
- })
679
- );
680
- }
681
- const objectArtifact = artifact;
682
- return uniqueOrdered(
683
- [
684
- ...objectArtifact.documentIds ?? [],
685
- ...objectArtifact.ids ?? [],
686
- ...(objectArtifact.results ?? []).map(
687
- (entry) => entry.documentId ?? entry.docId ?? entry.id ?? ""
688
- )
689
- ].map((value) => value.trim())
690
- );
691
- }
692
- function retrievalMetricsAtCutoff(input) {
693
- const top = input.rankedDocumentIds.slice(0, input.cutoff);
694
- const relevantIds = Object.keys(input.expectedScores).filter(
695
- (id) => input.expectedScores[id] > 0
696
- );
697
- const relevant = new Set(relevantIds);
698
- const hits = top.filter((id) => relevant.has(id)).length;
699
- const firstRelevantRank = top.findIndex((id) => relevant.has(id));
700
- const prefix = `@${input.cutoff}`;
701
- return {
702
- [`hit${prefix}`]: hits > 0 ? 1 : 0,
703
- [`recall${prefix}`]: relevant.size === 0 ? 1 : hits / relevant.size,
704
- [`precision${prefix}`]: hits / input.cutoff,
705
- [`mrr${prefix}`]: firstRelevantRank === -1 ? 0 : 1 / (firstRelevantRank + 1),
706
- [`ndcg${prefix}`]: ndcgAt(input.rankedDocumentIds, input.expectedScores, input.cutoff)
707
- };
708
- }
709
- function stringField(row, key) {
710
- const value = row[key];
711
- return typeof value === "string" ? value : void 0;
712
- }
713
- function stripKnown(row, keys) {
714
- const known = new Set(keys);
715
- return Object.fromEntries(Object.entries(row).filter(([key]) => !known.has(key)));
716
- }
717
- function normalizeCutoffs(cutoffs) {
718
- return [
719
- ...new Set(cutoffs.map((cutoff) => Math.trunc(cutoff)).filter((cutoff) => cutoff > 0))
720
- ].sort((a, b) => a - b);
721
- }
722
- function uniqueOrdered(values) {
723
- const seen = /* @__PURE__ */ new Set();
724
- const out = [];
725
- for (const value of values) {
726
- const trimmed = value.trim();
727
- if (!trimmed || seen.has(trimmed)) continue;
728
- seen.add(trimmed);
729
- out.push(trimmed);
730
- }
731
- return out;
732
- }
733
- function ndcgAt(rankedDocumentIds, expectedScores, cutoff) {
734
- const dcg = rankedDocumentIds.slice(0, cutoff).reduce(
735
- (sum, documentId, index) => sum + discountedGain(expectedScores[documentId] ?? 0, index),
736
- 0
737
- );
738
- const ideal = Object.values(expectedScores).filter((score) => score > 0).sort((a, b) => b - a).slice(0, cutoff).reduce((sum, score, index) => sum + discountedGain(score, index), 0);
739
- return ideal === 0 ? 1 : dcg / ideal;
740
- }
741
- function discountedGain(relevance, zeroBasedRank) {
742
- if (relevance <= 0) return 0;
743
- return (2 ** relevance - 1) / Math.log2(zeroBasedRank + 2);
744
- }
745
-
746
- export {
747
- calibrateBenchmarkMetric,
748
- BENCHMARK_SPLIT_SEED,
749
- deterministicSplit,
750
- routing_exports,
751
- runBenchmarkAdapter,
752
- summarizeBenchmarkCampaign,
753
- renderBenchmarkReportMarkdown,
754
- parseJsonlRows,
755
- parseTsvRows,
756
- parseQrels,
757
- parseBeirCorpusJsonl,
758
- parseBeirQueriesJsonl,
759
- buildStandardRetrievalItems,
760
- createRetrievalIdBenchmarkAdapter,
761
- evaluateStandardRetrieval,
762
- normalizeRetrievedDocumentIds,
763
- retrievalMetricsAtCutoff,
764
- benchmarks_exports
765
- };
766
- //# sourceMappingURL=chunk-XPRT64IE.js.map