@tangle-network/agent-eval 2.0.7 → 2.0.10

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 (314) hide show
  1. package/CHANGELOG.md +80 -16
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-CRdalpZv.d.ts → agent-profile-_JzxgLDM.d.ts} +11 -5
  4. package/dist/{agent-profile-CRdalpZv.d.ts.map → agent-profile-_JzxgLDM.d.ts.map} +1 -1
  5. package/dist/analyst/index.d.ts +14 -13
  6. package/dist/analyst/index.d.ts.map +1 -1
  7. package/dist/analyst/index.js +34 -13
  8. package/dist/analyst/index.js.map +1 -1
  9. package/dist/analyze-runs-Izz_ZeWg.d.ts +65 -0
  10. package/dist/analyze-runs-Izz_ZeWg.d.ts.map +1 -0
  11. package/dist/{analyze-runs-C_9cXPZn.js → analyze-runs-xhH2Qxoc.js} +6 -5
  12. package/dist/{analyze-runs-C_9cXPZn.js.map → analyze-runs-xhH2Qxoc.js.map} +1 -1
  13. package/dist/app-grade/index.d.ts +4 -4
  14. package/dist/app-grade/index.js +1 -1
  15. package/dist/{benchmark-command-DkBMUDwy.js → benchmark-command-CGQXNFj7.js} +12 -8
  16. package/dist/benchmark-command-CGQXNFj7.js.map +1 -0
  17. package/dist/benchmarks/index.d.ts +4 -4
  18. package/dist/benchmarks/index.js +4 -4
  19. package/dist/builder-eval/index.js +2 -2
  20. package/dist/calibration-CrORXMWx.d.ts +128 -0
  21. package/dist/calibration-CrORXMWx.d.ts.map +1 -0
  22. package/dist/{calibration-Cfoup0xz.js → calibration-Dz8mQb5P.js} +2 -2
  23. package/dist/{calibration-Cfoup0xz.js.map → calibration-Dz8mQb5P.js.map} +1 -1
  24. package/dist/campaign/index.d.ts +8 -8
  25. package/dist/campaign/index.js +13 -12
  26. package/dist/{campaign-DfSWSreo.js → campaign-eus7YRs2.js} +1590 -15
  27. package/dist/campaign-eus7YRs2.js.map +1 -0
  28. package/dist/{campaign-evidence-BojANgU7.d.ts → campaign-evidence-BOcX4w0r.d.ts} +5 -5
  29. package/dist/{campaign-evidence-BojANgU7.d.ts.map → campaign-evidence-BOcX4w0r.d.ts.map} +1 -1
  30. package/dist/{campaign-evidence-D_oBFfLc.js → campaign-evidence-KM5GTsHG.js} +5 -5
  31. package/dist/{campaign-evidence-D_oBFfLc.js.map → campaign-evidence-KM5GTsHG.js.map} +1 -1
  32. package/dist/{cluster-Bj90LK-1.d.ts → chat-client-BlTooBDA.d.ts} +9 -241
  33. package/dist/chat-client-BlTooBDA.d.ts.map +1 -0
  34. package/dist/{chat-client-CvyDOQBv.js → chat-client-Oyot5tyo.js} +2 -2
  35. package/dist/{chat-client-CvyDOQBv.js.map → chat-client-Oyot5tyo.js.map} +1 -1
  36. package/dist/{chat-json-call-DMrwmB-k.js → chat-json-call-DTmv2uNY.js} +2 -2
  37. package/dist/{chat-json-call-DMrwmB-k.js.map → chat-json-call-DTmv2uNY.js.map} +1 -1
  38. package/dist/cli.js +7 -7
  39. package/dist/cluster-BJ0nW3P7.d.ts +241 -0
  40. package/dist/cluster-BJ0nW3P7.d.ts.map +1 -0
  41. package/dist/{cluster-bootstrap-DPzVy3_K.js → cluster-bootstrap-CTC8Dd30.js} +3 -2
  42. package/dist/{cluster-bootstrap-DPzVy3_K.js.map → cluster-bootstrap-CTC8Dd30.js.map} +1 -1
  43. package/dist/{completion-verifier-DsotH2l3.js → completion-verifier-CCPG2Yc0.js} +3 -3
  44. package/dist/{completion-verifier-DsotH2l3.js.map → completion-verifier-CCPG2Yc0.js.map} +1 -1
  45. package/dist/{completion-verifier-Cy38EpGE.d.ts → completion-verifier-CQOC3_bm.d.ts} +2 -2
  46. package/dist/{completion-verifier-Cy38EpGE.d.ts.map → completion-verifier-CQOC3_bm.d.ts.map} +1 -1
  47. package/dist/contract/index.d.ts +14 -12
  48. package/dist/contract/index.js +14 -12
  49. package/dist/contract/index.js.map +1 -1
  50. package/dist/{decision-point-C46p-p9v.js → decision-point-CfqtnGop.js} +3 -3
  51. package/dist/{decision-point-C46p-p9v.js.map → decision-point-CfqtnGop.js.map} +1 -1
  52. package/dist/{default-registry-BWFPtmuI.js → default-registry-Rs5uzlfJ.js} +4 -4
  53. package/dist/{default-registry-BWFPtmuI.js.map → default-registry-Rs5uzlfJ.js.map} +1 -1
  54. package/dist/{default-registry-xoX0PMCb.d.ts → default-registry-X8McMoUV.d.ts} +6 -6
  55. package/dist/{default-registry-xoX0PMCb.d.ts.map → default-registry-X8McMoUV.d.ts.map} +1 -1
  56. package/dist/define-agent-eval-D8ntOXqV.js +96 -0
  57. package/dist/define-agent-eval-D8ntOXqV.js.map +1 -0
  58. package/dist/define-agent-eval-DH5-xi-F.d.ts +52 -0
  59. package/dist/define-agent-eval-DH5-xi-F.d.ts.map +1 -0
  60. package/dist/diagnosis/index.d.ts +3 -3
  61. package/dist/diagnosis/index.js +1 -1
  62. package/dist/{dspy-rlm-engine-r7YpKLhS.js → dspy-rlm-engine-ChE1PUM5.js} +3 -3
  63. package/dist/{dspy-rlm-engine-r7YpKLhS.js.map → dspy-rlm-engine-ChE1PUM5.js.map} +1 -1
  64. package/dist/{emitter-BjW3NnX-.js → emitter-xN9wGTVw.js} +9 -2
  65. package/dist/{emitter-BjW3NnX-.js.map → emitter-xN9wGTVw.js.map} +1 -1
  66. package/dist/{eval-campaign-Cyk-tkLh.js → eval-campaign-BciGnrGy.js} +3 -3
  67. package/dist/{eval-campaign-Cyk-tkLh.js.map → eval-campaign-BciGnrGy.js.map} +1 -1
  68. package/dist/{evaluation-X5E22NQK.d.ts → evaluation-CjZH6gW0.d.ts} +4 -4
  69. package/dist/{evaluation-X5E22NQK.d.ts.map → evaluation-CjZH6gW0.d.ts.map} +1 -1
  70. package/dist/evaluation.d.ts +1 -1
  71. package/dist/{exact-types-DjuabhUV.d.ts → exact-types-BIHqYBYf.d.ts} +2 -2
  72. package/dist/{exact-types-DjuabhUV.d.ts.map → exact-types-BIHqYBYf.d.ts.map} +1 -1
  73. package/dist/{execution-insight-CE20Bxq0.d.ts → execution-insight-YihQrSqd.d.ts} +2 -2
  74. package/dist/{execution-insight-CE20Bxq0.d.ts.map → execution-insight-YihQrSqd.d.ts.map} +1 -1
  75. package/dist/experiment/index.d.ts +5 -5
  76. package/dist/experiment/index.js +10 -184
  77. package/dist/experiment/index.js.map +1 -1
  78. package/dist/{external-optimizer-contracts-ZDBfbZ_s.js → external-optimizer-contracts-BFV8lnhl.js} +7 -2
  79. package/dist/{external-optimizer-contracts-ZDBfbZ_s.js.map → external-optimizer-contracts-BFV8lnhl.js.map} +1 -1
  80. package/dist/{external-optimizer-process-4QdcF7Kd.js → external-optimizer-process-B6emPodQ.js} +3 -3
  81. package/dist/{external-optimizer-process-4QdcF7Kd.js.map → external-optimizer-process-B6emPodQ.js.map} +1 -1
  82. package/dist/{external-optimizer-subprocess-BW0ZWUUr.js → external-optimizer-subprocess-_O06eDVA.js} +35 -376
  83. package/dist/external-optimizer-subprocess-_O06eDVA.js.map +1 -0
  84. package/dist/{feedback-trajectory-BMkJezPc.d.ts → feedback-trajectory-CoQPmSJV.d.ts} +3 -3
  85. package/dist/{feedback-trajectory-BMkJezPc.d.ts.map → feedback-trajectory-CoQPmSJV.d.ts.map} +1 -1
  86. package/dist/finding-scope-B_As3F_v.js +359 -0
  87. package/dist/finding-scope-B_As3F_v.js.map +1 -0
  88. package/dist/{findings-store-DV8WA5nD.js → findings-store-CvYUzQBR.js} +4 -4
  89. package/dist/{findings-store-DV8WA5nD.js.map → findings-store-CvYUzQBR.js.map} +1 -1
  90. package/dist/fuzz.js +1 -1
  91. package/dist/{index-C6TG1LwA.d.ts → index-BSb3fJyZ.d.ts} +318 -131
  92. package/dist/index-BSb3fJyZ.d.ts.map +1 -0
  93. package/dist/{index-CKjqN9_U.d.ts → index-Bk1XEkP7.d.ts} +99 -3
  94. package/dist/index-Bk1XEkP7.d.ts.map +1 -0
  95. package/dist/{index-DAFZRMlF.d.ts → index-BmWw8zN6.d.ts} +10 -8
  96. package/dist/index-BmWw8zN6.d.ts.map +1 -0
  97. package/dist/{index-DKpMyD_Z.d.ts → index-CCOaNmh2.d.ts} +7 -7
  98. package/dist/{index-DKpMyD_Z.d.ts.map → index-CCOaNmh2.d.ts.map} +1 -1
  99. package/dist/{index-xEM_SoCl.d.ts → index-ZffK_5sD.d.ts} +22 -20
  100. package/dist/index-ZffK_5sD.d.ts.map +1 -0
  101. package/dist/{index-BqAPIToS.d.ts → index-aRalB_Ma.d.ts} +3 -3
  102. package/dist/{index-BqAPIToS.d.ts.map → index-aRalB_Ma.d.ts.map} +1 -1
  103. package/dist/index.d.ts +33 -29
  104. package/dist/index.js +28 -25
  105. package/dist/index.js.map +1 -1
  106. package/dist/{analyze-runs-xjKBBqIB.d.ts → insight-report-DYofCMLx.d.ts} +4 -64
  107. package/dist/insight-report-DYofCMLx.d.ts.map +1 -0
  108. package/dist/{integrity-BF0tJK21.js → integrity-DacT3oJ1.js} +2 -2
  109. package/dist/{integrity-BF0tJK21.js.map → integrity-DacT3oJ1.js.map} +1 -1
  110. package/dist/{integrity-B9320cw1.d.ts → integrity-DotDLWtj.d.ts} +2 -2
  111. package/dist/{integrity-B9320cw1.d.ts.map → integrity-DotDLWtj.d.ts.map} +1 -1
  112. package/dist/{judge-gate-DqlzOBOm.js → judge-gate-CpD3wmcf.js} +3 -3
  113. package/dist/{judge-gate-DqlzOBOm.js.map → judge-gate-CpD3wmcf.js.map} +1 -1
  114. package/dist/{llm-client-Dw4x6EdE.js → llm-client-Dk8lBnMh.js} +15 -2
  115. package/dist/{llm-client-Dw4x6EdE.js.map → llm-client-Dk8lBnMh.js.map} +1 -1
  116. package/dist/llm-judge-DYmEdo3M.js +476 -0
  117. package/dist/llm-judge-DYmEdo3M.js.map +1 -0
  118. package/dist/{matrix-CqZSpwgN.d.ts → matrix-BDl7hoBr.d.ts} +6 -2
  119. package/dist/matrix-BDl7hoBr.d.ts.map +1 -0
  120. package/dist/measure-validity-plan-BReXzcVh.d.ts +201 -0
  121. package/dist/measure-validity-plan-BReXzcVh.d.ts.map +1 -0
  122. package/dist/measure-validity-plan-CJkBNzX_.js +154 -0
  123. package/dist/measure-validity-plan-CJkBNzX_.js.map +1 -0
  124. package/dist/meta-eval/index.d.ts +5 -3
  125. package/dist/meta-eval/index.js +808 -15
  126. package/dist/meta-eval/index.js.map +1 -1
  127. package/dist/multishot/golden/index.d.ts +1 -1
  128. package/dist/multishot/index.d.ts +497 -4
  129. package/dist/multishot/index.d.ts.map +1 -1
  130. package/dist/multishot/index.js +1000 -48
  131. package/dist/multishot/index.js.map +1 -1
  132. package/dist/node-transport-DJno8V46.js +62 -0
  133. package/dist/node-transport-DJno8V46.js.map +1 -0
  134. package/dist/openapi.json +1 -1
  135. package/dist/{llm-judge-DQJTQx01.js → optimization-method-4JlbMxd2.js} +38 -513
  136. package/dist/optimization-method-4JlbMxd2.js.map +1 -0
  137. package/dist/{outcome-observations-DL3CC8w1.js → outcome-observations-DEh8_V_P.js} +31 -6
  138. package/dist/outcome-observations-DEh8_V_P.js.map +1 -0
  139. package/dist/outcome-store-CHtuvstd.d.ts +56 -0
  140. package/dist/outcome-store-CHtuvstd.d.ts.map +1 -0
  141. package/dist/{paired-arms-DZhH3FGu.js → paired-arms-CJH5Q0wx.js} +3 -2
  142. package/dist/{paired-arms-DZhH3FGu.js.map → paired-arms-CJH5Q0wx.js.map} +1 -1
  143. package/dist/{paired-promotion-decision-Dn3-jaq4.js → paired-promotion-decision-BtfVwEAk.js} +3 -2
  144. package/dist/{paired-promotion-decision-Dn3-jaq4.js.map → paired-promotion-decision-BtfVwEAk.js.map} +1 -1
  145. package/dist/{paired-promotion-decision-ChHBuuHV.d.ts → paired-promotion-decision-DJlI4z_k.d.ts} +2 -2
  146. package/dist/{paired-promotion-decision-ChHBuuHV.d.ts.map → paired-promotion-decision-DJlI4z_k.d.ts.map} +1 -1
  147. package/dist/{paired-promotion-power-BlzXdgMD.js → paired-promotion-power-DG1avBKf.js} +3 -3
  148. package/dist/{paired-promotion-power-BlzXdgMD.js.map → paired-promotion-power-DG1avBKf.js.map} +1 -1
  149. package/dist/paired-tests-CXcD_B80.js +688 -0
  150. package/dist/paired-tests-CXcD_B80.js.map +1 -0
  151. package/dist/pareto-DIVE5D0T.js +81 -0
  152. package/dist/pareto-DIVE5D0T.js.map +1 -0
  153. package/dist/pipelines/index.d.ts +2 -1
  154. package/dist/pipelines/index.d.ts.map +1 -1
  155. package/dist/pipelines/index.js +1 -1
  156. package/dist/{sequential-BphITa5b.js → power-COie_o6E.js} +181 -4
  157. package/dist/power-COie_o6E.js.map +1 -0
  158. package/dist/{prime-protocol-Cv6_47rh.d.ts → prime-protocol-BRMk6dGI.d.ts} +2 -2
  159. package/dist/{prime-protocol-Cv6_47rh.d.ts.map → prime-protocol-BRMk6dGI.d.ts.map} +1 -1
  160. package/dist/{promotion-gate-CGkxh36r.d.ts → promotion-gate-B0VTBoXg.d.ts} +2 -2
  161. package/dist/{promotion-gate-CGkxh36r.d.ts.map → promotion-gate-B0VTBoXg.d.ts.map} +1 -1
  162. package/dist/{promotion-policy-CxDIh-9p.js → promotion-policy-BgI7PsQn.js} +4 -4
  163. package/dist/{promotion-policy-CxDIh-9p.js.map → promotion-policy-BgI7PsQn.js.map} +1 -1
  164. package/dist/{proposal-findings-DedMih-u.js → proposal-findings-CfRFCFXS.js} +2 -2
  165. package/dist/{proposal-findings-DedMih-u.js.map → proposal-findings-CfRFCFXS.js.map} +1 -1
  166. package/dist/{registry-CIjC6SdV.d.ts → registry-BeInzotS.d.ts} +4 -4
  167. package/dist/{registry-CIjC6SdV.d.ts.map → registry-BeInzotS.d.ts.map} +1 -1
  168. package/dist/{release-confidence-BLHOMK5Q.js → release-confidence-Cndq1hwi.js} +2 -2
  169. package/dist/{release-confidence-BLHOMK5Q.js.map → release-confidence-Cndq1hwi.js.map} +1 -1
  170. package/dist/reporting.d.ts +5 -5
  171. package/dist/reporting.js +6 -5
  172. package/dist/reporting.js.map +1 -1
  173. package/dist/{research-report-D6XIK0eK.d.ts → research-report-CL5_UqCX.d.ts} +2 -2
  174. package/dist/{research-report-D6XIK0eK.d.ts.map → research-report-CL5_UqCX.d.ts.map} +1 -1
  175. package/dist/{researcher---DhHG4J.d.ts → researcher-BOpZP_Ja.d.ts} +4 -4
  176. package/dist/{researcher---DhHG4J.d.ts.map → researcher-BOpZP_Ja.d.ts.map} +1 -1
  177. package/dist/{reward-hacking-DKAflk2c.js → reward-hacking-DMTm1OBd.js} +2 -2
  178. package/dist/{reward-hacking-DKAflk2c.js.map → reward-hacking-DMTm1OBd.js.map} +1 -1
  179. package/dist/rl.d.ts +9 -8
  180. package/dist/rl.d.ts.map +1 -1
  181. package/dist/rl.js +11 -10
  182. package/dist/rl.js.map +1 -1
  183. package/dist/rollout/index.d.ts +2 -2
  184. package/dist/rollout/index.js +1 -1
  185. package/dist/{rollout-B_lrpd9a.js → rollout--rSr43Pd.js} +2 -2
  186. package/dist/{rollout-B_lrpd9a.js.map → rollout--rSr43Pd.js.map} +1 -1
  187. package/dist/{rollout-nodes-Vas6OSxX.js → rollout-nodes-DFxKpIr2.js} +39 -10
  188. package/dist/rollout-nodes-DFxKpIr2.js.map +1 -0
  189. package/dist/{rubric-predictive-validity--6z0q8s6.js → rubric-predictive-validity-BXJ92Jp_.js} +3 -9
  190. package/dist/rubric-predictive-validity-BXJ92Jp_.js.map +1 -0
  191. package/dist/{rubric-predictive-validity-C9wc7f_D.d.ts → rubric-predictive-validity-DH94_0Q1.d.ts} +3 -56
  192. package/dist/rubric-predictive-validity-DH94_0Q1.d.ts.map +1 -0
  193. package/dist/{run-improvement-loop-BfwOUudy.d.ts → run-improvement-loop-BeHu5D9Z.d.ts} +396 -11
  194. package/dist/run-improvement-loop-BeHu5D9Z.d.ts.map +1 -0
  195. package/dist/{run-record-Bqg0NZ_e.js → run-record-CuO8ErrI.js} +3 -2
  196. package/dist/run-record-CuO8ErrI.js.map +1 -0
  197. package/dist/{runtime-rollouts-drQynu3t.js → runtime-rollouts-CE0MbQPq.js} +55 -8
  198. package/dist/runtime-rollouts-CE0MbQPq.js.map +1 -0
  199. package/dist/search/index.d.ts +2 -2
  200. package/dist/search/index.js +2 -2
  201. package/dist/{search-kernel-DJq9bUDU.d.ts → search-kernel-CJZ-ZSV1.d.ts} +3 -3
  202. package/dist/{search-kernel-DJq9bUDU.d.ts.map → search-kernel-CJZ-ZSV1.d.ts.map} +1 -1
  203. package/dist/{pareto-Bg75Gajo.js → search-kernel-mZc79S6N.js} +6 -88
  204. package/dist/search-kernel-mZc79S6N.js.map +1 -0
  205. package/dist/{search-summary-B1x1Vmzh.js → search-summary-CCgP2qXz.js} +4 -4
  206. package/dist/{search-summary-B1x1Vmzh.js.map → search-summary-CCgP2qXz.js.map} +1 -1
  207. package/dist/{define-agent-eval-Cjc0wWnO.d.ts → self-improve-B1fsNejr.d.ts} +8 -54
  208. package/dist/self-improve-B1fsNejr.d.ts.map +1 -0
  209. package/dist/{define-agent-eval-B6uE3gNu.js → self-improve-C_Bcdmv8.js} +9 -97
  210. package/dist/self-improve-C_Bcdmv8.js.map +1 -0
  211. package/dist/{sequential-BhbTSxpt.d.ts → sequential-CHplorpC.d.ts} +2 -2
  212. package/dist/{sequential-BhbTSxpt.d.ts.map → sequential-CHplorpC.d.ts.map} +1 -1
  213. package/dist/{sequential-ux_XrjBf.js → sequential-DR-pnYQ7.js} +3 -3
  214. package/dist/{sequential-ux_XrjBf.js.map → sequential-DR-pnYQ7.js.map} +1 -1
  215. package/dist/{server-1fzBCxMh.js → server-aZFmRucn.js} +3 -3
  216. package/dist/{server-1fzBCxMh.js.map → server-aZFmRucn.js.map} +1 -1
  217. package/dist/{skillopt-optimization-method-D_swD0Cy.js → skillopt-optimization-method-DHk1K757.js} +95 -40
  218. package/dist/skillopt-optimization-method-DHk1K757.js.map +1 -0
  219. package/dist/{statistical-heldout-CaS4T-43.js → statistical-heldout-CL_7mI5C.js} +3 -3
  220. package/dist/{statistical-heldout-CaS4T-43.js.map → statistical-heldout-CL_7mI5C.js.map} +1 -1
  221. package/dist/{statistics-DSidA5I2.js → statistics-AKnVFnK-.js} +233 -700
  222. package/dist/statistics-AKnVFnK-.js.map +1 -0
  223. package/dist/statistics.d.ts +3 -3
  224. package/dist/statistics.js +3 -2
  225. package/dist/{store-tool-spans-DniaFwjM.d.ts → store-tool-spans-M3WxeRrG.d.ts} +4 -4
  226. package/dist/{store-tool-spans-DniaFwjM.d.ts.map → store-tool-spans-M3WxeRrG.d.ts.map} +1 -1
  227. package/dist/{summary-report-CI4J6gxU.js → summary-report-DyBkOC6V.js} +15 -7
  228. package/dist/summary-report-DyBkOC6V.js.map +1 -0
  229. package/dist/summary-report-figures-CJHygLgw.d.ts.map +1 -1
  230. package/dist/supervisor-run/index.d.ts +12 -2
  231. package/dist/supervisor-run/index.d.ts.map +1 -1
  232. package/dist/supervisor-run/index.js +3 -3
  233. package/dist/{systemone-DzY-2Zri.d.ts → systemone-4PadCE4C.d.ts} +8 -7
  234. package/dist/systemone-4PadCE4C.d.ts.map +1 -0
  235. package/dist/{systemone-review-CXecR_m-.d.ts → systemone-review-DpAXWDkL.d.ts} +2 -2
  236. package/dist/{systemone-review-CXecR_m-.d.ts.map → systemone-review-DpAXWDkL.d.ts.map} +1 -1
  237. package/dist/systemone.d.ts +3 -3
  238. package/dist/systemone.js +1 -1
  239. package/dist/{tool-groups-DF6OqhoG.d.ts → tool-groups-SlnoQNyT.d.ts} +2 -2
  240. package/dist/tool-groups-SlnoQNyT.d.ts.map +1 -0
  241. package/dist/tool-waste-B01AMpID.d.ts +121 -0
  242. package/dist/tool-waste-B01AMpID.d.ts.map +1 -0
  243. package/dist/{tool-waste-u7JJ_BlE.js → tool-waste-BZnYSa6J.js} +3 -2
  244. package/dist/{tool-waste-u7JJ_BlE.js.map → tool-waste-BZnYSa6J.js.map} +1 -1
  245. package/dist/{trace-questions-DO8y3J-E.d.ts → trace-questions-ybyF0B6N.d.ts} +2 -2
  246. package/dist/{trace-questions-DO8y3J-E.d.ts.map → trace-questions-ybyF0B6N.d.ts.map} +1 -1
  247. package/dist/trace-repair/index.d.ts +1 -1
  248. package/dist/trace-repair/index.js +1 -1
  249. package/dist/traces.d.ts +4 -4
  250. package/dist/traces.js +1 -1
  251. package/dist/trajectory-B3o6Ald_.d.ts +100 -0
  252. package/dist/trajectory-B3o6Ald_.d.ts.map +1 -0
  253. package/dist/trajectory-replay/index.js +1 -1
  254. package/dist/{tree-DQMlcNFI.js → tree-CiIe-f3f.js} +6 -4
  255. package/dist/{tree-DQMlcNFI.js.map → tree-CiIe-f3f.js.map} +1 -1
  256. package/dist/{types-fuOwNq1C.d.ts → types-B1W3v8dT.d.ts} +3 -2
  257. package/dist/types-B1W3v8dT.d.ts.map +1 -0
  258. package/dist/{types-BMSDkS8l.d.ts → types-D5XtEH9Q.d.ts} +11 -4
  259. package/dist/{types-BMSDkS8l.d.ts.map → types-D5XtEH9Q.d.ts.map} +1 -1
  260. package/dist/types-DK4vNv5q.js.map +1 -1
  261. package/dist/{types-D_PfKC59.d.ts → types-an-CUndX.d.ts} +2 -2
  262. package/dist/{types-D_PfKC59.d.ts.map → types-an-CUndX.d.ts.map} +1 -1
  263. package/dist/{types-BLv2Ngla.d.ts → types-xVtEOBhO.d.ts} +31 -8
  264. package/dist/types-xVtEOBhO.d.ts.map +1 -0
  265. package/dist/wire/index.d.ts +2 -2
  266. package/dist/wire/index.js +1 -1
  267. package/dist/world/index.d.ts +529 -0
  268. package/dist/world/index.d.ts.map +1 -0
  269. package/dist/world/index.js +1356 -0
  270. package/dist/world/index.js.map +1 -0
  271. package/docs/campaign-proposers.md +7 -0
  272. package/docs/concepts.md +2 -0
  273. package/docs/design/statistics-decisions.md +48 -0
  274. package/docs/eval-surface-map.md +5 -2
  275. package/docs/feature-guide.md +3 -1
  276. package/docs/multi-turn-optimization.md +84 -0
  277. package/docs/outcome-validity.md +108 -0
  278. package/docs/public-api.md +89 -34
  279. package/docs/{multi-shot-optimization.md → trajectory-optimization.md} +1 -1
  280. package/docs/world.md +104 -0
  281. package/package.json +6 -1
  282. package/dist/analyze-runs-xjKBBqIB.d.ts.map +0 -1
  283. package/dist/benchmark-command-DkBMUDwy.js.map +0 -1
  284. package/dist/campaign-DfSWSreo.js.map +0 -1
  285. package/dist/cluster-Bj90LK-1.d.ts.map +0 -1
  286. package/dist/define-agent-eval-B6uE3gNu.js.map +0 -1
  287. package/dist/define-agent-eval-Cjc0wWnO.d.ts.map +0 -1
  288. package/dist/external-optimizer-subprocess-BW0ZWUUr.js.map +0 -1
  289. package/dist/index-C6TG1LwA.d.ts.map +0 -1
  290. package/dist/index-CKjqN9_U.d.ts.map +0 -1
  291. package/dist/index-DAFZRMlF.d.ts.map +0 -1
  292. package/dist/index-xEM_SoCl.d.ts.map +0 -1
  293. package/dist/interval-CWyxqDpE.d.ts +0 -43
  294. package/dist/interval-CWyxqDpE.d.ts.map +0 -1
  295. package/dist/llm-judge-DQJTQx01.js.map +0 -1
  296. package/dist/matrix-CqZSpwgN.d.ts.map +0 -1
  297. package/dist/outcome-observations-DL3CC8w1.js.map +0 -1
  298. package/dist/pareto-Bg75Gajo.js.map +0 -1
  299. package/dist/rollout-nodes-Vas6OSxX.js.map +0 -1
  300. package/dist/rubric-predictive-validity--6z0q8s6.js.map +0 -1
  301. package/dist/rubric-predictive-validity-C9wc7f_D.d.ts.map +0 -1
  302. package/dist/run-improvement-loop-BfwOUudy.d.ts.map +0 -1
  303. package/dist/run-record-Bqg0NZ_e.js.map +0 -1
  304. package/dist/runtime-rollouts-drQynu3t.js.map +0 -1
  305. package/dist/sequential-BphITa5b.js.map +0 -1
  306. package/dist/skillopt-optimization-method-D_swD0Cy.js.map +0 -1
  307. package/dist/statistics-DSidA5I2.js.map +0 -1
  308. package/dist/summary-report-CI4J6gxU.js.map +0 -1
  309. package/dist/systemone-DzY-2Zri.d.ts.map +0 -1
  310. package/dist/tool-groups-DF6OqhoG.d.ts.map +0 -1
  311. package/dist/tool-waste-CIhtU1ad.d.ts +0 -217
  312. package/dist/tool-waste-CIhtU1ad.d.ts.map +0 -1
  313. package/dist/types-BLv2Ngla.d.ts.map +0 -1
  314. package/dist/types-fuOwNq1C.d.ts.map +0 -1
