@tangle-network/agent-eval 0.129.0 → 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 (427) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -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 +81 -2872
  8. package/dist/analyst/index.d.ts.map +1 -0
  9. package/dist/analyst/index.js +319 -360
  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 -1188
  30. package/dist/belief-state/index.d.ts.map +1 -0
  31. package/dist/belief-state/index.js +1617 -1709
  32. package/dist/belief-state/index.js.map +1 -1
  33. package/dist/benchmarks/index.d.ts +2 -891
  34. package/dist/benchmarks/index.js +2 -60
  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 -6381
  44. package/dist/campaign/index.js +3 -213
  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 -175
  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 -5565
  61. package/dist/contract/index.d.ts.map +1 -0
  62. package/dist/contract/index.js +1730 -1938
  63. package/dist/contract/index.js.map +1 -1
  64. package/dist/control.d.ts +3 -1030
  65. package/dist/control.js +2 -33
  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 -618
  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 +3755 -15555
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +11182 -11216
  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 -480
  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 -1312
  196. package/dist/reporting.js +6 -51
  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 +760 -4010
  206. package/dist/rl.d.ts.map +1 -0
  207. package/dist/rl.js +2325 -1958
  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 -2087
  211. package/dist/rollout/index.js +8 -168
  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/{chunk-56TAVBOK.js.map → run-record-BuoE80Dq.js.map} +1 -1
  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 -959
  273. package/dist/supervisor-run/index.js +2 -65
  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 -252
  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 -1173
  298. package/dist/wire/index.d.ts.map +1 -0
  299. package/dist/wire/index.js +2 -81
  300. package/package.json +17 -9
  301. package/dist/benchmarks/index.js.map +0 -1
  302. package/dist/campaign/index.js.map +0 -1
  303. package/dist/chunk-2QU3YOPR.js +0 -7374
  304. package/dist/chunk-2QU3YOPR.js.map +0 -1
  305. package/dist/chunk-3OCR4R5I.js +0 -728
  306. package/dist/chunk-3OCR4R5I.js.map +0 -1
  307. package/dist/chunk-3RF76KTD.js +0 -84
  308. package/dist/chunk-3RF76KTD.js.map +0 -1
  309. package/dist/chunk-56TAVBOK.js +0 -698
  310. package/dist/chunk-5DTSBUL2.js +0 -159
  311. package/dist/chunk-5DTSBUL2.js.map +0 -1
  312. package/dist/chunk-7FO3TNPI.js +0 -232
  313. package/dist/chunk-7FO3TNPI.js.map +0 -1
  314. package/dist/chunk-7ZZMD7UK.js +0 -386
  315. package/dist/chunk-7ZZMD7UK.js.map +0 -1
  316. package/dist/chunk-BOD4O7OF.js +0 -40
  317. package/dist/chunk-BOD4O7OF.js.map +0 -1
  318. package/dist/chunk-BSO5JDQH.js +0 -2335
  319. package/dist/chunk-BSO5JDQH.js.map +0 -1
  320. package/dist/chunk-C6LXANRU.js +0 -1550
  321. package/dist/chunk-C6LXANRU.js.map +0 -1
  322. package/dist/chunk-DODXQREJ.js +0 -752
  323. package/dist/chunk-DODXQREJ.js.map +0 -1
  324. package/dist/chunk-DRYIUNWY.js +0 -622
  325. package/dist/chunk-DRYIUNWY.js.map +0 -1
  326. package/dist/chunk-E7QXT7SX.js +0 -183
  327. package/dist/chunk-E7QXT7SX.js.map +0 -1
  328. package/dist/chunk-EG66UGL4.js +0 -341
  329. package/dist/chunk-EG66UGL4.js.map +0 -1
  330. package/dist/chunk-FXTVJPYD.js +0 -576
  331. package/dist/chunk-FXTVJPYD.js.map +0 -1
  332. package/dist/chunk-G7MGMCZD.js +0 -153
  333. package/dist/chunk-G7MGMCZD.js.map +0 -1
  334. package/dist/chunk-GGE4NNQT.js +0 -65
  335. package/dist/chunk-GGE4NNQT.js.map +0 -1
  336. package/dist/chunk-H23X7XKK.js +0 -181
  337. package/dist/chunk-H23X7XKK.js.map +0 -1
  338. package/dist/chunk-HHWE3POT.js +0 -94
  339. package/dist/chunk-HHWE3POT.js.map +0 -1
  340. package/dist/chunk-HPWUNB47.js +0 -289
  341. package/dist/chunk-HPWUNB47.js.map +0 -1
  342. package/dist/chunk-IYCLP2N2.js +0 -766
  343. package/dist/chunk-IYCLP2N2.js.map +0 -1
  344. package/dist/chunk-JHCHEVET.js +0 -274
  345. package/dist/chunk-JHCHEVET.js.map +0 -1
  346. package/dist/chunk-JQSF5DQT.js +0 -701
  347. package/dist/chunk-JQSF5DQT.js.map +0 -1
  348. package/dist/chunk-K4DBDHLK.js +0 -158
  349. package/dist/chunk-K4DBDHLK.js.map +0 -1
  350. package/dist/chunk-K6N6XJJX.js +0 -306
  351. package/dist/chunk-K6N6XJJX.js.map +0 -1
  352. package/dist/chunk-M4YBQKIJ.js +0 -1040
  353. package/dist/chunk-M4YBQKIJ.js.map +0 -1
  354. package/dist/chunk-MA6HLL3S.js +0 -65
  355. package/dist/chunk-MA6HLL3S.js.map +0 -1
  356. package/dist/chunk-MAZ26DC7.js +0 -99
  357. package/dist/chunk-MAZ26DC7.js.map +0 -1
  358. package/dist/chunk-NPCTHQIO.js +0 -91
  359. package/dist/chunk-NPCTHQIO.js.map +0 -1
  360. package/dist/chunk-NY44NC4A.js +0 -1056
  361. package/dist/chunk-NY44NC4A.js.map +0 -1
  362. package/dist/chunk-OIUOT4QD.js +0 -44
  363. package/dist/chunk-OIUOT4QD.js.map +0 -1
  364. package/dist/chunk-ONWEPEDO.js +0 -57
  365. package/dist/chunk-ONWEPEDO.js.map +0 -1
  366. package/dist/chunk-OWN5NPMC.js +0 -152
  367. package/dist/chunk-OWN5NPMC.js.map +0 -1
  368. package/dist/chunk-P6FYH6K4.js +0 -1161
  369. package/dist/chunk-P6FYH6K4.js.map +0 -1
  370. package/dist/chunk-PC4UYEBM.js +0 -166
  371. package/dist/chunk-PC4UYEBM.js.map +0 -1
  372. package/dist/chunk-PC5DOSM7.js +0 -579
  373. package/dist/chunk-PC5DOSM7.js.map +0 -1
  374. package/dist/chunk-PXE2VKMX.js +0 -140
  375. package/dist/chunk-PXE2VKMX.js.map +0 -1
  376. package/dist/chunk-PZ5AY32C.js +0 -10
  377. package/dist/chunk-PZ5AY32C.js.map +0 -1
  378. package/dist/chunk-QB6BDBP2.js +0 -4464
  379. package/dist/chunk-QB6BDBP2.js.map +0 -1
  380. package/dist/chunk-RXHCETDZ.js +0 -536
  381. package/dist/chunk-RXHCETDZ.js.map +0 -1
  382. package/dist/chunk-RZTMDUO7.js +0 -49
  383. package/dist/chunk-RZTMDUO7.js.map +0 -1
  384. package/dist/chunk-SFLLL76A.js +0 -669
  385. package/dist/chunk-SFLLL76A.js.map +0 -1
  386. package/dist/chunk-SZLVEKMJ.js +0 -1446
  387. package/dist/chunk-SZLVEKMJ.js.map +0 -1
  388. package/dist/chunk-T4SQEITX.js +0 -95
  389. package/dist/chunk-T4SQEITX.js.map +0 -1
  390. package/dist/chunk-T6RLYGAD.js +0 -158
  391. package/dist/chunk-T6RLYGAD.js.map +0 -1
  392. package/dist/chunk-TJVT4QFF.js +0 -911
  393. package/dist/chunk-TJVT4QFF.js.map +0 -1
  394. package/dist/chunk-TQ7LNKZ3.js +0 -136
  395. package/dist/chunk-TQ7LNKZ3.js.map +0 -1
  396. package/dist/chunk-U4L7JRPZ.js +0 -1706
  397. package/dist/chunk-U4L7JRPZ.js.map +0 -1
  398. package/dist/chunk-U4PHLT2N.js +0 -419
  399. package/dist/chunk-U4PHLT2N.js.map +0 -1
  400. package/dist/chunk-VCZ5FQYW.js +0 -928
  401. package/dist/chunk-VCZ5FQYW.js.map +0 -1
  402. package/dist/chunk-VI2UW6B6.js +0 -162
  403. package/dist/chunk-VI2UW6B6.js.map +0 -1
  404. package/dist/chunk-VQMK5FMP.js +0 -247
  405. package/dist/chunk-VQMK5FMP.js.map +0 -1
  406. package/dist/chunk-WGXIEX7P.js +0 -116
  407. package/dist/chunk-WGXIEX7P.js.map +0 -1
  408. package/dist/chunk-WVATSFCP.js +0 -1553
  409. package/dist/chunk-WVATSFCP.js.map +0 -1
  410. package/dist/chunk-X4YIBDER.js +0 -1662
  411. package/dist/chunk-X4YIBDER.js.map +0 -1
  412. package/dist/chunk-YQN4ICPP.js +0 -355
  413. package/dist/chunk-YQN4ICPP.js.map +0 -1
  414. package/dist/chunk-ZET2UAYW.js +0 -89
  415. package/dist/chunk-ZET2UAYW.js.map +0 -1
  416. package/dist/chunk-ZHTZ4EYI.js +0 -1212
  417. package/dist/chunk-ZHTZ4EYI.js.map +0 -1
  418. package/dist/control.js.map +0 -1
  419. package/dist/hosted/index.js.map +0 -1
  420. package/dist/matrix/index.js.map +0 -1
  421. package/dist/reporting.js.map +0 -1
  422. package/dist/rollout/index.js.map +0 -1
  423. package/dist/run-campaign-OJJ7CZF4.js +0 -18
  424. package/dist/run-campaign-OJJ7CZF4.js.map +0 -1
  425. package/dist/supervisor-run/index.js.map +0 -1
  426. package/dist/traces.js.map +0 -1
  427. package/dist/wire/index.js.map +0 -1
