@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,908 +0,0 @@
1
- import {
2
- pairRunRecords
3
- } from "./chunk-DPUHNQLN.js";
4
- import {
5
- benjaminiHochberg,
6
- confidenceInterval,
7
- pairedBootstrap,
8
- pairedCohensDz,
9
- pairedMde,
10
- wilcoxonSignedRank
11
- } from "./chunk-MHELPNRP.js";
12
- import {
13
- canonicalize,
14
- hashJson
15
- } from "./chunk-2JX3CFMB.js";
16
-
17
- // src/summary-report.ts
18
- function summaryTable(runs, opts = {}) {
19
- const split = opts.split ?? "holdout";
20
- const confidence = opts.confidence ?? 0.95;
21
- const fdr = opts.fdr ?? 0.05;
22
- const comparator = opts.comparator ?? null;
23
- const scoreField = split === "holdout" ? "holdoutScore" : "searchScore";
24
- const byCandidate = /* @__PURE__ */ new Map();
25
- for (const r of runs) {
26
- if (r.splitTag !== split) continue;
27
- const v = r.outcome[scoreField];
28
- if (typeof v !== "number" || !Number.isFinite(v)) continue;
29
- const bucket = byCandidate.get(r.candidateId) ?? { runs: [], scores: [] };
30
- bucket.runs.push(r);
31
- bucket.scores.push(v);
32
- byCandidate.set(r.candidateId, bucket);
33
- }
34
- const candidateIds = [...byCandidate.keys()].sort();
35
- const compRuns = comparator ? byCandidate.get(comparator) : void 0;
36
- const tentative = [];
37
- for (const id of candidateIds) {
38
- const bucket = byCandidate.get(id);
39
- const ci = confidenceInterval(bucket.scores, confidence);
40
- let rawP = null;
41
- let d = null;
42
- let pairedN = null;
43
- let unpairedCandidateN = null;
44
- let unpairedComparatorN = null;
45
- if (comparator && compRuns && id !== comparator) {
46
- const paired = pairScoresByKey(bucket.runs, compRuns.runs, scoreField);
47
- pairedN = paired.before.length;
48
- unpairedCandidateN = paired.unpairedCandidateN;
49
- unpairedComparatorN = paired.unpairedComparatorN;
50
- if (paired.before.length >= 6) {
51
- rawP = wilcoxonSignedRank(paired.before, paired.after).p;
52
- }
53
- d = pairedCohensDz(paired.before, paired.after);
54
- }
55
- tentative.push({
56
- candidateId: id,
57
- n: bucket.scores.length,
58
- mean: ci.mean,
59
- ciLow: ci.lower,
60
- ciHigh: ci.upper,
61
- qValue: rawP,
62
- cohensD: d,
63
- pairedN,
64
- unpairedCandidateN,
65
- unpairedComparatorN,
66
- rawP
67
- });
68
- }
69
- if (comparator) {
70
- const idxs = [];
71
- const ps = [];
72
- for (let i = 0; i < tentative.length; i++) {
73
- const r = tentative[i];
74
- if (r.candidateId === comparator) continue;
75
- if (r.rawP === null || !Number.isFinite(r.rawP)) continue;
76
- idxs.push(i);
77
- ps.push(r.rawP);
78
- }
79
- if (ps.length > 0) {
80
- const { qValues } = benjaminiHochberg(ps, fdr);
81
- for (let k = 0; k < idxs.length; k++) {
82
- tentative[idxs[k]].qValue = qValues[k];
83
- }
84
- }
85
- }
86
- const rows = tentative.map(({ rawP: _rawP, ...rest }) => rest);
87
- const markdown = renderSummaryTableMarkdown(rows, comparator, split);
88
- return { rows, comparator, split, markdown };
89
- }
90
- function pairScoresByKey(candidate, baseline, scoreField) {
91
- const scoredCandidate = candidate.filter((run) => Number.isFinite(run.outcome[scoreField]));
92
- const scoredBaseline = baseline.filter((run) => Number.isFinite(run.outcome[scoreField]));
93
- const pairing = pairRunRecords(scoredBaseline, scoredCandidate);
94
- return {
95
- before: pairing.pairs.map((pair) => pair.baseline.outcome[scoreField]),
96
- after: pairing.pairs.map((pair) => pair.treatment.outcome[scoreField]),
97
- unpairedCandidateN: pairing.unpairedTreatment.length,
98
- unpairedComparatorN: pairing.unpairedBaseline.length
99
- };
100
- }
101
- function renderSummaryTableMarkdown(rows, comparator, split) {
102
- const lines = [];
103
- const cmpLabel = comparator ? ` (vs ${comparator})` : "";
104
- lines.push(`Summary Table \u2014 ${split} split${cmpLabel}`);
105
- lines.push("");
106
- lines.push("| Candidate | N | Pairs | Unpaired | Mean | 95% CI | q (BH) | Cohen's dz |");
107
- lines.push("|---|---:|---:|---:|---:|---|---:|---:|");
108
- for (const r of rows) {
109
- const ci = `[${fmt(r.ciLow)}, ${fmt(r.ciHigh)}]`;
110
- const q = r.qValue !== null ? r.qValue.toFixed(4) : "\u2014";
111
- const d = r.cohensD !== null ? r.cohensD.toFixed(3) : "\u2014";
112
- const paired = r.pairedN ?? "\u2014";
113
- const unpaired = r.unpairedCandidateN === null || r.unpairedComparatorN === null ? "\u2014" : `${r.unpairedCandidateN}/${r.unpairedComparatorN}`;
114
- lines.push(
115
- `| ${r.candidateId} | ${r.n} | ${paired} | ${unpaired} | ${fmt(r.mean)} | ${ci} | ${q} | ${d} |`
116
- );
117
- }
118
- return lines.join("\n");
119
- }
120
- function paretoChart(runs, opts = {}) {
121
- const split = opts.split ?? "holdout";
122
- const scoreField = split === "holdout" ? "holdoutScore" : "searchScore";
123
- const buckets = /* @__PURE__ */ new Map();
124
- for (const r of runs) {
125
- if (r.splitTag !== split) continue;
126
- const v = r.outcome[scoreField];
127
- if (typeof v !== "number" || !Number.isFinite(v)) continue;
128
- if (r.costUsd === null) continue;
129
- const bucket = buckets.get(r.candidateId) ?? { cost: [], quality: [] };
130
- bucket.cost.push(r.costUsd);
131
- bucket.quality.push(v);
132
- buckets.set(r.candidateId, bucket);
133
- }
134
- const points = [];
135
- for (const [candidateId, bucket] of buckets.entries()) {
136
- points.push({
137
- candidateId,
138
- cost: avg(bucket.cost),
139
- quality: avg(bucket.quality),
140
- n: bucket.cost.length,
141
- onFrontier: false,
142
- gate: opts.gateDecisions?.[candidateId] ? gateLabel(opts.gateDecisions[candidateId]) : void 0
143
- });
144
- }
145
- for (const p of points) {
146
- p.onFrontier = !points.some((q) => q !== p && dominates(q, p));
147
- }
148
- return {
149
- kind: "pareto-cost-quality",
150
- split,
151
- axes: { x: "costUsd", y: "score" },
152
- points
153
- };
154
- }
155
- function dominates(a, b) {
156
- return a.cost <= b.cost && a.quality >= b.quality && (a.cost < b.cost || a.quality > b.quality);
157
- }
158
- function gateLabel(d) {
159
- return d.promote ? "promote" : "reject";
160
- }
161
- function gainHistogram(runs, candidateId, comparator, opts = {}) {
162
- const split = opts.split ?? "holdout";
163
- const scoreField = split === "holdout" ? "holdoutScore" : "searchScore";
164
- const binCount = opts.bins ?? 11;
165
- if (binCount < 1) throw new Error("gainHistogram: bins must be \u2265 1");
166
- const candidate = runs.filter((r) => r.candidateId === candidateId && r.splitTag === split);
167
- const baseline = runs.filter((r) => r.candidateId === comparator && r.splitTag === split);
168
- const { before, after, unpairedCandidateN, unpairedComparatorN } = pairScoresByKey(
169
- candidate,
170
- baseline,
171
- scoreField
172
- );
173
- const n = before.length;
174
- if (n === 0) {
175
- return {
176
- kind: "gain-distribution",
177
- candidateId,
178
- comparator,
179
- split,
180
- n: 0,
181
- unpairedCandidateN,
182
- unpairedComparatorN,
183
- bins: [],
184
- median: null,
185
- ci: null
186
- };
187
- }
188
- const deltas = before.map((b, i) => after[i] - b);
189
- const sortedDeltas = [...deltas].sort((a, b) => a - b);
190
- const median = medianOfSorted(sortedDeltas);
191
- const min = sortedDeltas[0];
192
- const max = sortedDeltas[sortedDeltas.length - 1];
193
- const bound = Math.max(Math.abs(min), Math.abs(max), 1e-6);
194
- const lo = -bound;
195
- const hi = bound;
196
- const width = (hi - lo) / binCount;
197
- const bins = [];
198
- for (let i = 0; i < binCount; i++) {
199
- bins.push({ lo: lo + i * width, hi: lo + (i + 1) * width, count: 0 });
200
- }
201
- for (const d of deltas) {
202
- let idx = Math.floor((d - lo) / width);
203
- if (idx < 0) idx = 0;
204
- if (idx >= binCount) idx = binCount - 1;
205
- bins[idx].count += 1;
206
- }
207
- const ci = pairedBootstrap(before, after, {
208
- confidence: opts.confidence ?? 0.95,
209
- resamples: opts.resamples ?? 2e3,
210
- statistic: "median",
211
- seed: opts.seed
212
- });
213
- return {
214
- kind: "gain-distribution",
215
- candidateId,
216
- comparator,
217
- split,
218
- n,
219
- unpairedCandidateN,
220
- unpairedComparatorN,
221
- bins,
222
- median,
223
- ci: { low: ci.low, high: ci.high }
224
- };
225
- }
226
- var RESEARCH_REPORT_HARD_PAIR_FLOOR = 6;
227
- function pairedPosterior(runs, candidateId, comparator, opts) {
228
- const scoreField = opts.split === "holdout" ? "holdoutScore" : "searchScore";
229
- const candidate = runs.filter((r) => r.candidateId === candidateId && r.splitTag === opts.split);
230
- const baseline = runs.filter((r) => r.candidateId === comparator && r.splitTag === opts.split);
231
- const { before, after } = pairScoresByKey(candidate, baseline, scoreField);
232
- const n = before.length;
233
- if (n === 0) return null;
234
- const deltas = before.map((b, i) => after[i] - b);
235
- const meanDelta = deltas.reduce((s, x) => s + x, 0) / n;
236
- const sortedDeltas = [...deltas].sort((a, b) => a - b);
237
- const medianDelta = medianOfSorted(sortedDeltas);
238
- const sdDelta = stdev(deltas, meanDelta);
239
- const ci = pairedBootstrap(before, after, {
240
- confidence: opts.confidence,
241
- resamples: 2e3,
242
- statistic: "median",
243
- seed: opts.seed
244
- });
245
- const meanSamples = bayesianBootstrapMeanSamples(deltas, 2e3, opts.seed);
246
- const prGreaterThanZero = meanSamples.length === 0 ? 0 : meanSamples.filter((s) => s > 0).length / meanSamples.length;
247
- const prInRope = opts.rope === null || meanSamples.length === 0 ? null : meanSamples.filter((s) => s >= opts.rope.low && s <= opts.rope.high).length / meanSamples.length;
248
- const dStandardised = pairedMde({ nPaired: n, alpha: opts.mdeAlpha, power: opts.mdePower });
249
- const mde = sdDelta === 0 ? 0 : dStandardised * sdDelta;
250
- return {
251
- n,
252
- meanDelta,
253
- medianDelta,
254
- sdDelta,
255
- ci: { low: ci.low, high: ci.high },
256
- prGreaterThanZero,
257
- prInRope,
258
- mde
259
- };
260
- }
261
- function bayesianBootstrapMeanSamples(deltas, resamples, seed) {
262
- const n = deltas.length;
263
- if (n === 0) return [];
264
- if (n === 1) return new Array(resamples).fill(deltas[0]);
265
- const rng = seedRng(seed);
266
- const samples = new Array(resamples);
267
- for (let b = 0; b < resamples; b++) {
268
- let weightedSum = 0;
269
- let weightSum = 0;
270
- for (let k = 0; k < n; k++) {
271
- const weight = -Math.log(Math.max(Number.MIN_VALUE, rng()));
272
- weightedSum += deltas[k] * weight;
273
- weightSum += weight;
274
- }
275
- samples[b] = weightedSum / weightSum;
276
- }
277
- return samples;
278
- }
279
- function seedRng(seed) {
280
- if (seed === void 0) return Math.random;
281
- let s = seed >>> 0;
282
- return () => {
283
- s = s + 1831565813 >>> 0;
284
- let t = s;
285
- t = Math.imul(t ^ t >>> 15, t | 1);
286
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
287
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
288
- };
289
- }
290
- function stdev(xs, mean) {
291
- if (xs.length < 2) return 0;
292
- let sse = 0;
293
- for (const x of xs) sse += (x - mean) ** 2;
294
- return Math.sqrt(sse / (xs.length - 1));
295
- }
296
- async function researchReport(runs, opts = {}) {
297
- const split = opts.split ?? "holdout";
298
- const comparator = opts.comparator ?? null;
299
- const confidence = opts.confidence ?? 0.95;
300
- const fdr = opts.fdr ?? 0.05;
301
- const minPairs = Math.max(opts.minPairs ?? 20, RESEARCH_REPORT_HARD_PAIR_FLOOR);
302
- const rope = opts.rope ?? null;
303
- const mdePower = opts.mdePower ?? 0.8;
304
- const mdeAlpha = opts.mdeAlpha ?? fdr;
305
- const title = opts.title ?? "Agent Evaluation Research Report";
306
- const generatedAt = opts.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString();
307
- const preregistrationHash = opts.preregistrationHash ?? null;
308
- if (rope && !(Number.isFinite(rope.low) && Number.isFinite(rope.high) && rope.low <= rope.high)) {
309
- throw new Error(
310
- `researchReport: rope must satisfy low \u2264 high with finite bounds, got ${JSON.stringify(rope)}`
311
- );
312
- }
313
- const summary = summaryTable(runs, {
314
- comparator: comparator ?? void 0,
315
- split,
316
- confidence,
317
- fdr
318
- });
319
- const pareto = paretoChart(runs, { split, gateDecisions: opts.gateDecisions });
320
- const candidateIds = opts.candidateIds ?? summary.rows.map((r) => r.candidateId).filter((id) => id !== comparator);
321
- const gains = comparator ? candidateIds.map(
322
- (id) => gainHistogram(runs, id, comparator, {
323
- split,
324
- confidence,
325
- seed: opts.seed
326
- })
327
- ) : [];
328
- const gainByCandidate = new Map(gains.map((g) => [g.candidateId, g]));
329
- const paretoByCandidate = new Map(pareto.points.map((p) => [p.candidateId, p]));
330
- const posteriorByCandidate = /* @__PURE__ */ new Map();
331
- if (comparator) {
332
- for (const id of candidateIds) {
333
- posteriorByCandidate.set(
334
- id,
335
- pairedPosterior(runs, id, comparator, {
336
- split,
337
- confidence,
338
- seed: opts.seed,
339
- rope,
340
- mdePower,
341
- mdeAlpha
342
- })
343
- );
344
- }
345
- }
346
- const candidates = summary.rows.map((row) => {
347
- const gain = gainByCandidate.get(row.candidateId);
348
- const point = paretoByCandidate.get(row.candidateId);
349
- const posterior = posteriorByCandidate.get(row.candidateId) ?? null;
350
- const gateDecision = opts.gateDecisions?.[row.candidateId];
351
- const classified = classifyCandidate(row, {
352
- comparator,
353
- posterior,
354
- point,
355
- gateDecision,
356
- split,
357
- fdr,
358
- minPairs,
359
- rope
360
- });
361
- return {
362
- candidateId: row.candidateId,
363
- n: row.n,
364
- mean: row.mean,
365
- ciLow: row.ciLow,
366
- ciHigh: row.ciHigh,
367
- qValue: row.qValue,
368
- cohensD: row.cohensD,
369
- meanDeltaVsComparator: posterior ? posterior.meanDelta : null,
370
- pairedN: posterior?.n ?? gain?.n ?? 0,
371
- medianGain: posterior ? posterior.medianDelta : gain ? gain.median : null,
372
- meanGain: posterior ? posterior.meanDelta : null,
373
- gainCi: posterior ? posterior.ci : gain ? gain.ci : null,
374
- prGreaterThanZero: posterior ? posterior.prGreaterThanZero : null,
375
- prInRope: posterior ? posterior.prInRope : null,
376
- mde: posterior ? posterior.mde : null,
377
- onParetoFrontier: point?.onFrontier ?? false,
378
- gate: gateDecision ? gateLabel(gateDecision) : void 0,
379
- decision: classified.decision,
380
- decisionReason: classified.reason
381
- };
382
- }).sort((a, b) => {
383
- const decisionRank = decisionWeight(b.decision) - decisionWeight(a.decision);
384
- if (decisionRank !== 0) return decisionRank;
385
- return b.mean - a.mean;
386
- });
387
- const recommendation = buildRecommendation(candidates, {
388
- comparator,
389
- failureClusters: opts.failureClusters,
390
- rope,
391
- minPairs,
392
- preregistrationHash
393
- });
394
- const executiveSummary = buildExecutiveSummary(candidates, recommendation, {
395
- comparator,
396
- split,
397
- failureClusters: opts.failureClusters,
398
- preregistrationHash
399
- });
400
- const methodology = buildMethodology({
401
- split,
402
- comparator,
403
- fdr,
404
- minPairs,
405
- rope,
406
- confidence,
407
- mdePower,
408
- mdeAlpha
409
- });
410
- const runFingerprint = await hashJson(
411
- canonicalize({
412
- triples: runs.filter((r) => r.splitTag === split).map((r) => ({ runId: r.runId, candidateId: r.candidateId, splitTag: r.splitTag })).sort((a, b) => a.runId.localeCompare(b.runId)),
413
- comparator,
414
- split
415
- })
416
- );
417
- const markdown = renderResearchMarkdown({
418
- title,
419
- generatedAt,
420
- split,
421
- comparator,
422
- rope,
423
- runFingerprint,
424
- preregistrationHash,
425
- executiveSummary,
426
- recommendation,
427
- candidates,
428
- summary,
429
- pareto,
430
- gains,
431
- methodology,
432
- failureClusters: opts.failureClusters
433
- });
434
- const html = renderResearchHtml(markdown, title);
435
- return {
436
- kind: "agent-eval-research-report",
437
- title,
438
- generatedAt,
439
- split,
440
- comparator,
441
- runFingerprint,
442
- preregistrationHash,
443
- rope,
444
- executiveSummary,
445
- recommendation,
446
- candidates,
447
- summary,
448
- charts: { pareto, gains },
449
- methodology,
450
- failureClusters: opts.failureClusters,
451
- markdown,
452
- html
453
- };
454
- }
455
- function buildMethodology(ctx) {
456
- const assumptions = [
457
- "Pairs are matched by (experimentId, scenarioId, seed); input order does not affect the comparison.",
458
- "Paired deltas are exchangeable conditional on the matched scenario \u2014 no mid-run distribution shift.",
459
- `Decisions are pre-specified at fdr=${ctx.fdr}, minPairs=${ctx.minPairs}, confidence=${ctx.confidence}; deviating from these post-hoc invalidates the false-discovery control.`
460
- ];
461
- if (ctx.rope) {
462
- assumptions.push(
463
- `The Region of Practical Equivalence ${formatRope(ctx.rope)} is supplied by the domain owner; equivalent verdicts are only meaningful if that range is treated as the standing definition of "no material difference."`
464
- );
465
- }
466
- if (ctx.comparator === null) {
467
- assumptions.push("No comparator was configured; this run is descriptive, not causal.");
468
- }
469
- const methods = [
470
- "Marginal scores summarised with BH-FDR-adjusted Wilcoxon signed-rank q-values and paired Cohen's dz via summaryTable.",
471
- "Paired evidence summarised with a frequentist bootstrap CI on the median delta and a Dirichlet-weight Bayesian bootstrap for Pr(\u0394>0) and Pr(\u0394\u2208ROPE) on the mean delta.",
472
- `Minimum detectable effect reported per candidate at \u03B1=${ctx.mdeAlpha} (two-sided), power=${ctx.mdePower}, standardised by the observed paired-delta SD.`,
473
- "Pareto frontier flagged as a separate axis (cost vs quality); a candidate can be on-frontier without winning the paired test.",
474
- "Held-out gate decisions, when supplied, override the statistical verdict in the reject direction."
475
- ];
476
- const alternatives = [
477
- "Paired t-test rejected: not robust to the heavy-tailed score distributions common in agent benchmarks.",
478
- "Unpaired Mann\u2013Whitney rejected: matched scenarios make pairing free; unpaired throws away that variance reduction.",
479
- "Sequential / always-valid inference (e-values, mSPRT) is the right tool for iterative sweeps and is out of scope for this single-look report \u2014 preregister and run once, or wrap this report in an alpha-spending schedule.",
480
- "Hierarchical Bayesian shrinkage across many candidates is future work; the current ranking uses raw paired statistics."
481
- ];
482
- const whenNotToApply = [
483
- `Paired N below ${RESEARCH_REPORT_HARD_PAIR_FLOOR} on any candidate \u2014 the bootstrap CI is degenerate.`,
484
- "Comparator chosen post-hoc by inspecting the same data; q-values are no longer false-discovery-controlled.",
485
- "Scenarios not drawn under a stable preregistered protocol; the report can describe the data but cannot anchor a launch decision.",
486
- "Score distributions with mid-run shift (judge model swap, rubric change, infra outage) \u2014 pair exchangeability is violated."
487
- ];
488
- const citations = [
489
- "Benjamini, Y. & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. JRSS B, 57(1), 289\u2013300.",
490
- "Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80\u201383.",
491
- "Efron, B. (1979). Bootstrap methods: another look at the jackknife. Annals of Statistics, 7(1), 1\u201326.",
492
- "Rubin, D. B. (1981). The Bayesian bootstrap. Annals of Statistics, 9(1), 130\u2013134.",
493
- "Kruschke, J. K. (2018). Rejecting or accepting parameter values in Bayesian estimation. Advances in Methods and Practices in Psychological Science, 1(2), 270\u2013280. (ROPE.)"
494
- ];
495
- return { assumptions, methods, alternatives, whenNotToApply, citations };
496
- }
497
- function formatRope(rope) {
498
- return `[${fmt(rope.low)}, ${fmt(rope.high)}]`;
499
- }
500
- function classifyCandidate(row, ctx) {
501
- if (ctx.comparator && row.candidateId === ctx.comparator) {
502
- return { decision: "hold", reason: "Comparator baseline." };
503
- }
504
- if (ctx.gateDecision && !ctx.gateDecision.promote) {
505
- const code = ctx.gateDecision.rejectionCode ?? "rejected";
506
- return {
507
- decision: "reject",
508
- reason: `Held-out gate returned ${code}: ${ctx.gateDecision.reason}`
509
- };
510
- }
511
- if (!ctx.comparator) {
512
- return {
513
- decision: ctx.point?.onFrontier ? "hold" : "needs_more_data",
514
- reason: "No comparator configured; report ranks candidates but cannot anchor a promotion call."
515
- };
516
- }
517
- if (!ctx.posterior || ctx.posterior.n < RESEARCH_REPORT_HARD_PAIR_FLOOR) {
518
- return {
519
- decision: "needs_more_data",
520
- reason: `Only ${ctx.posterior?.n ?? 0} paired observations; below hard floor of ${RESEARCH_REPORT_HARD_PAIR_FLOOR} for any paired inference.`
521
- };
522
- }
523
- const ci = ctx.posterior.ci;
524
- if (ctx.split === "search") {
525
- return {
526
- decision: "hold",
527
- reason: "Search-split evidence is descriptive; release decisions require matched holdout runs."
528
- };
529
- }
530
- if (ctx.rope && ci.low >= ctx.rope.low && ci.high <= ctx.rope.high) {
531
- return {
532
- decision: "equivalent",
533
- reason: `Paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] is fully inside ROPE ${formatRope(ctx.rope)}; candidate is practically equivalent to comparator.`
534
- };
535
- }
536
- const gainPositive = ci.low > 0;
537
- const gainNegative = ci.high < 0;
538
- if (gainNegative) {
539
- return {
540
- decision: "reject",
541
- reason: `Paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] lies entirely below zero.`
542
- };
543
- }
544
- if (ctx.posterior.n < ctx.minPairs) {
545
- return {
546
- decision: "needs_more_data",
547
- reason: `Only ${ctx.posterior.n} paired observations; minimum detectable effect at this N is ${fmt(ctx.posterior.mde)} score units (need \u2265 ${ctx.minPairs} pairs to issue a directional verdict).`
548
- };
549
- }
550
- if (row.qValue !== null && row.qValue <= ctx.fdr && gainPositive) {
551
- return {
552
- decision: "promote",
553
- reason: `BH-adjusted q=${fmt(row.qValue)} \u2264 ${ctx.fdr} and paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] excludes zero; Pr(\u0394>0)=${fmt(ctx.posterior.prGreaterThanZero)}.`
554
- };
555
- }
556
- return {
557
- decision: "hold",
558
- reason: `Pr(\u0394>0)=${fmt(ctx.posterior.prGreaterThanZero)} but CI [${fmt(ci.low)}, ${fmt(ci.high)}] crosses zero; effect not decisive at fdr=${ctx.fdr}.`
559
- };
560
- }
561
- function buildRecommendation(candidates, ctx) {
562
- const nonComparator = candidates.filter((c) => c.candidateId !== ctx.comparator);
563
- const bestPromote = nonComparator.find((c) => c.decision === "promote");
564
- const bestEquivalent = nonComparator.find((c) => c.decision === "equivalent");
565
- const chosen = bestPromote ?? bestEquivalent ?? nonComparator[0] ?? null;
566
- const decision = bestPromote ? "promote" : nonComparator.some((c) => c.decision === "needs_more_data") ? "needs_more_data" : bestEquivalent ? "equivalent" : nonComparator.some((c) => c.decision === "hold") ? "hold" : "reject";
567
- const rationale = [];
568
- const risks = [];
569
- const nextActions = [];
570
- if (chosen) {
571
- rationale.push(`${chosen.candidateId}: ${chosen.decisionReason}`);
572
- if (chosen.gainCi) {
573
- const probSummary = chosen.prGreaterThanZero !== null ? `, Pr(\u0394>0)=${fmt(chosen.prGreaterThanZero)}` : "";
574
- rationale.push(
575
- `Median paired gain CI: [${fmt(chosen.gainCi.low)}, ${fmt(chosen.gainCi.high)}]${probSummary}.`
576
- );
577
- }
578
- if (chosen.mde !== null && Number.isFinite(chosen.mde)) {
579
- rationale.push(`MDE at current paired N=${chosen.pairedN}: ${fmt(chosen.mde)} score units.`);
580
- }
581
- }
582
- if (!ctx.comparator) {
583
- risks.push("No comparator was configured; verdict is descriptive, not causal.");
584
- nextActions.push("Re-run with a stable comparator candidate for paired inference.");
585
- }
586
- if (!ctx.preregistrationHash) {
587
- risks.push(
588
- "No preregistration hash supplied; readers cannot verify the analysis was specified before data inspection."
589
- );
590
- nextActions.push(
591
- "Sign a HypothesisManifest before the next sweep and pass `preregistrationHash` so the report cites it."
592
- );
593
- }
594
- if (ctx.rope === null && nonComparator.length > 0) {
595
- risks.push(
596
- 'No ROPE configured; the report cannot distinguish "equivalent" from "inconclusive".'
597
- );
598
- nextActions.push(
599
- "Define a domain-specific Region of Practical Equivalence and pass it to lock in the equivalence threshold."
600
- );
601
- }
602
- const inconclusive = nonComparator.filter((c) => c.decision === "needs_more_data");
603
- if (inconclusive.length > 0) {
604
- const worst = inconclusive.reduce((a, b) => b.pairedN < a.pairedN ? b : a);
605
- risks.push(
606
- `${inconclusive.length} candidate(s) below soft floor (${ctx.minPairs} pairs); thinnest is ${worst.candidateId} with ${worst.pairedN}.`
607
- );
608
- nextActions.push(
609
- `Collect at least ${ctx.minPairs - worst.pairedN} more matched holdout runs for ${worst.candidateId}.`
610
- );
611
- }
612
- const rejected = nonComparator.filter((c) => c.decision === "reject");
613
- if (rejected.length > 0) {
614
- risks.push(
615
- `${rejected.length} candidate(s) failed the paired test or held-out gate; do not ship those variants.`
616
- );
617
- }
618
- if (ctx.failureClusters && ctx.failureClusters.clusters.length > 0) {
619
- const top = ctx.failureClusters.clusters[0];
620
- risks.push(`Top failure cluster: ${top.failureClass} across ${top.runCount} run(s).`);
621
- nextActions.push("Prioritize the largest failure cluster before broad rollout.");
622
- }
623
- if (decision === "promote") {
624
- nextActions.push("Ship behind the existing promotion gate and monitor canaries.");
625
- } else if (decision === "hold") {
626
- nextActions.push("Keep current production candidate while expanding holdout evidence.");
627
- } else if (decision === "equivalent") {
628
- nextActions.push(
629
- "Either keep the comparator (no quality regression) or promote on cost/latency grounds \u2014 equivalence does not justify either; the choice is a product decision, not a stats one."
630
- );
631
- } else if (decision === "reject") {
632
- nextActions.push(
633
- "Do not promote this sweep; inspect failures and generate a revised candidate."
634
- );
635
- }
636
- return {
637
- decision,
638
- candidateId: chosen?.candidateId ?? null,
639
- rationale,
640
- risks,
641
- nextActions
642
- };
643
- }
644
- function buildExecutiveSummary(candidates, recommendation, ctx) {
645
- const lines = [];
646
- const nonComparator = candidates.filter((c) => c.candidateId !== ctx.comparator);
647
- lines.push(
648
- `Evaluated ${nonComparator.length} candidate(s) on the ${ctx.split} split${ctx.comparator ? ` against ${ctx.comparator}` : ""}.`
649
- );
650
- lines.push(
651
- `Recommendation: ${recommendation.decision}${recommendation.candidateId ? ` ${recommendation.candidateId}` : ""}.`
652
- );
653
- const promoted = nonComparator.filter((c) => c.decision === "promote").length;
654
- const held = nonComparator.filter((c) => c.decision === "hold").length;
655
- const equivalent = nonComparator.filter((c) => c.decision === "equivalent").length;
656
- const rejected = nonComparator.filter((c) => c.decision === "reject").length;
657
- const more = nonComparator.filter((c) => c.decision === "needs_more_data").length;
658
- lines.push(
659
- `Decision mix: ${promoted} promote, ${equivalent} equivalent, ${held} hold, ${rejected} reject, ${more} need more data.`
660
- );
661
- const frontier = nonComparator.filter((c) => c.onParetoFrontier).map((c) => c.candidateId);
662
- if (frontier.length > 0) lines.push(`Pareto-frontier candidates: ${frontier.join(", ")}.`);
663
- if (ctx.failureClusters) {
664
- lines.push(
665
- `Failure clustering found ${ctx.failureClusters.totalFailures}/${ctx.failureClusters.totalRuns} failed runs across ${ctx.failureClusters.clusters.length} reportable cluster(s).`
666
- );
667
- }
668
- lines.push(
669
- ctx.preregistrationHash ? `Preregistered analysis: ${ctx.preregistrationHash.slice(0, 12)}\u2026` : "Analysis is post-hoc \u2014 no preregistration hash supplied."
670
- );
671
- return lines;
672
- }
673
- function renderResearchMarkdown(report) {
674
- const lines = [];
675
- lines.push(`# ${report.title}`);
676
- lines.push("");
677
- lines.push(`**Generated:** ${report.generatedAt}`);
678
- lines.push(`**Primary split:** ${report.split}`);
679
- lines.push(`**Comparator:** ${report.comparator ?? "not configured"}`);
680
- lines.push(`**ROPE:** ${report.rope ? formatRope(report.rope) : "not configured"}`);
681
- lines.push(`**Run fingerprint:** \`${report.runFingerprint}\``);
682
- lines.push(
683
- `**Preregistration:** ${report.preregistrationHash ? `\`${report.preregistrationHash}\`` : "none"}`
684
- );
685
- lines.push("");
686
- lines.push("## Executive Summary");
687
- lines.push("");
688
- for (const item of report.executiveSummary) lines.push(`- ${item}`);
689
- lines.push("");
690
- lines.push("## Recommendation");
691
- lines.push("");
692
- lines.push(`**Decision:** ${report.recommendation.decision}`);
693
- lines.push(`**Candidate:** ${report.recommendation.candidateId ?? "N/A"}`);
694
- lines.push("");
695
- lines.push("### Rationale");
696
- lines.push("");
697
- for (const item of report.recommendation.rationale) lines.push(`- ${item}`);
698
- lines.push("");
699
- lines.push("### Risks");
700
- lines.push("");
701
- for (const item of report.recommendation.risks.length ? report.recommendation.risks : ["No material report-level risks detected."]) {
702
- lines.push(`- ${item}`);
703
- }
704
- lines.push("");
705
- lines.push("### Next Actions");
706
- lines.push("");
707
- for (const item of report.recommendation.nextActions) lines.push(`- ${item}`);
708
- lines.push("");
709
- lines.push("## Candidate Decision Table");
710
- lines.push("");
711
- lines.push(
712
- "| Candidate | Decision | Mean | \u0394\u0304 | Pr(\u0394>0) | q | dz | Paired N | Median Gain CI | MDE | Pareto | Gate |"
713
- );
714
- lines.push("|---|---|---:|---:|---:|---:|---:|---:|---|---:|---|---|");
715
- for (const c of report.candidates) {
716
- const delta = c.meanDeltaVsComparator === null ? "-" : signed(c.meanDeltaVsComparator);
717
- const prGt = c.prGreaterThanZero === null ? "-" : c.prGreaterThanZero.toFixed(3);
718
- const q = c.qValue !== null ? c.qValue.toFixed(4) : "-";
719
- const d = c.cohensD !== null ? c.cohensD.toFixed(3) : "-";
720
- const gain = c.gainCi ? `[${fmt(c.gainCi.low)}, ${fmt(c.gainCi.high)}]` : "-";
721
- const mde = c.mde === null || !Number.isFinite(c.mde) ? "-" : fmt(c.mde);
722
- lines.push(
723
- `| ${c.candidateId} | ${c.decision} | ${fmt(c.mean)} | ${delta} | ${prGt} | ${q} | ${d} | ${c.pairedN} | ${gain} | ${mde} | ${c.onParetoFrontier ? "yes" : "no"} | ${c.gate ?? "-"} |`
724
- );
725
- }
726
- lines.push("");
727
- lines.push("## Statistical Summary");
728
- lines.push("");
729
- lines.push(report.summary.markdown);
730
- lines.push("");
731
- lines.push("## Methodology");
732
- lines.push("");
733
- lines.push("### Assumptions");
734
- lines.push("");
735
- for (const item of report.methodology.assumptions) lines.push(`- ${item}`);
736
- lines.push("");
737
- lines.push("### Methods");
738
- lines.push("");
739
- for (const item of report.methodology.methods) lines.push(`- ${item}`);
740
- lines.push("");
741
- lines.push("### Alternatives Considered");
742
- lines.push("");
743
- for (const item of report.methodology.alternatives) lines.push(`- ${item}`);
744
- lines.push("");
745
- lines.push("### When NOT To Apply");
746
- lines.push("");
747
- for (const item of report.methodology.whenNotToApply) lines.push(`- ${item}`);
748
- lines.push("");
749
- lines.push("### Citations");
750
- lines.push("");
751
- for (const item of report.methodology.citations) lines.push(`- ${item}`);
752
- lines.push("");
753
- lines.push("## Chart Specs");
754
- lines.push("");
755
- lines.push(
756
- "The report carries JSON chart specs for Pareto cost/quality and paired gain histograms."
757
- );
758
- lines.push("");
759
- lines.push("```json");
760
- lines.push(JSON.stringify({ pareto: report.pareto, gains: report.gains }, null, 2));
761
- lines.push("```");
762
- if (report.failureClusters) {
763
- lines.push("");
764
- lines.push("## Failure Clusters");
765
- lines.push("");
766
- lines.push("| Failure Class | Runs | Scenarios | Tool | Example |");
767
- lines.push("|---|---:|---:|---|---|");
768
- for (const c of report.failureClusters.clusters.slice(0, 10)) {
769
- lines.push(
770
- `| ${c.failureClass} | ${c.runCount} | ${c.scenarioIds.length} | ${c.toolName ?? "-"} | ${escapePipes(c.exampleError ?? c.exampleRunId)} |`
771
- );
772
- }
773
- }
774
- return lines.join("\n");
775
- }
776
- function renderResearchHtml(markdown, title) {
777
- const body = markdownToHtml(markdown);
778
- return [
779
- "<!doctype html>",
780
- '<html lang="en">',
781
- "<head>",
782
- '<meta charset="utf-8">',
783
- '<meta name="viewport" content="width=device-width, initial-scale=1">',
784
- `<title>${escapeHtml(title)}</title>`,
785
- "<style>",
786
- 'body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;margin:0;color:#172026;background:#f7f8f8;}',
787
- "main{max-width:1080px;margin:0 auto;padding:40px 24px 64px;background:#fff;min-height:100vh;}",
788
- "h1{font-size:34px;line-height:1.15;margin:0 0 20px;}h2{margin-top:34px;border-top:1px solid #d9dfdf;padding-top:22px;}h3{margin-top:22px;}",
789
- "p,li{line-height:1.55;}table{border-collapse:collapse;width:100%;margin:16px 0;font-size:14px;}th,td{border:1px solid #d9dfdf;padding:8px;text-align:left;}th{background:#eef2f2;}",
790
- "code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}pre{overflow:auto;background:#111827;color:#f9fafb;padding:16px;border-radius:6px;}",
791
- "</style>",
792
- "</head>",
793
- "<body><main>",
794
- body,
795
- "</main></body></html>"
796
- ].join("\n");
797
- }
798
- function markdownToHtml(markdown) {
799
- const lines = markdown.split("\n");
800
- const html = [];
801
- let inList = false;
802
- let inCode = false;
803
- let code = [];
804
- let table = [];
805
- const flushList = () => {
806
- if (inList) {
807
- html.push("</ul>");
808
- inList = false;
809
- }
810
- };
811
- const flushTable = () => {
812
- if (table.length === 0) return;
813
- html.push(renderMarkdownTable(table));
814
- table = [];
815
- };
816
- for (const line of lines) {
817
- if (line.startsWith("```")) {
818
- if (inCode) {
819
- html.push(`<pre><code>${escapeHtml(code.join("\n"))}</code></pre>`);
820
- code = [];
821
- inCode = false;
822
- } else {
823
- flushList();
824
- flushTable();
825
- inCode = true;
826
- }
827
- continue;
828
- }
829
- if (inCode) {
830
- code.push(line);
831
- continue;
832
- }
833
- if (line.startsWith("|")) {
834
- flushList();
835
- table.push(line);
836
- continue;
837
- }
838
- flushTable();
839
- if (line.startsWith("- ")) {
840
- if (!inList) {
841
- html.push("<ul>");
842
- inList = true;
843
- }
844
- html.push(`<li>${inlineMarkdown(line.slice(2))}</li>`);
845
- continue;
846
- }
847
- flushList();
848
- if (line.startsWith("# ")) html.push(`<h1>${inlineMarkdown(line.slice(2))}</h1>`);
849
- else if (line.startsWith("## ")) html.push(`<h2>${inlineMarkdown(line.slice(3))}</h2>`);
850
- else if (line.startsWith("### ")) html.push(`<h3>${inlineMarkdown(line.slice(4))}</h3>`);
851
- else if (line.trim() === "") html.push("");
852
- else html.push(`<p>${inlineMarkdown(line)}</p>`);
853
- }
854
- flushList();
855
- flushTable();
856
- return html.join("\n");
857
- }
858
- function renderMarkdownTable(lines) {
859
- const rows = lines.filter((line) => !/^\|[-:\s|]+\|$/.test(line)).map(
860
- (line) => line.slice(1, -1).split("|").map((cell) => inlineMarkdown(cell.trim()))
861
- );
862
- if (rows.length === 0) return "";
863
- const [head, ...body] = rows;
864
- const th = head.map((cell) => `<th>${cell}</th>`).join("");
865
- const trs = body.map((row) => `<tr>${row.map((cell) => `<td>${cell}</td>`).join("")}</tr>`).join("\n");
866
- return `<table><thead><tr>${th}</tr></thead><tbody>${trs}</tbody></table>`;
867
- }
868
- function inlineMarkdown(s) {
869
- return escapeHtml(s).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>");
870
- }
871
- function escapeHtml(s) {
872
- return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
873
- }
874
- function escapePipes(s) {
875
- return s.replace(/\|/g, "\\|");
876
- }
877
- function decisionWeight(decision) {
878
- if (decision === "promote") return 5;
879
- if (decision === "equivalent") return 4;
880
- if (decision === "hold") return 3;
881
- if (decision === "needs_more_data") return 2;
882
- return 1;
883
- }
884
- function signed(x) {
885
- return `${x >= 0 ? "+" : ""}${fmt(x)}`;
886
- }
887
- function avg(xs) {
888
- if (xs.length === 0) return Number.NaN;
889
- return xs.reduce((s, x) => s + x, 0) / xs.length;
890
- }
891
- function medianOfSorted(sorted) {
892
- if (sorted.length === 0) return 0;
893
- const mid = Math.floor(sorted.length / 2);
894
- return sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
895
- }
896
- function fmt(x) {
897
- if (!Number.isFinite(x)) return String(x);
898
- return x.toFixed(4);
899
- }
900
-
901
- export {
902
- summaryTable,
903
- paretoChart,
904
- gainHistogram,
905
- RESEARCH_REPORT_HARD_PAIR_FLOOR,
906
- researchReport
907
- };
908
- //# sourceMappingURL=chunk-VLOATJQ2.js.map