@@ -2,8 +2,10 @@ import { l as hashJson } from "./agent-profile-cell-CUthydZB.js";
2
2
  import { r as observedSplitScore } from "./reward-DqMfaEax.js";
3
3
  import { n as renderResearchHtml } from "./reporting-html-DMXIjATy.js";
4
4
  import { t as interpolatedQuantile } from "./quantile-CncXP-Ss.js";
5
- import { r as pairRunRecords } from "./paired-arms-DZhH3FGu.js";
6
- import { R as pairedCohensDz, T as benjaminiHochberg, a as wilcoxonSignedRank, c as pairedMde, gt as makeRng, p as pairedBootstrap, pt as mean, rt as confidenceInterval } from "./statistics-DSidA5I2.js";
5
+ import { r as pairRunRecords } from "./paired-arms-CJH5Q0wx.js";
6
+ import { S as makeRng, _ as mean, r as pairedBootstrap, s as confidenceInterval } from "./paired-tests-CXcD_B80.js";
7
+ import { N as pairedCohensDz, a as wilcoxonSignedRank, b as benjaminiHochberg, c as pairedMde } from "./statistics-AKnVFnK-.js";
8
+ import { n as paretoFrontier } from "./pareto-DIVE5D0T.js";
7
9
  // src/research-report-render.ts
8
10
  function renderResearchMarkdown(report) {
9
11
  const lines = [];
@@ -478,7 +480,16 @@ function paretoChart(runs, opts = {}) {
478
480
  onFrontier: false,
479
481
  gate: opts.gateDecisions?.[candidateId] ? gateLabel(opts.gateDecisions[candidateId]) : void 0
480
482
  }));
481
- for (const p of points) p.onFrontier = !points.some((q) => q !== p && dominates(q, p));
483
+ const { frontier } = paretoFrontier(points, [{
484
+ name: "quality",
485
+ direction: "maximize",
486
+ value: (p) => p.quality
487
+ }, {
488
+ name: "cost",
489
+ direction: "minimize",
490
+ value: (p) => p.cost
491
+ }]);
492
+ for (const p of frontier) p.onFrontier = true;
482
493
  return {
483
494
  kind: "pareto-cost-quality",
484
495
  split,
@@ -489,9 +500,6 @@ function paretoChart(runs, opts = {}) {
489
500
  points
490
501
  };
491
502
  }