@@ -0,0 +1,754 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
+ import { Y as runCampaign, Z as fsCampaignStorage } from "./skillopt-optimization-method-D4ODwFVV.js";
3
+ import "./campaign-CBKZvQ1H.js";
4
+ import { join } from "node:path";
5
+ //#region src/benchmarks/calibration.ts
6
+ async function calibrateBenchmarkMetric(options) {
7
+ const weak = await options.adapter.evaluate(options.item, options.weakArtifact);
8
+ const strong = await options.adapter.evaluate(options.item, options.strongArtifact);
9
+ const weakScore = clamp01$1(weak.score);
10
+ const strongScore = clamp01$1(strong.score);
11
+ const maxWeakScore = options.maxWeakScore ?? .3;
12
+ const minStrongScore = options.minStrongScore ?? .7;
13
+ const minGap = options.minGap ?? .4;
14
+ const gap = strongScore - weakScore;
15
+ const reasons = [
16
+ weakScore <= maxWeakScore ? void 0 : `weak score ${weakScore.toFixed(3)} exceeds max ${maxWeakScore.toFixed(3)}`,
17
+ strongScore >= minStrongScore ? void 0 : `strong score ${strongScore.toFixed(3)} below min ${minStrongScore.toFixed(3)}`,
18
+ gap >= minGap ? void 0 : `gap ${gap.toFixed(3)} below min ${minGap.toFixed(3)}`
19
+ ].filter((reason) => Boolean(reason));
20
+ return {
21
+ passed: reasons.length === 0,
22
+ weak,
23
+ strong,
24
+ weakScore,
25
+ strongScore,
26
+ gap,
27
+ reasons
28
+ };
29
+ }
30
+ function clamp01$1(value) {
31
+ if (!Number.isFinite(value)) return 0;
32
+ if (value < 0) return 0;
33
+ if (value > 1) return 1;
34
+ return value;
35
+ }
36
+ //#endregion
37
+ //#region src/benchmarks/types.ts
38
+ /**
39
+ * 32-bit FNV-1a hash. Stable, allocation-free, deterministic across
40
+ * runtimes. We use it to assign items to splits rather than depending
41
+ * on a polyfilled crypto.subtle path.
42
+ */
43
+ function fnv1a32(input) {
44
+ let h = 2166136261;
45
+ for (let i = 0; i < input.length; i++) {
46
+ h ^= input.charCodeAt(i) & 255;
47
+ h = h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24)) >>> 0;
48
+ }
49
+ return h >>> 0;
50
+ }
51
+ /** Split-assignment seed shared across all benchmarks. Bumping this
52
+ * value reshuffles every split — do NOT do that lightly. */
53
+ const BENCHMARK_SPLIT_SEED = "agent-eval-v1";
54
+ /**
55
+ * Assign an item id to one of `'search' | 'dev' | 'holdout'` using a
56
+ * stable 32-bit hash of `${seed}::${id}`. Default proportions:
57
+ *
58
+ * search: 60% (optimization-readable)
59
+ * dev: 20% (held-out for tuning, leak-on-purpose during dev)
60
+ * holdout:20% (paper-grade held-out, gated reads)
61
+ */
62
+ function deterministicSplit(itemId, seed = BENCHMARK_SPLIT_SEED) {
63
+ const pos = fnv1a32(`${seed}::${itemId}`) / 4294967296;
64
+ if (pos < .6) return "search";
65
+ if (pos < .8) return "dev";
66
+ return "holdout";
67
+ }
68
+ //#endregion
69
+ //#region src/benchmarks/routing/dataset.ts
70
+ const ROUTING_DATASET = [
71
+ {
72
+ id: "file_001",
73
+ category: "file",
74
+ prompt: "Save the meeting notes to /tmp/notes-2025-04.md as markdown.",
75
+ route: "fs.write",
76
+ synonyms: ["filesystem.write", "write_file"],
77
+ hardNegatives: ["fs.read", "chat.reply"]
78
+ },
79
+ {
80
+ id: "file_002",
81
+ category: "file",
82
+ prompt: "Read the contents of /etc/hosts and summarize the entries.",
83
+ route: "fs.read",
84
+ synonyms: ["filesystem.read", "read_file"],
85
+ hardNegatives: ["fs.write", "search.web"]
86
+ },
87
+ {
88
+ id: "file_003",
89
+ category: "file",
90
+ prompt: "List every Python file under src/ recursively.",
91
+ route: "fs.list",
92
+ synonyms: ["filesystem.list", "list_files"],
93
+ hardNegatives: ["fs.read", "search.code"]
94
+ },
95
+ {
96
+ id: "file_004",
97
+ category: "file",
98
+ prompt: "Delete the cached build at .turbo/cache.",
99
+ route: "fs.delete",
100
+ synonyms: ["filesystem.delete", "remove_file"],
101
+ hardNegatives: ["fs.write", "fs.list"]
102
+ },
103
+ {
104
+ id: "math_001",
105
+ category: "math",
106
+ prompt: "What is the integral of 3x^2 + 2x from 0 to 5?",
107
+ route: "math.integral",
108
+ synonyms: ["calculator.integral", "math.solve"],
109
+ hardNegatives: ["math.derivative", "chat.reply"]
110
+ },
111
+ {
112
+ id: "math_002",
113
+ category: "math",
114
+ prompt: "Compute the derivative of sin(x) * cos(x).",
115
+ route: "math.derivative",
116
+ synonyms: ["calculator.derivative", "math.solve"],
117
+ hardNegatives: ["math.integral", "math.algebra"]
118
+ },
119
+ {
120
+ id: "math_003",
121
+ category: "math",
122
+ prompt: "Solve 2x + 7 = 19 for x.",
123
+ route: "math.algebra",
124
+ synonyms: ["calculator.algebra", "math.solve"],
125
+ hardNegatives: ["math.derivative", "math.integral"]
126
+ },
127
+ {
128
+ id: "math_004",
129
+ category: "math",
130
+ prompt: "What is the prime factorization of 360?",
131
+ route: "math.numbertheory",
132
+ synonyms: ["calculator.factor", "math.solve"],
133
+ hardNegatives: ["math.algebra", "search.web"]
134
+ },
135
+ {
136
+ id: "search_001",
137
+ category: "search",
138
+ prompt: "Find recent papers on agent prompt optimization with held-out promotion gates.",
139
+ route: "search.web",
140
+ synonyms: ["web.search", "search.papers"],
141
+ hardNegatives: ["search.code", "chat.reply"]
142
+ },
143
+ {
144
+ id: "search_002",
145
+ category: "search",
146
+ prompt: "Search the codebase for every call site of `runProposeReview`.",
147
+ route: "search.code",
148
+ synonyms: ["code.search", "grep"],
149
+ hardNegatives: ["search.web", "fs.read"]
150
+ },
151
+ {
152
+ id: "search_003",
153
+ category: "search",
154
+ prompt: "What is the latest release of the Tangle network on GitHub?",
155
+ route: "search.web",
156
+ synonyms: ["web.search", "github.releases"],
157
+ hardNegatives: ["search.code", "chat.reply"]
158
+ },
159
+ {
160
+ id: "search_004",
161
+ category: "search",
162
+ prompt: "Find all TODO comments in the agent-eval src tree.",
163
+ route: "search.code",
164
+ synonyms: ["code.search", "grep"],
165
+ hardNegatives: ["search.web", "fs.list"]
166
+ },
167
+ {
168
+ id: "chat_001",
169
+ category: "chat",
170
+ prompt: "Hi there, how are you doing today?",
171
+ route: "chat.reply",
172
+ synonyms: ["conversation.reply"],
173
+ hardNegatives: ["search.web", "fs.read"]
174
+ },
175
+ {
176
+ id: "chat_002",
177
+ category: "chat",
178
+ prompt: "Please explain the difference between an LLM and a foundation model.",
179
+ route: "chat.reply",
180
+ synonyms: ["conversation.reply", "qa.answer"],
181
+ hardNegatives: ["search.web", "math.algebra"]
182
+ },
183
+ {
184
+ id: "chat_003",
185
+ category: "chat",
186
+ prompt: "Tell me a short joke about distributed systems.",
187
+ route: "chat.reply",
188
+ synonyms: ["conversation.reply"],
189
+ hardNegatives: ["search.web", "fs.read"]
190
+ },
191
+ {
192
+ id: "chat_004",
193
+ category: "chat",
194
+ prompt: "Acknowledge my last message with a thumbs up.",
195
+ route: "chat.reply",
196
+ synonyms: ["conversation.reply", "react"],
197
+ hardNegatives: ["fs.write", "search.web"]
198
+ }
199
+ ];
200
+ //#endregion
201
+ //#region src/benchmarks/routing/index.ts
202
+ var routing_exports = /* @__PURE__ */ __exportAll({
203
+ ROUTING_DATASET: () => ROUTING_DATASET,
204
+ RoutingAdapter: () => RoutingAdapter,
205
+ assignSplit: () => assignSplit,
206
+ evaluate: () => evaluate,
207
+ extractRouteTokens: () => extractRouteTokens,
208
+ loadDataset: () => loadDataset
209
+ });
210
+ var RoutingAdapter = class {
211
+ id = "first-party/routing";
212
+ family = "first-party";
213
+ taskKind = "routing";
214
+ description = "Synthetic fixed-route classification smoke benchmark";
215
+ defaultMetric = "route_exact_match";
216
+ async loadDataset(split) {
217
+ return ROUTING_DATASET.map((item) => ({
218
+ id: item.id,
219
+ payload: item
220
+ })).filter((it) => assignSplitImpl(it.id) === split);
221
+ }
222
+ async evaluate(item, response) {
223
+ const tokens = extractRouteTokens(response);
224
+ const correct = new Set([item.payload.route, ...item.payload.synonyms].map((s) => s.toLowerCase()));
225
+ const hardNeg = new Set(item.payload.hardNegatives.map((s) => s.toLowerCase()));
226
+ const firstMatch = tokens.find((t) => correct.has(t.toLowerCase())) ?? null;
227
+ const firstHardNeg = tokens.find((t) => hardNeg.has(t.toLowerCase())) ?? null;
228
+ return {
229
+ score: firstMatch ? 1 : 0,
230
+ raw: {
231
+ firstToken: tokens[0] ?? null,
232
+ matchedRoute: firstMatch,
233
+ hitHardNegative: Boolean(firstHardNeg),
234
+ hardNegativeRoute: firstHardNeg,
235
+ category: item.payload.category
236
+ }
237
+ };
238
+ }
239
+ assignSplit(itemId) {
240
+ return assignSplitImpl(itemId);
241
+ }
242
+ };
243
+ function assignSplitImpl(itemId) {
244
+ return deterministicSplit(`routing::${itemId}`);
245
+ }
246
+ /**
247
+ * Pull route-shaped tokens out of a model response. Routes look like
248
+ * `category.action` (`fs.write`, `chat.reply`). Bare alphanumerics
249
+ * are not routes, but `category.action` patterns are robust to most
250
+ * model wrappers (JSON output, prose explanations, code fences).
251
+ */
252
+ function extractRouteTokens(response) {
253
+ return response.match(/[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*/gi) ?? [];
254
+ }
255
+ const adapter = new RoutingAdapter();
256
+ const loadDataset = adapter.loadDataset.bind(adapter);
257
+ const evaluate = adapter.evaluate.bind(adapter);
258
+ const assignSplit = adapter.assignSplit.bind(adapter);
259
+ //#endregion
260
+ //#region src/benchmarks/runner.ts
261
+ async function runBenchmarkAdapter(options) {
262
+ const storage = options.storage ?? fsCampaignStorage();
263
+ const benchmarkId = benchmarkIdFor(options.adapter);
264
+ const scenarios = await loadBenchmarkScenarios(options.adapter, options.splits);
265
+ const judge = benchmarkAdapterJudge(options.adapter);
266
+ const dispatch = async (scenario, context) => {
267
+ return options.respond({
268
+ scenario,
269
+ item: scenario.item,
270
+ context
271
+ });
272
+ };
273
+ const campaign = await runCampaign({
274
+ scenarios,
275
+ dispatch,
276
+ dispatchRef: `benchmark:${benchmarkId}`,
277
+ judges: [judge],
278
+ seed: options.seed,
279
+ reps: options.reps,
280
+ resumable: options.resumable,
281
+ costCeiling: options.costCeiling,
282
+ maxConcurrency: options.maxConcurrency,
283
+ dispatchTimeoutMs: options.dispatchTimeoutMs,
284
+ expectUsage: options.expectUsage ?? "off",
285
+ runDir: options.runDir,
286
+ repo: options.repo,
287
+ storage,
288
+ now: options.now
289
+ });
290
+ const report = summarizeBenchmarkCampaign({
291
+ adapter: options.adapter,
292
+ scenarios,
293
+ campaign
294
+ });
295
+ storage.ensureDir(campaign.runDir);
296
+ const reportJsonPath = join(campaign.runDir, "benchmark-report.json");
297
+ const reportMarkdownPath = join(campaign.runDir, "benchmark-report.md");
298
+ storage.write(reportJsonPath, `${JSON.stringify(report, null, 2)}\n`);
299
+ storage.write(reportMarkdownPath, renderBenchmarkReportMarkdown(report));
300
+ return {
301
+ scenarios,
302
+ campaign,
303
+ report,
304
+ reportJsonPath,
305
+ reportMarkdownPath
306
+ };
307
+ }
308
+ async function loadBenchmarkScenarios(adapter, splits = [
309
+ "search",
310
+ "dev",
311
+ "holdout"
312
+ ]) {
313
+ const benchmarkId = benchmarkIdFor(adapter);
314
+ const family = adapter.family ?? "custom";
315
+ const taskKind = adapter.taskKind ?? "custom";
316
+ const out = [];
317
+ const seen = /* @__PURE__ */ new Set();
318
+ for (const split of splits) {
319
+ const items = await adapter.loadDataset(split);
320
+ for (const item of items) {
321
+ const splitTag = item.split ?? adapter.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(adapter) {
341
+ const benchmarkId = benchmarkIdFor(adapter);
342
+ return {
343
+ name: `${benchmarkId}:score`,
344
+ dimensions: [{
345
+ key: "score",
346
+ description: `Primary ${benchmarkId} benchmark score`
347
+ }, {
348
+ key: "passed",
349
+ description: "Binary pass projection for aggregate reporting"
350
+ }],
351
+ appliesTo: (scenario) => {
352
+ return scenario.kind === "benchmark" && scenario.id.startsWith(`${benchmarkId}:`);
353
+ },
354
+ async score({ artifact, scenario }) {
355
+ const evaluation = await adapter.evaluate(scenario.item, artifact);
356
+ return {
357
+ dimensions: normalizeEvaluationDimensions(evaluation),
358
+ composite: clamp01(evaluation.score),
359
+ notes: evaluation.notes ?? ""
360
+ };
361
+ }
362
+ };
363
+ }
364
+ function summarizeBenchmarkCampaign(input) {
365
+ const scenarioById = new Map(input.scenarios.map((scenario) => [scenario.id, scenario]));
366
+ const successful = input.campaign.cells.map((cell) => {
367
+ const scenario = scenarioById.get(cell.scenarioId);
368
+ const judge = firstJudgeScore(cell.judgeScores);
369
+ const score = judge?.composite ?? 0;
370
+ return {
371
+ cell,
372
+ scenario,
373
+ score,
374
+ passed: (judge?.dimensions.passed ?? (score > 0 ? 1 : 0)) >= 1,
375
+ dimensions: judge?.dimensions ?? {}
376
+ };
377
+ }).filter((row) => !row.cell.error);
378
+ const scoreValues = successful.map((row) => row.score);
379
+ return {
380
+ benchmarkId: benchmarkIdFor(input.adapter),
381
+ family: input.adapter.family ?? "custom",
382
+ taskKind: input.adapter.taskKind ?? "custom",
383
+ ...input.adapter.source ? { source: input.adapter.source } : {},
384
+ runDir: input.campaign.runDir,
385
+ manifestHash: input.campaign.manifestHash,
386
+ seed: input.campaign.seed,
387
+ startedAt: input.campaign.startedAt,
388
+ endedAt: input.campaign.endedAt,
389
+ durationMs: input.campaign.durationMs,
390
+ totalItems: input.scenarios.length,
391
+ totalCells: input.campaign.cells.length,
392
+ cellsFailed: input.campaign.aggregates.cellsFailed,
393
+ cellsCached: input.campaign.aggregates.cellsCached,
394
+ totalCostUsd: input.campaign.aggregates.cost.totalCostUsd,
395
+ splits: summarizeSlices(successful, (row) => row.scenario?.splitTag ?? "unknown", [
396
+ "search",
397
+ "dev",
398
+ "holdout"
399
+ ]),
400
+ tags: summarizeSlices(successful, (row) => row.scenario?.tags ?? []),
401
+ dimensions: summarizeDimensions(successful.map((row) => row.dimensions)),
402
+ score: distribution(scoreValues),
403
+ costUsd: distribution(successful.map((row) => row.cell.costUsd)),
404
+ latencyMs: distribution(successful.map((row) => row.cell.durationMs))
405
+ };
406
+ }
407
+ function renderBenchmarkReportMarkdown(report) {
408
+ const splitRows = Object.entries(report.splits).map(([split, summary]) => {
409
+ return `| ${split} | ${summary.n} | ${fmt(summary.meanScore)} | ${fmt(summary.passRate)} | ${fmt(summary.score.p90)} | ${fmt(summary.costUsd.mean)} | ${fmt(summary.latencyMs.p90)} |`;
410
+ }).join("\n");
411
+ 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");
412
+ return [
413
+ `# Benchmark Report: ${report.benchmarkId}`,
414
+ "",
415
+ `- family: ${report.family}`,
416
+ `- task kind: ${report.taskKind}`,
417
+ `- run dir: ${report.runDir}`,
418
+ `- manifest: ${report.manifestHash}`,
419
+ `- cells: ${report.totalCells} total, ${report.cellsFailed} failed, ${report.cellsCached} cached`,
420
+ `- cost: $${fmt(report.totalCostUsd)}`,
421
+ `- score: mean ${fmt(report.score.mean)}, median ${fmt(report.score.median)}, p90 ${fmt(report.score.p90)}, n=${report.score.n}`,
422
+ "",
423
+ "## Splits",
424
+ "",
425
+ "| split | n | mean score | pass rate | score p90 | mean cost | latency p90 ms |",
426
+ "| --- | ---: | ---: | ---: | ---: | ---: | ---: |",
427
+ splitRows || "| none | 0 | 0 | 0 | 0 | 0 | 0 |",
428
+ "",
429
+ "## Dimensions",
430
+ "",
431
+ "| dimension | n | mean | p90 |",
432
+ "| --- | ---: | ---: | ---: |",
433
+ dimRows || "| none | 0 | 0 | 0 |",
434
+ ""
435
+ ].join("\n");
436
+ }
437
+ function benchmarkIdFor(adapter) {
438
+ return adapter.id ?? `${adapter.family ?? "custom"}/${adapter.taskKind ?? "custom"}`;
439
+ }
440
+ function normalizeEvaluationDimensions(evaluation) {
441
+ const dimensions = { score: clamp01(evaluation.score) };
442
+ for (const [key, value] of Object.entries(evaluation.dimensions ?? {})) if (Number.isFinite(value)) dimensions[key] = value;
443
+ dimensions.passed = evaluation.passed ?? evaluation.score > 0 ? 1 : 0;
444
+ return dimensions;
445
+ }
446
+ function summarizeDimensions(rows) {
447
+ const values = /* @__PURE__ */ new Map();
448
+ for (const row of rows) for (const [key, value] of Object.entries(row)) {
449
+ if (!Number.isFinite(value)) continue;
450
+ const list = values.get(key) ?? [];
451
+ list.push(value);
452
+ values.set(key, list);
453
+ }
454
+ return Object.fromEntries([...values.entries()].map(([key, vals]) => [key, distribution(vals)]));
455
+ }
456
+ function summarizeSlices(rows, keyOf, knownKeys = []) {
457
+ const grouped = /* @__PURE__ */ new Map();
458
+ for (const key of knownKeys) grouped.set(key, []);
459
+ for (const row of rows) {
460
+ const keys = keyOf(row);
461
+ for (const key of Array.isArray(keys) ? keys : [keys]) {
462
+ const list = grouped.get(key) ?? [];
463
+ list.push(row);
464
+ grouped.set(key, list);
465
+ }
466
+ }
467
+ const out = {};
468
+ for (const [key, list] of grouped) {
469
+ const withShape = list;
470
+ out[key] = {
471
+ n: list.length,
472
+ meanScore: mean(withShape.map((row) => row.score)),
473
+ passRate: mean(withShape.map((row) => row.passed ? 1 : 0)),
474
+ score: distribution(withShape.map((row) => row.score)),
475
+ costUsd: distribution(withShape.map((row) => row.cell.costUsd)),
476
+ latencyMs: distribution(withShape.map((row) => row.cell.durationMs))
477
+ };
478
+ }
479
+ return out;
480
+ }
481
+ function firstJudgeScore(judgeScores) {
482
+ return Object.values(judgeScores)[0];
483
+ }
484
+ function distribution(values) {
485
+ const finite = [...values].filter(Number.isFinite).sort((a, b) => a - b);
486
+ if (finite.length === 0) return {
487
+ n: 0,
488
+ min: 0,
489
+ mean: 0,
490
+ median: 0,
491
+ p90: 0,
492
+ max: 0
493
+ };
494
+ return {
495
+ n: finite.length,
496
+ min: finite[0],
497
+ mean: mean(finite),
498
+ median: percentile(finite, .5),
499
+ p90: percentile(finite, .9),
500
+ max: finite[finite.length - 1]
501
+ };
502
+ }
503
+ function percentile(sortedValues, p) {
504
+ if (sortedValues.length === 0) return 0;
505
+ return sortedValues[Math.min(sortedValues.length - 1, Math.max(0, Math.ceil(p * sortedValues.length) - 1))];
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 clamp01(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
+ //#endregion
523
+ //#region 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 score = Number(maybeScore === void 0 ? maybeDocIdOrScore : maybeScore);
544
+ if (!documentId || !Number.isFinite(score)) throw new Error(`invalid qrels row ${index + 1}: expected query id, doc id, score`);
545
+ return [{
546
+ queryId,
547
+ documentId,
548
+ score
549
+ }];
550
+ });
551
+ }
552
+ function parseBeirCorpusJsonl(text) {
553
+ return parseJsonlRows(text).map((row, index) => {
554
+ const id = stringField(row, "_id") ?? stringField(row, "id");
555
+ const body = stringField(row, "text") ?? stringField(row, "contents");
556
+ if (!id || body === void 0) throw new Error(`invalid BEIR corpus row ${index + 1}: expected _id/id and text/contents`);
557
+ return {
558
+ id,
559
+ title: stringField(row, "title"),
560
+ text: body,
561
+ metadata: stripKnown(row, [
562
+ "_id",
563
+ "id",
564
+ "title",
565
+ "text",
566
+ "contents"
567
+ ])
568
+ };
569
+ });
570
+ }
571
+ function parseBeirQueriesJsonl(text) {
572
+ return parseJsonlRows(text).map((row, index) => {
573
+ const id = stringField(row, "_id") ?? stringField(row, "id") ?? stringField(row, "query_id");
574
+ const query = stringField(row, "text") ?? stringField(row, "query");
575
+ if (!id || !query) throw new Error(`invalid BEIR query row ${index + 1}: expected _id/id and text/query`);
576
+ return {
577
+ id,
578
+ text: query,
579
+ metadata: stripKnown(row, [
580
+ "_id",
581
+ "id",
582
+ "query_id",
583
+ "text",
584
+ "query"
585
+ ])
586
+ };
587
+ });
588
+ }
589
+ function buildStandardRetrievalItems(options) {
590
+ const qrelsByQuery = /* @__PURE__ */ new Map();
591
+ for (const qrel of options.qrels) {
592
+ if (qrel.score <= 0) continue;
593
+ const list = qrelsByQuery.get(qrel.queryId) ?? [];
594
+ list.push(qrel);
595
+ qrelsByQuery.set(qrel.queryId, list);
596
+ }
597
+ const corpus = options.includeCorpusInPayload && options.corpus ? Object.fromEntries(options.corpus.map((document) => [document.id, document])) : void 0;
598
+ return options.queries.flatMap((query) => {
599
+ const qrels = qrelsByQuery.get(query.id) ?? [];
600
+ if (qrels.length === 0) return [];
601
+ const split = options.splitOf?.(query.id) ?? deterministicSplit(`${options.benchmarkId}:${query.id}`);
602
+ return [{
603
+ id: query.id,
604
+ split,
605
+ family: options.family,
606
+ taskKind: "retrieval",
607
+ tags: [.../* @__PURE__ */ new Set([...options.tags ?? [], split])],
608
+ ...options.source ? { source: options.source } : {},
609
+ ...query.metadata ? { metadata: query.metadata } : {},
610
+ payload: {
611
+ queryId: query.id,
612
+ query: query.text,
613
+ expectedDocumentIds: qrels.map((qrel) => qrel.documentId),
614
+ expectedScores: Object.fromEntries(qrels.map((qrel) => [qrel.documentId, qrel.score])),
615
+ ...corpus ? { corpus } : {},
616
+ ...query.metadata ? { metadata: query.metadata } : {}
617
+ }
618
+ }];
619
+ });
620
+ }
621
+ function createRetrievalIdBenchmarkAdapter(options) {
622
+ const items = buildStandardRetrievalItems(options);
623
+ return {
624
+ id: options.benchmarkId,
625
+ family: options.family,
626
+ taskKind: "retrieval",
627
+ source: options.source,
628
+ defaultMetric: options.primaryMetric ?? "ndcg@10",
629
+ async loadDataset(split) {
630
+ return items.filter((item) => item.split === split);
631
+ },
632
+ async evaluate(item, artifact) {
633
+ return evaluateStandardRetrieval(item.payload, artifact, options);
634
+ },
635
+ assignSplit(itemId) {
636
+ return options.splitOf?.(itemId) ?? deterministicSplit(`${options.benchmarkId}:${itemId}`);
637
+ }
638
+ };
639
+ }
640
+ function evaluateStandardRetrieval(payload, artifact, options = {}) {
641
+ const rankedDocumentIds = normalizeRetrievedDocumentIds(artifact, options.responseIdPattern ?? /[A-Za-z0-9_.:/-]+/g);
642
+ const cutoffs = normalizeCutoffs(options.cutoffs ?? [
643
+ 1,
644
+ 3,
645
+ 5,
646
+ 10
647
+ ]);
648
+ const dimensions = {
649
+ expected_count: payload.expectedDocumentIds.length,
650
+ returned_count: rankedDocumentIds.length
651
+ };
652
+ for (const cutoff of cutoffs) Object.assign(dimensions, retrievalMetricsAtCutoff({
653
+ rankedDocumentIds,
654
+ expectedScores: payload.expectedScores,
655
+ cutoff
656
+ }));
657
+ const primaryMetric = options.primaryMetric ?? "ndcg@10";
658
+ const passMetric = options.passMetric ?? "hit@10";
659
+ const score = dimensions[primaryMetric] ?? dimensions[`ndcg@${cutoffs[cutoffs.length - 1]}`] ?? 0;
660
+ return {
661
+ score,
662
+ passed: (dimensions[passMetric] ?? dimensions[`hit@${cutoffs[cutoffs.length - 1]}`] ?? score) >= (options.passThreshold ?? 1),
663
+ dimensions,
664
+ raw: {
665
+ rankedDocumentIds,
666
+ expectedDocumentIds: payload.expectedDocumentIds,
667
+ expectedScores: payload.expectedScores
668
+ }
669
+ };
670
+ }
671
+ function normalizeRetrievedDocumentIds(artifact, responseIdPattern = /[A-Za-z0-9_.:/-]+/g) {
672
+ if (typeof artifact === "string") return uniqueOrdered((artifact.match(responseIdPattern) ?? []).map((value) => value.trim()));
673
+ if (Array.isArray(artifact)) return uniqueOrdered(artifact.flatMap((entry) => {
674
+ if (typeof entry === "string") return [entry];
675
+ return [entry.documentId ?? entry.docId ?? entry.id ?? ""];
676
+ }));
677
+ const objectArtifact = artifact;
678
+ return uniqueOrdered([
679
+ ...objectArtifact.documentIds ?? [],
680
+ ...objectArtifact.ids ?? [],
681
+ ...(objectArtifact.results ?? []).map((entry) => entry.documentId ?? entry.docId ?? entry.id ?? "")
682
+ ].map((value) => value.trim()));
683
+ }
684
+ function retrievalMetricsAtCutoff(input) {
685
+ const top = input.rankedDocumentIds.slice(0, input.cutoff);
686
+ const relevantIds = Object.keys(input.expectedScores).filter((id) => input.expectedScores[id] > 0);
687
+ const relevant = new Set(relevantIds);
688
+ const hits = top.filter((id) => relevant.has(id)).length;
689
+ const firstRelevantRank = top.findIndex((id) => relevant.has(id));
690
+ const prefix = `@${input.cutoff}`;
691
+ return {
692
+ [`hit${prefix}`]: hits > 0 ? 1 : 0,
693
+ [`recall${prefix}`]: relevant.size === 0 ? 1 : hits / relevant.size,
694
+ [`precision${prefix}`]: hits / input.cutoff,
695
+ [`mrr${prefix}`]: firstRelevantRank === -1 ? 0 : 1 / (firstRelevantRank + 1),
696
+ [`ndcg${prefix}`]: ndcgAt(input.rankedDocumentIds, input.expectedScores, input.cutoff)
697
+ };
698
+ }
699
+ function stringField(row, key) {
700
+ const value = row[key];
701
+ return typeof value === "string" ? value : void 0;
702
+ }
703
+ function stripKnown(row, keys) {
704
+ const known = new Set(keys);
705
+ return Object.fromEntries(Object.entries(row).filter(([key]) => !known.has(key)));
706
+ }
707
+ function normalizeCutoffs(cutoffs) {
708
+ return [...new Set(cutoffs.map((cutoff) => Math.trunc(cutoff)).filter((cutoff) => cutoff > 0))].sort((a, b) => a - b);
709
+ }
710
+ function uniqueOrdered(values) {
711
+ const seen = /* @__PURE__ */ new Set();
712
+ const out = [];
713
+ for (const value of values) {
714
+ const trimmed = value.trim();
715
+ if (!trimmed || seen.has(trimmed)) continue;
716
+ seen.add(trimmed);
717
+ out.push(trimmed);
718
+ }
719
+ return out;
720
+ }
721
+ function ndcgAt(rankedDocumentIds, expectedScores, cutoff) {
722
+ const dcg = rankedDocumentIds.slice(0, cutoff).reduce((sum, documentId, index) => sum + discountedGain(expectedScores[documentId] ?? 0, index), 0);
723
+ 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);
724
+ return ideal === 0 ? 1 : dcg / ideal;
725
+ }
726
+ function discountedGain(relevance, zeroBasedRank) {
727
+ if (relevance <= 0) return 0;
728
+ return (2 ** relevance - 1) / Math.log2(zeroBasedRank + 2);
729
+ }
730
+ //#endregion
731
+ //#region src/benchmarks/index.ts
732
+ var benchmarks_exports = /* @__PURE__ */ __exportAll({
733
+ BENCHMARK_SPLIT_SEED: () => BENCHMARK_SPLIT_SEED,
734
+ buildStandardRetrievalItems: () => buildStandardRetrievalItems,
735
+ calibrateBenchmarkMetric: () => calibrateBenchmarkMetric,
736
+ createRetrievalIdBenchmarkAdapter: () => createRetrievalIdBenchmarkAdapter,
737
+ deterministicSplit: () => deterministicSplit,
738
+ evaluateStandardRetrieval: () => evaluateStandardRetrieval,
739
+ normalizeRetrievedDocumentIds: () => normalizeRetrievedDocumentIds,
740
+ parseBeirCorpusJsonl: () => parseBeirCorpusJsonl,
741
+ parseBeirQueriesJsonl: () => parseBeirQueriesJsonl,
742
+ parseJsonlRows: () => parseJsonlRows,
743
+ parseQrels: () => parseQrels,
744
+ parseTsvRows: () => parseTsvRows,
745
+ renderBenchmarkReportMarkdown: () => renderBenchmarkReportMarkdown,
746
+ retrievalMetricsAtCutoff: () => retrievalMetricsAtCutoff,
747
+ routing: () => routing_exports,
748
+ runBenchmarkAdapter: () => runBenchmarkAdapter,
749
+ summarizeBenchmarkCampaign: () => summarizeBenchmarkCampaign
750
+ });
751
+ //#endregion
752
+ export { deterministicSplit as _, normalizeRetrievedDocumentIds as a, parseJsonlRows as c, retrievalMetricsAtCutoff as d, renderBenchmarkReportMarkdown as f, BENCHMARK_SPLIT_SEED as g, routing_exports as h, evaluateStandardRetrieval as i, parseQrels as l, summarizeBenchmarkCampaign as m, buildStandardRetrievalItems as n, parseBeirCorpusJsonl as o, runBenchmarkAdapter as p, createRetrievalIdBenchmarkAdapter as r, parseBeirQueriesJsonl as s, benchmarks_exports as t, parseTsvRows as u, calibrateBenchmarkMetric as v };
753
+
754
+ //# sourceMappingURL=benchmarks-DviOvUNr.js.map