@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
@@ -1,1040 +0,0 @@
1
- import {
2
- paretoChart
3
- } from "./chunk-TJVT4QFF.js";
4
- import {
5
- pairRunRecords
6
- } from "./chunk-7FO3TNPI.js";
7
- import {
8
- continuousAgreement,
9
- pairedBootstrap,
10
- pairedCohensDz,
11
- pairedMde,
12
- pairedTTest,
13
- pearsonR,
14
- requiredPairedSampleSize,
15
- spearmanR
16
- } from "./chunk-ZHTZ4EYI.js";
17
- import {
18
- llmSpans
19
- } from "./chunk-ZET2UAYW.js";
20
- import {
21
- validateRunRecord
22
- } from "./chunk-56TAVBOK.js";
23
- import {
24
- observedSplitScore
25
- } from "./chunk-OIUOT4QD.js";
26
-
27
- // src/contamination-guard.ts
28
- function checkCanaries(output, scenarios) {
29
- const leaks = [];
30
- for (const s of scenarios) {
31
- if (!s.canary) continue;
32
- if (output.includes(s.canary)) {
33
- leaks.push({ scenarioId: s.id, canary: s.canary, evidence: excerpt(output, s.canary) });
34
- }
35
- }
36
- return leaks;
37
- }
38
- function checkBehavioralCanary(output, scenario) {
39
- const pattern = scenario.forbiddenPattern ?? scenario.canary;
40
- if (!pattern) return null;
41
- const hit = matchForbidden(output, pattern);
42
- if (!hit) return null;
43
- return {
44
- scenarioId: scenario.id,
45
- canary: pattern,
46
- evidence: excerpt(output, hit)
47
- };
48
- }
49
- function runBehavioralCanaries(cases) {
50
- const leaks = [];
51
- for (const c of cases) {
52
- const leak = checkBehavioralCanary(c.output, c.scenario);
53
- if (leak) leaks.push({ ...leak, runId: c.runId ?? leak.runId });
54
- }
55
- return leaks;
56
- }
57
- function matchForbidden(output, pattern) {
58
- const re = tryParseRegex(pattern);
59
- if (re) {
60
- const m = output.match(re);
61
- return m && m[0].length > 0 ? m[0] : null;
62
- }
63
- return output.includes(pattern) ? pattern : null;
64
- }
65
- function tryParseRegex(pattern) {
66
- if (pattern.length < 2 || pattern[0] !== "/") return null;
67
- const last = pattern.lastIndexOf("/");
68
- if (last <= 0) return null;
69
- const body = pattern.slice(1, last);
70
- const flags = pattern.slice(last + 1);
71
- if (!/^[gimsuy]*$/.test(flags)) return null;
72
- try {
73
- return new RegExp(body, flags);
74
- } catch {
75
- return null;
76
- }
77
- }
78
- async function canaryLeakView(store, scenarios) {
79
- const targets = scenarios.filter((s) => !!s.canary);
80
- if (targets.length === 0) return [];
81
- const spans = await llmSpans(store);
82
- const leaks = [];
83
- for (const span of spans) {
84
- const output = span.output ?? "";
85
- for (const s of targets) {
86
- if (s.canary && output.includes(s.canary)) {
87
- leaks.push({
88
- scenarioId: s.id,
89
- canary: s.canary,
90
- runId: span.runId,
91
- evidence: excerpt(output, s.canary)
92
- });
93
- }
94
- }
95
- }
96
- return leaks;
97
- }
98
- var HoldoutAuditor = class {
99
- scenarios;
100
- accessLog = [];
101
- constructor(scenarios) {
102
- this.scenarios = scenarios;
103
- }
104
- /** Retrieve a holdout scenario for a declared purpose. Non-'evaluation' throws. */
105
- get(scenarioId, purpose) {
106
- if (purpose !== "evaluation" && purpose !== "debugging") {
107
- throw new Error(
108
- `HoldoutAuditor.get: purpose must be 'evaluation' or 'debugging', got ${purpose}`
109
- );
110
- }
111
- const s = this.scenarios.find((x) => x.id === scenarioId);
112
- if (!s) throw new Error(`holdout scenario "${scenarioId}" not found`);
113
- this.accessLog.push({ scenarioId, purpose, at: Date.now() });
114
- return s;
115
- }
116
- getAccessLog() {
117
- return this.accessLog;
118
- }
119
- };
120
- function excerpt(source, needle) {
121
- const at = source.indexOf(needle);
122
- if (at < 0) return "";
123
- const start = Math.max(0, at - 30);
124
- const end = Math.min(source.length, at + needle.length + 30);
125
- return (start > 0 ? "\u2026" : "") + source.slice(start, end) + (end < source.length ? "\u2026" : "");
126
- }
127
-
128
- // src/contract/analyze-runs.ts
129
- function summarizeExecution(opts) {
130
- const runs = opts.runs.map(validateRunRecord);
131
- const bins = opts.histogramBins ?? 12;
132
- return {
133
- execution: computeExecutionInsight(runs, bins),
134
- costProvenance: summarizeCostProvenance(runs)
135
- };
136
- }
137
- async function analyzeRuns(opts) {
138
- const runs = opts.runs.map(validateRunRecord);
139
- const bins = opts.histogramBins ?? 12;
140
- const threshold = opts.decisionThreshold ?? 0.02;
141
- const split = resolveSplit(runs, opts.split ?? "auto");
142
- const compositeWithIds = runs.map((r) => ({ runId: r.runId, score: compositeOf(r, split) })).filter((p) => Number.isFinite(p.score));
143
- const composite = distributionOf(
144
- compositeWithIds.map((p) => p.score),
145
- bins,
146
- compositeWithIds
147
- );
148
- const perDimension = computePerDimension(runs, bins);
149
- const { execution, costProvenance: provenance } = summarizeExecution({
150
- runs,
151
- histogramBins: bins
152
- });
153
- const knownCostRuns = runs.filter((run) => run.costProvenance.kind !== "uncaptured");
154
- const costs = knownCostRuns.map((r) => r.costUsd).filter(isFiniteNumber);
155
- const costDist = distributionOf(costs, bins);
156
- const pareto = paretoChart(knownCostRuns, { split });
157
- const degraded = {};
158
- if (provenance.uncaptured.n > 0) {
159
- degraded.cost = diagnoseCostCoverage(runs, provenance);
160
- } else if (costs.length === 0 || costs.every((c) => c === 0)) {
161
- degraded.cost = `all ${runs.length} explicitly observed or estimated USD values are $0`;
162
- }
163
- if (pareto.points.length < 2) {
164
- degraded.pareto = pareto.points.length === 0 ? "no candidates \u2014 Pareto unavailable" : "single candidate \u2014 Pareto is a single point, not a frontier";
165
- }
166
- const costQuality = {
167
- cost: costDist,
168
- pareto,
169
- provenance,
170
- ...degraded.cost || degraded.pareto ? { degraded } : {}
171
- };
172
- const judges = computeJudgeInsights(runs);
173
- const interRater = opts.raterScores ? computeInterRater(opts.raterScores) : void 0;
174
- const lift = computeLift(runs, opts.baselineCandidateId, opts.candidateCandidateId, split);
175
- const failureClusters = opts.analyst ? await computeFailureClusters(runs, opts.analyst, split) : void 0;
176
- const failureClasses = computeFailureClasses(runs, split);
177
- const contamination = opts.canaryScenarios ? computeContamination(runs, opts.canaryScenarios) : void 0;
178
- const outcomeCorrelation = opts.outcomeSignal ? computeOutcomeCorrelation(runs, opts.outcomeSignal, split) : void 0;
179
- const release = buildReleaseScorecard(composite, lift, contamination);
180
- const priorPeriodComparison = opts.baselineRuns ? computePriorPeriodComparison(runs, opts.baselineRuns, split, opts.baselineLabel) : void 0;
181
- const recommendations = buildRecommendations({
182
- composite,
183
- judges,
184
- interRater,
185
- lift,
186
- failureClusters,
187
- failureClasses,
188
- contamination,
189
- outcomeCorrelation,
190
- priorPeriodComparison,
191
- threshold
192
- });
193
- return {
194
- n: runs.length,
195
- execution,
196
- composite,
197
- perDimension,
198
- costQuality,
199
- judges,
200
- interRater,
201
- lift,
202
- failureClusters,
203
- contamination,
204
- outcomeCorrelation,
205
- release,
206
- ...failureClasses ? { failureClasses } : {},
207
- ...priorPeriodComparison ? { priorPeriodComparison } : {},
208
- recommendations
209
- };
210
- }
211
- function computeExecutionInsight(runs, bins) {
212
- const aggregateRows = runs.flatMap((run) => {
213
- const usage = aggregateTokenUsage(run);
214
- return usage ? [{ usage, costUsd: finiteRaw(run, "aggregate_cost_usd") }] : [];
215
- });
216
- const aggregateCosts = aggregateRows.flatMap(
217
- (row) => row.costUsd !== void 0 ? [row.costUsd] : []
218
- );
219
- const modelCounts = /* @__PURE__ */ new Map();
220
- let executionErrorRuns = 0;
221
- let executionErrorEvents = 0;
222
- let errorReportingRuns = 0;
223
- let errorSpanEvents = 0;
224
- let errorSpanReportingRuns = 0;
225
- const terminalOutcomes = {
226
- succeeded: 0,
227
- failed: 0,
228
- cancelled: 0,
229
- incomplete: 0,
230
- unknown: 0
231
- };
232
- const errorsByTerminalOutcome = {
233
- succeeded: { withErrors: 0, withoutErrors: 0, unreported: 0 },
234
- failed: { withErrors: 0, withoutErrors: 0, unreported: 0 },
235
- cancelled: { withErrors: 0, withoutErrors: 0, unreported: 0 },
236
- incomplete: { withErrors: 0, withoutErrors: 0, unreported: 0 },
237
- unknown: { withErrors: 0, withoutErrors: 0, unreported: 0 }
238
- };
239
- let modelCallRuns = 0;
240
- let modelCallEvents = 0;
241
- let modelCallReportingRuns = 0;
242
- for (const run of runs) {
243
- modelCounts.set(run.model, (modelCounts.get(run.model) ?? 0) + 1);
244
- const terminalOutcome = run.terminalOutcome;
245
- terminalOutcomes[terminalOutcome] += 1;
246
- const modelCalls = nonNegativeCountRaw(run, "llm_span_count");
247
- if (modelCalls !== void 0) {
248
- modelCallEvents += modelCalls;
249
- modelCallReportingRuns += 1;
250
- }
251
- const usage = run.tokenUsage;
252
- if ((modelCalls ?? 0) > 0 || usage.input > 0 || usage.output > 0 || (usage.cached ?? 0) > 0 || (usage.cacheWrite ?? 0) > 0) {
253
- modelCallRuns += 1;
254
- }
255
- const errorEvents = reportedExecutionErrorEvents(run);
256
- if (errorEvents !== void 0) {
257
- executionErrorEvents += errorEvents;
258
- errorReportingRuns += 1;
259
- if (errorEvents > 0) {
260
- executionErrorRuns += 1;
261
- errorsByTerminalOutcome[terminalOutcome].withErrors += 1;
262
- } else errorsByTerminalOutcome[terminalOutcome].withoutErrors += 1;
263
- } else errorsByTerminalOutcome[terminalOutcome].unreported += 1;
264
- const reportedErrorSpans = nonNegativeCountRaw(run, "error_span_count");
265
- if (reportedErrorSpans !== void 0) {
266
- errorSpanEvents += reportedErrorSpans;
267
- errorSpanReportingRuns += 1;
268
- }
269
- }
270
- return {
271
- durationMs: distributionOf(
272
- runs.map((run) => run.wallMs),
273
- bins
274
- ),
275
- queueMs: distributionOf(
276
- runs.filter((run) => run.queueMs !== void 0).map((run) => run.queueMs),
277
- bins
278
- ),
279
- tokenUsage: summarizeTokenUsage(
280
- runs.map((run) => run.tokenUsage),
281
- bins
282
- ),
283
- aggregateUsage: {
284
- runs: aggregateRows.length,
285
- tokenUsage: summarizeTokenUsage(
286
- aggregateRows.map((row) => row.usage),
287
- bins
288
- ),
289
- costUsd: distributionOf(aggregateCosts, bins),
290
- totalCostUsd: aggregateCosts.reduce((total, value) => total + value, 0)
291
- },
292
- models: [...modelCounts.entries()].map(([model, count]) => ({ model, runs: count })).sort((left, right) => right.runs - left.runs || left.model.localeCompare(right.model)),
293
- modelCalls: {
294
- runs: modelCallRuns,
295
- events: modelCallEvents,
296
- reportingRuns: modelCallReportingRuns
297
- },
298
- executionErrors: {
299
- runs: executionErrorRuns,
300
- fraction: errorReportingRuns > 0 ? executionErrorRuns / errorReportingRuns : null,
301
- events: executionErrorEvents,
302
- reportingRuns: errorReportingRuns,
303
- errorSpanEvents,
304
- errorSpanReportingRuns,
305
- byTerminalOutcome: errorsByTerminalOutcome
306
- },
307
- terminalOutcomes
308
- };
309
- }
310
- function reportedExecutionErrorEvents(run) {
311
- return nonNegativeCountRaw(run, "execution_error_count");
312
- }
313
- function nonNegativeCountRaw(run, key) {
314
- const value = finiteRaw(run, key);
315
- return value !== void 0 && Number.isInteger(value) && value >= 0 ? value : void 0;
316
- }
317
- function summarizeTokenUsage(usages, bins) {
318
- const reasoning = usages.flatMap(
319
- (usage) => usage.reasoning !== void 0 ? [usage.reasoning] : []
320
- );
321
- const cached = usages.flatMap((usage) => usage.cached !== void 0 ? [usage.cached] : []);
322
- const cacheWrite = usages.flatMap(
323
- (usage) => usage.cacheWrite !== void 0 ? [usage.cacheWrite] : []
324
- );
325
- return {
326
- input: distributionOf(
327
- usages.map((usage) => usage.input),
328
- bins
329
- ),
330
- output: distributionOf(
331
- usages.map((usage) => usage.output),
332
- bins
333
- ),
334
- reasoning: distributionOf(reasoning, bins),
335
- cached: distributionOf(cached, bins),
336
- cacheWrite: distributionOf(cacheWrite, bins),
337
- totals: {
338
- input: usages.reduce((total, usage) => total + usage.input, 0),
339
- output: usages.reduce((total, usage) => total + usage.output, 0),
340
- reasoning: reasoning.reduce((total, value) => total + value, 0),
341
- cached: cached.reduce((total, value) => total + value, 0),
342
- cacheWrite: cacheWrite.reduce((total, value) => total + value, 0)
343
- }
344
- };
345
- }
346
- function aggregateTokenUsage(run) {
347
- const input = finiteRaw(run, "aggregate_prompt_tokens");
348
- const output = finiteRaw(run, "aggregate_completion_tokens");
349
- const reasoning = finiteRaw(run, "aggregate_reasoning_tokens");
350
- const cached = finiteRaw(run, "aggregate_cached_tokens");
351
- const cacheWrite = finiteRaw(run, "aggregate_cache_write_tokens");
352
- if (input === void 0 && output === void 0 && reasoning === void 0 && cached === void 0 && cacheWrite === void 0)
353
- return void 0;
354
- return {
355
- input: input ?? 0,
356
- output: output ?? 0,
357
- ...reasoning !== void 0 ? { reasoning } : {},
358
- ...cached !== void 0 ? { cached } : {},
359
- ...cacheWrite !== void 0 ? { cacheWrite } : {}
360
- };
361
- }
362
- function finiteRaw(run, key) {
363
- const value = run.outcome.raw[key];
364
- return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
365
- }
366
- function summarizeCostProvenance(runs) {
367
- const summary = {
368
- observed: { n: 0, totalUsd: 0 },
369
- estimated: { n: 0, totalUsd: 0 },
370
- uncaptured: { n: 0 },
371
- knownFraction: 0
372
- };
373
- for (const run of runs) {
374
- const cost = run.costProvenance;
375
- if (cost.kind === "uncaptured") {
376
- summary.uncaptured.n += 1;
377
- } else {
378
- summary[cost.kind].n += 1;
379
- summary[cost.kind].totalUsd += cost.usd;
380
- }
381
- }
382
- const known = summary.observed.n + summary.estimated.n;
383
- summary.knownFraction = runs.length > 0 ? known / runs.length : 0;
384
- return summary;
385
- }
386
- function diagnoseCostCoverage(runs, provenance) {
387
- const uncaptured = provenance.uncaptured.n;
388
- const known = provenance.observed.n + provenance.estimated.n;
389
- if (uncaptured === runs.length) {
390
- return `USD cost uncaptured for all ${runs.length} runs \u2014 no observed or estimated USD values; token and wall-time metrics remain available.`;
391
- }
392
- return `USD cost uncaptured for ${uncaptured}/${runs.length} runs; excluded those rows from cost statistics (${known}/${runs.length} retained: ${provenance.observed.n} observed, ${provenance.estimated.n} estimated).`;
393
- }
394
- function computeFailureClasses(runs, split) {
395
- const counts = /* @__PURE__ */ new Map();
396
- for (const r of runs) {
397
- if (!isTaskFailure(r, split)) continue;
398
- const key = r.failureClass !== void 0 && r.failureClass !== "success" ? r.failureClass : "unknown";
399
- counts.set(key, (counts.get(key) ?? 0) + 1);
400
- }
401
- if (counts.size === 0) return void 0;
402
- const n = runs.length;
403
- return [...counts.entries()].map(([failureClass, count]) => ({
404
- failureClass,
405
- count,
406
- share: n > 0 ? count / n : 0
407
- })).sort((a, b) => b.count - a.count || a.failureClass.localeCompare(b.failureClass));
408
- }
409
- function computePriorPeriodComparison(current, baseline, split, windowLabel) {
410
- if (current.length === 0 || baseline.length === 0) return void 0;
411
- const metrics = {};
412
- const directions = {};
413
- const compositeCurrent = current.map((r) => compositeOf(r, split)).filter(Number.isFinite);
414
- const compositeBaseline = baseline.map((r) => compositeOf(r, split)).filter(Number.isFinite);
415
- if (compositeCurrent.length > 0 && compositeBaseline.length > 0) {
416
- metrics.composite = welchCompare(compositeBaseline, compositeCurrent);
417
- directions.composite = "higher-is-better";
418
- }
419
- const costCurrent = knownCostValues(current);
420
- const costBaseline = knownCostValues(baseline);
421
- if (costCurrent.length > 0 && costBaseline.length > 0) {
422
- metrics.cost = welchCompare(costBaseline, costCurrent);
423
- directions.cost = "lower-is-better";
424
- }
425
- const durCurrent = current.map((r) => r.wallMs).filter(Number.isFinite);
426
- const durBaseline = baseline.map((r) => r.wallMs).filter(Number.isFinite);
427
- if (durCurrent.length > 0 && durBaseline.length > 0) {
428
- metrics.duration = welchCompare(durBaseline, durCurrent);
429
- directions.duration = "lower-is-better";
430
- }
431
- const tokCurrent = current.map((r) => (r.tokenUsage.input ?? 0) + (r.tokenUsage.output ?? 0)).filter(Number.isFinite);
432
- const tokBaseline = baseline.map((r) => (r.tokenUsage.input ?? 0) + (r.tokenUsage.output ?? 0)).filter(Number.isFinite);
433
- if (tokCurrent.length > 0 && tokBaseline.length > 0) {
434
- metrics.tokenUsage = welchCompare(tokBaseline, tokCurrent);
435
- directions.tokenUsage = "lower-is-better";
436
- }
437
- const dimsCurrent = collectPerDimension(current);
438
- const dimsBaseline = collectPerDimension(baseline);
439
- for (const dim of Object.keys(dimsCurrent)) {
440
- const b = dimsBaseline[dim];
441
- const c = dimsCurrent[dim];
442
- if (!b || b.length === 0 || !c || c.length === 0) continue;
443
- metrics[`dim.${dim}`] = welchCompare(b, c);
444
- directions[`dim.${dim}`] = "higher-is-better";
445
- }
446
- const regressedMetrics = [];
447
- const improvedMetrics = [];
448
- for (const [name, delta] of Object.entries(metrics)) {
449
- if (!delta.significant) continue;
450
- const dir = directions[name] ?? "higher-is-better";
451
- const better = dir === "higher-is-better" ? delta.delta > 0 : delta.delta < 0;
452
- if (better) improvedMetrics.push(name);
453
- else regressedMetrics.push(name);
454
- }
455
- return {
456
- baselineN: baseline.length,
457
- currentN: current.length,
458
- ...windowLabel ? { windowLabel } : {},
459
- metrics,
460
- regressedMetrics,
461
- improvedMetrics
462
- };
463
- }
464
- function knownCostValues(runs) {
465
- return runs.filter((run) => run.costProvenance.kind !== "uncaptured").map((run) => run.costUsd).filter(isFiniteNumber);
466
- }
467
- function isFiniteNumber(value) {
468
- return typeof value === "number" && Number.isFinite(value);
469
- }
470
- function collectPerDimension(runs) {
471
- const out = {};
472
- for (const r of runs) {
473
- const perDim = r.outcome.judgeScores?.perDimMean;
474
- if (!perDim) continue;
475
- for (const [dim, value] of Object.entries(perDim)) {
476
- if (!Number.isFinite(value)) continue;
477
- if (!out[dim]) out[dim] = [];
478
- out[dim].push(value);
479
- }
480
- }
481
- return out;
482
- }
483
- function welchCompare(baseline, current) {
484
- const baselineMean = mean(baseline);
485
- const currentMean = mean(current);
486
- const baselineVar = sampleVariance(baseline, baselineMean);
487
- const currentVar = sampleVariance(current, currentMean);
488
- const baselineN = baseline.length;
489
- const currentN = current.length;
490
- const delta = currentMean - baselineMean;
491
- const se = Math.sqrt(baselineVar / baselineN + currentVar / currentN);
492
- const halfWidth = 1.96 * (se > 0 ? se : 0);
493
- const ci95 = [delta - halfWidth, delta + halfWidth];
494
- const t = se > 0 ? delta / se : 0;
495
- const pValue = se > 0 ? 2 * (1 - standardNormalCdf(Math.abs(t))) : 1;
496
- const pooledStddev = Math.sqrt(
497
- ((baselineN - 1) * baselineVar + (currentN - 1) * currentVar) / Math.max(1, baselineN + currentN - 2)
498
- );
499
- const cohensD = pooledStddev > 0 ? delta / pooledStddev : 0;
500
- const significant = pValue < 0.05 && Math.abs(cohensD) >= 0.2;
501
- return {
502
- current: currentMean,
503
- baseline: baselineMean,
504
- delta,
505
- ci95,
506
- pValue,
507
- cohensD,
508
- baselineN,
509
- currentN,
510
- significant
511
- };
512
- }
513
- function sampleVariance(xs, xsMean) {
514
- if (xs.length < 2) return 0;
515
- let s = 0;
516
- for (const x of xs) s += (x - xsMean) ** 2;
517
- return s / (xs.length - 1);
518
- }
519
- function standardNormalCdf(z) {
520
- const a1 = 0.254829592;
521
- const a2 = -0.284496736;
522
- const a3 = 1.421413741;
523
- const a4 = -1.453152027;
524
- const a5 = 1.061405429;
525
- const p = 0.3275911;
526
- const sign = z < 0 ? -1 : 1;
527
- const x = Math.abs(z) / Math.SQRT2;
528
- const t = 1 / (1 + p * x);
529
- const y = 1 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);
530
- return 0.5 * (1 + sign * y);
531
- }
532
- function resolveSplit(runs, pref) {
533
- if (pref !== "auto") return pref;
534
- const hasHoldout = runs.some((r) => Number.isFinite(observedSplitScore(r, "holdout")));
535
- return hasHoldout ? "holdout" : "search";
536
- }
537
- function compositeOf(run, split) {
538
- const score = observedSplitScore(run, split);
539
- return Number.isFinite(score) ? score : Number.NaN;
540
- }
541
- function distributionOf(values, bins, withIds) {
542
- if (values.length === 0) {
543
- return {
544
- n: 0,
545
- mean: null,
546
- p50: null,
547
- p95: null,
548
- stddev: null,
549
- min: null,
550
- max: null,
551
- histogram: []
552
- };
553
- }
554
- const sorted = [...values].sort((a, b) => a - b);
555
- const n = sorted.length;
556
- const mean2 = sorted.reduce((s, v) => s + v, 0) / n;
557
- const variance = sorted.reduce((s, v) => s + (v - mean2) ** 2, 0) / n;
558
- const stddev = Math.sqrt(variance);
559
- const tailRuns = withIds ? [...withIds].sort((a, b) => a.score - b.score).slice(0, Math.min(5, withIds.length)) : void 0;
560
- return {
561
- n,
562
- mean: mean2,
563
- p50: percentile(sorted, 0.5),
564
- p95: percentile(sorted, 0.95),
565
- stddev,
566
- min: sorted[0],
567
- max: sorted[n - 1],
568
- histogram: histogram(sorted, bins),
569
- ...tailRuns ? { tailRuns } : {}
570
- };
571
- }
572
- function percentile(sorted, q) {
573
- if (sorted.length === 0) return 0;
574
- if (sorted.length === 1) return sorted[0];
575
- const idx = (sorted.length - 1) * q;
576
- const lo = Math.floor(idx);
577
- const hi = Math.ceil(idx);
578
- if (lo === hi) return sorted[lo];
579
- const w = idx - lo;
580
- return sorted[lo] * (1 - w) + sorted[hi] * w;
581
- }
582
- function histogram(sorted, bins) {
583
- if (sorted.length === 0 || bins < 1) return [];
584
- const min = sorted[0];
585
- const max = sorted[sorted.length - 1];
586
- if (min === max) return [{ lo: min, hi: max, count: sorted.length }];
587
- const width = (max - min) / bins;
588
- const out = [];
589
- for (let i = 0; i < bins; i++) {
590
- const lo = min + i * width;
591
- const hi = i === bins - 1 ? max : lo + width;
592
- out.push({ lo, hi, count: 0 });
593
- }
594
- for (const v of sorted) {
595
- const idx = Math.min(bins - 1, Math.floor((v - min) / width));
596
- out[idx].count++;
597
- }
598
- return out;
599
- }
600
- function computePerDimension(runs, bins) {
601
- const byDim = /* @__PURE__ */ new Map();
602
- for (const run of runs) {
603
- const scores = run.outcome.judgeScores;
604
- if (!scores) continue;
605
- for (const [dim, value] of Object.entries(scores.perDimMean ?? {})) {
606
- if (!Number.isFinite(value)) continue;
607
- const arr = byDim.get(dim) ?? [];
608
- arr.push(value);
609
- byDim.set(dim, arr);
610
- }
611
- }
612
- const out = {};
613
- for (const [dim, values] of byDim) out[dim] = distributionOf(values, bins);
614
- return out;
615
- }
616
- function computeJudgeInsights(runs) {
617
- const out = {};
618
- const byJudge = /* @__PURE__ */ new Map();
619
- for (const run of runs) {
620
- const scores = run.outcome.judgeScores;
621
- if (!scores?.perJudge) continue;
622
- for (const [judgeId, dims] of Object.entries(scores.perJudge)) {
623
- const dimValues = Object.values(dims).filter(Number.isFinite);
624
- if (dimValues.length === 0) continue;
625
- const judgeMean = dimValues.reduce((s, v) => s + v, 0) / dimValues.length;
626
- const arr = byJudge.get(judgeId) ?? [];
627
- arr.push(judgeMean);
628
- byJudge.set(judgeId, arr);
629
- }
630
- }
631
- for (const [judgeId, values] of byJudge) {
632
- out[judgeId] = {
633
- n: values.length,
634
- meanScore: values.reduce((s, v) => s + v, 0) / values.length
635
- };
636
- }
637
- return out;
638
- }
639
- function computeInterRater(ratings) {
640
- const byRun = /* @__PURE__ */ new Map();
641
- for (const r of ratings) {
642
- if (!Number.isFinite(r.score)) continue;
643
- const list = byRun.get(r.runId) ?? [];
644
- list.push({ rater: r.rater, score: r.score });
645
- byRun.set(r.runId, list);
646
- }
647
- const raters = new Set(ratings.map((r) => r.rater));
648
- const jointlyRated = [];
649
- for (const [runId, ratersForRun] of byRun) {
650
- const seen = new Set(ratersForRun.map((r) => r.rater));
651
- let all = true;
652
- for (const r of raters) if (!seen.has(r)) all = false;
653
- if (all) jointlyRated.push(runId);
654
- }
655
- if (raters.size < 2 || jointlyRated.length === 0) return void 0;
656
- const raterList = [...raters].sort();
657
- const perPair = {};
658
- for (let i = 0; i < raterList.length; i++) {
659
- for (let j = i + 1; j < raterList.length; j++) {
660
- const a = raterList[i];
661
- const b = raterList[j];
662
- const aScores = [];
663
- const bScores = [];
664
- for (const runId of jointlyRated) {
665
- const ratersForRun = byRun.get(runId);
666
- const sa = ratersForRun.find((r) => r.rater === a)?.score;
667
- const sb = ratersForRun.find((r) => r.rater === b)?.score;
668
- if (sa !== void 0 && sb !== void 0) {
669
- aScores.push(sa);
670
- bScores.push(sb);
671
- }
672
- }
673
- const agreement2 = continuousAgreement(
674
- aScores.map((score, index) => [score, bScores[index]]),
675
- { bootstrap: 0 }
676
- );
677
- perPair[`${a}::${b}`] = agreement2.weightedKappa;
678
- }
679
- }
680
- const matrix = jointlyRated.map((runId) => {
681
- const ratingsByRater = new Map(byRun.get(runId).map((rating) => [rating.rater, rating.score]));
682
- return raterList.map((rater) => ratingsByRater.get(rater));
683
- });
684
- const agreement = continuousAgreement(matrix, { bootstrap: 0 });
685
- const disagreementCases = jointlyRated.map((runId) => {
686
- const ratersForRun = byRun.get(runId);
687
- const scores = ratersForRun.map((r) => r.score);
688
- const range = Math.max(...scores) - Math.min(...scores);
689
- return { runId, ratings: ratersForRun, range };
690
- }).sort((a, b) => b.range - a.range).slice(0, 20);
691
- return {
692
- raters: raters.size,
693
- jointlyRated: jointlyRated.length,
694
- kappa: Number.isFinite(agreement.weightedKappa) ? agreement.weightedKappa : 0,
695
- icc: agreement.icc,
696
- pearson: agreement.pearson,
697
- spearman: agreement.spearman,
698
- perPair,
699
- disagreementCases
700
- };
701
- }
702
- function computeLift(runs, baselineId, candidateId, split) {
703
- let bId = baselineId;
704
- let cId = candidateId;
705
- if (!bId || !cId) {
706
- const ids = [...new Set(runs.map((r) => r.candidateId))];
707
- if (ids.length !== 2) return void 0;
708
- const [idA, idB] = ids;
709
- const scoresA = finiteCompositeScores(
710
- runs.filter((run) => run.candidateId === idA),
711
- split
712
- );
713
- const scoresB = finiteCompositeScores(
714
- runs.filter((run) => run.candidateId === idB),
715
- split
716
- );
717
- if (scoresA.length === 0 || scoresB.length === 0) return void 0;
718
- const meanA = mean(scoresA);
719
- const meanB = mean(scoresB);
720
- bId = meanA <= meanB ? idA : idB;
721
- cId = meanA <= meanB ? idB : idA;
722
- }
723
- const baseline = runs.filter((r) => r.candidateId === bId);
724
- const candidate = runs.filter((r) => r.candidateId === cId);
725
- if (baseline.length === 0 || candidate.length === 0) return void 0;
726
- const scoredBaseline = baseline.filter((run) => Number.isFinite(compositeOf(run, split)));
727
- const scoredCandidate = candidate.filter((run) => Number.isFinite(compositeOf(run, split)));
728
- const pairing = pairRunRecords(scoredBaseline, scoredCandidate);
729
- const pairedBaseline = pairing.pairs.map((pair) => compositeOf(pair.baseline, split));
730
- const pairedCandidate = pairing.pairs.map((pair) => compositeOf(pair.treatment, split));
731
- if (pairedBaseline.length === 0) return void 0;
732
- const baselineMean = mean(pairedBaseline);
733
- const candidateMean = mean(pairedCandidate);
734
- const delta = candidateMean - baselineMean;
735
- const bootstrap = pairedBootstrap(pairedBaseline, pairedCandidate, {
736
- confidence: 0.95,
737
- resamples: 2e3,
738
- statistic: "mean"
739
- });
740
- const tTest = pairedTTest(pairedBaseline, pairedCandidate);
741
- const d = pairedCohensDz(pairedBaseline, pairedCandidate);
742
- const mde = pairedMde({ nPaired: pairedBaseline.length, power: 0.8, alpha: 0.05 });
743
- const requiredN = d === null || d === 0 ? null : requiredPairedSampleSize({
744
- effect: Math.abs(d),
745
- power: 0.8,
746
- alpha: 0.05
747
- });
748
- return {
749
- baselineMean,
750
- candidateMean,
751
- delta,
752
- ci95: [bootstrap.low, bootstrap.high],
753
- pValue: tTest.p,
754
- n: pairedBaseline.length,
755
- unpairedBaseline: pairing.unpairedBaseline.length,
756
- unpairedCandidate: pairing.unpairedTreatment.length,
757
- cohensD: d,
758
- mde,
759
- requiredN
760
- };
761
- }
762
- function mean(arr) {
763
- return arr.length === 0 ? 0 : arr.reduce((s, v) => s + v, 0) / arr.length;
764
- }
765
- async function computeFailureClusters(runs, analyst, split) {
766
- const failed = runs.filter((run) => isTaskFailure(run, split));
767
- if (failed.length === 0) return { clusters: [], totalFailures: 0 };
768
- const clusters = /* @__PURE__ */ new Map();
769
- for (const run of failed) {
770
- try {
771
- const result = await analyst.run(run.runId, { runRecord: run });
772
- for (const finding of result.findings) {
773
- const key = finding.area || finding.analyst_id || "unclassified";
774
- const c = clusters.get(key) ?? { exemplars: [], share: 0 };
775
- if (c.exemplars.length < 5) c.exemplars.push(run.runId);
776
- clusters.set(key, c);
777
- }
778
- } catch {
779
- const c = clusters.get("analyst-error") ?? { exemplars: [], share: 0 };
780
- if (c.exemplars.length < 5) c.exemplars.push(run.runId);
781
- clusters.set("analyst-error", c);
782
- }
783
- }
784
- const clusterList = [...clusters.entries()].map(([id, c]) => ({
785
- id,
786
- name: id,
787
- share: c.exemplars.length / failed.length,
788
- exemplars: c.exemplars
789
- }));
790
- clusterList.sort((a, b) => b.share - a.share);
791
- return { clusters: clusterList, totalFailures: failed.length };
792
- }
793
- function finiteCompositeScores(runs, split) {
794
- return runs.map((run) => compositeOf(run, split)).filter(Number.isFinite);
795
- }
796
- function isTaskFailure(run, split) {
797
- if (run.failureClass !== void 0 && run.failureClass !== "success") return true;
798
- const score = compositeOf(run, split);
799
- return Number.isFinite(score) && score < 0.5;
800
- }
801
- function computeContamination(runs, canaries) {
802
- let leaks = 0;
803
- const details = [];
804
- for (const run of runs) {
805
- const output = stringifyOutput(run);
806
- if (!output) continue;
807
- const leaksHere = checkCanaries(output, canaries);
808
- for (const leak of leaksHere) {
809
- leaks++;
810
- details.push({ runId: run.runId, canary: leak.canary, matched: leak.evidence });
811
- }
812
- }
813
- return { leaks, holdoutAuditPassed: leaks === 0, details };
814
- }
815
- function stringifyOutput(run) {
816
- const metadata = run.metadata;
817
- if (typeof metadata?.output === "string") return metadata.output;
818
- if (typeof metadata?.text === "string") return metadata.text;
819
- return void 0;
820
- }
821
- function computeOutcomeCorrelation(runs, outcome, split) {
822
- const xs = [];
823
- const ys = [];
824
- for (const run of runs) {
825
- const y = outcome.valueByRunId[run.runId];
826
- if (y === void 0 || !Number.isFinite(y)) continue;
827
- const x = compositeOf(run, split);
828
- if (!Number.isFinite(x)) continue;
829
- xs.push(x);
830
- ys.push(y);
831
- }
832
- if (xs.length < 3) return void 0;
833
- const p = pearsonR(xs, ys);
834
- const s = spearmanR(xs, ys);
835
- const meanX = mean(xs);
836
- const meanY = mean(ys);
837
- let num = 0;
838
- let denom = 0;
839
- for (let i = 0; i < xs.length; i++) {
840
- num += (xs[i] - meanX) * (ys[i] - meanY);
841
- denom += (xs[i] - meanX) ** 2;
842
- }
843
- const slope = denom === 0 ? 0 : num / denom;
844
- const intercept = meanY - slope * meanX;
845
- const ssTot = ys.reduce((a, y) => a + (y - meanY) ** 2, 0);
846
- const ssRes = ys.reduce((a, y, i) => a + (y - (intercept + slope * xs[i])) ** 2, 0);
847
- const r2 = ssTot === 0 ? 0 : 1 - ssRes / ssTot;
848
- return {
849
- metric: outcome.metric,
850
- n: xs.length,
851
- pearson: p,
852
- spearman: s,
853
- rewardModel: { intercept, slope, r2 }
854
- };
855
- }
856
- function buildReleaseScorecard(composite, lift, contamination) {
857
- const axes = [];
858
- const liftPass = lift === void 0 ? "not_evaluated" : lift.ci95[0] > 0 ? "pass" : lift.delta > 0 ? "warn" : "fail";
859
- axes.push({
860
- name: "quality-lift",
861
- status: liftPass,
862
- detail: lift ? `delta=${lift.delta.toFixed(3)}, CI95=[${lift.ci95[0].toFixed(3)}, ${lift.ci95[1].toFixed(3)}], n=${lift.n}` : "no baseline/candidate pair available"
863
- });
864
- const contamPass = contamination === void 0 ? "not_evaluated" : contamination.leaks === 0 ? "pass" : "fail";
865
- axes.push({
866
- name: "contamination",
867
- status: contamPass,
868
- detail: contamination ? `${contamination.leaks} canary leak(s)` : "no canaries supplied"
869
- });
870
- axes.push(
871
- composite.n === 0 ? {
872
- name: "composite-distribution",
873
- status: "not_evaluated",
874
- detail: "no task-quality scores available"
875
- } : {
876
- name: "composite-distribution",
877
- status: composite.mean !== null && composite.mean >= 0.5 ? "pass" : composite.mean !== null && composite.mean >= 0.3 ? "warn" : "fail",
878
- detail: composite.mean === null || composite.p50 === null || composite.p95 === null ? "task-quality distribution is internally incomplete" : `mean=${composite.mean.toFixed(3)}, p50=${composite.p50.toFixed(3)}, p95=${composite.p95.toFixed(3)} over n=${composite.n}`
879
- }
880
- );
881
- const status = axes.some((a) => a.status === "fail") ? "fail" : axes.some((a) => a.status === "warn" || a.status === "not_evaluated") ? "warn" : "pass";
882
- return {
883
- status,
884
- axes,
885
- issues: []
886
- };
887
- }
888
- function buildRecommendations(ctx) {
889
- const out = [];
890
- if (ctx.priorPeriodComparison) {
891
- const ppc = ctx.priorPeriodComparison;
892
- const label = ppc.windowLabel ?? "baseline period";
893
- for (const name of ppc.regressedMetrics) {
894
- const d = ppc.metrics[name];
895
- if (!d) continue;
896
- out.push({
897
- priority: "critical",
898
- kind: "investigate",
899
- title: `${name} regressed from ${d.baseline.toFixed(3)} \u2192 ${d.current.toFixed(3)} vs ${label}`,
900
- detail: `Welch CI95 = [${d.ci95[0].toFixed(3)}, ${d.ci95[1].toFixed(3)}], p=${d.pValue.toFixed(4)}, Cohen's d=${d.cohensD.toFixed(2)} (n_current=${d.currentN}, n_baseline=${d.baselineN}). The regression is statistically significant at p<0.05 with at-least-small effect size.`,
901
- evidencePath: `priorPeriodComparison.metrics.${name}`
902
- });
903
- }
904
- for (const name of ppc.improvedMetrics) {
905
- const d = ppc.metrics[name];
906
- if (!d) continue;
907
- out.push({
908
- priority: "low",
909
- kind: "ship",
910
- title: `${name} improved from ${d.baseline.toFixed(3)} \u2192 ${d.current.toFixed(3)} vs ${label}`,
911
- detail: `Welch CI95 = [${d.ci95[0].toFixed(3)}, ${d.ci95[1].toFixed(3)}], p=${d.pValue.toFixed(4)}, Cohen's d=${d.cohensD.toFixed(2)} (n_current=${d.currentN}, n_baseline=${d.baselineN}). Statistically significant improvement worth flagging.`,
912
- evidencePath: `priorPeriodComparison.metrics.${name}`
913
- });
914
- }
915
- }
916
- if (ctx.composite.n > 0 && ctx.composite.mean !== null && ctx.composite.p50 !== null && ctx.composite.p95 !== null) {
917
- if (ctx.composite.mean < 0.3) {
918
- const tail = ctx.composite.tailRuns ?? [];
919
- const names = tail.slice(0, 5).map((t) => `${t.runId}=${t.score.toFixed(3)}`).join(", ");
920
- out.push({
921
- priority: "critical",
922
- kind: "investigate",
923
- title: `Composite mean ${ctx.composite.mean.toFixed(3)} is below the 0.3 floor \u2014 the agent is broken on this corpus`,
924
- detail: tail.length > 0 ? `Worst ${tail.length} run${tail.length === 1 ? "" : "s"} to inspect first: ${names}. Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.` : `Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.`,
925
- evidencePath: "composite.tailRuns"
926
- });
927
- } else if (ctx.composite.mean < 0.5) {
928
- const tail = ctx.composite.tailRuns ?? [];
929
- const names = tail.slice(0, 3).map((t) => `${t.runId}=${t.score.toFixed(3)}`).join(", ");
930
- out.push({
931
- priority: "high",
932
- kind: "investigate",
933
- title: `Composite mean ${ctx.composite.mean.toFixed(3)} is below 0.5 \u2014 investigate the lower tail before claiming the agent is healthy`,
934
- detail: tail.length > 0 ? `Worst ${tail.length} run${tail.length === 1 ? "" : "s"}: ${names}. Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.` : `Histogram p50=${ctx.composite.p50.toFixed(3)}, p95=${ctx.composite.p95.toFixed(3)}.`,
935
- evidencePath: "composite.tailRuns"
936
- });
937
- }
938
- }
939
- if (ctx.failureClasses && ctx.failureClasses.length > 0) {
940
- const top = ctx.failureClasses[0];
941
- if (top.count >= 3 && top.share >= 0.15) {
942
- out.push({
943
- priority: top.share >= 0.25 ? "high" : "medium",
944
- kind: "investigate",
945
- title: `'${top.failureClass}' is the dominant failure class \u2014 ${top.count} runs (${(top.share * 100).toFixed(0)}% of the corpus)`,
946
- detail: `The mean composite can look acceptable while one failure class dominates the lower tail. ${top.count} of ${ctx.composite.n} runs failed with '${top.failureClass}'${ctx.failureClasses.length > 1 ? ` (next: '${ctx.failureClasses[1].failureClass}' \xD7${ctx.failureClasses[1].count})` : ""}. Fix this cause first.`,
947
- evidencePath: "failureClasses"
948
- });
949
- }
950
- }
951
- if (Object.keys(ctx.judges).length === 0 && ctx.composite.n > 0) {
952
- out.push({
953
- priority: "medium",
954
- kind: "expand-corpus",
955
- title: "No judge scores recorded \u2014 per-dimension + calibration insights unavailable",
956
- detail: "Records have no `outcome.judgeScores`. To unlock perDimension, judges, and calibration, attach a Judge run during your eval pass and populate `outcome.judgeScores.perJudge[judgeName][dimension] = score`. See `docs/insight-report.md` for the expected shape.",
957
- evidencePath: "judges"
958
- });
959
- }
960
- if (ctx.lift) {
961
- const pairedEffect = ctx.lift.cohensD === null ? "undefined (zero delta variance)" : ctx.lift.cohensD.toFixed(2);
962
- const requiredRuns = ctx.lift.requiredN === null ? "not estimable" : `~${ctx.lift.requiredN} paired runs`;
963
- const decisive = ctx.lift.ci95[0] > ctx.threshold;
964
- const inconclusive = ctx.lift.ci95[0] <= ctx.threshold && ctx.lift.ci95[1] > ctx.threshold;
965
- if (decisive) {
966
- out.push({
967
- priority: "critical",
968
- kind: "ship",
969
- title: `Ship \u2014 lift ${ctx.lift.delta.toFixed(3)} (95% CI ${ctx.lift.ci95[0].toFixed(3)}..${ctx.lift.ci95[1].toFixed(3)})`,
970
- detail: `Holdout lift exceeds threshold ${ctx.threshold} with 95% bootstrap confidence (n=${ctx.lift.n}, p=${ctx.lift.pValue.toFixed(4)}, paired d=${pairedEffect}).`,
971
- evidencePath: "lift"
972
- });
973
- } else if (inconclusive) {
974
- out.push({
975
- priority: "high",
976
- kind: "expand-corpus",
977
- title: `Inconclusive \u2014 required sample is ${requiredRuns} (have ${ctx.lift.n}) at current effect size`,
978
- detail: `CI straddles threshold. Current MDE at 80% power is ${ctx.lift.mde.toFixed(3)}; observed delta is ${ctx.lift.delta.toFixed(3)}.`,
979
- evidencePath: "lift"
980
- });
981
- } else {
982
- out.push({
983
- priority: "critical",
984
- kind: "hold",
985
- title: `Hold \u2014 lift CI lower bound ${ctx.lift.ci95[0].toFixed(3)} is at or below threshold ${ctx.threshold}`,
986
- detail: `Bootstrap CI provides no statistical evidence the candidate is better. Consider tightening the mutation or expanding the holdout.`,
987
- evidencePath: "lift"
988
- });
989
- }
990
- }
991
- if (ctx.contamination && ctx.contamination.leaks > 0) {
992
- out.push({
993
- priority: "critical",
994
- kind: "fix",
995
- title: `${ctx.contamination.leaks} canary leak${ctx.contamination.leaks === 1 ? "" : "s"} detected`,
996
- detail: `Holdout integrity is compromised. The lift number is unreliable until you investigate.`,
997
- evidencePath: "contamination"
998
- });
999
- }
1000
- if (ctx.interRater && ctx.interRater.kappa < 0.5) {
1001
- out.push({
1002
- priority: "high",
1003
- kind: "recalibrate",
1004
- title: `Inter-rater weighted kappa ${ctx.interRater.kappa.toFixed(2)} is below 0.5`,
1005
- detail: "Raters disagree on what good looks like. Review the largest disagreement cases and refine the rubric before automating these decisions.",
1006
- evidencePath: "interRater"
1007
- });
1008
- }
1009
- if (ctx.failureClusters && ctx.failureClusters.clusters.length > 0) {
1010
- const top = ctx.failureClusters.clusters[0];
1011
- out.push({
1012
- priority: "high",
1013
- kind: "investigate",
1014
- title: `Top failure cluster: ${top.name} (${(top.share * 100).toFixed(0)}% of failures)`,
1015
- detail: `${ctx.failureClusters.totalFailures} runs failed. The largest cluster groups ${top.exemplars.length} exemplars under '${top.name}'.`,
1016
- evidencePath: "failureClusters.clusters[0]"
1017
- });
1018
- }
1019
- if (ctx.outcomeCorrelation && Math.abs(ctx.outcomeCorrelation.spearman) < 0.3) {
1020
- out.push({
1021
- priority: "medium",
1022
- kind: "recalibrate",
1023
- title: `Judge scores decoupled from ${ctx.outcomeCorrelation.metric} (Spearman \u03C1=${ctx.outcomeCorrelation.spearman.toFixed(2)})`,
1024
- detail: `Your judges score what they were trained to score, but it isn't predicting downstream ${ctx.outcomeCorrelation.metric}. Consider retraining the judge against ${ctx.outcomeCorrelation.metric} as the gold signal.`,
1025
- evidencePath: "outcomeCorrelation"
1026
- });
1027
- }
1028
- return out;
1029
- }
1030
-
1031
- export {
1032
- checkCanaries,
1033
- checkBehavioralCanary,
1034
- runBehavioralCanaries,
1035
- canaryLeakView,
1036
- HoldoutAuditor,
1037
- summarizeExecution,
1038
- analyzeRuns
1039
- };
1040
- //# sourceMappingURL=chunk-M4YBQKIJ.js.map