492
- function dominates(a, b) {
493
- return a.cost <= b.cost && a.quality >= b.quality && (a.cost < b.cost || a.quality > b.quality);
494
- }
495
503
  function gateLabel(d) {
496
504
  return d.promote ? "promote" : "reject";
497
505
  }
@@ -722,4 +730,4 @@ async function researchReport(runs, opts = {}) {
722
730
  }
723
731
  export { RESEARCH_REPORT_HARD_PAIR_FLOOR as a, summaryTable as i, gainHistogram as n, paretoChart as r, researchReport as t };
724
732
 
725
- //# sourceMappingURL=summary-report-CI4J6gxU.js.map
733
+ //# sourceMappingURL=summary-report-DyBkOC6V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary-report-DyBkOC6V.js","names":["avg"],"sources":["../src/research-report-render.ts","../src/research-report-analysis.ts","../src/summary-report-evidence.ts","../src/summary-report-figures.ts","../src/research-report.ts"],"sourcesContent":["/** Markdown research reports and their shared numeric text formatting. */\n\nimport type { FailureClusterReport } from './pipelines/failure-cluster'\nimport type {\n ResearchReportCandidate,\n ResearchReportMethodology,\n ResearchReportRecommendation,\n} from './research-report'\nimport type {\n GainDistributionFigureSpec,\n ParetoFigureSpec,\n SummaryTable,\n} from './summary-report-figures'\n\nexport function renderResearchMarkdown(report: {\n title: string\n generatedAt: string\n split: 'search' | 'holdout'\n comparator: string | null\n executiveSummary: string[]\n recommendation: ResearchReportRecommendation\n candidates: ResearchReportCandidate[]\n summary: SummaryTable\n pareto: ParetoFigureSpec\n gains: GainDistributionFigureSpec[]\n rope: { low: number; high: number } | null\n runFingerprint: string\n preregistrationHash: string | null\n methodology: ResearchReportMethodology\n failureClusters?: FailureClusterReport\n}): string {\n const lines: string[] = []\n lines.push(`# ${report.title}`)\n lines.push('')\n lines.push(`**Generated:** ${report.generatedAt}`)\n lines.push(`**Primary split:** ${report.split}`)\n lines.push(`**Comparator:** ${report.comparator ?? 'not configured'}`)\n lines.push(`**ROPE:** ${report.rope ? formatRope(report.rope) : 'not configured'}`)\n lines.push(`**Run fingerprint:** \\`${report.runFingerprint}\\``)\n lines.push(\n `**Preregistration:** ${report.preregistrationHash ? `\\`${report.preregistrationHash}\\`` : 'none'}`,\n )\n lines.push('')\n lines.push('## Executive Summary')\n lines.push('')\n for (const item of report.executiveSummary) lines.push(`- ${item}`)\n lines.push('')\n lines.push('## Recommendation')\n lines.push('')\n lines.push(`**Decision:** ${report.recommendation.decision}`)\n lines.push(`**Candidate:** ${report.recommendation.candidateId ?? 'N/A'}`)\n lines.push('')\n lines.push('### Rationale')\n lines.push('')\n for (const item of report.recommendation.rationale) lines.push(`- ${item}`)\n lines.push('')\n lines.push('### Risks')\n lines.push('')\n for (const item of report.recommendation.risks.length\n ? report.recommendation.risks\n : ['No material report-level risks detected.']) {\n lines.push(`- ${item}`)\n }\n lines.push('')\n lines.push('### Next Actions')\n lines.push('')\n for (const item of report.recommendation.nextActions) lines.push(`- ${item}`)\n lines.push('')\n lines.push('## Candidate Decision Table')\n lines.push('')\n lines.push(\n '| Candidate | Decision | Mean | Δ̄ | Pr(Δ>0) | q | dz | Paired N | Median Gain CI | MDE | Pareto | Gate |',\n )\n lines.push('|---|---|---:|---:|---:|---:|---:|---:|---|---:|---|---|')\n for (const c of report.candidates) {\n const delta = c.meanDeltaVsComparator === null ? '-' : signed(c.meanDeltaVsComparator)\n const prGt = c.prGreaterThanZero === null ? '-' : c.prGreaterThanZero.toFixed(3)\n const q = c.qValue !== null ? c.qValue.toFixed(4) : '-'\n const d = c.cohensD !== null ? c.cohensD.toFixed(3) : '-'\n const gain = c.gainCi ? `[${fmt(c.gainCi.low)}, ${fmt(c.gainCi.high)}]` : '-'\n const mde = c.mde === null || !Number.isFinite(c.mde) ? '-' : fmt(c.mde)\n lines.push(\n `| ${c.candidateId} | ${c.decision} | ${fmt(c.mean)} | ${delta} | ${prGt} | ${q} | ${d} | ${c.pairedN} | ${gain} | ${mde} | ${c.onParetoFrontier ? 'yes' : 'no'} | ${c.gate ?? '-'} |`,\n )\n }\n lines.push('')\n lines.push('## Statistical Summary')\n lines.push('')\n lines.push(report.summary.markdown)\n lines.push('')\n lines.push('## Methodology')\n lines.push('')\n lines.push('### Assumptions')\n lines.push('')\n for (const item of report.methodology.assumptions) lines.push(`- ${item}`)\n lines.push('')\n lines.push('### Methods')\n lines.push('')\n for (const item of report.methodology.methods) lines.push(`- ${item}`)\n lines.push('')\n lines.push('### Alternatives Considered')\n lines.push('')\n for (const item of report.methodology.alternatives) lines.push(`- ${item}`)\n lines.push('')\n lines.push('### When NOT To Apply')\n lines.push('')\n for (const item of report.methodology.whenNotToApply) lines.push(`- ${item}`)\n lines.push('')\n lines.push('### Citations')\n lines.push('')\n for (const item of report.methodology.citations) lines.push(`- ${item}`)\n lines.push('')\n lines.push('## Chart Specs')\n lines.push('')\n lines.push(\n 'The report carries JSON chart specs for Pareto cost/quality and paired gain histograms.',\n )\n lines.push('')\n lines.push('```json')\n lines.push(JSON.stringify({ pareto: report.pareto, gains: report.gains }, null, 2))\n lines.push('```')\n if (report.failureClusters) {\n lines.push('')\n lines.push('## Failure Clusters')\n lines.push('')\n lines.push('| Failure Class | Runs | Scenarios | Tool | Example |')\n lines.push('|---|---:|---:|---|---|')\n for (const c of report.failureClusters.clusters.slice(0, 10)) {\n lines.push(\n `| ${c.failureClass} | ${c.runCount} | ${c.scenarioIds.length} | ${c.toolName ?? '-'} | ${escapePipes(c.exampleError ?? c.exampleRunId)} |`,\n )\n }\n }\n return lines.join('\\n')\n}\n\nfunction escapePipes(s: string): string {\n return s.replace(/\\|/g, '\\\\|')\n}\n\nfunction signed(x: number): string {\n return `${x >= 0 ? '+' : ''}${fmt(x)}`\n}\n\nexport function formatRope(rope: { low: number; high: number }): string {\n return `[${fmt(rope.low)}, ${fmt(rope.high)}]`\n}\n\nexport function fmt(x: number): string {\n if (!Number.isFinite(x)) return String(x)\n return x.toFixed(4)\n}\n","/** Evidence-based report verdicts, recommendations, and methodology. */\n\nimport type { HeldOutGateDecision } from './held-out-gate'\nimport type { FailureClusterReport } from './pipelines/failure-cluster'\nimport type {\n ResearchReportCandidate,\n ResearchReportDecision,\n ResearchReportMethodology,\n ResearchReportRecommendation,\n} from './research-report'\nimport { fmt, formatRope } from './research-report-render'\nimport type { pairedPosterior } from './summary-report-evidence'\nimport type { ParetoPoint, SummaryTableRow } from './summary-report-figures'\n\n/**\n * Hard floor below which a paired comparison is treated as uninformative\n * regardless of `minPairs`. Mirrors the lower limit on Wilcoxon signed-rank\n * exact tables; below this the test has no power to separate effect sizes.\n */\nexport const RESEARCH_REPORT_HARD_PAIR_FLOOR = 6\n\nexport function buildMethodology(ctx: {\n split: 'search' | 'holdout'\n comparator: string | null\n fdr: number\n minPairs: number\n rope: { low: number; high: number } | null\n confidence: number\n mdePower: number\n mdeAlpha: number\n}): ResearchReportMethodology {\n const assumptions: string[] = [\n 'Pairs are matched by (experimentId, scenarioId, seed); input order does not affect the comparison.',\n 'Paired deltas are exchangeable conditional on the matched scenario — no mid-run distribution shift.',\n `Decisions are pre-specified at fdr=${ctx.fdr}, minPairs=${ctx.minPairs}, confidence=${ctx.confidence}; deviating from these post-hoc invalidates the false-discovery control.`,\n ]\n if (ctx.rope) {\n assumptions.push(\n `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.\"`,\n )\n }\n if (ctx.comparator === null) {\n assumptions.push('No comparator was configured; this run is descriptive, not causal.')\n }\n const methods: string[] = [\n \"Marginal scores summarised with BH-FDR-adjusted Wilcoxon signed-rank q-values and paired Cohen's dz via summaryTable.\",\n 'Paired evidence summarised with a frequentist bootstrap CI on the median delta and a Dirichlet-weight Bayesian bootstrap for Pr(Δ>0) and Pr(Δ∈ROPE) on the mean delta.',\n `Minimum detectable effect reported per candidate at α=${ctx.mdeAlpha} (two-sided), power=${ctx.mdePower}, standardised by the observed paired-delta SD.`,\n 'Pareto frontier flagged as a separate axis (cost vs quality); a candidate can be on-frontier without winning the paired test.',\n 'Held-out gate decisions, when supplied, override the statistical verdict in the reject direction.',\n ]\n const alternatives: string[] = [\n 'Paired t-test rejected: not robust to the heavy-tailed score distributions common in agent benchmarks.',\n 'Unpaired Mann–Whitney rejected: matched scenarios make pairing free; unpaired throws away that variance reduction.',\n 'Sequential / always-valid inference (e-values, mSPRT) is the right tool for iterative sweeps and is out of scope for this single-look report — preregister and run once, or wrap this report in an alpha-spending schedule.',\n 'Hierarchical Bayesian shrinkage across many candidates is future work; the current ranking uses raw paired statistics.',\n ]\n const whenNotToApply: string[] = [\n `Paired N below ${RESEARCH_REPORT_HARD_PAIR_FLOOR} on any candidate — the bootstrap CI is degenerate.`,\n 'Comparator chosen post-hoc by inspecting the same data; q-values are no longer false-discovery-controlled.',\n 'Scenarios not drawn under a stable preregistered protocol; the report can describe the data but cannot anchor a launch decision.',\n 'Score distributions with mid-run shift (judge model swap, rubric change, infra outage) — pair exchangeability is violated.',\n ]\n const citations: string[] = [\n 'Benjamini, Y. & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. JRSS B, 57(1), 289–300.',\n 'Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83.',\n 'Efron, B. (1979). Bootstrap methods: another look at the jackknife. Annals of Statistics, 7(1), 1–26.',\n 'Rubin, D. B. (1981). The Bayesian bootstrap. Annals of Statistics, 9(1), 130–134.',\n 'Kruschke, J. K. (2018). Rejecting or accepting parameter values in Bayesian estimation. Advances in Methods and Practices in Psychological Science, 1(2), 270–280. (ROPE.)',\n ]\n return { assumptions, methods, alternatives, whenNotToApply, citations }\n}\n\nexport function classifyCandidate(\n row: SummaryTableRow,\n ctx: {\n comparator: string | null\n posterior: ReturnType<typeof pairedPosterior> | null\n point?: ParetoPoint\n gateDecision?: HeldOutGateDecision\n split: 'search' | 'holdout'\n fdr: number\n minPairs: number\n rope: { low: number; high: number } | null\n },\n): { decision: ResearchReportDecision; reason: string } {\n if (ctx.comparator && row.candidateId === ctx.comparator) {\n return { decision: 'hold', reason: 'Comparator baseline.' }\n }\n if (ctx.gateDecision && !ctx.gateDecision.promote) {\n const code = ctx.gateDecision.rejectionCode ?? 'rejected'\n return {\n decision: 'reject',\n reason: `Held-out gate returned ${code}: ${ctx.gateDecision.reason}`,\n }\n }\n if (!ctx.comparator) {\n return {\n decision: ctx.point?.onFrontier ? 'hold' : 'needs_more_data',\n reason:\n 'No comparator configured; report ranks candidates but cannot anchor a promotion call.',\n }\n }\n if (!ctx.posterior || ctx.posterior.n < RESEARCH_REPORT_HARD_PAIR_FLOOR) {\n return {\n decision: 'needs_more_data',\n reason: `Only ${ctx.posterior?.n ?? 0} paired observations; below hard floor of ${RESEARCH_REPORT_HARD_PAIR_FLOOR} for any paired inference.`,\n }\n }\n const ci = ctx.posterior.ci\n if (ctx.split === 'search') {\n return {\n decision: 'hold',\n reason:\n 'Search-split evidence is descriptive; release decisions require matched holdout runs.',\n }\n }\n // A ZERO-WIDTH interval cannot support any directional or equivalence claim:\n // every resample was identical, so it says nothing about how far the estimate\n // could be wrong. It is the shape that sits fully inside any ROPE containing\n // it (a fake \"practically equivalent\") and clears any threshold below it (a\n // fake \"promote\"). Both are an absence of evidence, so it is disqualified from\n // each claim rather than short-circuiting the whole classifier — the\n // sample-size and MDE diagnostics below are still the more useful answer when\n // they apply.\n const degenerate = !Number.isFinite(ci.low) || !Number.isFinite(ci.high) || ci.low === ci.high\n if (!degenerate && ctx.rope && ci.low >= ctx.rope.low && ci.high <= ctx.rope.high) {\n return {\n decision: 'equivalent',\n reason: `Paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] is fully inside ROPE ${formatRope(ctx.rope)}; candidate is practically equivalent to comparator.`,\n }\n }\n const gainPositive = !degenerate && ci.low > 0\n const gainNegative = !degenerate && ci.high < 0\n if (gainNegative) {\n return {\n decision: 'reject',\n reason: `Paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] lies entirely below zero.`,\n }\n }\n if (ctx.posterior.n < ctx.minPairs) {\n return {\n decision: 'needs_more_data',\n reason: `Only ${ctx.posterior.n} paired observations; minimum detectable effect at this N is ${fmt(ctx.posterior.mde)} score units (need ≥ ${ctx.minPairs} pairs to issue a directional verdict).`,\n }\n }\n if (degenerate) {\n return {\n decision: 'needs_more_data',\n reason: `Paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] has zero width — every resample was identical, so the interval carries no information about how far the estimate could be wrong and cannot support a promote or equivalence call.`,\n }\n }\n if (row.qValue !== null && row.qValue <= ctx.fdr && gainPositive) {\n return {\n decision: 'promote',\n reason: `BH-adjusted q=${fmt(row.qValue)} ≤ ${ctx.fdr} and paired-delta CI [${fmt(ci.low)}, ${fmt(ci.high)}] excludes zero; Pr(Δ>0)=${fmt(ctx.posterior.prGreaterThanZero)}.`,\n }\n }\n return {\n decision: 'hold',\n reason: `Pr(Δ>0)=${fmt(ctx.posterior.prGreaterThanZero)} but CI [${fmt(ci.low)}, ${fmt(ci.high)}] crosses zero; effect not decisive at fdr=${ctx.fdr}.`,\n }\n}\n\nexport function buildRecommendation(\n candidates: ResearchReportCandidate[],\n ctx: {\n comparator: string | null\n failureClusters?: FailureClusterReport\n rope: { low: number; high: number } | null\n minPairs: number\n preregistrationHash: string | null\n },\n): ResearchReportRecommendation {\n const nonComparator = candidates.filter((c) => c.candidateId !== ctx.comparator)\n const bestPromote = nonComparator.find((c) => c.decision === 'promote')\n const bestEquivalent = nonComparator.find((c) => c.decision === 'equivalent')\n const chosen = bestPromote ?? bestEquivalent ?? nonComparator[0] ?? null\n const decision: ResearchReportDecision = bestPromote\n ? 'promote'\n : nonComparator.some((c) => c.decision === 'needs_more_data')\n ? 'needs_more_data'\n : bestEquivalent\n ? 'equivalent'\n : nonComparator.some((c) => c.decision === 'hold')\n ? 'hold'\n : 'reject'\n\n const rationale: string[] = []\n const risks: string[] = []\n const nextActions: string[] = []\n\n if (chosen) {\n rationale.push(`${chosen.candidateId}: ${chosen.decisionReason}`)\n if (chosen.gainCi) {\n const probSummary =\n chosen.prGreaterThanZero !== null ? `, Pr(Δ>0)=${fmt(chosen.prGreaterThanZero)}` : ''\n rationale.push(\n `Median paired gain CI: [${fmt(chosen.gainCi.low)}, ${fmt(chosen.gainCi.high)}]${probSummary}.`,\n )\n }\n if (chosen.mde !== null && Number.isFinite(chosen.mde)) {\n rationale.push(`MDE at current paired N=${chosen.pairedN}: ${fmt(chosen.mde)} score units.`)\n }\n }\n if (!ctx.comparator) {\n risks.push('No comparator was configured; verdict is descriptive, not causal.')\n nextActions.push('Re-run with a stable comparator candidate for paired inference.')\n }\n if (!ctx.preregistrationHash) {\n risks.push(\n 'No preregistration hash supplied; readers cannot verify the analysis was specified before data inspection.',\n )\n nextActions.push(\n 'Sign a HypothesisManifest before the next sweep and pass `preregistrationHash` so the report cites it.',\n )\n }\n if (ctx.rope === null && nonComparator.length > 0) {\n risks.push(\n 'No ROPE configured; the report cannot distinguish \"equivalent\" from \"inconclusive\".',\n )\n nextActions.push(\n 'Define a domain-specific Region of Practical Equivalence and pass it to lock in the equivalence threshold.',\n )\n }\n const inconclusive = nonComparator.filter((c) => c.decision === 'needs_more_data')\n if (inconclusive.length > 0) {\n const worst = inconclusive.reduce((a, b) => (b.pairedN < a.pairedN ? b : a))\n risks.push(\n `${inconclusive.length} candidate(s) below soft floor (${ctx.minPairs} pairs); thinnest is ${worst.candidateId} with ${worst.pairedN}.`,\n )\n nextActions.push(\n `Collect at least ${ctx.minPairs - worst.pairedN} more matched holdout runs for ${worst.candidateId}.`,\n )\n }\n const rejected = nonComparator.filter((c) => c.decision === 'reject')\n if (rejected.length > 0) {\n risks.push(\n `${rejected.length} candidate(s) failed the paired test or held-out gate; do not ship those variants.`,\n )\n }\n if (ctx.failureClusters && ctx.failureClusters.clusters.length > 0) {\n const top = ctx.failureClusters.clusters[0]!\n risks.push(`Top failure cluster: ${top.failureClass} across ${top.runCount} run(s).`)\n nextActions.push('Prioritize the largest failure cluster before broad rollout.')\n }\n if (decision === 'promote') {\n nextActions.push('Ship behind the existing promotion gate and monitor canaries.')\n } else if (decision === 'hold') {\n nextActions.push('Keep current production candidate while expanding holdout evidence.')\n } else if (decision === 'equivalent') {\n nextActions.push(\n 'Either keep the comparator (no quality regression) or promote on cost/latency grounds — equivalence does not justify either; the choice is a product decision, not a stats one.',\n )\n } else if (decision === 'reject') {\n nextActions.push(\n 'Do not promote this sweep; inspect failures and generate a revised candidate.',\n )\n }\n\n return {\n decision,\n candidateId: chosen?.candidateId ?? null,\n rationale,\n risks,\n nextActions,\n }\n}\n\nexport function buildExecutiveSummary(\n candidates: ResearchReportCandidate[],\n recommendation: ResearchReportRecommendation,\n ctx: {\n comparator: string | null\n split: 'search' | 'holdout'\n failureClusters?: FailureClusterReport\n preregistrationHash: string | null\n },\n): string[] {\n const lines: string[] = []\n const nonComparator = candidates.filter((c) => c.candidateId !== ctx.comparator)\n lines.push(\n `Evaluated ${nonComparator.length} candidate(s) on the ${ctx.split} split${ctx.comparator ? ` against ${ctx.comparator}` : ''}.`,\n )\n lines.push(\n `Recommendation: ${recommendation.decision}${recommendation.candidateId ? ` ${recommendation.candidateId}` : ''}.`,\n )\n const promoted = nonComparator.filter((c) => c.decision === 'promote').length\n const held = nonComparator.filter((c) => c.decision === 'hold').length\n const equivalent = nonComparator.filter((c) => c.decision === 'equivalent').length\n const rejected = nonComparator.filter((c) => c.decision === 'reject').length\n const more = nonComparator.filter((c) => c.decision === 'needs_more_data').length\n lines.push(\n `Decision mix: ${promoted} promote, ${equivalent} equivalent, ${held} hold, ${rejected} reject, ${more} need more data.`,\n )\n const frontier = nonComparator.filter((c) => c.onParetoFrontier).map((c) => c.candidateId)\n if (frontier.length > 0) lines.push(`Pareto-frontier candidates: ${frontier.join(', ')}.`)\n if (ctx.failureClusters) {\n lines.push(\n `Failure clustering found ${ctx.failureClusters.totalFailures}/${ctx.failureClusters.totalRuns} failed runs across ${ctx.failureClusters.clusters.length} reportable cluster(s).`,\n )\n }\n lines.push(\n ctx.preregistrationHash\n ? `Preregistered analysis: ${ctx.preregistrationHash.slice(0, 12)}…`\n : 'Analysis is post-hoc — no preregistration hash supplied.',\n )\n return lines\n}\n\nexport function decisionWeight(decision: ResearchReportDecision): number {\n if (decision === 'promote') return 5\n if (decision === 'equivalent') return 4\n if (decision === 'hold') return 3\n if (decision === 'needs_more_data') return 2\n return 1\n}\n","/** Matched split scores and paired statistical evidence for report consumers. */\n\nimport { interpolatedQuantile } from './math/quantile'\nimport { pairRunRecords } from './paired-arms'\nimport { observedSplitScore, type ScorePreference } from './rollout/reward'\nimport type { RunRecord } from './run-record'\nimport { pairedBootstrap, pairedMde } from './statistics'\nimport { makeRng } from './statistics/internal'\n\nexport function pairScoresByKey(\n candidate: RunRecord[],\n baseline: RunRecord[],\n split: ScorePreference,\n): {\n before: number[]\n after: number[]\n unpairedCandidateN: number\n unpairedComparatorN: number\n} {\n // RAW, split-exact reads through `observedSplitScore` — the single allowed\n // spelling of the split-score derivation (see rollout/score-derivation-guard).\n const scoreOf = (run: RunRecord): number | undefined => {\n const v = observedSplitScore(run, split)\n return typeof v === 'number' && Number.isFinite(v) ? v : undefined\n }\n const scoredCandidate = candidate.filter((run) => scoreOf(run) !== undefined)\n const scoredBaseline = baseline.filter((run) => scoreOf(run) !== undefined)\n const pairing = pairRunRecords(scoredBaseline, scoredCandidate)\n return {\n before: pairing.pairs.map((pair) => scoreOf(pair.baseline) as number),\n after: pairing.pairs.map((pair) => scoreOf(pair.treatment) as number),\n unpairedCandidateN: pairing.unpairedTreatment.length,\n unpairedComparatorN: pairing.unpairedBaseline.length,\n }\n}\n\n/**\n * Internal: paired posterior summary on (candidate − comparator) deltas.\n *\n * Returns the bootstrap CI on the median (matching `gainHistogram`) plus\n * Bayesian-bootstrap posterior summaries Pr(Δ>0) and Pr(Δ∈ROPE) computed\n * from Dirichlet(1, ..., 1) weights on the observed paired deltas\n * (Rubin 1981), and the\n * minimum detectable paired effect at the configured power and α.\n *\n * `null` is returned when no paired observations exist; callers must\n * gate on `n` before consuming the bootstrap statistics.\n */\nexport function pairedPosterior(\n runs: RunRecord[],\n candidateId: string,\n comparator: string,\n opts: {\n split: 'search' | 'holdout'\n confidence: number\n seed?: number\n rope: { low: number; high: number } | null\n mdePower: number\n mdeAlpha: number\n },\n): {\n n: number\n meanDelta: number\n medianDelta: number\n sdDelta: number\n ci: { low: number; high: number }\n prGreaterThanZero: number\n prInRope: number | null\n mde: number\n} | null {\n const candidate = runs.filter((r) => r.candidateId === candidateId && r.splitTag === opts.split)\n const baseline = runs.filter((r) => r.candidateId === comparator && r.splitTag === opts.split)\n const { before, after } = pairScoresByKey(candidate, baseline, opts.split)\n const n = before.length\n if (n === 0) return null\n\n const deltas = before.map((b, i) => after[i]! - b)\n const meanDelta = deltas.reduce((s, x) => s + x, 0) / n\n const sortedDeltas = [...deltas].sort((a, b) => a - b)\n const medianDelta = interpolatedQuantile(sortedDeltas, 0.5)\n const sdDelta = stdev(deltas, meanDelta)\n\n const ci = pairedBootstrap(before, after, {\n confidence: opts.confidence,\n resamples: 2000,\n statistic: 'median',\n seed: opts.seed,\n })\n\n const meanSamples = bayesianBootstrapMeanSamples(deltas, 2000, opts.seed)\n const prGreaterThanZero =\n meanSamples.length === 0 ? 0 : meanSamples.filter((s) => s > 0).length / meanSamples.length\n const prInRope =\n opts.rope === null || meanSamples.length === 0\n ? null\n : meanSamples.filter((s) => s >= opts.rope!.low && s <= opts.rope!.high).length /\n meanSamples.length\n\n const dStandardised = pairedMde({ nPaired: n, alpha: opts.mdeAlpha, power: opts.mdePower })\n const mde = sdDelta === 0 ? 0 : dStandardised * sdDelta\n\n return {\n n,\n meanDelta,\n medianDelta,\n sdDelta,\n ci: { low: ci.low, high: ci.high },\n prGreaterThanZero,\n prInRope,\n mde,\n }\n}\n\nfunction bayesianBootstrapMeanSamples(\n deltas: number[],\n resamples: number,\n seed?: number,\n): number[] {\n const n = deltas.length\n if (n === 0) return []\n if (n === 1) return new Array<number>(resamples).fill(deltas[0]!)\n const rng = makeRng(seed, deltas)\n const samples = new Array<number>(resamples)\n for (let b = 0; b < resamples; b++) {\n let weightedSum = 0\n let weightSum = 0\n for (let k = 0; k < n; k++) {\n const weight = -Math.log(Math.max(Number.MIN_VALUE, rng()))\n weightedSum += deltas[k]! * weight\n weightSum += weight\n }\n samples[b] = weightedSum / weightSum\n }\n return samples\n}\n\nfunction stdev(xs: number[], mean: number): number {\n if (xs.length < 2) return 0\n let sse = 0\n for (const x of xs) sse += (x - mean) ** 2\n return Math.sqrt(sse / (xs.length - 1))\n}\n","/** Tables and library-independent chart specifications from scored runs. */\n\nimport type { HeldOutGateDecision } from './held-out-gate'\nimport { interpolatedQuantile } from './math/quantile'\nimport { paretoFrontier } from './pareto'\nimport { fmt } from './research-report-render'\nimport { observedSplitScore } from './rollout/reward'\nimport type { RunRecord } from './run-record'\nimport {\n benjaminiHochberg,\n confidenceInterval,\n pairedBootstrap,\n pairedCohensDz,\n wilcoxonSignedRank,\n} from './statistics'\nimport { mean as avg } from './statistics/mean'\nimport { pairScoresByKey } from './summary-report-evidence'\n\n// ── summaryTable ───────────────────────────────────────────────────────\n\nexport interface SummaryTableOptions {\n /** Comparator candidate id. Wilcoxon + paired Cohen's dz are computed\n * versus this candidate. Required for paired stats columns. */\n comparator?: string\n /** Which split to read scores from. Default 'holdout'. */\n split?: 'search' | 'holdout'\n /** Confidence level for the bootstrap CI on the mean. Default 0.95. */\n confidence?: number\n /** FDR for BH adjustment of the comparison p-values. Default 0.05. */\n fdr?: number\n}\n\nexport interface SummaryTableRow {\n candidateId: string\n n: number\n mean: number\n ciLow: number\n ciHigh: number\n /** BH-adjusted q-value vs comparator, or null when unavailable. */\n qValue: number | null\n /** Paired Cohen's dz vs comparator, or null when the paired variance is zero. */\n cohensD: number | null\n /** Matched observations used for paired comparison, or null on the comparator row. */\n pairedN: number | null\n /** Candidate observations without a comparator match. */\n unpairedCandidateN: number | null\n /** Comparator observations without a candidate match. */\n unpairedComparatorN: number | null\n}\n\nexport interface SummaryTable {\n rows: SummaryTableRow[]\n comparator: string | null\n split: 'search' | 'holdout'\n /** Pre-rendered markdown — drop into a paper or PR. */\n markdown: string\n}\n\n/**\n * Table 1 helper. Buckets runs by `candidateId`, computes mean +\n * bootstrap CI on the chosen split, and (when a comparator is given)\n * BH-adjusted Wilcoxon p + paired Cohen's dz versus that comparator.\n */\nexport function summaryTable(runs: RunRecord[], opts: SummaryTableOptions = {}): SummaryTable {\n const split = opts.split ?? 'holdout'\n const confidence = opts.confidence ?? 0.95\n const fdr = opts.fdr ?? 0.05\n const comparator = opts.comparator ?? null\n\n const byCandidate = new Map<string, { runs: RunRecord[]; scores: number[] }>()\n for (const r of runs) {\n if (r.splitTag !== split) continue\n // Report raw, exact-split scores so gaming remains visible.\n const v = observedSplitScore(r, split)\n if (typeof v !== 'number' || !Number.isFinite(v)) continue\n const bucket = byCandidate.get(r.candidateId) ?? { runs: [], scores: [] }\n bucket.runs.push(r)\n bucket.scores.push(v)\n byCandidate.set(r.candidateId, bucket)\n }\n\n const compRuns = comparator ? byCandidate.get(comparator) : undefined\n\n const rows: SummaryTableRow[] = [...byCandidate.keys()].sort().map((id) => {\n const bucket = byCandidate.get(id)!\n const ci = confidenceInterval(bucket.scores, confidence)\n const paired =\n comparator && compRuns && id !== comparator\n ? pairScoresByKey(bucket.runs, compRuns.runs, split)\n : null\n return {\n candidateId: id,\n n: bucket.scores.length,\n mean: ci.mean,\n ciLow: ci.lower,\n ciHigh: ci.upper,\n qValue:\n paired && paired.before.length >= 6\n ? wilcoxonSignedRank(paired.before, paired.after).p\n : null,\n cohensD: paired ? pairedCohensDz(paired.before, paired.after) : null,\n pairedN: paired?.before.length ?? null,\n unpairedCandidateN: paired?.unpairedCandidateN ?? null,\n unpairedComparatorN: paired?.unpairedComparatorN ?? null,\n }\n })\n if (comparator) {\n const comparisons = rows.filter(\n (row) => row.candidateId !== comparator && row.qValue !== null && Number.isFinite(row.qValue),\n )\n if (comparisons.length > 0) {\n const { qValues } = benjaminiHochberg(\n comparisons.map((row) => row.qValue!),\n fdr,\n )\n comparisons.forEach((row, index) => {\n row.qValue = qValues[index]!\n })\n }\n }\n\n const markdown = renderSummaryTableMarkdown(rows, comparator, split)\n return { rows, comparator, split, markdown }\n}\n\nfunction renderSummaryTableMarkdown(\n rows: SummaryTableRow[],\n comparator: string | null,\n split: 'search' | 'holdout',\n): string {\n return [\n `Summary Table — ${split} split${comparator ? ` (vs ${comparator})` : ''}`,\n '',\n \"| Candidate | N | Pairs | Unpaired | Mean | 95% CI | q (BH) | Cohen's dz |\",\n '|---|---:|---:|---:|---:|---|---:|---:|',\n ...rows.map(\n (r) =>\n `| ${[\n r.candidateId,\n r.n,\n r.pairedN ?? '—',\n r.unpairedCandidateN === null || r.unpairedComparatorN === null\n ? '—'\n : `${r.unpairedCandidateN}/${r.unpairedComparatorN}`,\n fmt(r.mean),\n `[${fmt(r.ciLow)}, ${fmt(r.ciHigh)}]`,\n r.qValue?.toFixed(4) ?? '—',\n r.cohensD?.toFixed(3) ?? '—',\n ].join(' | ')} |`,\n ),\n ].join('\\n')\n}\n\n// ── paretoChart ─────────────────────────────────────────────────────\n\nexport interface ParetoPoint {\n candidateId: string\n /** Mean USD cost per run on the chosen split. */\n cost: number\n /** Mean score on the chosen split. */\n quality: number\n /** Number of runs that informed this point. */\n n: number\n /** Whether this candidate is on the Pareto frontier — high\n * quality, low cost, no dominator. */\n onFrontier: boolean\n /** Optional gate verdict for this candidate, if a `HeldOutGateDecision`\n * for it was passed in. */\n gate?: 'promote' | 'reject'\n}\n\nexport interface ParetoFigureSpec {\n kind: 'pareto-cost-quality'\n split: 'search' | 'holdout'\n points: ParetoPoint[]\n axes: { x: 'costUsd'; y: 'score' }\n}\n\n/**\n * Cost vs quality scatter spec. `gateDecisions` is keyed by\n * candidate id; if present, every point picks up the gate verdict\n * for overlay.\n */\nexport function paretoChart(\n runs: RunRecord[],\n opts: {\n split?: 'search' | 'holdout'\n gateDecisions?: Record<string, HeldOutGateDecision>\n } = {},\n): ParetoFigureSpec {\n const split = opts.split ?? 'holdout'\n\n const buckets = new Map<string, { cost: number[]; quality: number[] }>()\n for (const r of runs) {\n if (r.splitTag !== split) continue\n const v = observedSplitScore(r, split)\n if (typeof v !== 'number' || !Number.isFinite(v)) continue\n if (r.costUsd === null) continue\n const bucket = buckets.get(r.candidateId) ?? { cost: [], quality: [] }\n bucket.cost.push(r.costUsd)\n bucket.quality.push(v)\n buckets.set(r.candidateId, bucket)\n }\n\n const points: ParetoPoint[] = [...buckets].map(([candidateId, bucket]) => ({\n candidateId,\n cost: avg(bucket.cost),\n quality: avg(bucket.quality),\n n: bucket.cost.length,\n onFrontier: false,\n gate: opts.gateDecisions?.[candidateId]\n ? gateLabel(opts.gateDecisions[candidateId]!)\n : undefined,\n }))\n\n const { frontier } = paretoFrontier(points, [\n { name: 'quality', direction: 'maximize', value: (p) => p.quality },\n { name: 'cost', direction: 'minimize', value: (p) => p.cost },\n ])\n for (const p of frontier) p.onFrontier = true\n\n return {\n kind: 'pareto-cost-quality',\n split,\n axes: { x: 'costUsd', y: 'score' },\n points,\n }\n}\n\nexport function gateLabel(d: HeldOutGateDecision): ParetoPoint['gate'] {\n return d.promote ? 'promote' : 'reject'\n}\n\n// ── gainHistogram ───────────────────────────────────────────\n\nexport interface GainDistributionBin {\n /** Inclusive lower edge. */\n lo: number\n /** Exclusive upper edge (or inclusive if it's the last bin). */\n hi: number\n /** Number of pairs whose delta lands in this bin. */\n count: number\n}\n\nexport interface GainDistributionFigureSpec {\n kind: 'gain-distribution'\n candidateId: string\n comparator: string\n split: 'search' | 'holdout'\n /** Number of pairs used. */\n n: number\n /** Candidate rows without a comparator match. */\n unpairedCandidateN: number\n /** Comparator rows without a candidate match. */\n unpairedComparatorN: number\n bins: GainDistributionBin[]\n median: number | null\n ci: { low: number; high: number } | null\n}\n\nexport interface GainDistributionOptions {\n /** Number of histogram bins. Default 11 (so the centre is exact at 0). */\n bins?: number\n /** Which split to use. Default 'holdout'. */\n split?: 'search' | 'holdout'\n /** Confidence level for the CI. Default 0.95. */\n confidence?: number\n /** Bootstrap resamples. Default 2000. */\n resamples?: number\n /** Deterministic seed. */\n seed?: number\n}\n\n/**\n * Held-out improvement distribution: per-pair delta (candidate −\n * comparator), histogrammed. Includes the bootstrap CI on the median\n * delta — same primitive the promotion gate uses.\n */\nexport function gainHistogram(\n runs: RunRecord[],\n candidateId: string,\n comparator: string,\n opts: GainDistributionOptions = {},\n): GainDistributionFigureSpec {\n const split = opts.split ?? 'holdout'\n const binCount = opts.bins ?? 11\n if (binCount < 1) throw new Error('gainHistogram: bins must be ≥ 1')\n\n const candidate = runs.filter((r) => r.candidateId === candidateId && r.splitTag === split)\n const baseline = runs.filter((r) => r.candidateId === comparator && r.splitTag === split)\n // pairScoresByKey returns before=baseline-score, after=candidate-score\n // for each canonical work-identity pair where both sides recorded a\n // valid score on this split. delta = after - before = candidate - baseline.\n const { before, after, unpairedCandidateN, unpairedComparatorN } = pairScoresByKey(\n candidate,\n baseline,\n split,\n )\n const n = before.length\n\n const deltas = before.map((b, i) => after[i]! - b)\n const sortedDeltas = [...deltas].sort((a, b) => a - b)\n const median = n === 0 ? null : interpolatedQuantile(sortedDeltas, 0.5)\n\n // Symmetric bins around the wider of (|min|, |max|) so the chart\n // visually centres on zero without dropping outliers.\n const bound = Math.max(\n Math.abs(sortedDeltas[0]!),\n Math.abs(sortedDeltas[sortedDeltas.length - 1]!),\n 1e-6,\n )\n const lo = -bound\n const width = (bound - lo) / binCount\n const bins: GainDistributionBin[] = []\n for (let i = 0; n > 0 && i < binCount; i++) {\n bins.push({ lo: lo + i * width, hi: lo + (i + 1) * width, count: 0 })\n }\n for (const d of deltas) {\n let idx = Math.floor((d - lo) / width)\n if (idx < 0) idx = 0\n if (idx >= binCount) idx = binCount - 1\n bins[idx]!.count += 1\n }\n\n const ci =\n n === 0\n ? null\n : pairedBootstrap(before, after, {\n confidence: opts.confidence ?? 0.95,\n resamples: opts.resamples ?? 2000,\n statistic: 'median',\n seed: opts.seed,\n })\n\n return {\n kind: 'gain-distribution',\n candidateId,\n comparator,\n split,\n n,\n unpairedCandidateN,\n unpairedComparatorN,\n bins,\n median,\n ci: ci === null ? null : { low: ci.low, high: ci.high },\n }\n}\n","/** Assemble research report evidence, guidance, figures, and rendered documents. */\n\nimport type { HeldOutGateDecision } from './held-out-gate'\nimport type { FailureClusterReport } from './pipelines/failure-cluster'\nimport { hashJson } from './pre-registration'\nimport { renderResearchHtml } from './reporting-html'\nimport {\n buildExecutiveSummary,\n buildMethodology,\n buildRecommendation,\n classifyCandidate,\n decisionWeight,\n RESEARCH_REPORT_HARD_PAIR_FLOOR,\n} from './research-report-analysis'\nimport { renderResearchMarkdown } from './research-report-render'\nimport type { RunRecord } from './run-record'\nimport { pairedPosterior } from './summary-report-evidence'\nimport {\n type GainDistributionFigureSpec,\n gainHistogram,\n gateLabel,\n type ParetoFigureSpec,\n type ParetoPoint,\n paretoChart,\n type SummaryTable,\n summaryTable,\n} from './summary-report-figures'\n\nexport { RESEARCH_REPORT_HARD_PAIR_FLOOR } from './research-report-analysis'\n\nexport type ResearchReportDecision =\n | 'promote'\n | 'hold'\n | 'reject'\n | 'equivalent'\n | 'needs_more_data'\n\nexport interface ResearchReportOptions {\n /** Human-readable report title. */\n title?: string\n /** Comparator candidate id. Required for statistical decision guidance. */\n comparator?: string\n /** Which split to use for the primary decision. Default 'holdout'. */\n split?: 'search' | 'holdout'\n /** Confidence level used by lower-level report helpers. Default 0.95. */\n confidence?: number\n /** FDR threshold for q-values. Default 0.05. */\n fdr?: number\n /**\n * Soft floor on paired observations before issuing a directional\n * promote / reject. Below this we report `needs_more_data` and surface the\n * minimum detectable effect at the current N. Default 20 — chosen so the\n * Wilcoxon signed-rank approximation is reasonable and so the paired\n * bootstrap CI has non-degenerate coverage. Hard floor is enforced at\n * `RESEARCH_REPORT_HARD_PAIR_FLOOR` (6) regardless of this value.\n */\n minPairs?: number\n /**\n * Region of Practical Equivalence on the paired delta. When a candidate's\n * paired-delta CI is fully contained in `[low, high]`, the decision is\n * `equivalent` rather than `hold`. Sourced from the domain owner — there is\n * no statistically-defensible default.\n */\n rope?: { low: number; high: number }\n /**\n * Power for the minimum detectable effect (MDE) reported on each candidate.\n * Default 0.8.\n */\n mdePower?: number\n /**\n * Two-sided alpha for the MDE. Default matches `fdr` so the reported MDE\n * lines up with the test the report actually runs.\n */\n mdeAlpha?: number\n /** Optional held-out gate decisions keyed by candidate id. */\n gateDecisions?: Record<string, HeldOutGateDecision>\n /** Optional failure clusters from failureClusterView. */\n failureClusters?: FailureClusterReport\n /** Build gain histograms for these candidates. Defaults to all non-comparator candidates. */\n candidateIds?: string[]\n /** Deterministic bootstrap seed passed to gainHistogram and the posterior helper. */\n seed?: number\n /** Report timestamp. Defaults to current time. */\n generatedAt?: string\n /**\n * Hash of a preregistered protocol (e.g. `signManifest({...}).contentHash`).\n * Embedded verbatim in the report so the analysis can be cited as the\n * preregistered one rather than a post-hoc fishing expedition.\n */\n preregistrationHash?: string\n}\n\nexport interface ResearchReportRecommendation {\n decision: ResearchReportDecision\n candidateId: string | null\n rationale: string[]\n risks: string[]\n nextActions: string[]\n}\n\nexport interface ResearchReportCandidate {\n candidateId: string\n n: number\n mean: number\n ciLow: number\n ciHigh: number\n qValue: number | null\n cohensD: number | null\n meanDeltaVsComparator: number | null\n pairedN: number\n medianGain: number | null\n meanGain: number | null\n gainCi: { low: number; high: number } | null\n /**\n * Bayesian-bootstrap posterior summaries on the paired mean delta.\n * Dirichlet(1, ..., 1) weights represent uncertainty over the empirical\n * distribution of matched deltas.\n */\n prGreaterThanZero: number | null\n prInRope: number | null\n /**\n * Minimum detectable effect (in score units) at the candidate's paired N,\n * the configured power, and the configured alpha. Standardised by the\n * observed paired-delta SD and inverted via `requiredSampleSize`. Reported\n * for every candidate so a `needs_more_data` verdict is actionable.\n */\n mde: number | null\n onParetoFrontier: boolean\n gate?: ParetoPoint['gate']\n decision: ResearchReportDecision\n decisionReason: string\n}\n\nexport interface ResearchReportMethodology {\n /**\n * Plain-language assumptions the report depends on. Read these first when\n * deciding whether the verdict is load-bearing for a launch decision.\n */\n assumptions: string[]\n /** Tests and estimators the verdict was computed from. */\n methods: string[]\n /** Alternatives the author considered and why this report didn't take them. */\n alternatives: string[]\n /** Failure modes — when this report should NOT drive a decision. */\n whenNotToApply: string[]\n /** Citations for the methodological choices above. */\n citations: string[]\n}\n\nexport interface ResearchReport {\n kind: 'agent-eval-research-report'\n title: string\n generatedAt: string\n split: 'search' | 'holdout'\n comparator: string | null\n /**\n * SHA-256 over the canonicalised set of `(runId, candidateId, split)` triples\n * the report was computed from, plus the comparator and split. Stable across\n * key insertion order; recomputable by the reader to verify provenance.\n */\n runFingerprint: string\n preregistrationHash: string | null\n rope: { low: number; high: number } | null\n executiveSummary: string[]\n recommendation: ResearchReportRecommendation\n candidates: ResearchReportCandidate[]\n summary: SummaryTable\n charts: {\n pareto: ParetoFigureSpec\n gains: GainDistributionFigureSpec[]\n }\n methodology: ResearchReportMethodology\n failureClusters?: FailureClusterReport\n markdown: string\n html: string\n}\n\n/**\n * Executive research report for CPO / AI-lead / launch-review consumption.\n *\n * Composes:\n * - `summaryTable` marginal stats with BH-FDR-adjusted q-values\n * - `paretoChart` cost-vs-quality frontier with gate overlay\n * - `gainHistogram` per-candidate paired-delta distribution\n * - paired posterior (this file): bootstrap CI on median, Bayesian-bootstrap Pr(Δ>0),\n * Pr(Δ∈ROPE), MDE at the configured power\n *\n * Decisions are made on paired evidence — never on marginal means alone —\n * and respect any held-out gate decision the caller passes through. The\n * report embeds a SHA-256 fingerprint of the input run set and, optionally,\n * the hash of a preregistered protocol so a downstream reader can verify\n * provenance and that the analysis was the preregistered one.\n *\n * Async because the fingerprint uses Web Crypto via `hashJson`; deterministic\n * for any fixed `runs`, `seed`, and ROPE.\n */\nexport async function researchReport(\n runs: RunRecord[],\n opts: ResearchReportOptions = {},\n): Promise<ResearchReport> {\n const split = opts.split ?? 'holdout'\n const comparator = opts.comparator ?? null\n const confidence = opts.confidence ?? 0.95\n const fdr = opts.fdr ?? 0.05\n const minPairs = Math.max(opts.minPairs ?? 20, RESEARCH_REPORT_HARD_PAIR_FLOOR)\n const rope = opts.rope ?? null\n const mdePower = opts.mdePower ?? 0.8\n const mdeAlpha = opts.mdeAlpha ?? fdr\n const title = opts.title ?? 'Agent Evaluation Research Report'\n const generatedAt = opts.generatedAt ?? new Date().toISOString()\n const preregistrationHash = opts.preregistrationHash ?? null\n\n if (rope && !(Number.isFinite(rope.low) && Number.isFinite(rope.high) && rope.low <= rope.high)) {\n throw new Error(\n `researchReport: rope must satisfy low ≤ high with finite bounds, got ${JSON.stringify(rope)}`,\n )\n }\n\n const summary = summaryTable(runs, {\n comparator: comparator ?? undefined,\n split,\n confidence,\n fdr,\n })\n const pareto = paretoChart(runs, { split, gateDecisions: opts.gateDecisions })\n const candidateIds =\n opts.candidateIds ?? summary.rows.map((r) => r.candidateId).filter((id) => id !== comparator)\n const gains = comparator\n ? candidateIds.map((id) =>\n gainHistogram(runs, id, comparator, {\n split,\n confidence,\n seed: opts.seed,\n }),\n )\n : []\n\n const gainByCandidate = new Map(gains.map((g) => [g.candidateId, g]))\n const paretoByCandidate = new Map(pareto.points.map((p) => [p.candidateId, p]))\n const posteriorByCandidate = new Map<string, ReturnType<typeof pairedPosterior>>()\n if (comparator) {\n for (const id of candidateIds) {\n posteriorByCandidate.set(\n id,\n pairedPosterior(runs, id, comparator, {\n split,\n confidence,\n seed: opts.seed,\n rope,\n mdePower,\n mdeAlpha,\n }),\n )\n }\n }\n\n const candidates = summary.rows\n .map((row) => {\n const gain = gainByCandidate.get(row.candidateId)\n const point = paretoByCandidate.get(row.candidateId)\n const posterior = posteriorByCandidate.get(row.candidateId) ?? null\n const gateDecision = opts.gateDecisions?.[row.candidateId]\n const classified = classifyCandidate(row, {\n comparator,\n posterior,\n point,\n gateDecision,\n split,\n fdr,\n minPairs,\n rope,\n })\n return {\n candidateId: row.candidateId,\n n: row.n,\n mean: row.mean,\n ciLow: row.ciLow,\n ciHigh: row.ciHigh,\n qValue: row.qValue,\n cohensD: row.cohensD,\n meanDeltaVsComparator: posterior ? posterior.meanDelta : null,\n pairedN: posterior?.n ?? gain?.n ?? 0,\n medianGain: posterior ? posterior.medianDelta : gain ? gain.median : null,\n meanGain: posterior ? posterior.meanDelta : null,\n gainCi: posterior ? posterior.ci : gain ? gain.ci : null,\n prGreaterThanZero: posterior ? posterior.prGreaterThanZero : null,\n prInRope: posterior ? posterior.prInRope : null,\n mde: posterior ? posterior.mde : null,\n onParetoFrontier: point?.onFrontier ?? false,\n gate: gateDecision ? gateLabel(gateDecision) : undefined,\n decision: classified.decision,\n decisionReason: classified.reason,\n } satisfies ResearchReportCandidate\n })\n .sort((a, b) => {\n const decisionRank = decisionWeight(b.decision) - decisionWeight(a.decision)\n if (decisionRank !== 0) return decisionRank\n return b.mean - a.mean\n })\n\n const recommendation = buildRecommendation(candidates, {\n comparator,\n failureClusters: opts.failureClusters,\n rope,\n minPairs,\n preregistrationHash,\n })\n const executiveSummary = buildExecutiveSummary(candidates, recommendation, {\n comparator,\n split,\n failureClusters: opts.failureClusters,\n preregistrationHash,\n })\n const methodology = buildMethodology({\n split,\n comparator,\n fdr,\n minPairs,\n rope,\n confidence,\n mdePower,\n mdeAlpha,\n })\n\n const runFingerprint = await hashJson({\n triples: runs\n .filter((r) => r.splitTag === split)\n .map((r) => ({ runId: r.runId, candidateId: r.candidateId, splitTag: r.splitTag }))\n .sort((a, b) => a.runId.localeCompare(b.runId)),\n comparator,\n split,\n })\n\n const markdown = renderResearchMarkdown({\n title,\n generatedAt,\n split,\n comparator,\n rope,\n runFingerprint,\n preregistrationHash,\n executiveSummary,\n recommendation,\n candidates,\n summary,\n pareto,\n gains,\n methodology,\n failureClusters: opts.failureClusters,\n })\n const html = renderResearchHtml(markdown, title)\n\n return {\n kind: 'agent-eval-research-report',\n title,\n generatedAt,\n split,\n comparator,\n runFingerprint,\n preregistrationHash,\n rope,\n executiveSummary,\n recommendation,\n candidates,\n summary,\n charts: { pareto, gains },\n methodology,\n failureClusters: opts.failureCl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AAE,OAAO,EAAE;GAAO,aAAa,EAAE;GAAa,UAAU,EAAE;EAAS,EAAE,CAAC,CAClF,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC;EAChD;EACA;CACF,CAAC;CAED,MAAM,WAAW,uBAAuB;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB,KAAK;CACxB,CAAC;CACD,MAAM,OAAO,mBAAmB,UAAU,KAAK;CAE/C,OAAO;EACL,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;GAAE;GAAQ;EAAM;EACxB;EACA,iBAAiB,KAAK;EACtB;EACA;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"summary-report-figures-CJHygLgw.d.ts","names":[],"sources":["../src/summary-report-figures.ts"],"mappings":";UAmBiB;;;EAGf;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf,MAAM;EACN;EACA;;EAEA;;;;;;;iBAQc,aAAa,MAAM,aAAa,OAAM,sBAA2B;UA4FhE;EACf;;EAEA;;EAEA;;EAEA;;;EAGA;;;EAGA;;UAGe;EACf;EACA;EACA,QAAQ;EACR;IAAQ;IAAc;;;UAiEP;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA,MAAM;EACN;EACA;IAAM;IAAa;;;UAGJ;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;iBAQc,cACd,MAAM,aACN,qBACA,oBACA,OAAM,0BACL"}
1
+ {"version":3,"file":"summary-report-figures-CJHygLgw.d.ts","names":[],"sources":["../src/summary-report-figures.ts"],"mappings":";UAoBiB;;;EAGf;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf,MAAM;EACN;EACA;;EAEA;;;;;;;iBAQc,aAAa,MAAM,aAAa,OAAM,sBAA2B;UA4FhE;EACf;;EAEA;;EAEA;;EAEA;;;EAGA;;;EAGA;;UAGe;EACf;EACA;EACA,QAAQ;EACR;IAAQ;IAAc;;;UA4DP;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA,MAAM;EACN;EACA;IAAM;IAAa;;;UAGJ;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;iBAQc,cACd,MAAM,aACN,qBACA,oBACA,OAAM,0BACL"}
@@ -1,5 +1,5 @@
1
1
  import { b as RolloutSplit, h as RolloutLine } from "../schema-BfSoJjD-.js";
2
- import { A as WorkerTurnCoverage, C as SupervisorRunTreeGapCode, D as WallDistribution, E as Unavailable, M as showMeasured, N as unavailable, O as WorkerLogSource, S as SupervisorRunTreeGap, T as TerminalFailure, _ as SupervisorRunReader, a as OrchestrationMetrics, b as SupervisorRunSources, c as PerWorkerRow, d as RollupCellRow, f as SourceLimits, g as SupervisorRunNodeRole, h as SteerBreakdown, i as NamedResourceReceipt, j as isUnavailable, k as WorkerNativeSession, l as ResourceSpendRecord, m as SpendMeasurements, n as EconomicsMetrics, o as OutcomeMetrics, p as SpendMeasurement, r as Measured, s as PatchStats, t as DecisionMetrics, u as RoleSpend, v as SupervisorRunReport, w as SupervisorStatusSource, x as SupervisorRunTree, y as SupervisorRunRollup } from "../types-BLv2Ngla.js";
2
+ import { A as WorkerNativeSession, C as SupervisorRunTreeGap, D as Unavailable, E as TerminalFailure, M as isUnavailable, N as showMeasured, O as WallDistribution, P as unavailable, S as SupervisorRunTree, T as SupervisorStatusSource, _ as SupervisorRunNodeRole, a as NamedResourceReceipt, b as SupervisorRunRollup, c as PatchStats, d as RoleSpend, f as RollupCellRow, g as SteerBreakdown, h as SpendMeasurements, i as Measured, j as WorkerTurnCoverage, k as WorkerLogSource, l as PerWorkerRow, m as SpendMeasurement, n as EconomicsMetrics, o as OrchestrationMetrics, p as SourceLimits, r as GraphStopSource, s as OutcomeMetrics, t as DecisionMetrics, u as ResourceSpendRecord, v as SupervisorRunReader, w as SupervisorRunTreeGapCode, x as SupervisorRunSources, y as SupervisorRunReport } from "../types-xVtEOBhO.js";
3
3
  import { HarnessSession } from "@tangle-network/harness-sessions";
4
4
  /**
5
5
  * Analyze already-read supervisor-run bytes. Pure and synchronous: same bytes
@@ -520,6 +520,11 @@ interface TerminalRecordInput {
520
520
  * none; `undefined` when the store has no such document type.
521
521
  */
522
522
  readonly failure: Record<string, unknown> | null | undefined;
523
+ /**
524
+ * The stopping node's output, read beside a `stopped` no-winner result;
525
+ * undefined when the source has none.
526
+ */
527
+ readonly graphStop?: GraphStopSource;
523
528
  }
524
529
  interface TerminalRecord {
525
530
  readonly supStatus: Measured<string>;
@@ -536,7 +541,12 @@ interface TerminalRecord {
536
541
  * other recorded terminal state; null when no terminal record exists.
537
542
  */
538
543
  readonly completed: boolean | null;
544
+ /**
545
+ * Why a `stopped` no-winner with no error reports no graph-stop failure:
546
+ * the stopping node, its output or its `reason` is absent. Unset otherwise.
547
+ */
548
+ readonly graphStopGap?: string;
539
549
  }
540
550
  export declare function readTerminalRecord(input: TerminalRecordInput): TerminalRecord;
541
- export { type ClaudeCodeReaderOptions, type CloseRow, type DecisionMetrics, type EconomicsMetrics, type Measured, type NamedResourceReceipt, type OrchestrationMetrics, type OutcomeMetrics, type PatchStats, type PerWorkerRow, type ResourceSpendRecord, type RoleSpend, type RollupCellRow, type RunVerdict, type RuntimeNativeTranscriptRequest, type RuntimeReaderOptions, type RuntimeRunRolloutOptions, type RuntimeRunRollouts, type SourceLimits, type SpawnRow, type SpendMeasurement, type SpendMeasurements, type SteerAcknowledgementFact, type SteerBreakdown, type SteerRequestFact, type SupervisorJournalDialect, type SupervisorRolloutOptions, type SupervisorRunCommandIo, type SupervisorRunIntegrityEvidence, type SupervisorRunIntegrityIssue, type SupervisorRunIntegrityIssueCode, type SupervisorRunIntegrityOptions, type SupervisorRunIntegrityReport, type SupervisorRunIntegritySeverity, type SupervisorRunNodeRole, type SupervisorRunReader, type SupervisorRunReport, type SupervisorRunReportFormat, type SupervisorRunRollup, type SupervisorRunSourceOnlyCheckCode, type SupervisorRunSources, type SupervisorRunTree, type SupervisorRunTreeGap, type SupervisorRunTreeGapCode, type SupervisorStatusSource, type SupervisorTreeFacts, type TerminalFailure, type TerminalRecord, type TerminalRecordInput, type Unavailable, type WallDistribution, type WorkerLogFacts, type WorkerLogSource, type WorkerNativeSession, type WorkerTurnCoverage, type WriteSupervisorRunOptions, isUnavailable, showMeasured, unavailable };
551
+ export { type ClaudeCodeReaderOptions, type CloseRow, type DecisionMetrics, type EconomicsMetrics, type GraphStopSource, type Measured, type NamedResourceReceipt, type OrchestrationMetrics, type OutcomeMetrics, type PatchStats, type PerWorkerRow, type ResourceSpendRecord, type RoleSpend, type RollupCellRow, type RunVerdict, type RuntimeNativeTranscriptRequest, type RuntimeReaderOptions, type RuntimeRunRolloutOptions, type RuntimeRunRollouts, type SourceLimits, type SpawnRow, type SpendMeasurement, type SpendMeasurements, type SteerAcknowledgementFact, type SteerBreakdown, type SteerRequestFact, type SupervisorJournalDialect, type SupervisorRolloutOptions, type SupervisorRunCommandIo, type SupervisorRunIntegrityEvidence, type SupervisorRunIntegrityIssue, type SupervisorRunIntegrityIssueCode, type SupervisorRunIntegrityOptions, type SupervisorRunIntegrityReport, type SupervisorRunIntegritySeverity, type SupervisorRunNodeRole, type SupervisorRunReader, type SupervisorRunReport, type SupervisorRunReportFormat, type SupervisorRunRollup, type SupervisorRunSourceOnlyCheckCode, type SupervisorRunSources, type SupervisorRunTree, type SupervisorRunTreeGap, type SupervisorRunTreeGapCode, type SupervisorStatusSource, type SupervisorTreeFacts, type TerminalFailure, type TerminalRecord, type TerminalRecordInput, type Unavailable, type WallDistribution, type WorkerLogFacts, type WorkerLogSource, type WorkerNativeSession, type WorkerTurnCoverage, type WriteSupervisorRunOptions, isUnavailable, showMeasured, unavailable };
542
552
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/supervisor-run/analyze.ts","../../src/supervisor-run/claude-code-reader.ts","../../src/supervisor-run/integrity-types.ts","../../src/supervisor-run/integrity.ts","../../src/supervisor-run/patch-stats.ts","../../src/supervisor-run/reader.ts","../../src/supervisor-run/render.ts","../../src/supervisor-run/report-command.ts","../../src/supervisor-run/source-facts.ts","../../src/supervisor-run/rollout-nodes.ts","../../src/supervisor-run/rollup.ts","../../src/supervisor-run/coordination-reader.ts","../../src/supervisor-run/runtime-reader.ts","../../src/supervisor-run/runtime-rollouts.ts","../../src/supervisor-run/terminal-record.ts"],"mappings":";;;;;;;wBAuCgB,4BACd,KAAK,sBACL,qBACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCiBc;;WAEN;;;;;WAKA;WACA;WACA;WACA;WACA;WACA;WACA;;qBCtEE;KAED;KAEA;KAKA;UAqCK;WACN;WACA;;UAGM;WACN,MAAM;WACN;WACA,UAAU;WACV;WACA;WACA;WACA,mBAAmB;WACnB;WACA,WAAW,SAAS;;UAGd;WACN,eAAe;WACf;WACA;WACA,MAAM;WACN,iBAAiB;;UAGX;;WAEN;;;;;;wBC9BK,8BACd,OAAO,uBAAuB,mBAC9B,UAAS,gCACR;;wBC5Ca,WAAW,eAAe;;;;;;wBCgBpB,qBACpB,gBAAgB,sBAAsB,uBACrC,QAAQ;UAYM;;WAEN;;WAEA;;;;;;WAMA;;;;;;;;wBASW,sBAAsB,eAAe;;;;;wBChC3C,4BAA4B,GAAG;wBA8E/B,4BAA4B,GAAG;wBAsL/B,+BACd,QAAQ,qBACR;;;;;;;;;;;KCzQU;;UAQK;WACN,SAAS;WACT,SAAS;;UCKV;EACR;EACA;EACA;EACA;;EAEA;;;;;;EAMA;;UAGQ;WACC,YA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ACR;EACA,UAAU;;EAEV,wBACE,SAAS,mCACN;IACC;IAAiB;MAAS,mBAAmB;;;IAC7C;IAAkB;;;;UAoXT;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;;UAoBe;EACf;EACA,OAAO;EACP,MAAM;;EAEN,MAAM;;;wBAIc,uBACpB,gBACA,UAAS,2BACR,QAAQ;;qBC9cE;;qBAIA;UAEI;;WAEN,OAAO;;WAEP,QAAQ;;;;;WAKR,SAAS;;UAGH;WACN,WAAW;WACX,iBAAiB,SAAS;;;;;WAK1B,WAAW;;WAEX,SAAS,SAAS;;;;;WAKlB;;wBAmBK,mBAAmB,OAAO,sBAAsB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/supervisor-run/analyze.ts","../../src/supervisor-run/claude-code-reader.ts","../../src/supervisor-run/integrity-types.ts","../../src/supervisor-run/integrity.ts","../../src/supervisor-run/patch-stats.ts","../../src/supervisor-run/reader.ts","../../src/supervisor-run/render.ts","../../src/supervisor-run/report-command.ts","../../src/supervisor-run/source-facts.ts","../../src/supervisor-run/rollout-nodes.ts","../../src/supervisor-run/rollup.ts","../../src/supervisor-run/coordination-reader.ts","../../src/supervisor-run/runtime-reader.ts","../../src/supervisor-run/runtime-rollouts.ts","../../src/supervisor-run/terminal-record.ts"],"mappings":";;;;;;;wBAuCgB,4BACd,KAAK,sBACL,qBACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCiBc;;WAEN;;;;;WAKA;WACA;WACA;WACA;WACA;WACA;WACA;;qBCtEE;KAED;KAEA;KAKA;UAqCK;WACN;WACA;;UAGM;WACN,MAAM;WACN;WACA,UAAU;WACV;WACA;WACA;WACA,mBAAmB;WACnB;WACA,WAAW,SAAS;;UAGd;WACN,eAAe;WACf;WACA;WACA,MAAM;WACN,iBAAiB;;UAGX;;WAEN;;;;;;wBC9BK,8BACd,OAAO,uBAAuB,mBAC9B,UAAS,gC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ACA;;WAEA;;;;;;;wBAwBK,0BACd,KAAK,sBACL,OAAM,2BACL;;;;;;wBCzFa,qBAAqB,kBAAkB,wBAAwB;;;;;;;;cCElE,eAAgB,iBAAe;UC0uB3B;;WAEN,kBAAkB;;;;;;WAMlB;;;;;;;;;;;;;;;;;;;wBAqEW,yBACpB,gBACA,OAAM,uBACL,QAAQ;;;;;;wBA4FW,0BAA0B,iBAAiB;;UCr3BhD;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,QAAQ;EACR;EACA,UAAU;;EAEV,wBACE,SAAS,mCACN;IACC;IAAiB;MAAS,mBAAmB;;;IAC7C;IAAkB;;;;UAoXT;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;;UAoBe;EACf;EACA,OAAO;EACP,MAAM;;EAEN,MAAM;;;wBAIc,uBACpB,gBACA,UAAS,2BACR,QAAQ;;qBC7cE;;qBAIA;UAEI;;WAEN,OAAO;;WAEP,QAAQ;;;;;WAKR,SAAS;;;;;WAKT,YAAY;;UAGN;WACN,WAAW;WACX,iBAAiB,SAAS;;;;;WAK1B,WAAW;;WAEX,SAAS,SAAS;;;;;WAKlB;;;;;WAKA;;wBA+CK,mBAAmB,OAAO,sBAAsB"}
@@ -1,7 +1,7 @@
1
1
  import { t as roundDecimal } from "../round-decimal-ZmjAQPo1.js";
2
- import { n as SUPERVISOR_RUN_INTEGRITY_SCHEMA, t as analyzeSupervisorRunIntegrity } from "../integrity-BF0tJK21.js";
3
- import { _ as showMeasured, a as readTerminalRecord, g as isUnavailable, i as RUNTIME_FAILED_STATUS, m as SUPERVISOR_RUN_ROLLUP_SCHEMA, r as NO_TERMINAL_RECORD, t as supervisorRunRolloutLines, u as parseSupervisorTree, v as unavailable } from "../rollout-nodes-Vas6OSxX.js";
4
- import { a as analyzeSupervisorRun, c as readRuntimeSupervisorRun, i as renderSupervisorRunMarkdown, l as analyzeSupervisorRunSources, n as renderSupervisorRollupMarkdown, o as findSupervisorRunDirs, r as renderSupervisorRunHeadline, s as isRuntimeSupervisorRunDir, t as runtimeRunRolloutLines, u as parsePatch } from "../runtime-rollouts-drQynu3t.js";
2
+ import { n as SUPERVISOR_RUN_INTEGRITY_SCHEMA, t as analyzeSupervisorRunIntegrity } from "../integrity-DacT3oJ1.js";
3
+ import { _ as isUnavailable, a as RUNTIME_FAILED_STATUS, d as parseSupervisorTree, h as SUPERVISOR_RUN_ROLLUP_SCHEMA, i as NO_TERMINAL_RECORD, o as readTerminalRecord, t as supervisorRunRolloutLines, v as showMeasured, y as unavailable } from "../rollout-nodes-DFxKpIr2.js";
4
+ import { a as analyzeSupervisorRun, c as readRuntimeSupervisorRun, i as renderSupervisorRunMarkdown, l as analyzeSupervisorRunSources, n as renderSupervisorRollupMarkdown, o as findSupervisorRunDirs, r as renderSupervisorRunHeadline, s as isRuntimeSupervisorRunDir, t as runtimeRunRolloutLines, u as parsePatch } from "../runtime-rollouts-CE0MbQPq.js";
5
5
  // src/supervisor-run/rollup.ts
6
6
  /** Aggregate supervisor reports while retaining missing-measurement denominators. */
7
7
  /**
@@ -1,12 +1,13 @@
1
1
  import { f as CostReceiptInput, m as CustomTokenPricing } from "./cost-ledger-CSP-OfFe.js";
2
- import { D as FindingLayer, M as FindingScope, T as FindingCalibration, i as AnalystFinding, m as EvidenceRef, n as AnalystContext, t as Analyst } from "./types-fuOwNq1C.js";
2
+ import { D as FindingLayer, M as FindingScope, T as FindingCalibration, i as AnalystFinding, m as EvidenceRef, n as AnalystContext, t as Analyst } from "./types-B1W3v8dT.js";
3
3
  import { r as LedgerHash } from "./canonical-CGXS21f_.js";
4
- import { R as Scenario, S as JudgeConfig, w as JudgeScore } from "./types-BMSDkS8l.js";
5
- import { l as ExactCapableAnalyst } from "./exact-types-DjuabhUV.js";
6
- import { a as EvaluationResult, o as EvaluatorOptions, r as EvaluationContext } from "./evaluation-X5E22NQK.js";
4
+ import { R as Scenario, S as JudgeConfig, w as JudgeScore } from "./types-D5XtEH9Q.js";
5
+ import { l as calibrationFromPairs } from "./calibration-CrORXMWx.js";
6
+ import { l as ExactCapableAnalyst } from "./exact-types-BIHqYBYf.js";
7
+ import { a as EvaluationResult, o as EvaluatorOptions, r as EvaluationContext } from "./evaluation-CjZH6gW0.js";
7
8
  import { a as SystemOneJson, d as SystemOneRequest, g as SystemOneState, o as SystemOneQuestion, p as SystemOneResult, s as SystemOneQuestions } from "./systemone-protocol-C4t7JH4Y.js";
8
- import { Yt as calibrationFromPairs } from "./index-C6TG1LwA.js";
9
- import "./systemone-review-CXecR_m-.js";
9
+ import "./index-BSb3fJyZ.js";
10
+ import "./systemone-review-DpAXWDkL.js";
10
11
  import { z } from "zod";
11
12
  /**
12
13
  * One persisted row. We attach `run_id` on disk so a single file can
@@ -389,4 +390,4 @@ interface SystemOneAnalystOptions<I, Q extends SystemOneQuestions = SystemOneQue
389
390
  }
390
391
  declare function systemOneAnalyst<I, Q extends SystemOneQuestions = SystemOneQuestions>(options: SystemOneAnalystOptions<I, Q>): Analyst<I>;
391
392
  export { DecisionRoute as A, DiffPolicy as B, DecisionPointOptions as C, decisionPoint as D, DecisionQuestions as E, FindingsTimeStep as F, FindingsStore as H, LedgerFinding as I, diffFindingsOverTime as L, FindingsLedgerOutcome as M, FindingsLedgerRead as N, decisionQuestionDigest as O, FindingsQuery as P, openFindingsLedger as R, DecisionInvocation as S, DecisionQuestionPolicy as T, PersistedFinding as U, FindingsDiff as V, diffFindings as W, assessSystemOneDomainMatch as _, SystemOneOptions as a, DECISION_POINT_AUC_BAR as b, systemOneEvaluator as c, SystemOneDomainCoverage as d, SystemOneDomainEvidence as f, SystemOneDomainMatchThresholds as g, SystemOneDomainMatchReport as h, SystemOneJudgeOptions as i, FindingsLedger as j, DecisionRecord as k, systemOneJudge as l, SystemOneDomainMatchReason as m, SystemOneEvaluate as n, normalizedSystemOneScore as o, SystemOneDomainMatchInput as p, SystemOneEvaluatorOptions as r, systemOneAnalyst as s, SystemOneAnalystOptions as t, PreparedSystemOneDomainMatch as u, prepareSystemOneDomainMatch as v, DecisionPointResult as w, DECISION_POINT_MIN_KAPPA as x, systemOneChoiceMargin as y, queryFindings as z };
392
- //# sourceMappingURL=systemone-DzY-2Zri.d.ts.map
393
+ //# sourceMappingURL=systemone-4PadCE4C.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"systemone-4PadCE4C.d.ts","names":["_$__meta_eval0.calibrationFromPairs"],"sources":["../src/analyst/findings-store.ts","../src/analyst/findings-ledger.ts","../src/decision-point-records.ts","../src/decision-point.ts","../src/systemone-domain-match.ts","../src/systemone.ts"],"mappings":";;;;;;;;;;;;;;;;UA8BiB,yBAAyB;EACxC;;cAGW;WAGiB;mBAFX;EAEW,YAAA;EAItB,OAAO,eAAe,UAAU,mBAAmB;;EAQzD,WAAW;;EAkBX,QAAQ,gBAAgB;;UAOT;;EAEf,UAAU;;EAEV,aAAa;;EAEb,WAAW;;;;;EAKX,SAAS;IAAQ,UAAU;IAAkB,SAAS;;;UAGvC;;;;;;;;EAQf,cAAc,UAAU,gBAAgB,SAAS;;;;;;iBAkBnC,aACd,UAAU,oBACV,SAAS,oBACT,SAAQ,aACP;;UC7Dc,sBAAsB;;EAErC;EACA,WAAW;;UAGI;EACf,UAAU;;EAEV,YAAY;;KAGF,sBAAsB;EAC5B;EAAiB,OAAO;;EAExB;EACA;IAAS;IAA8C;;;UAG5C;WACN;EACT,OACE,eACA,mBAAmB,mBAClB,QAAQ;IAAwB;IAAkB;;EACrD,QAAQ,QAAQ,sBAAsB;;;iBAwFxB,mBAAmB;EAAW;IAAiB;UAkE9C;EACf,QAAQ,wBAAwB;EAChC;EACA;EACA;EACA;;;;;EAKA;;;iBAIc,cAAc,UAAU;EAAmB;GACzD,eAAe,KACf,OAAO,gBACN;UAoBc;EACf;EACA;EACA,MAAM;;;;;;;iBAQQ,qBACd,eAAe,iBACf,SAAQ,aACP;cC7PU,qBAAmB,EAAA,uBAAA,EAAA;;;;;;;GAI9B,EAAA,KAA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,GACP,SAAS,mBACN,mBAAmB,QAAQ;EAChC,UACE,QAAQ,iBAAiB,gBAAgB,KACzC,OAAO,GACP,SAAS,0BACC;;iBAGE,iBAAiB,GAAG,UAAU,qBAAqB,oBACjE,SAAS,wBAAwB,GAAG,KACnC,QAAQ"}
@@ -1,4 +1,4 @@
1
- import { i as AnalystFinding } from "./types-fuOwNq1C.js";
1
+ import { i as AnalystFinding } from "./types-B1W3v8dT.js";
2
2
  import { d as SystemOneRequest, p as SystemOneResult, s as SystemOneQuestions } from "./systemone-protocol-C4t7JH4Y.js";
3
3
  import { z } from "zod";
4
4
  declare const checkSchema: z.ZodObject<{
@@ -71,4 +71,4 @@ declare function systemOneReviewFindings<Q extends SystemOneQuestions>(review: P
71
71
  producedAt?: string;
72
72
  }): AnalystFinding[];
73
73
  export { SystemOneReviewReport as a, systemOneReviewFindings as c, SystemOneReviewInput as i, SystemOneReviewAssessment as n, assessSystemOneReview as o, SystemOneReviewCheck as r, prepareSystemOneReview as s, PreparedSystemOneReview as t };
74
- //# sourceMappingURL=systemone-review-CXecR_m-.d.ts.map
74
+ //# sourceMappingURL=systemone-review-DpAXWDkL.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"systemone-review-CXecR_m-.d.ts","names":[],"sources":["../src/systemone-review.ts"],"mappings":";;;cAcM,aAAW,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0Bb,EAAA,KAAA;;KAGQ,uBAAuB,EAAE,aAAa;UACjC,qBAAqB,UAAU,qBAAqB;EACnE;EACA,SAAS,iBAAiB;EAC1B,WAAW,WAAW,IAAI;;UAGX,wBAAwB,UAAU,qBAAqB,4BAC9D,qBAAqB;;EAE7B;;UAGe;EACf;EACA;EACA;;EAQA;EACA;EACA;EACA;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA,aAAa;;;iBAWC,6BAA6B,UAAU,oBACrD,OAAO,qBAAqB,KAC3B,wBAAwB;;iBAuCX,sBAAsB,UAAU,oBAC9C,QAAQ,wBAAwB,IAChC,eACC;;iBAyDa,wBAAwB,UAAU,oBAChD,QAAQ,wBAAwB,IAChC,QAAQ,gBAAgB,IACxB;EAAW;EAAmB;IAC7B"}
1
+ {"version":3,"file":"systemone-review-DpAXWDkL.d.ts","names":[],"sources":["../src/systemone-review.ts"],"mappings":";;;cAcM,aAAW,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0Bb,EAAA,KAAA;;KAGQ,uBAAuB,EAAE,aAAa;UACjC,qBAAqB,UAAU,qBAAqB;EACnE;EACA,SAAS,iBAAiB;EAC1B,WAAW,WAAW,IAAI;;UAGX,wBAAwB,UAAU,qBAAqB,4BAC9D,qBAAqB;;EAE7B;;UAGe;EACf;EACA;EACA;;EAQA;EACA;EACA;EACA;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA,aAAa;;;iBAWC,6BAA6B,UAAU,oBACrD,OAAO,qBAAqB,KAC3B,wBAAwB;;iBAuCX,sBAAsB,UAAU,oBAC9C,QAAQ,wBAAwB,IAChC,eACC;;iBAyDa,wBAAwB,UAAU,oBAChD,QAAQ,wBAAwB,IAChC,QAAQ,gBAAgB,IACxB;EAAW;EAAmB;IAC7B"}
@@ -1,5 +1,5 @@
1
- import { a as EvaluationResult, c as asJudge, i as EvaluationJudgeOptions, l as createEvaluator, n as EvaluationAnalystOptions, o as EvaluatorOptions, r as EvaluationContext, s as asAnalyst, t as CostedEvaluator } from "./evaluation-X5E22NQK.js";
1
+ import { a as EvaluationResult, c as asJudge, i as EvaluationJudgeOptions, l as createEvaluator, n as EvaluationAnalystOptions, o as EvaluatorOptions, r as EvaluationContext, s as asAnalyst, t as CostedEvaluator } from "./evaluation-CjZH6gW0.js";
2
2
  import { C as systemOneUsage, S as systemOneConfidence, _ as normalizeSystemOneResult, a as SystemOneJson, b as parseSystemOneRequest, c as SystemOneRecordedQuestion, d as SystemOneRequest, f as SystemOneResponseError, g as SystemOneState, h as SystemOneScoreCriteria, i as SystemOneDescription, l as SystemOneRecordedQuestions, m as SystemOneResultProfile, n as SystemOneAnswer, o as SystemOneQuestion, p as SystemOneResult, r as SystemOneAnswerFor, s as SystemOneQuestions, u as SystemOneRecordedRequest, x as parseSystemOneResult, y as parseSystemOneRecordedRequest } from "./systemone-protocol-C4t7JH4Y.js";
3
- import { A as DecisionRoute, C as DecisionPointOptions, D as decisionPoint, E as DecisionQuestions, O as decisionQuestionDigest, S as DecisionInvocation, T as DecisionQuestionPolicy, _ as assessSystemOneDomainMatch, a as SystemOneOptions, b as DECISION_POINT_AUC_BAR, c as systemOneEvaluator, d as SystemOneDomainCoverage, f as SystemOneDomainEvidence, g as SystemOneDomainMatchThresholds, h as SystemOneDomainMatchReport, i as SystemOneJudgeOptions, k as DecisionRecord, l as systemOneJudge, m as SystemOneDomainMatchReason, n as SystemOneEvaluate, o as normalizedSystemOneScore, p as SystemOneDomainMatchInput, r as SystemOneEvaluatorOptions, s as systemOneAnalyst, t as SystemOneAnalystOptions, u as PreparedSystemOneDomainMatch, v as prepareSystemOneDomainMatch, w as DecisionPointResult, x as DECISION_POINT_MIN_KAPPA, y as systemOneChoiceMargin } from "./systemone-DzY-2Zri.js";
4
- import { a as SystemOneReviewReport, c as systemOneReviewFindings, i as SystemOneReviewInput, n as SystemOneReviewAssessment, o as assessSystemOneReview, r as SystemOneReviewCheck, s as prepareSystemOneReview, t as PreparedSystemOneReview } from "./systemone-review-CXecR_m-.js";
3
+ import { A as DecisionRoute, C as DecisionPointOptions, D as decisionPoint, E as DecisionQuestions, O as decisionQuestionDigest, S as DecisionInvocation, T as DecisionQuestionPolicy, _ as assessSystemOneDomainMatch, a as SystemOneOptions, b as DECISION_POINT_AUC_BAR, c as systemOneEvaluator, d as SystemOneDomainCoverage, f as SystemOneDomainEvidence, g as SystemOneDomainMatchThresholds, h as SystemOneDomainMatchReport, i as SystemOneJudgeOptions, k as DecisionRecord, l as systemOneJudge, m as SystemOneDomainMatchReason, n as SystemOneEvaluate, o as normalizedSystemOneScore, p as SystemOneDomainMatchInput, r as SystemOneEvaluatorOptions, s as systemOneAnalyst, t as SystemOneAnalystOptions, u as PreparedSystemOneDomainMatch, v as prepareSystemOneDomainMatch, w as DecisionPointResult, x as DECISION_POINT_MIN_KAPPA, y as systemOneChoiceMargin } from "./systemone-4PadCE4C.js";
4
+ import { a as SystemOneReviewReport, c as systemOneReviewFindings, i as SystemOneReviewInput, n as SystemOneReviewAssessment, o as assessSystemOneReview, r as SystemOneReviewCheck, s as prepareSystemOneReview, t as PreparedSystemOneReview } from "./systemone-review-DpAXWDkL.js";
5
5
  export { CostedEvaluator, DECISION_POINT_AUC_BAR, DECISION_POINT_MIN_KAPPA, DecisionInvocation, DecisionPointOptions, DecisionPointResult, DecisionQuestionPolicy, DecisionQuestions, type DecisionRecord, type DecisionRoute, EvaluationAnalystOptions, EvaluationContext, EvaluationJudgeOptions, EvaluationResult, EvaluatorOptions, PreparedSystemOneDomainMatch, PreparedSystemOneReview, SystemOneAnalystOptions, type SystemOneAnswer, type SystemOneAnswerFor, type SystemOneDescription, SystemOneDomainCoverage, SystemOneDomainEvidence, SystemOneDomainMatchInput, SystemOneDomainMatchReason, SystemOneDomainMatchReport, SystemOneDomainMatchThresholds, SystemOneEvaluate, SystemOneEvaluatorOptions, type SystemOneJson, SystemOneJudgeOptions, SystemOneOptions, type SystemOneQuestion, type SystemOneQuestions, type SystemOneRecordedQuestion, type SystemOneRecordedQuestions, type SystemOneRecordedRequest, type SystemOneRequest, SystemOneResponseError, type SystemOneResult, type SystemOneResultProfile, SystemOneReviewAssessment, SystemOneReviewCheck, SystemOneReviewInput, SystemOneReviewReport, type SystemOneScoreCriteria, type SystemOneState, asAnalyst, asJudge, assessSystemOneDomainMatch, assessSystemOneReview, createEvaluator, decisionPoint, decisionQuestionDigest, normalizeSystemOneResult, normalizedSystemOneScore, parseSystemOneRecordedRequest, parseSystemOneRequest, parseSystemOneResult, prepareSystemOneDomainMatch, prepareSystemOneReview, systemOneAnalyst, systemOneChoiceMargin, systemOneConfidence, systemOneEvaluator, systemOneJudge, systemOneReviewFindings, systemOneUsage };
package/dist/systemone.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SystemOneResponseError, normalizeSystemOneResult, parseSystemOneRecordedRequest, parseSystemOneRequest, parseSystemOneResult, systemOneConfidence, systemOneUsage } from "./systemone-protocol.js";
2
- import { a as normalizedSystemOneScore, c as systemOneJudge, d as systemOneChoiceMargin, i as decisionQuestionDigest, l as assessSystemOneDomainMatch, n as DECISION_POINT_MIN_KAPPA, o as systemOneAnalyst, r as decisionPoint, s as systemOneEvaluator, t as DECISION_POINT_AUC_BAR, u as prepareSystemOneDomainMatch } from "./decision-point-C46p-p9v.js";
2
+ import { a as normalizedSystemOneScore, c as systemOneJudge, d as systemOneChoiceMargin, i as decisionQuestionDigest, l as assessSystemOneDomainMatch, n as DECISION_POINT_MIN_KAPPA, o as systemOneAnalyst, r as decisionPoint, s as systemOneEvaluator, t as DECISION_POINT_AUC_BAR, u as prepareSystemOneDomainMatch } from "./decision-point-CfqtnGop.js";
3
3
  import { n as asJudge, r as createEvaluator, t as asAnalyst } from "./evaluation-BAisv8ZR.js";
4
4
  import { n as prepareSystemOneReview, r as systemOneReviewFindings, t as assessSystemOneReview } from "./systemone-review-ir3Cbejl.js";
5
5
  export { DECISION_POINT_AUC_BAR, DECISION_POINT_MIN_KAPPA, SystemOneResponseError, asAnalyst, asJudge, assessSystemOneDomainMatch, assessSystemOneReview, createEvaluator, decisionPoint, decisionQuestionDigest, normalizeSystemOneResult, normalizedSystemOneScore, parseSystemOneRecordedRequest, parseSystemOneRequest, parseSystemOneResult, prepareSystemOneDomainMatch, prepareSystemOneReview, systemOneAnalyst, systemOneChoiceMargin, systemOneConfidence, systemOneEvaluator, systemOneJudge, systemOneReviewFindings, systemOneUsage };
@@ -1,4 +1,4 @@
1
- import { dt as TraceAnalysisStore, nt as TraceAnalysisToolDescriptor } from "./types-fuOwNq1C.js";
1
+ import { dt as TraceAnalysisStore, nt as TraceAnalysisToolDescriptor } from "./types-B1W3v8dT.js";
2
2
  /** Named tool sets. Kinds pass `tools: TRACE_TOOL_GROUPS.failureForensics` etc. */
3
3
  type TraceToolGroupName =
4
4
  /** All available tools. Use for open-ended discovery kinds. */
@@ -22,4 +22,4 @@ type TraceToolGroupName =
22
22
  */
23
23
  declare function buildTraceToolsForGroup(group: TraceToolGroupName, store: TraceAnalysisStore): TraceAnalysisToolDescriptor[];
24
24
  export { buildTraceToolsForGroup as n, TraceToolGroupName as t };
25
- //# sourceMappingURL=tool-groups-DF6OqhoG.d.ts.map
25
+ //# sourceMappingURL=tool-groups-SlnoQNyT.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-groups-SlnoQNyT.d.ts","names":[],"sources":["../src/analyst/tool-groups.ts"],"mappings":";;KAmBY;;;;;;;;;;;;;;;;;;;;iBAyDI,wBACd,OAAO,oBACP,OAAO,qBACN"}
@@ -0,0 +1,121 @@
1
+ import { r as BudgetSpec, x as ToolSpan } from "./schema-CkIvnmLU.js";
2
+ import { s as TraceStore } from "./store-CMs5wGXP.js";
3
+ import { a as llmSpans } from "./query-UD0B08Sb.js";
4
+ interface BaselineOptions {
5
+ /** Effect size threshold for meaningful delta (default 0.5 — medium effect). */
6
+ effectThreshold?: number;
7
+ /** p-value threshold for statistical significance (default 0.05). */
8
+ alpha?: number;
9
+ /** IQR/mean ratio above which samples are flagged unstable (default 0.30). */
10
+ unstableCvThreshold?: number;
11
+ }
12
+ type WelchTestStatus = 'ok' | 'insufficient-sample' | 'zero-variance';
13
+ /** Independent b − a effects; insufficient counts or zero variance have no confidence interval. */
14
+ interface WelchTestResultBase {
15
+ meanA: number;
16
+ meanB: number;
17
+ delta: number;
18
+ }
19
+ type WelchTestResult = (WelchTestResultBase & {
20
+ status: 'ok';
21
+ standardError: number;
22
+ t: number;
23
+ df: number;
24
+ p: number;
25
+ ci95: [number, number];
26
+ cohensD: number;
27
+ }) | (WelchTestResultBase & {
28
+ status: 'insufficient-sample' | 'zero-variance';
29
+ standardError: number;
30
+ t: number;
31
+ df: number;
32
+ p: number;
33
+ ci95: null;
34
+ cohensD: null;
35
+ });
36
+ /** Inter-quartile range; 0 when the sample has no spread. */
37
+ declare function iqr(xs: number[]): number;
38
+ /** Use Student-t at finite df; unavailable inference is NaN with a null interval and explicit status. */
39
+ declare function welchsTTest(a: number[], b: number[]): WelchTestResult;
40
+ interface ToolUseMetrics {
41
+ runId: string;
42
+ totalCalls: number;
43
+ /** Calls whose arguments were captured and can be compared for duplication. */
44
+ callsWithCapturedArgs: number;
45
+ byTool: Record<string, ToolStats>;
46
+ errorRate: number;
47
+ /** Ratio of captured-argument calls already seen with the same tool name and arguments. */
48
+ duplicateRate: number;
49
+ /** Ratio of error calls followed by ≥1 retry on same tool. */
50
+ retryRate: number;
51
+ /** Optional: of the calls agent made, fraction the evaluator marked as "correct selection". */
52
+ selectionAccuracy?: number;
53
+ }
54
+ interface ToolStats {
55
+ calls: number;
56
+ callsWithCapturedArgs: number;
57
+ errors: number;
58
+ avgLatencyMs: number;
59
+ duplicates: number;
60
+ }
61
+ interface ToolUseOptions {
62
+ /** Map of spanId → whether the evaluator judged the tool selection correct. Optional. */
63
+ selectionLabels?: Record<string, boolean>;
64
+ }
65
+ declare function computeToolUseMetrics(store: TraceStore, runId: string, options?: ToolUseOptions): Promise<ToolUseMetrics>;
66
+ interface BudgetBreachFinding {
67
+ runId: string;
68
+ scenarioId: string;
69
+ variantId?: string;
70
+ dimension: keyof BudgetSpec;
71
+ limit: number;
72
+ consumed: number;
73
+ excessRatio: number;
74
+ timestamp: number;
75
+ }
76
+ interface BudgetBreachReport {
77
+ findings: BudgetBreachFinding[];
78
+ byDimension: Record<string, number>;
79
+ byScenario: Record<string, number>;
80
+ byVariant: Record<string, number>;
81
+ totalRuns: number;
82
+ breachedRunRatio: number;
83
+ }
84
+ declare function budgetBreachView(store: TraceStore, options?: {
85
+ scenarioId?: string;
86
+ variantId?: string;
87
+ }): Promise<BudgetBreachReport>;
88
+ interface JudgePair {
89
+ judgeA: string;
90
+ judgeB: string;
91
+ dimension: string;
92
+ /** Number of (targetSpanId, dimension) tuples both judges scored. */
93
+ commonItems: number;
94
+ pearson: number;
95
+ krippendorff: number;
96
+ }
97
+ interface JudgeAgreementReport {
98
+ pairs: JudgePair[];
99
+ dimensions: string[];
100
+ judgeIds: string[];
101
+ }
102
+ declare function judgeAgreementView(store: TraceStore): Promise<JudgeAgreementReport>;
103
+ interface ToolWasteFinding {
104
+ runId: string;
105
+ wastedCalls: number;
106
+ totalCalls: number;
107
+ wasteRate: number;
108
+ }
109
+ interface ToolWasteReport {
110
+ byRun: ToolWasteFinding[];
111
+ overallWasteRate: number;
112
+ }
113
+ interface ToolWasteOptions {
114
+ runId?: string;
115
+ usageOracle?: (tool: ToolSpan, later: {
116
+ llm: Awaited<ReturnType<typeof llmSpans>>;
117
+ }) => boolean;
118
+ }
119
+ declare function toolWasteView(store: TraceStore, options?: ToolWasteOptions): Promise<ToolWasteReport>;
120
+ export { WelchTestStatus as _, JudgeAgreementReport as a, BudgetBreachFinding as c, ToolStats as d, ToolUseMetrics as f, WelchTestResult as g, BaselineOptions as h, toolWasteView as i, BudgetBreachReport as l, computeToolUseMetrics as m, ToolWasteOptions as n, JudgePair as o, ToolUseOptions as p, ToolWasteReport as r, judgeAgreementView as s, ToolWasteFinding as t, budgetBreachView as u, iqr as v, welchsTTest as y };
121
+ //# sourceMappingURL=tool-waste-B01AMpID.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-waste-B01AMpID.d.ts","names":[],"sources":["../src/baseline.ts","../src/tool-use-metrics.ts","../src/pipelines/budget-breach.ts","../src/pipelines/judge-agreement.ts","../src/pipelines/tool-waste.ts"],"mappings":";;;UAwCiB;;EAEf;;EAEA;;EAEA;;KAGU;;UAGF;EACR;EACA;EACA;;KAGU,mBACP;EACC;EACA;EACA;EACA;EACA;EACA;EACA;MAED;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;;iBAkEU,IAAI;;iBAOJ,YAAY,aAAa,cAAc;UCvItC;EACf;EACA;;EAEA;EACA,QAAQ,eAAe;EACvB;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;;EAEf,kBAAkB;;iBAGE,sBACpB,OAAO,YACP,eACA,UAAS,iBACR,QAAQ;UCnCM;EACf;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;;UAGe;EACf,UAAU;EACV,aAAa;EACb,YAAY;EACZ,WAAW;EACX;EACA;;iBAGoB,iBACpB,OAAO,YACP;EAAW;EAAqB;IAC/B,QAAQ;UCnBM;EACf;EACA;EACA;;EAEA;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;;iBAGoB,mBAAmB,OAAO,aAAa,QAAQ;UCbpD;EACf;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP;;UAGe;EACf;EACA,eAAe,MAAM,UAAU;IAAS,KAAK,QAAQ,kBAAkB;;;iBAGnD,cACpB,OAAO,YACP,UAAS,mBACR,QAAQ"}
@@ -1,4 +1,5 @@
1
- import { Y as interRaterReliability, ot as pearsonR } from "./statistics-DSidA5I2.js";
1
+ import { u as pearsonR } from "./paired-tests-CXcD_B80.js";
2
+ import { q as interRaterReliability } from "./statistics-AKnVFnK-.js";
2
3
  import { a as llmSpans, l as toolSpans, n as groupBy, r as hasCapturedToolArgs, t as argHash } from "./query-Dhjkwqyx.js";
3
4
  import { n as classifyFailure, t as DEFAULT_RULES } from "./failure-taxonomy-9eQfXKoW.js";
4
5
  // src/pipelines/budget-breach.ts
@@ -348,4 +349,4 @@ function stringify(v) {
348
349
  }
349
350
  export { budgetBreachView as a, failureClusterView as i, computeToolUseMetrics as n, judgeAgreementView as r, toolWasteView as t };
350
351
 
351
- //# sourceMappingURL=tool-waste-u7JJ_BlE.js.map
352
+ //# sourceMappingURL=tool-waste-BZnYSa6J.js.map