@tangle-network/agent-eval 2.0.5 → 2.0.9

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 (309) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-CcOq7bOO.d.ts → agent-profile-ORN4aArD.d.ts} +5 -5
  4. package/dist/{agent-profile-CcOq7bOO.d.ts.map → agent-profile-ORN4aArD.d.ts.map} +1 -1
  5. package/dist/analyst/index.d.ts +15 -15
  6. package/dist/analyst/index.js +18 -14
  7. package/dist/analyst/index.js.map +1 -1
  8. package/dist/{analyze-runs-C_9cXPZn.js → analyze-runs-CE_5VKh2.js} +6 -5
  9. package/dist/{analyze-runs-C_9cXPZn.js.map → analyze-runs-CE_5VKh2.js.map} +1 -1
  10. package/dist/analyze-runs-DT693FJ7.d.ts +65 -0
  11. package/dist/analyze-runs-DT693FJ7.d.ts.map +1 -0
  12. package/dist/app-grade/index.d.ts +4 -4
  13. package/dist/app-grade/index.js +1 -1
  14. package/dist/{benchmark-command-MfXRocwZ.js → benchmark-command-DLg8E4y8.js} +16 -9
  15. package/dist/benchmark-command-DLg8E4y8.js.map +1 -0
  16. package/dist/benchmarks/index.d.ts +4 -4
  17. package/dist/benchmarks/index.js +4 -4
  18. package/dist/builder-eval/index.js +2 -2
  19. package/dist/calibration-CrORXMWx.d.ts +128 -0
  20. package/dist/calibration-CrORXMWx.d.ts.map +1 -0
  21. package/dist/{calibration-Cfoup0xz.js → calibration-Dz8mQb5P.js} +2 -2
  22. package/dist/{calibration-Cfoup0xz.js.map → calibration-Dz8mQb5P.js.map} +1 -1
  23. package/dist/campaign/index.d.ts +8 -8
  24. package/dist/campaign/index.js +12 -11
  25. package/dist/{campaign-DfSWSreo.js → campaign-C_S3MOYa.js} +1589 -14
  26. package/dist/campaign-C_S3MOYa.js.map +1 -0
  27. package/dist/{campaign-evidence-D_oBFfLc.js → campaign-evidence-BTfzZo1u.js} +4 -4
  28. package/dist/{campaign-evidence-D_oBFfLc.js.map → campaign-evidence-BTfzZo1u.js.map} +1 -1
  29. package/dist/{campaign-evidence-BmMs8YJt.d.ts → campaign-evidence-CM4FBOkX.d.ts} +5 -5
  30. package/dist/{campaign-evidence-BmMs8YJt.d.ts.map → campaign-evidence-CM4FBOkX.d.ts.map} +1 -1
  31. package/dist/{cluster-Bj90LK-1.d.ts → chat-client-uQNXGuO4.d.ts} +3 -240
  32. package/dist/chat-client-uQNXGuO4.d.ts.map +1 -0
  33. package/dist/cli.js +6 -6
  34. package/dist/cluster-C-K0N2br.d.ts +241 -0
  35. package/dist/cluster-C-K0N2br.d.ts.map +1 -0
  36. package/dist/{cluster-bootstrap-DPzVy3_K.js → cluster-bootstrap-DXbnIdm8.js} +3 -2
  37. package/dist/{cluster-bootstrap-DPzVy3_K.js.map → cluster-bootstrap-DXbnIdm8.js.map} +1 -1
  38. package/dist/{completion-verifier-Cy38EpGE.d.ts → completion-verifier-C7wipJOK.d.ts} +2 -2
  39. package/dist/{completion-verifier-Cy38EpGE.d.ts.map → completion-verifier-C7wipJOK.d.ts.map} +1 -1
  40. package/dist/contract/index.d.ts +14 -12
  41. package/dist/contract/index.js +13 -11
  42. package/dist/contract/index.js.map +1 -1
  43. package/dist/{decision-point-C46p-p9v.js → decision-point-CfqtnGop.js} +3 -3
  44. package/dist/{decision-point-C46p-p9v.js.map → decision-point-CfqtnGop.js.map} +1 -1
  45. package/dist/{default-registry-CUuorCWZ.d.ts → default-registry-Bskl2HzV.d.ts} +6 -7
  46. package/dist/default-registry-Bskl2HzV.d.ts.map +1 -0
  47. package/dist/{default-registry-IkE3byrA.js → default-registry-kps1SOaD.js} +27 -15
  48. package/dist/default-registry-kps1SOaD.js.map +1 -0
  49. package/dist/define-agent-eval-Dnh4jXLX.js +96 -0
  50. package/dist/define-agent-eval-Dnh4jXLX.js.map +1 -0
  51. package/dist/define-agent-eval-tu3anVlk.d.ts +52 -0
  52. package/dist/define-agent-eval-tu3anVlk.d.ts.map +1 -0
  53. package/dist/diagnosis/index.d.ts +3 -3
  54. package/dist/diagnosis/index.js +1 -1
  55. package/dist/{dspy-rlm-engine-DE11iBcC.js → dspy-rlm-engine-DQbPdT_o.js} +8 -4
  56. package/dist/{dspy-rlm-engine-DE11iBcC.js.map → dspy-rlm-engine-DQbPdT_o.js.map} +1 -1
  57. package/dist/{emitter-BjW3NnX-.js → emitter-xN9wGTVw.js} +9 -2
  58. package/dist/{emitter-BjW3NnX-.js.map → emitter-xN9wGTVw.js.map} +1 -1
  59. package/dist/{eval-campaign-Cyk-tkLh.js → eval-campaign-DswSn7Gm.js} +3 -3
  60. package/dist/{eval-campaign-Cyk-tkLh.js.map → eval-campaign-DswSn7Gm.js.map} +1 -1
  61. package/dist/{evaluation-DfyLPVL1.d.ts → evaluation-C4-tf3Z_.d.ts} +4 -4
  62. package/dist/{evaluation-DfyLPVL1.d.ts.map → evaluation-C4-tf3Z_.d.ts.map} +1 -1
  63. package/dist/evaluation.d.ts +1 -1
  64. package/dist/{exact-types-CiCXYhNK.d.ts → exact-types-CUsSMW3n.d.ts} +2 -2
  65. package/dist/{exact-types-CiCXYhNK.d.ts.map → exact-types-CUsSMW3n.d.ts.map} +1 -1
  66. package/dist/{execution-insight-wUNXxo5Y.d.ts → execution-insight-YihQrSqd.d.ts} +2 -2
  67. package/dist/{execution-insight-wUNXxo5Y.d.ts.map → execution-insight-YihQrSqd.d.ts.map} +1 -1
  68. package/dist/experiment/index.d.ts +5 -5
  69. package/dist/experiment/index.js +10 -184
  70. package/dist/experiment/index.js.map +1 -1
  71. package/dist/{external-optimizer-process-4QdcF7Kd.js → external-optimizer-process-CVi1x2nb.js} +2 -2
  72. package/dist/{external-optimizer-process-4QdcF7Kd.js.map → external-optimizer-process-CVi1x2nb.js.map} +1 -1
  73. package/dist/{external-optimizer-subprocess-BW0ZWUUr.js → external-optimizer-subprocess-mV-2swJI.js} +3 -357
  74. package/dist/external-optimizer-subprocess-mV-2swJI.js.map +1 -0
  75. package/dist/{feedback-trajectory-HJticMDz.d.ts → feedback-trajectory-D7hgL6y5.d.ts} +3 -3
  76. package/dist/{feedback-trajectory-HJticMDz.d.ts.map → feedback-trajectory-D7hgL6y5.d.ts.map} +1 -1
  77. package/dist/finding-scope-B_As3F_v.js +359 -0
  78. package/dist/finding-scope-B_As3F_v.js.map +1 -0
  79. package/dist/{findings-store-BxpV-hfH.js → findings-store-CZy5kUDo.js} +26 -19
  80. package/dist/findings-store-CZy5kUDo.js.map +1 -0
  81. package/dist/fuzz.js +1 -1
  82. package/dist/{harness-session-lines-CSxKR6no.js → harness-session-lines-CTh1-uOb.js} +21 -19
  83. package/dist/harness-session-lines-CTh1-uOb.js.map +1 -0
  84. package/dist/{index-Ucp54Pcl.d.ts → index--vDCtdaj.d.ts} +7 -8
  85. package/dist/index--vDCtdaj.d.ts.map +1 -0
  86. package/dist/{index-CKjqN9_U.d.ts → index-CIqYaySd.d.ts} +89 -3
  87. package/dist/index-CIqYaySd.d.ts.map +1 -0
  88. package/dist/{index-C6TG1LwA.d.ts → index-Cav3abKy.d.ts} +256 -131
  89. package/dist/index-Cav3abKy.d.ts.map +1 -0
  90. package/dist/{index-CR-guIiZ.d.ts → index-DmMHTDjT.d.ts} +10 -8
  91. package/dist/index-DmMHTDjT.d.ts.map +1 -0
  92. package/dist/{index-oX0TuJFv.d.ts → index-Er8TKQ3q.d.ts} +4 -4
  93. package/dist/{index-oX0TuJFv.d.ts.map → index-Er8TKQ3q.d.ts.map} +1 -1
  94. package/dist/{index-B_k8aY9k.d.ts → index-moZnazVj.d.ts} +22 -21
  95. package/dist/index-moZnazVj.d.ts.map +1 -0
  96. package/dist/index.d.ts +33 -30
  97. package/dist/index.js +27 -24
  98. package/dist/index.js.map +1 -1
  99. package/dist/{analyze-runs-Ke0WbAf6.d.ts → insight-report-DYofCMLx.d.ts} +4 -64
  100. package/dist/insight-report-DYofCMLx.d.ts.map +1 -0
  101. package/dist/{integrity-B9320cw1.d.ts → integrity-BJGstiCh.d.ts} +2 -2
  102. package/dist/{integrity-B9320cw1.d.ts.map → integrity-BJGstiCh.d.ts.map} +1 -1
  103. package/dist/{judge-gate-DqlzOBOm.js → judge-gate-DANg5FLq.js} +2 -2
  104. package/dist/{judge-gate-DqlzOBOm.js.map → judge-gate-DANg5FLq.js.map} +1 -1
  105. package/dist/{kind-factory-BDd4rhML.js → kind-factory-B-xCxG7p.js} +33 -5
  106. package/dist/kind-factory-B-xCxG7p.js.map +1 -0
  107. package/dist/llm-judge-DFoSy4Qn.js +476 -0
  108. package/dist/llm-judge-DFoSy4Qn.js.map +1 -0
  109. package/dist/{matrix-DlSrRl_v.d.ts → matrix-OgdWQBQa.d.ts} +6 -2
  110. package/dist/matrix-OgdWQBQa.d.ts.map +1 -0
  111. package/dist/measure-validity-plan-B1_qYlsk.d.ts +143 -0
  112. package/dist/measure-validity-plan-B1_qYlsk.d.ts.map +1 -0
  113. package/dist/measure-validity-plan-t0YQRzJQ.js +117 -0
  114. package/dist/measure-validity-plan-t0YQRzJQ.js.map +1 -0
  115. package/dist/meta-eval/index.d.ts +5 -3
  116. package/dist/meta-eval/index.js +664 -14
  117. package/dist/meta-eval/index.js.map +1 -1
  118. package/dist/multishot/golden/index.d.ts +1 -1
  119. package/dist/multishot/index.d.ts +458 -4
  120. package/dist/multishot/index.d.ts.map +1 -1
  121. package/dist/multishot/index.js +926 -47
  122. package/dist/multishot/index.js.map +1 -1
  123. package/dist/openapi.json +1 -1
  124. package/dist/{llm-judge-DQJTQx01.js → optimization-method-D4CpYsVA.js} +18 -482
  125. package/dist/optimization-method-D4CpYsVA.js.map +1 -0
  126. package/dist/{outcome-observations-DL3CC8w1.js → outcome-observations-DEh8_V_P.js} +31 -6
  127. package/dist/outcome-observations-DEh8_V_P.js.map +1 -0
  128. package/dist/outcome-store-CHtuvstd.d.ts +56 -0
  129. package/dist/outcome-store-CHtuvstd.d.ts.map +1 -0
  130. package/dist/{paired-arms-DZhH3FGu.js → paired-arms-B6EXnI47.js} +3 -2
  131. package/dist/{paired-arms-DZhH3FGu.js.map → paired-arms-B6EXnI47.js.map} +1 -1
  132. package/dist/{paired-promotion-decision-ChHBuuHV.d.ts → paired-promotion-decision-DuvRdnsW.d.ts} +2 -2
  133. package/dist/{paired-promotion-decision-ChHBuuHV.d.ts.map → paired-promotion-decision-DuvRdnsW.d.ts.map} +1 -1
  134. package/dist/{paired-promotion-decision-Dn3-jaq4.js → paired-promotion-decision-xYe881cD.js} +3 -2
  135. package/dist/{paired-promotion-decision-Dn3-jaq4.js.map → paired-promotion-decision-xYe881cD.js.map} +1 -1
  136. package/dist/{paired-promotion-power-BlzXdgMD.js → paired-promotion-power-DirShsIs.js} +3 -3
  137. package/dist/{paired-promotion-power-BlzXdgMD.js.map → paired-promotion-power-DirShsIs.js.map} +1 -1
  138. package/dist/paired-tests-CXcD_B80.js +688 -0
  139. package/dist/paired-tests-CXcD_B80.js.map +1 -0
  140. package/dist/pareto-DIVE5D0T.js +81 -0
  141. package/dist/pareto-DIVE5D0T.js.map +1 -0
  142. package/dist/pipelines/index.d.ts +2 -1
  143. package/dist/pipelines/index.d.ts.map +1 -1
  144. package/dist/pipelines/index.js +1 -1
  145. package/dist/{sequential-BphITa5b.js → power-DTg6u30w.js} +181 -4
  146. package/dist/power-DTg6u30w.js.map +1 -0
  147. package/dist/{prime-protocol-iEaSEGZB.d.ts → prime-protocol-Jm2pWh--.d.ts} +2 -2
  148. package/dist/{prime-protocol-iEaSEGZB.d.ts.map → prime-protocol-Jm2pWh--.d.ts.map} +1 -1
  149. package/dist/{promotion-gate-CGkxh36r.d.ts → promotion-gate-BXgcORnM.d.ts} +2 -2
  150. package/dist/{promotion-gate-CGkxh36r.d.ts.map → promotion-gate-BXgcORnM.d.ts.map} +1 -1
  151. package/dist/{promotion-policy-CxDIh-9p.js → promotion-policy-Z5E-C32U.js} +4 -4
  152. package/dist/{promotion-policy-CxDIh-9p.js.map → promotion-policy-Z5E-C32U.js.map} +1 -1
  153. package/dist/{proposal-findings-DedMih-u.js → proposal-findings-CfRFCFXS.js} +2 -2
  154. package/dist/{proposal-findings-DedMih-u.js.map → proposal-findings-CfRFCFXS.js.map} +1 -1
  155. package/dist/{registry-V8o2kZtn.d.ts → registry-DEZDECdr.d.ts} +4 -4
  156. package/dist/{registry-V8o2kZtn.d.ts.map → registry-DEZDECdr.d.ts.map} +1 -1
  157. package/dist/{release-confidence-BLHOMK5Q.js → release-confidence-Cndq1hwi.js} +2 -2
  158. package/dist/{release-confidence-BLHOMK5Q.js.map → release-confidence-Cndq1hwi.js.map} +1 -1
  159. package/dist/reporting.d.ts +5 -5
  160. package/dist/reporting.js +6 -5
  161. package/dist/reporting.js.map +1 -1
  162. package/dist/{research-report-D6XIK0eK.d.ts → research-report-CIgUe1lv.d.ts} +2 -2
  163. package/dist/{research-report-D6XIK0eK.d.ts.map → research-report-CIgUe1lv.d.ts.map} +1 -1
  164. package/dist/{researcher---DhHG4J.d.ts → researcher-CY_byuZl.d.ts} +4 -4
  165. package/dist/{researcher---DhHG4J.d.ts.map → researcher-CY_byuZl.d.ts.map} +1 -1
  166. package/dist/{reward-hacking-DKAflk2c.js → reward-hacking-DMTm1OBd.js} +2 -2
  167. package/dist/{reward-hacking-DKAflk2c.js.map → reward-hacking-DMTm1OBd.js.map} +1 -1
  168. package/dist/rl.d.ts +9 -8
  169. package/dist/rl.d.ts.map +1 -1
  170. package/dist/rl.js +11 -10
  171. package/dist/rl.js.map +1 -1
  172. package/dist/rollout/index.d.ts +2 -2
  173. package/dist/rollout/index.js +2 -2
  174. package/dist/{rollout-DVwpCHBC.js → rollout-B_lrpd9a.js} +2 -2
  175. package/dist/{rollout-DVwpCHBC.js.map → rollout-B_lrpd9a.js.map} +1 -1
  176. package/dist/{rubric-predictive-validity--6z0q8s6.js → rubric-predictive-validity-BXJ92Jp_.js} +3 -9
  177. package/dist/rubric-predictive-validity-BXJ92Jp_.js.map +1 -0
  178. package/dist/{rubric-predictive-validity-C9wc7f_D.d.ts → rubric-predictive-validity-DH94_0Q1.d.ts} +3 -56
  179. package/dist/rubric-predictive-validity-DH94_0Q1.d.ts.map +1 -0
  180. package/dist/{run-improvement-loop-CtLyPb5-.d.ts → run-improvement-loop-BaPDVbW8.d.ts} +384 -11
  181. package/dist/run-improvement-loop-BaPDVbW8.d.ts.map +1 -0
  182. package/dist/{run-record-Bqg0NZ_e.js → run-record-CuO8ErrI.js} +3 -2
  183. package/dist/run-record-CuO8ErrI.js.map +1 -0
  184. package/dist/{runtime-rollouts-DdUijr_t.js → runtime-rollouts-Vv-BAqmq.js} +3 -3
  185. package/dist/{runtime-rollouts-DdUijr_t.js.map → runtime-rollouts-Vv-BAqmq.js.map} +1 -1
  186. package/dist/search/index.d.ts +2 -2
  187. package/dist/search/index.js +2 -2
  188. package/dist/{search-kernel-DXA1EhnN.d.ts → search-kernel-BzTeb89p.d.ts} +3 -3
  189. package/dist/{search-kernel-DXA1EhnN.d.ts.map → search-kernel-BzTeb89p.d.ts.map} +1 -1
  190. package/dist/{pareto-Bg75Gajo.js → search-kernel-DOPW08Hx.js} +6 -88
  191. package/dist/search-kernel-DOPW08Hx.js.map +1 -0
  192. package/dist/{search-summary-B1x1Vmzh.js → search-summary-CYOHZAAy.js} +4 -4
  193. package/dist/{search-summary-B1x1Vmzh.js.map → search-summary-CYOHZAAy.js.map} +1 -1
  194. package/dist/{define-agent-eval-B6uE3gNu.js → self-improve-CIFqccHV.js} +8 -97
  195. package/dist/self-improve-CIFqccHV.js.map +1 -0
  196. package/dist/{define-agent-eval-D17XsdAt.d.ts → self-improve-DY8ZY4lY.d.ts} +8 -54
  197. package/dist/self-improve-DY8ZY4lY.d.ts.map +1 -0
  198. package/dist/{sequential-BhbTSxpt.d.ts → sequential-B9iROM1S.d.ts} +2 -2
  199. package/dist/{sequential-BhbTSxpt.d.ts.map → sequential-B9iROM1S.d.ts.map} +1 -1
  200. package/dist/{sequential-ux_XrjBf.js → sequential-tZjGysXY.js} +3 -3
  201. package/dist/{sequential-ux_XrjBf.js.map → sequential-tZjGysXY.js.map} +1 -1
  202. package/dist/{skillopt-optimization-method-D_swD0Cy.js → skillopt-optimization-method-CbHBkopM.js} +9 -8
  203. package/dist/{skillopt-optimization-method-D_swD0Cy.js.map → skillopt-optimization-method-CbHBkopM.js.map} +1 -1
  204. package/dist/{statistical-heldout-CaS4T-43.js → statistical-heldout-C7Jjo5nP.js} +3 -3
  205. package/dist/{statistical-heldout-CaS4T-43.js.map → statistical-heldout-C7Jjo5nP.js.map} +1 -1
  206. package/dist/{statistics-DSidA5I2.js → statistics-BPl13X3G.js} +208 -700
  207. package/dist/statistics-BPl13X3G.js.map +1 -0
  208. package/dist/statistics.d.ts +3 -3
  209. package/dist/statistics.js +3 -2
  210. package/dist/{store-otlp-CR9fWum6.js → store-otlp-CdeW7NWq.js} +2 -2
  211. package/dist/{store-otlp-CR9fWum6.js.map → store-otlp-CdeW7NWq.js.map} +1 -1
  212. package/dist/{store-tool-spans-tkdUJWup.js → store-tool-spans-CVX-jfkk.js} +3 -3
  213. package/dist/{store-tool-spans-tkdUJWup.js.map → store-tool-spans-CVX-jfkk.js.map} +1 -1
  214. package/dist/{store-tool-spans-C47hUUVM.d.ts → store-tool-spans-Dq8r0PbJ.d.ts} +4 -5
  215. package/dist/store-tool-spans-Dq8r0PbJ.d.ts.map +1 -0
  216. package/dist/{summary-report-CI4J6gxU.js → summary-report-DzbnK81K.js} +15 -7
  217. package/dist/summary-report-DzbnK81K.js.map +1 -0
  218. package/dist/summary-report-figures-CJHygLgw.d.ts.map +1 -1
  219. package/dist/supervisor-run/index.d.ts +1 -1
  220. package/dist/supervisor-run/index.js +1 -1
  221. package/dist/{systemone-MXhFSYdy.d.ts → systemone-BuSZTI88.d.ts} +8 -7
  222. package/dist/systemone-BuSZTI88.d.ts.map +1 -0
  223. package/dist/{systemone-review-C9kbs3zD.d.ts → systemone-review-mlfxWdLz.d.ts} +2 -2
  224. package/dist/{systemone-review-C9kbs3zD.d.ts.map → systemone-review-mlfxWdLz.d.ts.map} +1 -1
  225. package/dist/systemone.d.ts +3 -3
  226. package/dist/systemone.js +1 -1
  227. package/dist/{tool-groups-BSd08M7B.d.ts → tool-groups-PNDX8fd-.d.ts} +2 -3
  228. package/dist/tool-groups-PNDX8fd-.d.ts.map +1 -0
  229. package/dist/{tool-waste-u7JJ_BlE.js → tool-waste-783VCo1y.js} +3 -2
  230. package/dist/{tool-waste-u7JJ_BlE.js.map → tool-waste-783VCo1y.js.map} +1 -1
  231. package/dist/tool-waste-B01AMpID.d.ts +121 -0
  232. package/dist/tool-waste-B01AMpID.d.ts.map +1 -0
  233. package/dist/{trace-questions-CJANeK9P.d.ts → trace-questions-DBtr4jWi.d.ts} +2 -3
  234. package/dist/trace-questions-DBtr4jWi.d.ts.map +1 -0
  235. package/dist/trace-repair/index.d.ts +1 -1
  236. package/dist/trace-repair/index.js +1 -1
  237. package/dist/traces.d.ts +4 -5
  238. package/dist/traces.d.ts.map +1 -1
  239. package/dist/traces.js +4 -4
  240. package/dist/trajectory-B3o6Ald_.d.ts +100 -0
  241. package/dist/trajectory-B3o6Ald_.d.ts.map +1 -0
  242. package/dist/trajectory-replay/index.js +1 -1
  243. package/dist/{tree-DQMlcNFI.js → tree-CtlQQL1w.js} +6 -4
  244. package/dist/{tree-DQMlcNFI.js.map → tree-CtlQQL1w.js.map} +1 -1
  245. package/dist/{types-DD1eUTLn.d.ts → types-BO948H-U.d.ts} +7 -4
  246. package/dist/{types-DD1eUTLn.d.ts.map → types-BO948H-U.d.ts.map} +1 -1
  247. package/dist/{types-AGUuvnae.d.ts → types-CKNAzCSA.d.ts} +158 -3
  248. package/dist/types-CKNAzCSA.d.ts.map +1 -0
  249. package/dist/{types-BLv2Ngla.d.ts → types-D-WF1KM3.d.ts} +2 -2
  250. package/dist/{types-BLv2Ngla.d.ts.map → types-D-WF1KM3.d.ts.map} +1 -1
  251. package/dist/types-DK4vNv5q.js.map +1 -1
  252. package/dist/{types-CE9JMZhk.d.ts → types-DbeIGi73.d.ts} +2 -2
  253. package/dist/{types-CE9JMZhk.d.ts.map → types-DbeIGi73.d.ts.map} +1 -1
  254. package/dist/types-_tlhWGUq.js.map +1 -1
  255. package/dist/wire/index.d.ts +4 -4
  256. package/dist/world/index.d.ts +529 -0
  257. package/dist/world/index.d.ts.map +1 -0
  258. package/dist/world/index.js +1356 -0
  259. package/dist/world/index.js.map +1 -0
  260. package/docs/campaign-proposers.md +7 -0
  261. package/docs/concepts.md +2 -0
  262. package/docs/design/statistics-decisions.md +31 -0
  263. package/docs/eval-surface-map.md +4 -1
  264. package/docs/feature-guide.md +2 -0
  265. package/docs/multi-turn-optimization.md +80 -0
  266. package/docs/outcome-validity.md +69 -0
  267. package/docs/public-api.md +86 -31
  268. package/docs/trace-analysis.md +1 -0
  269. package/docs/world.md +104 -0
  270. package/package.json +7 -2
  271. package/dist/analyze-runs-Ke0WbAf6.d.ts.map +0 -1
  272. package/dist/benchmark-command-MfXRocwZ.js.map +0 -1
  273. package/dist/campaign-DfSWSreo.js.map +0 -1
  274. package/dist/cluster-Bj90LK-1.d.ts.map +0 -1
  275. package/dist/default-registry-CUuorCWZ.d.ts.map +0 -1
  276. package/dist/default-registry-IkE3byrA.js.map +0 -1
  277. package/dist/define-agent-eval-B6uE3gNu.js.map +0 -1
  278. package/dist/define-agent-eval-D17XsdAt.d.ts.map +0 -1
  279. package/dist/engine-BZVXOc6n.d.ts +0 -152
  280. package/dist/engine-BZVXOc6n.d.ts.map +0 -1
  281. package/dist/external-optimizer-subprocess-BW0ZWUUr.js.map +0 -1
  282. package/dist/findings-store-BxpV-hfH.js.map +0 -1
  283. package/dist/harness-session-lines-CSxKR6no.js.map +0 -1
  284. package/dist/index-B_k8aY9k.d.ts.map +0 -1
  285. package/dist/index-C6TG1LwA.d.ts.map +0 -1
  286. package/dist/index-CKjqN9_U.d.ts.map +0 -1
  287. package/dist/index-CR-guIiZ.d.ts.map +0 -1
  288. package/dist/index-Ucp54Pcl.d.ts.map +0 -1
  289. package/dist/interval-CWyxqDpE.d.ts +0 -43
  290. package/dist/interval-CWyxqDpE.d.ts.map +0 -1
  291. package/dist/kind-factory-BDd4rhML.js.map +0 -1
  292. package/dist/llm-judge-DQJTQx01.js.map +0 -1
  293. package/dist/matrix-DlSrRl_v.d.ts.map +0 -1
  294. package/dist/outcome-observations-DL3CC8w1.js.map +0 -1
  295. package/dist/pareto-Bg75Gajo.js.map +0 -1
  296. package/dist/rubric-predictive-validity--6z0q8s6.js.map +0 -1
  297. package/dist/rubric-predictive-validity-C9wc7f_D.d.ts.map +0 -1
  298. package/dist/run-improvement-loop-CtLyPb5-.d.ts.map +0 -1
  299. package/dist/run-record-Bqg0NZ_e.js.map +0 -1
  300. package/dist/sequential-BphITa5b.js.map +0 -1
  301. package/dist/statistics-DSidA5I2.js.map +0 -1
  302. package/dist/store-tool-spans-C47hUUVM.d.ts.map +0 -1
  303. package/dist/summary-report-CI4J6gxU.js.map +0 -1
  304. package/dist/systemone-MXhFSYdy.d.ts.map +0 -1
  305. package/dist/tool-groups-BSd08M7B.d.ts.map +0 -1
  306. package/dist/tool-waste-CIhtU1ad.d.ts +0 -217
  307. package/dist/tool-waste-CIhtU1ad.d.ts.map +0 -1
  308. package/dist/trace-questions-CJANeK9P.d.ts.map +0 -1
  309. package/dist/types-AGUuvnae.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"eval-campaign-Cyk-tkLh.js","names":[],"sources":["../src/eval-campaign.ts"],"sourcesContent":["/**\n * EvalCampaign — opinionated matrix runner that wires the four\n * capture-integrity directives by construction.\n *\n * The canonical benchmark shape — matrix runner → for each\n * (variant, scenario, seed) → start a TraceEmitter → call LLMs → end the\n * run → analyze — has a bug class at the integration boundary: raw\n * events not captured, route silently wrong, integrity not asserted,\n * analyst never run. The directives in `SKILL.md § Capture integrity`\n * are the mitigations.\n *\n * `EvalCampaign` is the structural fix — consumers don't wire the\n * integrity surface themselves; the campaign owns it. Specifically:\n *\n * - constructs a per-run `TraceStore` and `RawProviderSink` via factories\n * - builds the run's `ChatClient` through `chatFactory`, handing it the\n * run's raw sink and trace context — a transport built any other way has\n * no raw HTTP envelope, and `assertRunCaptured` says so\n * - calls `assertRunCaptured` after every `endRun` and routes failures\n * through a configurable policy (`throw` / `mark_failed` / `log`)\n * - assembles per-run `RunRecord`s and runs `researchReport` at the end\n * so the campaign artifact is launch-decision-grade by default\n * - embeds the campaign fingerprint (a SHA-256 over the canonicalised\n * run set) and optional `preregistrationHash` in the report\n *\n * The runner contract is intentionally narrow: produce a `CampaignRunOutcome`\n * given a fully-wired `CampaignRunContext`. Everything orchestration-shaped\n * lives in the campaign. This is the inversion-of-control point — consumers\n * stop writing matrix runners and start writing scenario-runners.\n *\n * Out of scope for v1 (tracked in `docs/research-report-methodology.md`):\n *\n * - Distributed/cluster execution (concurrency is local async)\n * - Adaptive sampling / sequential interim looks\n * - Resume from partial state across crashes\n * - LLM-call retry beyond what the caller's transport already does\n */\n\nimport {\n type AgentProfileCell,\n type AgentProfileCellInput,\n buildAgentProfileCell,\n verifyAgentProfileCell,\n} from './agent-profile-cell'\nimport type { ChatClient } from './analyst/chat-client'\nimport { hashJson } from './pre-registration'\nimport type {\n JudgeScoresRecord,\n RunCostProvenance,\n RunJudgeMetadata,\n RunOutcome,\n RunRecord,\n RunSplitTag,\n RunTaskFailure,\n RunTokenUsage,\n} from './run-record'\nimport { validateRunRecord } from './run-record'\nimport { type ResearchReport, type ResearchReportOptions, researchReport } from './summary-report'\nimport type { RunCompleteHook } from './trace/emitter'\nimport { TraceEmitter } from './trace/emitter'\nimport {\n assertRunCaptured,\n RunIntegrityError,\n type RunIntegrityExpectations,\n type RunIntegrityReport,\n} from './trace/integrity'\nimport { FileSystemRawProviderSink, type RawProviderSink } from './trace/raw-provider-sink'\nimport type { TraceStore } from './trace/store'\n\n// ── Public types ─────────────────────────────────────────────────────────\n\nexport interface CampaignVariant<V> {\n id: string\n payload: V\n}\n\nexport interface CampaignScenario {\n scenarioId: string\n /** Free-form metadata propagated to runs and reports. */\n tags?: Record<string, string>\n}\n\nexport interface CampaignRunContext<V> {\n /** Stable run id. The campaign generates this; the runner does not. */\n runId: string\n /** Logical experiment id (campaignId by default; overridable per-run via opts). */\n experimentId: string\n variant: V\n variantId: string\n scenarioId: string\n scenarioTags: Record<string, string>\n seed: number\n splitTag: RunSplitTag\n /**\n * The TraceEmitter for this run, with `onRunComplete` hooks pre-wired\n * (analyst auto-execution if configured, plus integrity check). The\n * runner MUST call `emitter.startRun` before doing any work and either\n * `emitter.endRun` or `emitter.abortRun` before returning.\n */\n emitter: TraceEmitter\n store: TraceStore\n rawSink: RawProviderSink\n /**\n * The run's model transport, built by `chatFactory` with this run's\n * `rawSink` and `runId` already bound.\n */\n chat: ChatClient\n}\n\n/** What the campaign binds into the run's transport. */\nexport interface CampaignChatWiring {\n /**\n * Raw provider sink for this run. Bind it into the transport: the campaign's\n * integrity check requires every LLM span to carry a matching raw request\n * event, so a transport built without it fails `assertRunCaptured`.\n */\n rawSink: RawProviderSink\n runId: string\n}\n\ninterface CampaignRunOutcomeFields {\n /** Did the run pass? Mirrors `RunOutcome.pass` semantics. */\n pass: boolean\n /** Score for the run on its split. Maps to `searchScore` or `holdoutScore`. */\n score: number\n /** Cost in USD, or null when the runner could not capture it. */\n costUsd: number | null\n /** Source of the cost amount. */\n costProvenance: RunCostProvenance\n tokenUsage: RunTokenUsage\n /** Snapshot model id (e.g. `claude-sonnet-5-5` or `gpt-4o-2024-11-20`). */\n model: string\n /** sha256 of the effective prompt sent to the model. */\n promptHash: string\n /** sha256 of the effective config (model, temperature, tools, judges, splits). */\n configHash: string\n /** Optional extra numeric metrics to land in `outcome.raw`. */\n raw?: Record<string, number>\n /** Optional judge metadata when a judge was used. */\n judgeMetadata?: RunJudgeMetadata\n /**\n * Optional per-judge / per-dim breakdown for ensemble-judged runs.\n * Propagated to `outcome.judgeScores` on the resulting `RunRecord`.\n * Single-judge or scalar-only runs leave this unset.\n */\n judgeScores?: JudgeScoresRecord\n /**\n * Agent profile cell observed by the runner. When supplied, it overrides\n * `EvalCampaignOptions.agentProfile` for this run and must match the\n * outcome's `model` and `promptHash`.\n */\n agentProfile?: AgentProfileCell | AgentProfileCellInput\n}\n\n/** Campaign result with the same task-failure invariant as `RunRecord`. */\nexport type CampaignRunOutcome = CampaignRunOutcomeFields & RunTaskFailure\n\nexport type CampaignRunner<V> = (ctx: CampaignRunContext<V>) => Promise<CampaignRunOutcome>\n\nexport type CampaignIntegrityPolicy = 'throw' | 'mark_failed' | 'log'\n\nexport interface EvalCampaignOptions<V> {\n /**\n * Stable id for the campaign. Used as the default `experimentId` on\n * every run, and folded into the campaign fingerprint.\n */\n campaignId: string\n variants: CampaignVariant<V>[]\n scenarios: CampaignScenario[]\n /** Default `[0, 1, 2]`. */\n seeds?: number[]\n /** Default `'holdout'` — the split that anchors a launch decision. */\n splitTag?: RunSplitTag\n /** Git SHA the campaign is run against. Mandatory; `RunRecord` rejects unset. */\n commitSha: string\n /**\n * Build the model transport for one run. agent-eval executes no paid model:\n * the caller owns the transport and the credential never enters this\n * package. The campaign calls this once per run and passes the run's raw\n * provider sink and `runId`, so a transport that binds them captures the\n * raw HTTP envelope `assertRunCaptured` checks for.\n */\n chatFactory: (wiring: CampaignChatWiring) => ChatClient\n /**\n * Caller-declared identity of the execution route, folded into the campaign\n * fingerprint so two campaigns run against different endpoints do not share\n * one identity. agent-eval no longer knows the endpoint; the owner of\n * execution names it.\n */\n executionRef?: string\n /**\n * Per-run TraceStore factory. Common shape: a fresh store per run keyed\n * on `runId`. Implementations that share a store across the campaign\n * are valid — the campaign only writes through `emitter`.\n */\n storeFactory: (params: CampaignFactoryParams) => TraceStore\n /**\n * Per-run RawProviderSink factory. Defaults to `FileSystemRawProviderSink`\n * rooted at `${workDir}/raw-events/${runId}` if `workDir` is supplied;\n * otherwise required. Forensic capture is non-negotiable in a campaign\n * run — pass `NoopRawProviderSink` explicitly if you want to opt out.\n */\n rawSinkFactory?: (params: CampaignFactoryParams) => RawProviderSink\n /**\n * Filesystem root for default `rawSinkFactory`. Ignored if\n * `rawSinkFactory` is supplied.\n */\n workDir?: string\n /**\n * Extra `onRunComplete` hooks the campaign appends (after its own\n * integrity-check hook). Pass `traceAnalystOnRunComplete(...)` here.\n */\n onRunComplete?: RunCompleteHook[]\n /**\n * Per-run integrity expectations. Defaults to:\n * `{ llmSpansMin: 1, requireRawCoverageOfLlmSpans: true, requireOutcome: true }`.\n * Override (e.g. `{ llmSpansMin: 0 }`) for runs that don't call LLMs.\n */\n integrity?: RunIntegrityExpectations\n /** Behaviour when integrity fails. Default `'mark_failed'`. */\n onIntegrityFailure?: CampaignIntegrityPolicy\n /**\n * Per-run runner. Receives a fully-wired context; produces an outcome\n * the campaign converts into a `RunRecord`.\n */\n runner: CampaignRunner<V>\n /**\n * If set, the campaign computes `researchReport` at the end. `comparator`\n * is a `variantId`. Other fields are forwarded verbatim.\n */\n report?: { comparator?: string } & Omit<\n ResearchReportOptions,\n 'comparator' | 'preregistrationHash' | 'generatedAt'\n >\n /**\n * Hash of a signed `HypothesisManifest` (see `pre-registration.ts`).\n * Embedded in the campaign fingerprint and the research report.\n */\n preregistrationHash?: string\n /** Local concurrency. Default `1` (sequential). */\n concurrency?: number\n /**\n * Override the time source. Tests pass a mock to make wallMs deterministic.\n */\n now?: () => number\n /** Override the runId generator. Tests pin this. */\n runId?: (params: CampaignFactoryParams) => string\n /**\n * Agent profile cell for campaign runs. Static profiles can pass an object;\n * routers or variant-specific harnesses can pass a factory. The campaign\n * stamps the built cell onto every `RunRecord` and rejects profile/model or\n * profile/prompt contradictions.\n */\n agentProfile?:\n | AgentProfileCell\n | AgentProfileCellInput\n | ((\n params: CampaignFactoryParams & {\n variant: V\n scenarioTags: Record<string, string>\n },\n ) =>\n | AgentProfileCell\n | AgentProfileCellInput\n | Promise<AgentProfileCell | AgentProfileCellInput>)\n}\n\nexport interface CampaignFactoryParams {\n campaignId: string\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n}\n\nexport interface FailedRun {\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n reason: string\n error?: string\n}\n\nexport interface EvalCampaignResult {\n campaignId: string\n /** SHA-256 over canonicalised `(variantIds, scenarioIds, seeds, comparator, splitTag, executionRef, preregistrationHash)`. */\n campaignFingerprint: string\n preregistrationHash: string | null\n /** Successful runs only. Failed runs land in `failedRuns`. */\n runs: RunRecord[]\n /** Integrity reports for every successful run. */\n integrityReports: RunIntegrityReport[]\n failedRuns: FailedRun[]\n /** Computed when `report` is set on options. */\n report?: ResearchReport\n startedAt: string\n endedAt: string\n}\n\n// ── Implementation ───────────────────────────────────────────────────────\n\nconst DEFAULT_INTEGRITY: RunIntegrityExpectations = {\n llmSpansMin: 1,\n requireRawCoverageOfLlmSpans: true,\n requireOutcome: true,\n}\n\ntype CampaignCell<V> = { variant: CampaignVariant<V>; scenario: CampaignScenario; seed: number }\n\ntype CampaignRunResult = { record: RunRecord; integrity: RunIntegrityReport }\n\n/** Resolved options shared by every step of one campaign. */\ninterface CampaignSettings {\n seeds: number[]\n splitTag: RunSplitTag\n concurrency: number\n integrity: RunIntegrityExpectations\n onIntegrityFailure: CampaignIntegrityPolicy\n now: () => number\n executionRef: string | null\n preregistrationHash: string | null\n rawSinkFactory: (params: CampaignFactoryParams) => RawProviderSink\n}\n\n/**\n * Mutable state of one campaign's worker pool.\n *\n * A genuine (non-CellExecutionError) error from any worker is a bug, not a\n * run-level failure. We must NOT let `Promise.all` reject mid-flight and\n * orphan the other workers' in-progress runs (emitters never finalized,\n * sinks/handles leak, partial work silently discarded). Instead: capture the\n * first genuine error, stop dispatching new cells so in-flight workers wind\n * down, finalize every still-open run, then re-throw the aggregated error.\n */\ninterface CampaignPool<V> {\n opts: EvalCampaignOptions<V>\n settings: CampaignSettings\n cells: CampaignCell<V>[]\n cursor: number\n aborting: boolean\n genuineErrors: unknown[]\n /**\n * Emitters for runs that are currently mid-flight, keyed by runId. A worker\n * registers its emitter before invoking the runner and removes it once the\n * run is finalized (via endRun/abortRun, success or failure). Anything left\n * here after the pool settles is an orphan we must abort.\n */\n openRuns: Map<string, TraceEmitter>\n runs: RunRecord[]\n integrityReports: RunIntegrityReport[]\n failedRuns: FailedRun[]\n}\n\nexport async function runEvalCampaign<V>(\n opts: EvalCampaignOptions<V>,\n): Promise<EvalCampaignResult> {\n assertCampaignPreflight(opts)\n const settings = resolveCampaignSettings(opts)\n const campaignFingerprint = await fingerprintCampaign(opts, settings)\n\n const startedAt = new Date(settings.now()).toISOString()\n const pool: CampaignPool<V> = {\n opts,\n settings,\n cells: planCampaignCells(opts, settings.seeds),\n cursor: 0,\n aborting: false,\n genuineErrors: [],\n openRuns: new Map(),\n runs: [],\n integrityReports: [],\n failedRuns: [],\n }\n await drainCampaignPool(pool)\n\n const report = await buildCampaignReport(opts, settings, pool.runs)\n const endedAt = new Date(settings.now()).toISOString()\n\n return {\n campaignId: opts.campaignId,\n campaignFingerprint,\n preregistrationHash: settings.preregistrationHash,\n runs: pool.runs,\n integrityReports: pool.integrityReports,\n failedRuns: pool.failedRuns,\n report,\n startedAt,\n endedAt,\n }\n}\n\n/** Reject structurally invalid campaigns before any work starts. */\nfunction assertCampaignPreflight<V>(opts: EvalCampaignOptions<V>): void {\n if (opts.variants.length === 0) {\n throw new Error('runEvalCampaign: variants must be non-empty.')\n }\n if (opts.scenarios.length === 0) {\n throw new Error('runEvalCampaign: scenarios must be non-empty.')\n }\n const variantIds = new Set<string>()\n for (const v of opts.variants) {\n if (variantIds.has(v.id)) {\n throw new Error(`runEvalCampaign: duplicate variant id \"${v.id}\".`)\n }\n variantIds.add(v.id)\n }\n const scenarioIds = new Set<string>()\n for (const s of opts.scenarios) {\n if (scenarioIds.has(s.scenarioId)) {\n throw new Error(`runEvalCampaign: duplicate scenarioId \"${s.scenarioId}\".`)\n }\n scenarioIds.add(s.scenarioId)\n }\n if (opts.report?.comparator && !variantIds.has(opts.report.comparator)) {\n throw new Error(\n `runEvalCampaign: report.comparator \"${opts.report.comparator}\" is not a configured variantId.`,\n )\n }\n if (!opts.commitSha) {\n throw new Error('runEvalCampaign: commitSha is required (every RunRecord needs it).')\n }\n}\n\n/** Apply defaults to the optional campaign options. */\nfunction resolveCampaignSettings<V>(opts: EvalCampaignOptions<V>): CampaignSettings {\n return {\n seeds: opts.seeds ?? [0, 1, 2],\n splitTag: opts.splitTag ?? 'holdout',\n concurrency: Math.max(1, opts.concurrency ?? 1),\n integrity: { ...DEFAULT_INTEGRITY, ...(opts.integrity ?? {}) },\n onIntegrityFailure: opts.onIntegrityFailure ?? 'mark_failed',\n now: opts.now ?? (() => Date.now()),\n executionRef: opts.executionRef ?? null,\n preregistrationHash: opts.preregistrationHash ?? null,\n rawSinkFactory: opts.rawSinkFactory ?? defaultRawSinkFactory(opts.workDir),\n }\n}\n\n/** SHA-256 over the canonicalised matrix definition. */\nfunction fingerprintCampaign<V>(\n opts: EvalCampaignOptions<V>,\n settings: CampaignSettings,\n): Promise<string> {\n return hashJson({\n campaignId: opts.campaignId,\n variants: opts.variants.map((v) => v.id).sort(),\n scenarios: opts.scenarios.map((s) => s.scenarioId).sort(),\n seeds: [...settings.seeds].sort((a, b) => a - b),\n splitTag: settings.splitTag,\n comparator: opts.report?.comparator ?? null,\n executionRef: settings.executionRef,\n preregistrationHash: settings.preregistrationHash,\n })\n}\n\n/** Expand variants x scenarios x seeds, variant-major. */\nfunction planCampaignCells<V>(opts: EvalCampaignOptions<V>, seeds: number[]): CampaignCell<V>[] {\n const cells: CampaignCell<V>[] = []\n for (const variant of opts.variants) {\n for (const scenario of opts.scenarios) {\n for (const seed of seeds) {\n cells.push({ variant, scenario, seed })\n }\n }\n }\n return cells\n}\n\n/**\n * Run the bounded-concurrency worker pool to completion, finalize any run left\n * open, and re-throw the genuine errors the workers captured.\n */\nasync function drainCampaignPool<V>(pool: CampaignPool<V>): Promise<void> {\n const workers = Array.from(\n { length: Math.min(pool.settings.concurrency, pool.cells.length) },\n () => campaignWorker(pool),\n )\n // allSettled (not all): a genuine error in one worker must not reject the\n // pool mid-flight and orphan the others. Each worker captures its own\n // genuine error into `genuineErrors` and returns; we re-throw below.\n await Promise.allSettled(workers)\n\n // Finalize any run still open after the pool wound down. With the\n // stop-dispatch flag these are the runs that were mid-flight in peer workers\n // when the first genuine error fired — abort them so their emitters finalize\n // (hooks fire, store records a terminal status) instead of leaking.\n for (const [runId, emitter] of pool.openRuns) {\n await finalizeAbort(emitter, runId, 'campaign aborted: genuine error in a sibling run')\n }\n pool.openRuns.clear()\n\n if (pool.genuineErrors.length > 0) {\n throw pool.genuineErrors.length === 1\n ? pool.genuineErrors[0]\n : new AggregateError(\n pool.genuineErrors,\n `runEvalCampaign: ${pool.genuineErrors.length} runs failed with genuine (non-run-level) errors`,\n )\n }\n}\n\n/** Pull cells off the shared cursor until none remain or the pool is aborting. */\nasync function campaignWorker<V>(pool: CampaignPool<V>): Promise<void> {\n while (!pool.aborting) {\n const i = pool.cursor++\n if (i >= pool.cells.length) return\n const cell = pool.cells[i]!\n try {\n const result = await runCampaignCell(pool, cell)\n pool.runs.push(result.record)\n pool.integrityReports.push(result.integrity)\n } catch (err) {\n if (err instanceof CellExecutionError) {\n pool.failedRuns.push(err.failed)\n if (err.integrity) pool.integrityReports.push(err.integrity)\n } else {\n // Genuine bug — not a runner failure, not an integrity failure.\n // Capture it and stop dispatching so peers wind down gracefully;\n // re-thrown after the pool settles. Do not surface here — that would\n // reject Promise.all and orphan the other workers' runs.\n pool.genuineErrors.push(err)\n pool.aborting = true\n return\n }\n }\n }\n}\n\n/** Run one matrix cell: runner, integrity check, then the validated RunRecord. */\nasync function runCampaignCell<V>(\n pool: CampaignPool<V>,\n cell: CampaignCell<V>,\n): Promise<CampaignRunResult> {\n const { opts, settings } = pool\n const runId = (opts.runId ?? defaultRunId)({\n campaignId: opts.campaignId,\n runId: '', // unused by default generator\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n })\n const factoryParams: CampaignFactoryParams = {\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n }\n const store = opts.storeFactory(factoryParams)\n const rawSink = settings.rawSinkFactory(factoryParams)\n\n const emitter = new TraceEmitter(store, {\n runId,\n now: opts.now,\n onRunComplete: opts.onRunComplete,\n })\n // Track this run as open so a genuine error elsewhere in the pool can\n // finalize it instead of orphaning it. Removed in the finally below.\n pool.openRuns.set(runId, emitter)\n\n const chat = opts.chatFactory({ rawSink, runId })\n\n const ctx: CampaignRunContext<V> = {\n runId,\n experimentId: opts.campaignId,\n variant: cell.variant.payload,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n scenarioTags: cell.scenario.tags ?? {},\n seed: cell.seed,\n splitTag: settings.splitTag,\n emitter,\n store,\n rawSink,\n chat,\n }\n\n try {\n const wallStart = settings.now()\n const outcome = await invokeCampaignRunner(opts, cell, ctx)\n const wallMs = settings.now() - wallStart\n\n const integrityReport = await assertRunCaptured(store, runId, {\n ...settings.integrity,\n rawSink,\n })\n if (!integrityReport.ok) admitOrRejectIntegrity(settings, cell, runId, integrityReport)\n\n const record = buildCampaignRunRecord(opts, settings, cell, runId, outcome, wallMs)\n await stampAgentProfile(opts, cell, record, runId, outcome)\n return { record: validateRunRecord(record), integrity: integrityReport }\n } finally {\n // This run's worker has finished with it (success, run-level failure, or\n // genuine error). It is no longer the pool's job to finalize — drop it so\n // the post-settle sweep doesn't double-abort a finalized run.\n pool.openRuns.delete(runId)\n }\n}\n\n/** Invoke the runner; a throw aborts the run and becomes a run-level failure. */\nasync function invokeCampaignRunner<V>(\n opts: EvalCampaignOptions<V>,\n cell: CampaignCell<V>,\n ctx: CampaignRunContext<V>,\n): Promise<CampaignRunOutcome> {\n try {\n return await opts.runner(ctx)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n // The runner threw mid-execution. Abort the run so the emitter\n // finalizes. The only benign abortRun failure is \"the runner never\n // started the run\" (nothing to finalize). A store-write failure (disk\n // full, FS error) is a genuine diagnostic — surface it rather than\n // masking it as a plain runner failure.\n await finalizeAbort(ctx.emitter, ctx.runId, message)\n throw new CellExecutionError({\n runId: ctx.runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'runner_threw',\n error: message,\n })\n }\n}\n\n/** Apply the integrity-failure policy to a report that is not ok. */\nfunction admitOrRejectIntegrity<V>(\n settings: CampaignSettings,\n cell: CampaignCell<V>,\n runId: string,\n integrityReport: RunIntegrityReport,\n): void {\n switch (settings.onIntegrityFailure) {\n case 'throw':\n throw new RunIntegrityError(integrityReport)\n case 'mark_failed':\n throw new CellExecutionError(\n {\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'integrity_failed',\n error: integrityReport.issues.map((i) => i.code).join(', '),\n },\n integrityReport,\n )\n case 'log':\n // Caller wants the run admitted with a flagged report; fall through.\n break\n }\n}\n\n/** Assemble the RunRecord for a successful run, before profile stamping. */\nfunction buildCampaignRunRecord<V>(\n opts: EvalCampaignOptions<V>,\n settings: CampaignSettings,\n cell: CampaignCell<V>,\n runId: string,\n outcome: CampaignRunOutcome,\n wallMs: number,\n): RunRecord {\n const recordOutcome: RunOutcome = {\n raw: outcome.raw ?? {},\n }\n if (settings.splitTag === 'holdout') recordOutcome.holdoutScore = outcome.score\n else recordOutcome.searchScore = outcome.score\n if (outcome.judgeScores !== undefined) recordOutcome.judgeScores = outcome.judgeScores\n\n return {\n runId,\n experimentId: opts.campaignId,\n candidateId: cell.variant.id,\n seed: cell.seed,\n model: outcome.model,\n promptHash: outcome.promptHash,\n configHash: outcome.configHash,\n commitSha: opts.commitSha,\n wallMs,\n costUsd: outcome.costUsd,\n costProvenance: outcome.costProvenance,\n tokenUsage: outcome.tokenUsage,\n terminalOutcome: 'succeeded',\n judgeMetadata: outcome.judgeMetadata,\n outcome: recordOutcome,\n ...(outcome.failureClass ? { failureClass: outcome.failureClass } : {}),\n failureMode: outcome.failureMode,\n splitTag: settings.splitTag,\n scenarioId: cell.scenario.scenarioId,\n }\n}\n\n/** Resolve the run's agent profile (outcome first, then options) and stamp it on the record. */\nasync function stampAgentProfile<V>(\n opts: EvalCampaignOptions<V>,\n cell: CampaignCell<V>,\n record: RunRecord,\n runId: string,\n outcome: CampaignRunOutcome,\n): Promise<void> {\n const profileSource =\n outcome.agentProfile ??\n (typeof opts.agentProfile === 'function'\n ? await opts.agentProfile({\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n variant: cell.variant.payload,\n scenarioTags: cell.scenario.tags ?? {},\n })\n : opts.agentProfile)\n if (profileSource !== undefined) {\n const agentProfile = await resolveAgentProfileCell(profileSource)\n assertAgentProfileMatchesRun(agentProfile, outcome.model, outcome.promptHash)\n record.agentProfile = agentProfile\n }\n}\n\n/** Build the optional research report over the successful runs. */\nasync function buildCampaignReport<V>(\n opts: EvalCampaignOptions<V>,\n settings: CampaignSettings,\n runs: RunRecord[],\n): Promise<ResearchReport | undefined> {\n if (!opts.report) return undefined\n const reportOpts: ResearchReportOptions = {\n ...opts.report,\n comparator: opts.report.comparator,\n split: settings.splitTag === 'dev' ? 'search' : settings.splitTag,\n generatedAt: new Date(settings.now()).toISOString(),\n preregistrationHash: settings.preregistrationHash ?? undefined,\n }\n return researchReport(runs, reportOpts)\n}\n\n// ── Internal ─────────────────────────────────────────────────────────────\n\nclass CellExecutionError extends Error {\n readonly failed: FailedRun\n readonly integrity?: RunIntegrityReport\n constructor(failed: FailedRun, integrity?: RunIntegrityReport) {\n super(`cell ${failed.variantId}/${failed.scenarioId}@${failed.seed} failed: ${failed.reason}`)\n this.failed = failed\n this.integrity = integrity\n }\n}\n\n/**\n * Abort a run whose owning work threw or was orphaned by a sibling's genuine\n * error, finalizing the emitter so hooks fire and the store records a terminal\n * status. Safe to call unconditionally: it only aborts runs that are still\n * `running`. Two no-op cases are intentional and benign:\n *\n * - the run was never started (absent from the store) — nothing to finalize\n * - the run is already terminal (`completed` / `failed` / `aborted`) —\n * finalizing again would overwrite the real outcome (e.g. flip a passed run\n * to `aborted` with `{ pass: false, notes: reason }`), so we leave it alone\n *\n * Any OTHER failure of the store read or the abort write (disk full, FS fault,\n * backend down) is a genuine diagnostic and propagates rather than being\n * swallowed.\n */\nasync function finalizeAbort(emitter: TraceEmitter, runId: string, reason: string): Promise<void> {\n const existing = await emitter.traceStore.getRun(runId)\n if (existing === undefined) return // run never started; nothing to abort\n if (existing.status !== 'running') return // already finalized; never overwrite a real outcome\n // The emitter never throws on a failed store write; it counts it. A failed\n // abort write is a genuine diagnostic here, so read the count and surface it.\n const droppedBefore = emitter.captureStats().dropped\n await emitter.abortRun(reason)\n const after = emitter.captureStats()\n if (after.dropped > droppedBefore) {\n throw new Error(`finalizeAbort: run ${runId} could not be finalized: ${after.lastError}`)\n }\n}\n\nfunction defaultRawSinkFactory(workDir: string | undefined) {\n return (params: CampaignFactoryParams): RawProviderSink => {\n if (!workDir) {\n throw new Error(\n 'runEvalCampaign: rawSinkFactory not supplied and workDir not set. Pass either to enable raw provider capture, or pass `new NoopRawProviderSink()` via rawSinkFactory to opt out explicitly.',\n )\n }\n return new FileSystemRawProviderSink({\n dir: `${workDir}/raw-events/${params.runId}`,\n })\n }\n}\n\nasync function resolveAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): Promise<AgentProfileCell> {\n if (isAgentProfileCell(input)) {\n if (!(await verifyAgentProfileCell(input))) {\n throw new Error(`runEvalCampaign: agentProfile.cellId does not match its content`)\n }\n return input\n }\n return buildAgentProfileCell(input)\n}\n\nfunction isAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): input is AgentProfileCell {\n return 'schemaVersion' in input && 'cellId' in input\n}\n\nfunction assertAgentProfileMatchesRun(\n profile: AgentProfileCell,\n model: string,\n promptHash: string,\n): void {\n if (profile.model !== undefined && profile.model !== model) {\n throw new Error(\n `runEvalCampaign: agentProfile.model \"${profile.model}\" does not match outcome.model \"${model}\"`,\n )\n }\n if (profile.promptHash !== undefined && profile.promptHash !== promptHash) {\n throw new Error(\n `runEvalCampaign: agentProfile.promptHash \"${profile.promptHash}\" does not match outcome.promptHash \"${promptHash}\"`,\n )\n }\n}\n\nfunction defaultRunId(params: CampaignFactoryParams): string {\n // Stable across re-runs: fingerprint of (campaignId, variantId, scenarioId, seed).\n // Caller can override via opts.runId for non-deterministic IDs.\n const base = `${params.campaignId}::${params.variantId}::${params.scenarioId}::${params.seed}`\n // TWO 32-bit FNV-1a accumulators with different offsets, concatenated for a\n // 64-bit-wide id. Not crypto-grade; stability and uniqueness are what this\n // needs. Frozen: the value names a persisted cell, and the second\n // accumulator's offset is part of the identity, so no single-accumulator\n // helper can replace it.\n let h1 = 0x811c9dc5\n let h2 = 0x12345678\n for (let i = 0; i < base.length; i++) {\n const c = base.charCodeAt(i)\n h1 = Math.imul(h1 ^ c, 0x01000193) >>> 0\n h2 = Math.imul(h2 ^ c, 0x9e3779b1) >>> 0\n }\n return `run-${h1.toString(16).padStart(8, '0')}${h2.toString(16).padStart(8, '0')}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8SA,MAAM,oBAA8C;CAClD,aAAa;CACb,8BAA8B;CAC9B,gBAAgB;AAClB;AAgDA,eAAsB,gBACpB,MAC6B;CAC7B,wBAAwB,IAAI;CAC5B,MAAM,WAAW,wBAAwB,IAAI;CAC7C,MAAM,sBAAsB,MAAM,oBAAoB,MAAM,QAAQ;CAEpE,MAAM,YAAY,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,YAAY;CACvD,MAAM,OAAwB;EAC5B;EACA;EACA,OAAO,kBAAkB,MAAM,SAAS,KAAK;EAC7C,QAAQ;EACR,UAAU;EACV,eAAe,CAAC;EAChB,0BAAU,IAAI,IAAI;EAClB,MAAM,CAAC;EACP,kBAAkB,CAAC;EACnB,YAAY,CA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6BACP,SACA,OACA,YACM;CACN,IAAI,QAAQ,UAAU,KAAA,KAAa,QAAQ,UAAU,OACnD,MAAM,IAAI,MACR,wCAAwC,QAAQ,MAAM,kCAAkC,MAAM,EAChG;CAEF,IAAI,QAAQ,eAAe,KAAA,KAAa,QAAQ,eAAe,YAC7D,MAAM,IAAI,MACR,6CAA6C,QAAQ,WAAW,uCAAuC,WAAW,EACpH;AAEJ;AAEA,SAAS,aAAa,QAAuC;CAG3D,MAAM,OAAO,GAAG,OAAO,WAAW,IAAI,OAAO,UAAU,IAAI,OAAO,WAAW,IAAI,OAAO;CAMxF,IAAI,KAAK;CACT,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,IAAI,KAAK,WAAW,CAAC;EAC3B,KAAK,KAAK,KAAK,KAAK,GAAG,QAAU,MAAM;EACvC,KAAK,KAAK,KAAK,KAAK,GAAG,UAAU,MAAM;CACzC;CACA,OAAO,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAClF"}
1
+ {"version":3,"file":"eval-campaign-DswSn7Gm.js","names":[],"sources":["../src/eval-campaign.ts"],"sourcesContent":["/**\n * EvalCampaign — opinionated matrix runner that wires the four\n * capture-integrity directives by construction.\n *\n * The canonical benchmark shape — matrix runner → for each\n * (variant, scenario, seed) → start a TraceEmitter → call LLMs → end the\n * run → analyze — has a bug class at the integration boundary: raw\n * events not captured, route silently wrong, integrity not asserted,\n * analyst never run. The directives in `SKILL.md § Capture integrity`\n * are the mitigations.\n *\n * `EvalCampaign` is the structural fix — consumers don't wire the\n * integrity surface themselves; the campaign owns it. Specifically:\n *\n * - constructs a per-run `TraceStore` and `RawProviderSink` via factories\n * - builds the run's `ChatClient` through `chatFactory`, handing it the\n * run's raw sink and trace context — a transport built any other way has\n * no raw HTTP envelope, and `assertRunCaptured` says so\n * - calls `assertRunCaptured` after every `endRun` and routes failures\n * through a configurable policy (`throw` / `mark_failed` / `log`)\n * - assembles per-run `RunRecord`s and runs `researchReport` at the end\n * so the campaign artifact is launch-decision-grade by default\n * - embeds the campaign fingerprint (a SHA-256 over the canonicalised\n * run set) and optional `preregistrationHash` in the report\n *\n * The runner contract is intentionally narrow: produce a `CampaignRunOutcome`\n * given a fully-wired `CampaignRunContext`. Everything orchestration-shaped\n * lives in the campaign. This is the inversion-of-control point — consumers\n * stop writing matrix runners and start writing scenario-runners.\n *\n * Out of scope for v1 (tracked in `docs/research-report-methodology.md`):\n *\n * - Distributed/cluster execution (concurrency is local async)\n * - Adaptive sampling / sequential interim looks\n * - Resume from partial state across crashes\n * - LLM-call retry beyond what the caller's transport already does\n */\n\nimport {\n type AgentProfileCell,\n type AgentProfileCellInput,\n buildAgentProfileCell,\n verifyAgentProfileCell,\n} from './agent-profile-cell'\nimport type { ChatClient } from './analyst/chat-client'\nimport { hashJson } from './pre-registration'\nimport type {\n JudgeScoresRecord,\n RunCostProvenance,\n RunJudgeMetadata,\n RunOutcome,\n RunRecord,\n RunSplitTag,\n RunTaskFailure,\n RunTokenUsage,\n} from './run-record'\nimport { validateRunRecord } from './run-record'\nimport { type ResearchReport, type ResearchReportOptions, researchReport } from './summary-report'\nimport type { RunCompleteHook } from './trace/emitter'\nimport { TraceEmitter } from './trace/emitter'\nimport {\n assertRunCaptured,\n RunIntegrityError,\n type RunIntegrityExpectations,\n type RunIntegrityReport,\n} from './trace/integrity'\nimport { FileSystemRawProviderSink, type RawProviderSink } from './trace/raw-provider-sink'\nimport type { TraceStore } from './trace/store'\n\n// ── Public types ─────────────────────────────────────────────────────────\n\nexport interface CampaignVariant<V> {\n id: string\n payload: V\n}\n\nexport interface CampaignScenario {\n scenarioId: string\n /** Free-form metadata propagated to runs and reports. */\n tags?: Record<string, string>\n}\n\nexport interface CampaignRunContext<V> {\n /** Stable run id. The campaign generates this; the runner does not. */\n runId: string\n /** Logical experiment id (campaignId by default; overridable per-run via opts). */\n experimentId: string\n variant: V\n variantId: string\n scenarioId: string\n scenarioTags: Record<string, string>\n seed: number\n splitTag: RunSplitTag\n /**\n * The TraceEmitter for this run, with `onRunComplete` hooks pre-wired\n * (analyst auto-execution if configured, plus integrity check). The\n * runner MUST call `emitter.startRun` before doing any work and either\n * `emitter.endRun` or `emitter.abortRun` before returning.\n */\n emitter: TraceEmitter\n store: TraceStore\n rawSink: RawProviderSink\n /**\n * The run's model transport, built by `chatFactory` with this run's\n * `rawSink` and `runId` already bound.\n */\n chat: ChatClient\n}\n\n/** What the campaign binds into the run's transport. */\nexport interface CampaignChatWiring {\n /**\n * Raw provider sink for this run. Bind it into the transport: the campaign's\n * integrity check requires every LLM span to carry a matching raw request\n * event, so a transport built without it fails `assertRunCaptured`.\n */\n rawSink: RawProviderSink\n runId: string\n}\n\ninterface CampaignRunOutcomeFields {\n /** Did the run pass? Mirrors `RunOutcome.pass` semantics. */\n pass: boolean\n /** Score for the run on its split. Maps to `searchScore` or `holdoutScore`. */\n score: number\n /** Cost in USD, or null when the runner could not capture it. */\n costUsd: number | null\n /** Source of the cost amount. */\n costProvenance: RunCostProvenance\n tokenUsage: RunTokenUsage\n /** Snapshot model id (e.g. `claude-sonnet-5-5` or `gpt-4o-2024-11-20`). */\n model: string\n /** sha256 of the effective prompt sent to the model. */\n promptHash: string\n /** sha256 of the effective config (model, temperature, tools, judges, splits). */\n configHash: string\n /** Optional extra numeric metrics to land in `outcome.raw`. */\n raw?: Record<string, number>\n /** Optional judge metadata when a judge was used. */\n judgeMetadata?: RunJudgeMetadata\n /**\n * Optional per-judge / per-dim breakdown for ensemble-judged runs.\n * Propagated to `outcome.judgeScores` on the resulting `RunRecord`.\n * Single-judge or scalar-only runs leave this unset.\n */\n judgeScores?: JudgeScoresRecord\n /**\n * Agent profile cell observed by the runner. When supplied, it overrides\n * `EvalCampaignOptions.agentProfile` for this run and must match the\n * outcome's `model` and `promptHash`.\n */\n agentProfile?: AgentProfileCell | AgentProfileCellInput\n}\n\n/** Campaign result with the same task-failure invariant as `RunRecord`. */\nexport type CampaignRunOutcome = CampaignRunOutcomeFields & RunTaskFailure\n\nexport type CampaignRunner<V> = (ctx: CampaignRunContext<V>) => Promise<CampaignRunOutcome>\n\nexport type CampaignIntegrityPolicy = 'throw' | 'mark_failed' | 'log'\n\nexport interface EvalCampaignOptions<V> {\n /**\n * Stable id for the campaign. Used as the default `experimentId` on\n * every run, and folded into the campaign fingerprint.\n */\n campaignId: string\n variants: CampaignVariant<V>[]\n scenarios: CampaignScenario[]\n /** Default `[0, 1, 2]`. */\n seeds?: number[]\n /** Default `'holdout'` — the split that anchors a launch decision. */\n splitTag?: RunSplitTag\n /** Git SHA the campaign is run against. Mandatory; `RunRecord` rejects unset. */\n commitSha: string\n /**\n * Build the model transport for one run. agent-eval executes no paid model:\n * the caller owns the transport and the credential never enters this\n * package. The campaign calls this once per run and passes the run's raw\n * provider sink and `runId`, so a transport that binds them captures the\n * raw HTTP envelope `assertRunCaptured` checks for.\n */\n chatFactory: (wiring: CampaignChatWiring) => ChatClient\n /**\n * Caller-declared identity of the execution route, folded into the campaign\n * fingerprint so two campaigns run against different endpoints do not share\n * one identity. agent-eval no longer knows the endpoint; the owner of\n * execution names it.\n */\n executionRef?: string\n /**\n * Per-run TraceStore factory. Common shape: a fresh store per run keyed\n * on `runId`. Implementations that share a store across the campaign\n * are valid — the campaign only writes through `emitter`.\n */\n storeFactory: (params: CampaignFactoryParams) => TraceStore\n /**\n * Per-run RawProviderSink factory. Defaults to `FileSystemRawProviderSink`\n * rooted at `${workDir}/raw-events/${runId}` if `workDir` is supplied;\n * otherwise required. Forensic capture is non-negotiable in a campaign\n * run — pass `NoopRawProviderSink` explicitly if you want to opt out.\n */\n rawSinkFactory?: (params: CampaignFactoryParams) => RawProviderSink\n /**\n * Filesystem root for default `rawSinkFactory`. Ignored if\n * `rawSinkFactory` is supplied.\n */\n workDir?: string\n /**\n * Extra `onRunComplete` hooks the campaign appends (after its own\n * integrity-check hook). Pass `traceAnalystOnRunComplete(...)` here.\n */\n onRunComplete?: RunCompleteHook[]\n /**\n * Per-run integrity expectations. Defaults to:\n * `{ llmSpansMin: 1, requireRawCoverageOfLlmSpans: true, requireOutcome: true }`.\n * Override (e.g. `{ llmSpansMin: 0 }`) for runs that don't call LLMs.\n */\n integrity?: RunIntegrityExpectations\n /** Behaviour when integrity fails. Default `'mark_failed'`. */\n onIntegrityFailure?: CampaignIntegrityPolicy\n /**\n * Per-run runner. Receives a fully-wired context; produces an outcome\n * the campaign converts into a `RunRecord`.\n */\n runner: CampaignRunner<V>\n /**\n * If set, the campaign computes `researchReport` at the end. `comparator`\n * is a `variantId`. Other fields are forwarded verbatim.\n */\n report?: { comparator?: string } & Omit<\n ResearchReportOptions,\n 'comparator' | 'preregistrationHash' | 'generatedAt'\n >\n /**\n * Hash of a signed `HypothesisManifest` (see `pre-registration.ts`).\n * Embedded in the campaign fingerprint and the research report.\n */\n preregistrationHash?: string\n /** Local concurrency. Default `1` (sequential). */\n concurrency?: number\n /**\n * Override the time source. Tests pass a mock to make wallMs deterministic.\n */\n now?: () => number\n /** Override the runId generator. Tests pin this. */\n runId?: (params: CampaignFactoryParams) => string\n /**\n * Agent profile cell for campaign runs. Static profiles can pass an object;\n * routers or variant-specific harnesses can pass a factory. The campaign\n * stamps the built cell onto every `RunRecord` and rejects profile/model or\n * profile/prompt contradictions.\n */\n agentProfile?:\n | AgentProfileCell\n | AgentProfileCellInput\n | ((\n params: CampaignFactoryParams & {\n variant: V\n scenarioTags: Record<string, string>\n },\n ) =>\n | AgentProfileCell\n | AgentProfileCellInput\n | Promise<AgentProfileCell | AgentProfileCellInput>)\n}\n\nexport interface CampaignFactoryParams {\n campaignId: string\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n}\n\nexport interface FailedRun {\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n reason: string\n error?: string\n}\n\nexport interface EvalCampaignResult {\n campaignId: string\n /** SHA-256 over canonicalised `(variantIds, scenarioIds, seeds, comparator, splitTag, executionRef, preregistrationHash)`. */\n campaignFingerprint: string\n preregistrationHash: string | null\n /** Successful runs only. Failed runs land in `failedRuns`. */\n runs: RunRecord[]\n /** Integrity reports for every successful run. */\n integrityReports: RunIntegrityReport[]\n failedRuns: FailedRun[]\n /** Computed when `report` is set on options. */\n report?: ResearchReport\n startedAt: string\n endedAt: string\n}\n\n// ── Implementation ───────────────────────────────────────────────────────\n\nconst DEFAULT_INTEGRITY: RunIntegrityExpectations = {\n llmSpansMin: 1,\n requireRawCoverageOfLlmSpans: true,\n requireOutcome: true,\n}\n\ntype CampaignCell<V> = { variant: CampaignVariant<V>; scenario: CampaignScenario; seed: number }\n\ntype CampaignRunResult = { record: RunRecord; integrity: RunIntegrityReport }\n\n/** Resolved options shared by every step of one campaign. */\ninterface CampaignSettings {\n seeds: number[]\n splitTag: RunSplitTag\n concurrency: number\n integrity: RunIntegrityExpectations\n onIntegrityFailure: CampaignIntegrityPolicy\n now: () => number\n executionRef: string | null\n preregistrationHash: string | null\n rawSinkFactory: (params: CampaignFactoryParams) => RawProviderSink\n}\n\n/**\n * Mutable state of one campaign's worker pool.\n *\n * A genuine (non-CellExecutionError) error from any worker is a bug, not a\n * run-level failure. We must NOT let `Promise.all` reject mid-flight and\n * orphan the other workers' in-progress runs (emitters never finalized,\n * sinks/handles leak, partial work silently discarded). Instead: capture the\n * first genuine error, stop dispatching new cells so in-flight workers wind\n * down, finalize every still-open run, then re-throw the aggregated error.\n */\ninterface CampaignPool<V> {\n opts: EvalCampaignOptions<V>\n settings: CampaignSettings\n cells: CampaignCell<V>[]\n cursor: number\n aborting: boolean\n genuineErrors: unknown[]\n /**\n * Emitters for runs that are currently mid-flight, keyed by runId. A worker\n * registers its emitter before invoking the runner and removes it once the\n * run is finalized (via endRun/abortRun, success or failure). Anything left\n * here after the pool settles is an orphan we must abort.\n */\n openRuns: Map<string, TraceEmitter>\n runs: RunRecord[]\n integrityReports: RunIntegrityReport[]\n failedRuns: FailedRun[]\n}\n\nexport async function runEvalCampaign<V>(\n opts: EvalCampaignOptions<V>,\n): Promise<EvalCampaignResult> {\n assertCampaignPreflight(opts)\n const settings = resolveCampaignSettings(opts)\n const campaignFingerprint = await fingerprintCampaign(opts, settings)\n\n const startedAt = new Date(settings.now()).toISOString()\n const pool: CampaignPool<V> = {\n opts,\n settings,\n cells: planCampaignCells(opts, settings.seeds),\n cursor: 0,\n aborting: false,\n genuineErrors: [],\n openRuns: new Map(),\n runs: [],\n integrityReports: [],\n failedRuns: [],\n }\n await drainCampaignPool(pool)\n\n const report = await buildCampaignReport(opts, settings, pool.runs)\n const endedAt = new Date(settings.now()).toISOString()\n\n return {\n campaignId: opts.campaignId,\n campaignFingerprint,\n preregistrationHash: settings.preregistrationHash,\n runs: pool.runs,\n integrityReports: pool.integrityReports,\n failedRuns: pool.failedRuns,\n report,\n startedAt,\n endedAt,\n }\n}\n\n/** Reject structurally invalid campaigns before any work starts. */\nfunction assertCampaignPreflight<V>(opts: EvalCampaignOptions<V>): void {\n if (opts.variants.length === 0) {\n throw new Error('runEvalCampaign: variants must be non-empty.')\n }\n if (opts.scenarios.length === 0) {\n throw new Error('runEvalCampaign: scenarios must be non-empty.')\n }\n const variantIds = new Set<string>()\n for (const v of opts.variants) {\n if (variantIds.has(v.id)) {\n throw new Error(`runEvalCampaign: duplicate variant id \"${v.id}\".`)\n }\n variantIds.add(v.id)\n }\n const scenarioIds = new Set<string>()\n for (const s of opts.scenarios) {\n if (scenarioIds.has(s.scenarioId)) {\n throw new Error(`runEvalCampaign: duplicate scenarioId \"${s.scenarioId}\".`)\n }\n scenarioIds.add(s.scenarioId)\n }\n if (opts.report?.comparator && !variantIds.has(opts.report.comparator)) {\n throw new Error(\n `runEvalCampaign: report.comparator \"${opts.report.comparator}\" is not a configured variantId.`,\n )\n }\n if (!opts.commitSha) {\n throw new Error('runEvalCampaign: commitSha is required (every RunRecord needs it).')\n }\n}\n\n/** Apply defaults to the optional campaign options. */\nfunction resolveCampaignSettings<V>(opts: EvalCampaignOptions<V>): CampaignSettings {\n return {\n seeds: opts.seeds ?? [0, 1, 2],\n splitTag: opts.splitTag ?? 'holdout',\n concurrency: Math.max(1, opts.concurrency ?? 1),\n integrity: { ...DEFAULT_INTEGRITY, ...(opts.integrity ?? {}) },\n onIntegrityFailure: opts.onIntegrityFailure ?? 'mark_failed',\n now: opts.now ?? (() => Date.now()),\n executionRef: opts.executionRef ?? null,\n preregistrationHash: opts.preregistrationHash ?? null,\n rawSinkFactory: opts.rawSinkFactory ?? defaultRawSinkFactory(opts.workDir),\n }\n}\n\n/** SHA-256 over the canonicalised matrix definition. */\nfunction fingerprintCampaign<V>(\n opts: EvalCampaignOptions<V>,\n settings: CampaignSettings,\n): Promise<string> {\n return hashJson({\n campaignId: opts.campaignId,\n variants: opts.variants.map((v) => v.id).sort(),\n scenarios: opts.scenarios.map((s) => s.scenarioId).sort(),\n seeds: [...settings.seeds].sort((a, b) => a - b),\n splitTag: settings.splitTag,\n comparator: opts.report?.comparator ?? null,\n executionRef: settings.executionRef,\n preregistrationHash: settings.preregistrationHash,\n })\n}\n\n/** Expand variants x scenarios x seeds, variant-major. */\nfunction planCampaignCells<V>(opts: EvalCampaignOptions<V>, seeds: number[]): CampaignCell<V>[] {\n const cells: CampaignCell<V>[] = []\n for (const variant of opts.variants) {\n for (const scenario of opts.scenarios) {\n for (const seed of seeds) {\n cells.push({ variant, scenario, seed })\n }\n }\n }\n return cells\n}\n\n/**\n * Run the bounded-concurrency worker pool to completion, finalize any run left\n * open, and re-throw the genuine errors the workers captured.\n */\nasync function drainCampaignPool<V>(pool: CampaignPool<V>): Promise<void> {\n const workers = Array.from(\n { length: Math.min(pool.settings.concurrency, pool.cells.length) },\n () => campaignWorker(pool),\n )\n // allSettled (not all): a genuine error in one worker must not reject the\n // pool mid-flight and orphan the others. Each worker captures its own\n // genuine error into `genuineErrors` and returns; we re-throw below.\n await Promise.allSettled(workers)\n\n // Finalize any run still open after the pool wound down. With the\n // stop-dispatch flag these are the runs that were mid-flight in peer workers\n // when the first genuine error fired — abort them so their emitters finalize\n // (hooks fire, store records a terminal status) instead of leaking.\n for (const [runId, emitter] of pool.openRuns) {\n await finalizeAbort(emitter, runId, 'campaign aborted: genuine error in a sibling run')\n }\n pool.openRuns.clear()\n\n if (pool.genuineErrors.length > 0) {\n throw pool.genuineErrors.length === 1\n ? pool.genuineErrors[0]\n : new AggregateError(\n pool.genuineErrors,\n `runEvalCampaign: ${pool.genuineErrors.length} runs failed with genuine (non-run-level) errors`,\n )\n }\n}\n\n/** Pull cells off the shared cursor until none remain or the pool is aborting. */\nasync function campaignWorker<V>(pool: CampaignPool<V>): Promise<void> {\n while (!pool.aborting) {\n const i = pool.cursor++\n if (i >= pool.cells.length) return\n const cell = pool.cells[i]!\n try {\n const result = await runCampaignCell(pool, cell)\n pool.runs.push(result.record)\n pool.integrityReports.push(result.integrity)\n } catch (err) {\n if (err instanceof CellExecutionError) {\n pool.failedRuns.push(err.failed)\n if (err.integrity) pool.integrityReports.push(err.integrity)\n } else {\n // Genuine bug — not a runner failure, not an integrity failure.\n // Capture it and stop dispatching so peers wind down gracefully;\n // re-thrown after the pool settles. Do not surface here — that would\n // reject Promise.all and orphan the other workers' runs.\n pool.genuineErrors.push(err)\n pool.aborting = true\n return\n }\n }\n }\n}\n\n/** Run one matrix cell: runner, integrity check, then the validated RunRecord. */\nasync function runCampaignCell<V>(\n pool: CampaignPool<V>,\n cell: CampaignCell<V>,\n): Promise<CampaignRunResult> {\n const { opts, settings } = pool\n const runId = (opts.runId ?? defaultRunId)({\n campaignId: opts.campaignId,\n runId: '', // unused by default generator\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n })\n const factoryParams: CampaignFactoryParams = {\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n }\n const store = opts.storeFactory(factoryParams)\n const rawSink = settings.rawSinkFactory(factoryParams)\n\n const emitter = new TraceEmitter(store, {\n runId,\n now: opts.now,\n onRunComplete: opts.onRunComplete,\n })\n // Track this run as open so a genuine error elsewhere in the pool can\n // finalize it instead of orphaning it. Removed in the finally below.\n pool.openRuns.set(runId, emitter)\n\n const chat = opts.chatFactory({ rawSink, runId })\n\n const ctx: CampaignRunContext<V> = {\n runId,\n experimentId: opts.campaignId,\n variant: cell.variant.payload,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n scenarioTags: cell.scenario.tags ?? {},\n seed: cell.seed,\n splitTag: settings.splitTag,\n emitter,\n store,\n rawSink,\n chat,\n }\n\n try {\n const wallStart = settings.now()\n const outcome = await invokeCampaignRunner(opts, cell, ctx)\n const wallMs = settings.now() - wallStart\n\n const integrityReport = await assertRunCaptured(store, runId, {\n ...settings.integrity,\n rawSink,\n })\n if (!integrityReport.ok) admitOrRejectIntegrity(settings, cell, runId, integrityReport)\n\n const record = buildCampaignRunRecord(opts, settings, cell, runId, outcome, wallMs)\n await stampAgentProfile(opts, cell, record, runId, outcome)\n return { record: validateRunRecord(record), integrity: integrityReport }\n } finally {\n // This run's worker has finished with it (success, run-level failure, or\n // genuine error). It is no longer the pool's job to finalize — drop it so\n // the post-settle sweep doesn't double-abort a finalized run.\n pool.openRuns.delete(runId)\n }\n}\n\n/** Invoke the runner; a throw aborts the run and becomes a run-level failure. */\nasync function invokeCampaignRunner<V>(\n opts: EvalCampaignOptions<V>,\n cell: CampaignCell<V>,\n ctx: CampaignRunContext<V>,\n): Promise<CampaignRunOutcome> {\n try {\n return await opts.runner(ctx)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n // The runner threw mid-execution. Abort the run so the emitter\n // finalizes. The only benign abortRun failure is \"the runner never\n // started the run\" (nothing to finalize). A store-write failure (disk\n // full, FS error) is a genuine diagnostic — surface it rather than\n // masking it as a plain runner failure.\n await finalizeAbort(ctx.emitter, ctx.runId, message)\n throw new CellExecutionError({\n runId: ctx.runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'runner_threw',\n error: message,\n })\n }\n}\n\n/** Apply the integrity-failure policy to a report that is not ok. */\nfunction admitOrRejectIntegrity<V>(\n settings: CampaignSettings,\n cell: CampaignCell<V>,\n runId: string,\n integrityReport: RunIntegrityReport,\n): void {\n switch (settings.onIntegrityFailure) {\n case 'throw':\n throw new RunIntegrityError(integrityReport)\n case 'mark_failed':\n throw new CellExecutionError(\n {\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'integrity_failed',\n error: integrityReport.issues.map((i) => i.code).join(', '),\n },\n integrityReport,\n )\n case 'log':\n // Caller wants the run admitted with a flagged report; fall through.\n break\n }\n}\n\n/** Assemble the RunRecord for a successful run, before profile stamping. */\nfunction buildCampaignRunRecord<V>(\n opts: EvalCampaignOptions<V>,\n settings: CampaignSettings,\n cell: CampaignCell<V>,\n runId: string,\n outcome: CampaignRunOutcome,\n wallMs: number,\n): RunRecord {\n const recordOutcome: RunOutcome = {\n raw: outcome.raw ?? {},\n }\n if (settings.splitTag === 'holdout') recordOutcome.holdoutScore = outcome.score\n else recordOutcome.searchScore = outcome.score\n if (outcome.judgeScores !== undefined) recordOutcome.judgeScores = outcome.judgeScores\n\n return {\n runId,\n experimentId: opts.campaignId,\n candidateId: cell.variant.id,\n seed: cell.seed,\n model: outcome.model,\n promptHash: outcome.promptHash,\n configHash: outcome.configHash,\n commitSha: opts.commitSha,\n wallMs,\n costUsd: outcome.costUsd,\n costProvenance: outcome.costProvenance,\n tokenUsage: outcome.tokenUsage,\n terminalOutcome: 'succeeded',\n judgeMetadata: outcome.judgeMetadata,\n outcome: recordOutcome,\n ...(outcome.failureClass ? { failureClass: outcome.failureClass } : {}),\n failureMode: outcome.failureMode,\n splitTag: settings.splitTag,\n scenarioId: cell.scenario.scenarioId,\n }\n}\n\n/** Resolve the run's agent profile (outcome first, then options) and stamp it on the record. */\nasync function stampAgentProfile<V>(\n opts: EvalCampaignOptions<V>,\n cell: CampaignCell<V>,\n record: RunRecord,\n runId: string,\n outcome: CampaignRunOutcome,\n): Promise<void> {\n const profileSource =\n outcome.agentProfile ??\n (typeof opts.agentProfile === 'function'\n ? await opts.agentProfile({\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n variant: cell.variant.payload,\n scenarioTags: cell.scenario.tags ?? {},\n })\n : opts.agentProfile)\n if (profileSource !== undefined) {\n const agentProfile = await resolveAgentProfileCell(profileSource)\n assertAgentProfileMatchesRun(agentProfile, outcome.model, outcome.promptHash)\n record.agentProfile = agentProfile\n }\n}\n\n/** Build the optional research report over the successful runs. */\nasync function buildCampaignReport<V>(\n opts: EvalCampaignOptions<V>,\n settings: CampaignSettings,\n runs: RunRecord[],\n): Promise<ResearchReport | undefined> {\n if (!opts.report) return undefined\n const reportOpts: ResearchReportOptions = {\n ...opts.report,\n comparator: opts.report.comparator,\n split: settings.splitTag === 'dev' ? 'search' : settings.splitTag,\n generatedAt: new Date(settings.now()).toISOString(),\n preregistrationHash: settings.preregistrationHash ?? undefined,\n }\n return researchReport(runs, reportOpts)\n}\n\n// ── Internal ─────────────────────────────────────────────────────────────\n\nclass CellExecutionError extends Error {\n readonly failed: FailedRun\n readonly integrity?: RunIntegrityReport\n constructor(failed: FailedRun, integrity?: RunIntegrityReport) {\n super(`cell ${failed.variantId}/${failed.scenarioId}@${failed.seed} failed: ${failed.reason}`)\n this.failed = failed\n this.integrity = integrity\n }\n}\n\n/**\n * Abort a run whose owning work threw or was orphaned by a sibling's genuine\n * error, finalizing the emitter so hooks fire and the store records a terminal\n * status. Safe to call unconditionally: it only aborts runs that are still\n * `running`. Two no-op cases are intentional and benign:\n *\n * - the run was never started (absent from the store) — nothing to finalize\n * - the run is already terminal (`completed` / `failed` / `aborted`) —\n * finalizing again would overwrite the real outcome (e.g. flip a passed run\n * to `aborted` with `{ pass: false, notes: reason }`), so we leave it alone\n *\n * Any OTHER failure of the store read or the abort write (disk full, FS fault,\n * backend down) is a genuine diagnostic and propagates rather than being\n * swallowed.\n */\nasync function finalizeAbort(emitter: TraceEmitter, runId: string, reason: string): Promise<void> {\n const existing = await emitter.traceStore.getRun(runId)\n if (existing === undefined) return // run never started; nothing to abort\n if (existing.status !== 'running') return // already finalized; never overwrite a real outcome\n // The emitter never throws on a failed store write; it counts it. A failed\n // abort write is a genuine diagnostic here, so read the count and surface it.\n const droppedBefore = emitter.captureStats().dropped\n await emitter.abortRun(reason)\n const after = emitter.captureStats()\n if (after.dropped > droppedBefore) {\n throw new Error(`finalizeAbort: run ${runId} could not be finalized: ${after.lastError}`)\n }\n}\n\nfunction defaultRawSinkFactory(workDir: string | undefined) {\n return (params: CampaignFactoryParams): RawProviderSink => {\n if (!workDir) {\n throw new Error(\n 'runEvalCampaign: rawSinkFactory not supplied and workDir not set. Pass either to enable raw provider capture, or pass `new NoopRawProviderSink()` via rawSinkFactory to opt out explicitly.',\n )\n }\n return new FileSystemRawProviderSink({\n dir: `${workDir}/raw-events/${params.runId}`,\n })\n }\n}\n\nasync function resolveAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): Promise<AgentProfileCell> {\n if (isAgentProfileCell(input)) {\n if (!(await verifyAgentProfileCell(input))) {\n throw new Error(`runEvalCampaign: agentProfile.cellId does not match its content`)\n }\n return input\n }\n return buildAgentProfileCell(input)\n}\n\nfunction isAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): input is AgentProfileCell {\n return 'schemaVersion' in input && 'cellId' in input\n}\n\nfunction assertAgentProfileMatchesRun(\n profile: AgentProfileCell,\n model: string,\n promptHash: string,\n): void {\n if (profile.model !== undefined && profile.model !== model) {\n throw new Error(\n `runEvalCampaign: agentProfile.model \"${profile.model}\" does not match outcome.model \"${model}\"`,\n )\n }\n if (profile.promptHash !== undefined && profile.promptHash !== promptHash) {\n throw new Error(\n `runEvalCampaign: agentProfile.promptHash \"${profile.promptHash}\" does not match outcome.promptHash \"${promptHash}\"`,\n )\n }\n}\n\nfunction defaultRunId(params: CampaignFactoryParams): string {\n // Stable across re-runs: fingerprint of (campaignId, variantId, scenarioId, seed).\n // Caller can override via opts.runId for non-deterministic IDs.\n const base = `${params.campaignId}::${params.variantId}::${params.scenarioId}::${params.seed}`\n // TWO 32-bit FNV-1a accumulators with different offsets, concatenated for a\n // 64-bit-wide id. Not crypto-grade; stability and uniqueness are what this\n // needs. Frozen: the value names a persisted cell, and the second\n // accumulator's offset is part of the identity, so no single-accumulator\n // helper can replace it.\n let h1 = 0x811c9dc5\n let h2 = 0x12345678\n for (let i = 0; i < base.length; i++) {\n const c = base.charCodeAt(i)\n h1 = Math.imul(h1 ^ c, 0x01000193) >>> 0\n h2 = Math.imul(h2 ^ c, 0x9e3779b1) >>> 0\n }\n return `run-${h1.toString(16).padStart(8, '0')}${h2.toString(16).padStart(8, '0')}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8SA,MAAM,oBAA8C;CAClD,aAAa;CACb,8BAA8B;CAC9B,gBAAgB;AAClB;AAgDA,eAAsB,gBACpB,MAC6B;CAC7B,wBAAwB,IAAI;CAC5B,MAAM,WAAW,wBAAwB,IAAI;CAC7C,MAAM,sBAAsB,MAAM,oBAAoB,MAAM,QAAQ;CAEpE,MAAM,YAAY,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,YAAY;CACvD,MAAM,OAAwB;EAC5B;EACA;EACA,OAAO,kBAAkB,MAAM,SAAS,KAAK;EAC7C,QAAQ;EACR,UAAU;EACV,eAAe,CAAC;EAChB,0BAAU,IAAI,IAAI;EAClB,MAAM,CAAC;EACP,kBAAkB,CAAC;EACnB,YAAY,CAAC;CACf;CACA,MAAM,kBAAkB,IAAI;CAE5B,MAAM,SAAS,MAAM,oBAAoB,MAAM,UAAU,KAAK,IAAI;CAClE,MAAM,UAAU,IAAI,KAAK,SA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AAM,EAChG;CAEF,IAAI,QAAQ,eAAe,KAAA,KAAa,QAAQ,eAAe,YAC7D,MAAM,IAAI,MACR,6CAA6C,QAAQ,WAAW,uCAAuC,WAAW,EACpH;AAEJ;AAEA,SAAS,aAAa,QAAuC;CAG3D,MAAM,OAAO,GAAG,OAAO,WAAW,IAAI,OAAO,UAAU,IAAI,OAAO,WAAW,IAAI,OAAO;CAMxF,IAAI,KAAK;CACT,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,IAAI,KAAK,WAAW,CAAC;EAC3B,KAAK,KAAK,KAAK,KAAK,GAAG,QAAU,MAAM;EACvC,KAAK,KAAK,KAAK,KAAK,GAAG,UAAU,MAAM;CACzC;CACA,OAAO,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAClF"}
@@ -1,7 +1,7 @@
1
1
  import { d as CostReceipt, f as CostReceiptInput, h as MaximumCharge, i as CostChannel, o as CostLedgerHandle } from "./cost-ledger-CSP-OfFe.js";
2
- import { i as AnalystFinding, n as AnalystContext, t as Analyst } from "./types-AGUuvnae.js";
3
- import { R as Scenario, S as JudgeConfig, w as JudgeScore } from "./types-DD1eUTLn.js";
4
- import { l as ExactCapableAnalyst } from "./exact-types-CiCXYhNK.js";
2
+ import { i as AnalystFinding, n as AnalystContext, t as Analyst } from "./types-CKNAzCSA.js";
3
+ import { R as Scenario, S as JudgeConfig, w as JudgeScore } from "./types-BO948H-U.js";
4
+ import { l as ExactCapableAnalyst } from "./exact-types-CUsSMW3n.js";
5
5
  interface EvaluationResult<T> {
6
6
  value: T;
7
7
  receipt: CostReceipt;
@@ -72,4 +72,4 @@ interface EvaluationAnalystOptions<I, O> {
72
72
  /** Registry, graph, and trace consumers keep the same Analyst interface. */
73
73
  declare function asAnalyst<I, O>(options: EvaluationAnalystOptions<I, O>): Analyst<I>;
74
74
  export { EvaluationResult as a, asJudge as c, EvaluationJudgeOptions as i, createEvaluator as l, EvaluationAnalystOptions as n, EvaluatorOptions as o, EvaluationContext as r, asAnalyst as s, CostedEvaluator as t };
75
- //# sourceMappingURL=evaluation-DfyLPVL1.d.ts.map
75
+ //# sourceMappingURL=evaluation-C4-tf3Z_.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evaluation-DfyLPVL1.d.ts","names":[],"sources":["../src/evaluation.ts"],"mappings":";;;;UAaiB,iBAAiB;EAChC,OAAO;EACP,SAAS;EACT;;UAGe;;;EAGf;EACA,SAAS;EACT,aAAa;EACb;EACA,UAAU;EACV;EACA,WAAW;EACX,gBAAgB;;EAEhB,aAAa,SAAS,uBAAuB;;KAGnC,gBAAgB,GAAG,MAC7B,OAAO,GACP,UAAU,sBACP,QAAQ,iBAAiB;UAEb,iBAAiB,GAAG;EACnC,UAAU,OAAO,GAAG;IAAW,QAAQ;IAAa;QAA6B,QAAQ;EACzF,UAAU,OAAO,MAAM;EACvB,oBAAoB,OAAO,UAAU;EACrC,mBAAmB,OAAO;EAC1B,aAAa;EACb,gBAAgB;;EAEhB,YAAY,OAAO,GAAG,OAAO,aAAa;;;iBAI5B,gBAAgB,GAAG,GAAG,SAAS,iBAAiB,GAAG,KAAK,gBAAgB,GAAG;UA6B1E,uBAAuB,GAAG,UAAU,UAAU;EAC7D;EACA;EACA,YAAY,YAAY,GAAG;EAC3B,UAAU;IAAkB,UAAU;IAAG,UAAU;KAAK;EACxD,MAAM,OAAO,GAAG;IAAS,UAAU;IAAG,UAAU;QAAQ,aAAa,QAAQ;;EAE7E,UACE,QAAQ,iBAAiB,IACzB;IAAS,UAAU;IAAG,UAAU;eACtB;EACZ,aAAa,UAAU;;;iBAIT,QAAQ,GAAG,UAAU,UAAU,GAC7C,SAAS,uBAAuB,GAAG,GAAG,KACrC,YAAY,GAAG;UA4BD,yBAAyB,GAAG;EAC3C;EACA;EACA;EACA,WAAW,QAAQ;EAC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UA4BD,yBAAyB,GAAG;EAC3C;EACA;EACA;EACA,WAAW,QAAQ;EACnB,MAAM,QAAQ;EACd,kBAAkB,oBAAoB;EACtC,WACE,OAAO,GACP,SAAS,mBACT,gBAAgB,mBACb,QAAQ,iBAAiB;EAC9B,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,mBAAmB,mBAAmB,QAAQ;EACjF,UAAU,QAAQ,iBAAiB,IAAI,OAAO,GAAG,SAAS,0BAA0B;;;iBAItE,UAAU,GAAG,GAAG,SAAS,yBAAyB,GAAG,KAAK,QAAQ"}
@@ -1,2 +1,2 @@
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-DfyLPVL1.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-C4-tf3Z_.js";
2
2
  export { CostedEvaluator, EvaluationAnalystOptions, EvaluationContext, EvaluationJudgeOptions, EvaluationResult, EvaluatorOptions, asAnalyst, asJudge, createEvaluator };
@@ -1,4 +1,4 @@
1
- import { c as AnalystRunEvent, d as AnalystRunSummary, t as Analyst, u as AnalystRunResult } from "./types-AGUuvnae.js";
1
+ import { c as AnalystRunEvent, d as AnalystRunSummary, t as Analyst, u as AnalystRunResult } from "./types-CKNAzCSA.js";
2
2
  import { z } from "zod";
3
3
  /** Analyst metadata required before the exact registry path will execute it. */
4
4
  interface ExactCapableAnalyst<TInput = unknown> extends Analyst<TInput> {
@@ -229,4 +229,4 @@ declare const exactExecutionPlanSchema: z.ZodObject<{
229
229
  digest: z.ZodString;
230
230
  }, z.core.$strict>;
231
231
  export { ExactAnalystRunPolicySnapshot as a, ExactAnalystSnapshot as c, ExactExecutionComponentSnapshot as d, ExactAnalystRunEvent as i, ExactCapableAnalyst as l, ExactAnalystExecutionPlanSnapshot as n, ExactAnalystRunResult as o, ExactAnalystRunCompletion as r, ExactAnalystRunSummary as s, ExactAnalystBudgetSnapshot as t, ExactExecutionComponentIdentity as u };
232
- //# sourceMappingURL=exact-types-CiCXYhNK.d.ts.map
232
+ //# sourceMappingURL=exact-types-CUsSMW3n.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exact-types-CiCXYhNK.d.ts","names":[],"sources":["../src/analyst/exact-types.ts"],"mappings":";;;UAMiB,oBAAoB,0BAA0B,QAAQ;;WAE5D,iBAAiB,SAAS;;KAGhC,aAAa,KAAK,0BAA0B,mBACpC,aAAa,UACtB,+BACc,aAAa,IAAI,aAAa,EAAE,WAC5C;KAEM,uBAAuB,aAAa,EAAE,aAAa;KACnD,6BAA6B,aAAa,EAAE,aAAa;;UAGpD;EACf;EACA;EACA,QAAQ,SAAS;;;UAIF;EACf;EACA;EACA;;KAyBU,gCAAgC,aAAa,EAAE,aAAa;KAC5D,oCAAoC,aAC9C,EAAE,aAAa;KAGL,yBAAyB;;EAEnC;;KAGU;EACN;;EAEA;EACA;IAAS;IAAe;;;UAGb,8BAA8B;EAC7C,aAAa;EACb,gBAAgB;EAChB,YAAY;;;KAIF,wBACP,QAAQ;EAAmB;;EAC1B,gBAAgB;MAEjB,KAAK,QAAQ;EAAmB;;EAC/B,SAAS;KAEX,QAAQ;EAAmB;MAC1B,KAAK,QAAQ;EAAmB;;EAC/B,SAAS;MAEV,KAAK,QAAQ;EAAmB;;EAC/B,QAAQ;;cAwCR,uBAAqB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAOzB,EAAA,KAAA;cAII,sBAAoB,EAAA,uBAAA,EAAA;;;;;;;;;;;GAaxB,EAAA,KAAA;cAiBI,sBAAoB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAYxB,EAAA,KAAA;cAEI,0BAAwB,EAAA;;;;;;;;;;;;;;;;;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-kuOr3BCF.js";
2
- import { a as ExecutionInsight, r as CostProvenanceSummary } from "./analyze-runs-Ke0WbAf6.js";
2
+ import { r as ExecutionInsight, t as CostProvenanceSummary } from "./insight-report-DYofCMLx.js";
3
3
  interface SummarizeExecutionOptions {
4
4
  runs: RunRecord[];
5
5
  histogramBins?: number;
@@ -11,4 +11,4 @@ interface ExecutionReport {
11
11
  /** Summarize runtime facts without interpreting task quality or promotion readiness. */
12
12
  declare function summarizeExecution(opts: SummarizeExecutionOptions): ExecutionReport;
13
13
  export { SummarizeExecutionOptions as n, summarizeExecution as r, ExecutionReport as t };
14
- //# sourceMappingURL=execution-insight-wUNXxo5Y.d.ts.map
14
+ //# sourceMappingURL=execution-insight-YihQrSqd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execution-insight-wUNXxo5Y.d.ts","names":[],"sources":["../src/contract/execution-insight.ts"],"mappings":";;UAWiB;EACf,MAAM;EACN;;UAGe;EACf,WAAW;EACX,gBAAgB;;;iBAIF,mBAAmB,MAAM,4BAA4B"}
1
+ {"version":3,"file":"execution-insight-YihQrSqd.d.ts","names":[],"sources":["../src/contract/execution-insight.ts"],"mappings":";;UAWiB;EACf,MAAM;EACN;;UAGe;EACf,WAAW;EACX,gBAAgB;;;iBAIF,mBAAmB,MAAM,4BAA4B"}
@@ -1,8 +1,8 @@
1
- import { A as pairedBootstrap, C as BOOTSTRAP_GATE_MIN_N, E as PairedBootstrapResult, G as pairedRiskDifferenceScore, J as benjaminiHochberg, L as ProportionInterval, S as requiredSampleSize, T as PairedBootstrapOptions, U as pairedRiskDifference, V as mcnemar, W as pairedRiskDifferenceExact, X as holm, Y as bonferroni, _ as mulberry32, a as eProcess, b as pairedMde, i as EProcessStep, n as EProcessOptions, q as wilson, r as EProcessState, t as EProcess, v as mcnemarPower, x as requiredPairedSampleSize, y as mcnemarRequiredN } from "../index-CKjqN9_U.js";
1
+ import { A as pairedBootstrap, C as BOOTSTRAP_GATE_MIN_N, E as PairedBootstrapResult, G as pairedRiskDifferenceScore, J as wilson, L as ProportionInterval, S as requiredSampleSize, T as PairedBootstrapOptions, U as pairedRiskDifference, V as mcnemar, W as pairedRiskDifferenceExact, X as bonferroni, Y as benjaminiHochberg, Z as holm, _ as mulberry32, a as eProcess, b as pairedMde, i as EProcessStep, n as EProcessOptions, r as EProcessState, t as EProcess, v as mcnemarPower, x as requiredPairedSampleSize, y as mcnemarRequiredN } from "../index-CIqYaySd.js";
2
2
  import { at as summarizeEvaluationUnits, it as defineEvaluationClaim, nt as EvaluationClaim, rt as EvaluationUnitSummary } from "../search-ledger-types-BhZE848w.js";
3
- import { A as SequentialPairedGateOptions, B as signManifest, C as heldoutSignificance, Ct as FinalEvidenceError, D as SequentialGateDecision, Dt as FinalEvidenceRecord, Et as FinalEvidenceOutcome, F as HypothesisResult, G as EvidenceVector, I as SignedManifest, L as SignedManifestAlgo, M as sequentialDecide, N as sequentialPairedGate, O as SequentialObservation, Ot as FinalEvidenceReservation, P as HypothesisManifest, Q as paretoSignificanceGate, R as hashJson, St as FinalEvidenceConflictError, Tt as FinalEvidenceMeasurement, V as verifyManifest, X as buildEvidenceVector, Y as PromotionPolicy, Z as paretoPolicy, _t as pairArms, a as EvidenceAuthorityKind, at as powerPreflight, b as HeldoutSignificanceOptions, bt as ArmPopulationReading, c as EvidenceReceiptVerification, d as verifyEvidenceReceipt, ft as PairedArmRow, gt as comparePairedArms, i as EvidenceAuthority, it as PowerPreflightOptions, k as SequentialPairedGate, kt as openFinalEvidenceLedger, l as createEvidenceReceipt, lt as PairArmsOptions, n as createCampaignEvidenceReceipt, o as EvidenceBinding, r as CreateEvidenceReceiptInput, rt as PowerPreflight, s as EvidenceReceipt, st as MatchedPair, t as CampaignEvidenceContext, u as isIndependentEvidence, ut as PairArmsResult, vt as pairRunRecords, w as pairHoldout, wt as FinalEvidenceLedger, x as PairedHoldout, xt as ArmPopulationSummary, y as HeldoutSignificance, yt as ArmAssignment, z as manifestContentDigest } from "../campaign-evidence-BmMs8YJt.js";
4
- import { a as JsonValue, i as EvidenceRecord, n as IntervalSpec, r as computeInterval, t as ComputedInterval } from "../interval-CWyxqDpE.js";
5
- import { a as PairedEvalueStep, i as PairedEvalueSequence, o as SequentialCrossingHorizon, r as PairedEvalueOptions, s as SequentialCrossingHorizonOptions, u as pairedEvalueSequence } from "../sequential-BhbTSxpt.js";
3
+ import { A as SequentialPairedGateOptions, B as signManifest, C as heldoutSignificance, Ct as FinalEvidenceError, D as SequentialGateDecision, Dt as FinalEvidenceRecord, Et as FinalEvidenceOutcome, F as HypothesisResult, G as EvidenceVector, I as SignedManifest, L as SignedManifestAlgo, M as sequentialDecide, N as sequentialPairedGate, O as SequentialObservation, Ot as FinalEvidenceReservation, P as HypothesisManifest, Q as paretoSignificanceGate, R as hashJson, St as FinalEvidenceConflictError, Tt as FinalEvidenceMeasurement, V as verifyManifest, X as buildEvidenceVector, Y as PromotionPolicy, Z as paretoPolicy, _t as pairArms, a as EvidenceAuthorityKind, at as powerPreflight, b as HeldoutSignificanceOptions, bt as ArmPopulationReading, c as EvidenceReceiptVerification, d as verifyEvidenceReceipt, ft as PairedArmRow, gt as comparePairedArms, i as EvidenceAuthority, it as PowerPreflightOptions, k as SequentialPairedGate, kt as openFinalEvidenceLedger, l as createEvidenceReceipt, lt as PairArmsOptions, n as createCampaignEvidenceReceipt, o as EvidenceBinding, r as CreateEvidenceReceiptInput, rt as PowerPreflight, s as EvidenceReceipt, st as MatchedPair, t as CampaignEvidenceContext, u as isIndependentEvidence, ut as PairArmsResult, vt as pairRunRecords, w as pairHoldout, wt as FinalEvidenceLedger, x as PairedHoldout, xt as ArmPopulationSummary, y as HeldoutSignificance, yt as ArmAssignment, z as manifestContentDigest } from "../campaign-evidence-CM4FBOkX.js";
4
+ import { a as MeasureValiditySelectionRules, c as verifyMeasureValidityPlan, d as computeInterval, f as EvidenceRecord, i as MeasureValidityPlanInput, l as ComputedInterval, n as MeasureValidityOutcome, o as SealedMeasureValidityPlan, p as JsonValue, r as MeasureValidityPlan, s as sealMeasureValidityPlan, t as MeasureValidityMeasure, u as IntervalSpec } from "../measure-validity-plan-B1_qYlsk.js";
5
+ import { a as PairedEvalueStep, i as PairedEvalueSequence, o as SequentialCrossingHorizon, r as PairedEvalueOptions, s as SequentialCrossingHorizonOptions, u as pairedEvalueSequence } from "../sequential-B9iROM1S.js";
6
6
  import { z } from "zod";
7
7
  /**
8
8
  * Closed-key comparison over a declared record schema. The only leaf node.
@@ -955,5 +955,5 @@ interface ProspectiveCanaryJoinInput {
955
955
  * randomization and the pre-traffic witness in `decideRandomizedCanary`.
956
956
  */
957
957
  export declare function joinProspectiveCanaryReceipts(input: ProspectiveCanaryJoinInput): CanaryObservation[];
958
- export { type AdmissionExecution, type AdmissionPartition, type AdmissionRule, type AdmissionStage, type ArmAssignment, type ArmPopulationReading, type ArmPopulationSummary, type ArmRealizedBudget, type ArmSpec, BOOTSTRAP_GATE_MIN_N, type BudgetRule, type CampaignEvidenceContext, type CanaryArm, type CanaryAssignmentReceipt, type CanaryCohortReceipt, type CanaryCohortVerifier, type CanaryObservation, type CanaryRefusal, type ClusteredPowerOptions, type ClusteredPowerPoint, type ClusteredPowerRefusal, type ClusteredPowerResult, type ComputedInterval, type Condition, type CreateEvidenceReceiptInput, type DecisionBranch, type DecisionOutcome, type DecisionRule, type DerivedQuantities, type EProcess, type EProcessOptions, type EProcessState, type EProcessStep, type Estimand, type EstimandResult, type EvaluationClaim, type EvaluationUnitSummary, type EvidenceAuthority, type EvidenceAuthorityKind, type EvidenceBinding, type EvidenceDenominator, type EvidenceReceipt, type EvidenceReceiptVerification, type EvidenceRecord, type EvidenceRegistryRecord, type EvidenceState, type EvidenceVector, type ExperimentFunnel, type ExperimentGateEvidence, type ExperimentSpec, FinalEvidenceConflictError, FinalEvidenceError, type FinalEvidenceLedger, type FinalEvidenceMeasurement, type FinalEvidenceOutcome, type FinalEvidenceRecord, type FinalEvidenceReservation, type FunnelPartitionCount, type FunnelStageCount, type FunnelStageInput, type HaltOutcome, type HaltRule, type HeldoutSignificance, type HeldoutSignificanceOptions, type HypothesisManifest, type HypothesisResult, type IntervalSpec, type JsonValue, type MatchedBudgetRule, type MatchedBudgetVerdict, type MatchedPair, type NLadderProjection, type Obligation, type OutcomeSpec, type PairArmsOptions, type PairArmsResult, type PairedArmRow, type PairedBootstrapOptions, type PairedBootstrapResult, type PairedEvalueOptions, type PairedEvalueSequence, type PairedEvalueStep, type PairedHoldout, type PowerPreflight, type PowerPreflightOptions, type Predicate, type PromotionPolicy, type ProportionInterval, type ProspectiveCanaryAssignment, type ProspectiveCanaryBilling, type ProspectiveCanaryExecution, type ProspectiveCanaryJoinInput, type ProspectiveCanaryOutcome, type RandomizedCanaryDecision, type RandomizedCanaryRule, type RegisteredExperiment, type ReissuePolicy, type ReissueVerdict, type SealAmendment, type SealedExperiment, type SealedRandomizedCanaryRule, type SeedDerivation, type SelectionRule, type SequentialCrossingHorizon, type SequentialCrossingHorizonOptions, type SequentialGateDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SetExpr, type SignFlipFloor, type SignedManifest, type SignedManifestAlgo, type UniformPassDecision, type UniformPassSchedule, type ValidityGate, type ValidityGateResult, benjaminiHochberg, bonferroni, buildEvidenceVector, comparePairedArms, computeInterval, createCampaignEvidenceReceipt, createEvidenceReceipt, defineEvaluationClaim, eProcess, hashJson, heldoutSignificance, holm, isIndependentEvidence, manifestContentDigest, mcnemar, mcnemarPower, mcnemarRequiredN, mulberry32, openFinalEvidenceLedger, pairArms, pairHoldout, pairRunRecords, pairedBootstrap, pairedEvalueSequence, pairedMde, pairedRiskDifference, pairedRiskDifferenceExact, pairedRiskDifferenceScore, paretoPolicy, paretoSignificanceGate, powerPreflight, requiredPairedSampleSize, requiredSampleSize, sequentialDecide, sequentialPairedGate, signManifest, summarizeEvaluationUnits, verifyEvidenceReceipt, verifyManifest, wilson };
958
+ export { type AdmissionExecution, type AdmissionPartition, type AdmissionRule, type AdmissionStage, type ArmAssignment, type ArmPopulationReading, type ArmPopulationSummary, type ArmRealizedBudget, type ArmSpec, BOOTSTRAP_GATE_MIN_N, type BudgetRule, type CampaignEvidenceContext, type CanaryArm, type CanaryAssignmentReceipt, type CanaryCohortReceipt, type CanaryCohortVerifier, type CanaryObservation, type CanaryRefusal, type ClusteredPowerOptions, type ClusteredPowerPoint, type ClusteredPowerRefusal, type ClusteredPowerResult, type ComputedInterval, type Condition, type CreateEvidenceReceiptInput, type DecisionBranch, type DecisionOutcome, type DecisionRule, type DerivedQuantities, type EProcess, type EProcessOptions, type EProcessState, type EProcessStep, type Estimand, type EstimandResult, type EvaluationClaim, type EvaluationUnitSummary, type EvidenceAuthority, type EvidenceAuthorityKind, type EvidenceBinding, type EvidenceDenominator, type EvidenceReceipt, type EvidenceReceiptVerification, type EvidenceRecord, type EvidenceRegistryRecord, type EvidenceState, type EvidenceVector, type ExperimentFunnel, type ExperimentGateEvidence, type ExperimentSpec, FinalEvidenceConflictError, FinalEvidenceError, type FinalEvidenceLedger, type FinalEvidenceMeasurement, type FinalEvidenceOutcome, type FinalEvidenceRecord, type FinalEvidenceReservation, type FunnelPartitionCount, type FunnelStageCount, type FunnelStageInput, type HaltOutcome, type HaltRule, type HeldoutSignificance, type HeldoutSignificanceOptions, type HypothesisManifest, type HypothesisResult, type IntervalSpec, type JsonValue, type MatchedBudgetRule, type MatchedBudgetVerdict, type MatchedPair, type MeasureValidityMeasure, type MeasureValidityOutcome, type MeasureValidityPlan, type MeasureValidityPlanInput, type MeasureValiditySelectionRules, type NLadderProjection, type Obligation, type OutcomeSpec, type PairArmsOptions, type PairArmsResult, type PairedArmRow, type PairedBootstrapOptions, type PairedBootstrapResult, type PairedEvalueOptions, type PairedEvalueSequence, type PairedEvalueStep, type PairedHoldout, type PowerPreflight, type PowerPreflightOptions, type Predicate, type PromotionPolicy, type ProportionInterval, type ProspectiveCanaryAssignment, type ProspectiveCanaryBilling, type ProspectiveCanaryExecution, type ProspectiveCanaryJoinInput, type ProspectiveCanaryOutcome, type RandomizedCanaryDecision, type RandomizedCanaryRule, type RegisteredExperiment, type ReissuePolicy, type ReissueVerdict, type SealAmendment, type SealedExperiment, type SealedMeasureValidityPlan, type SealedRandomizedCanaryRule, type SeedDerivation, type SelectionRule, type SequentialCrossingHorizon, type SequentialCrossingHorizonOptions, type SequentialGateDecision, type SequentialObservation, type SequentialPairedGate, type SequentialPairedGateOptions, type SetExpr, type SignFlipFloor, type SignedManifest, type SignedManifestAlgo, type UniformPassDecision, type UniformPassSchedule, type ValidityGate, type ValidityGateResult, benjaminiHochberg, bonferroni, buildEvidenceVector, comparePairedArms, computeInterval, createCampaignEvidenceReceipt, createEvidenceReceipt, defineEvaluationClaim, eProcess, hashJson, heldoutSignificance, holm, isIndependentEvidence, manifestContentDigest, mcnemar, mcnemarPower, mcnemarRequiredN, mulberry32, openFinalEvidenceLedger, pairArms, pairHoldout, pairRunRecords, pairedBootstrap, pairedEvalueSequence, pairedMde, pairedRiskDifference, pairedRiskDifferenceExact, pairedRiskDifferenceScore, paretoPolicy, paretoSignificanceGate, powerPreflight, requiredPairedSampleSize, requiredSampleSize, sealMeasureValidityPlan, sequentialDecide, sequentialPairedGate, signManifest, summarizeEvaluationUnits, verifyEvidenceReceipt, verifyManifest, verifyMeasureValidityPlan, wilson };
959
959
  //# sourceMappingURL=index.d.ts.map
@@ -1,17 +1,19 @@
1
1
  import { n as CaptureIntegrityError, s as ValidationError } from "../errors-DeEEV9Vx.js";
2
2
  import { a as hashCanonical, t as LEDGER_HASH_PATTERN } from "../canonical-DKgL_Wby.js";
3
3
  import { d as signManifest, f as verifyManifest, l as hashJson, u as manifestContentDigest } from "../agent-profile-cell-CUthydZB.js";
4
- import { n as pairArms, r as pairRunRecords, t as comparePairedArms } from "../paired-arms-DZhH3FGu.js";
5
- import { Ct as studentTCdf, D as holm, E as bonferroni, S as pairedRiskDifferenceScore, T as benjaminiHochberg, b as pairedRiskDifference, c as pairedMde, d as BOOTSTRAP_GATE_MIN_N, l as requiredPairedSampleSize, o as mcnemarPower, p as pairedBootstrap, s as mcnemarRequiredN, t as eProcess, u as requiredSampleSize, v as mcnemar, w as wilson, wt as studentTQuantile, x as pairedRiskDifferenceExact } from "../statistics-DSidA5I2.js";
4
+ import { n as pairArms, r as pairRunRecords, t as comparePairedArms } from "../paired-arms-B6EXnI47.js";
5
+ import { D as studentTCdf, O as studentTQuantile, r as pairedBootstrap, t as BOOTSTRAP_GATE_MIN_N } from "../paired-tests-CXcD_B80.js";
6
6
  import { t as mulberry32 } from "../random-DrzcgC7F.js";
7
- import { a as heldoutSignificance, o as pairHoldout } from "../statistical-heldout-CaS4T-43.js";
8
- import { C as openFinalEvidenceLedger, S as FinalEvidenceError, b as powerPreflight, i as verifyEvidenceReceipt, n as createEvidenceReceipt, r as isIndependentEvidence, t as createCampaignEvidenceReceipt, x as FinalEvidenceConflictError } from "../campaign-evidence-D_oBFfLc.js";
7
+ import { S as holm, b as benjaminiHochberg, c as pairedMde, f as mcnemar, g as pairedRiskDifferenceScore, h as pairedRiskDifferenceExact, l as requiredPairedSampleSize, m as pairedRiskDifference, o as mcnemarPower, s as mcnemarRequiredN, t as eProcess, u as requiredSampleSize, x as bonferroni, y as wilson } from "../statistics-BPl13X3G.js";
8
+ import { a as heldoutSignificance, o as pairHoldout } from "../statistical-heldout-C7Jjo5nP.js";
9
+ import { C as FinalEvidenceError, S as FinalEvidenceConflictError, i as verifyEvidenceReceipt, n as createEvidenceReceipt, r as isIndependentEvidence, t as createCampaignEvidenceReceipt, w as openFinalEvidenceLedger, x as powerPreflight } from "../campaign-evidence-BTfzZo1u.js";
9
10
  import { n as evaluatePredicate, r as readField, t as compareValues } from "../predicate-BYHA4MBn.js";
10
11
  import { r as summarizeEvaluationUnits, t as defineEvaluationClaim } from "../claim-BWEXwwBk.js";
11
- import { n as pairedEvalueSequence } from "../sequential-ux_XrjBf.js";
12
+ import { n as pairedEvalueSequence } from "../sequential-tZjGysXY.js";
12
13
  import { n as intervalSpecProblems, r as computeEstimand, t as computeInterval } from "../interval-Bd2f4CRT.js";
13
- import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-CxDIh-9p.js";
14
- import { n as sequentialPairedGate, t as sequentialDecide } from "../sequential-BphITa5b.js";
14
+ import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-Z5E-C32U.js";
15
+ import { i as sequentialPairedGate, n as clusteredPower, r as sequentialDecide, t as assertDesignAdequate } from "../power-DTg6u30w.js";
16
+ import { n as verifyMeasureValidityPlan, t as sealMeasureValidityPlan } from "../measure-validity-plan-t0YQRzJQ.js";
15
17
  import { z } from "zod";
16
18
  // src/experiment/ast/decision.ts
17
19
  /** A decision rule's branches did not cover the evidence. */
@@ -867,182 +869,6 @@ const evidenceRegistryRecordSchema = z.strictObject({
867
869
  supersedes: z.array(z.string().regex(idPattern)).optional(),
868
870
  notes: z.string().min(1).optional()
869
871
  });
870
- // src/experiment/power.ts
871
- /**
872
- * Design-time power for task-clustered paired designs, with a refusal verdict.
873
- *
874
- * The failure this prevents (measured): a pre-registered kill test fixed a
875
- * task-clustered bootstrap over 14 rows in 4 task clusters. Simulated at the
876
- * registered seed, the design's power topped out at 0.69 — at a per-row
877
- * effect of 1.0. "Four clusters cannot certify any effect size, including
878
- * 1.0" was learned by running the experiment; this module computes it before
879
- * a dollar is spent.
880
- *
881
- * Two floors, one simulation:
882
- * - Closed form, zero spend: with C independent clusters the exact
883
- * whole-cluster sign-flip test can never produce a two-sided p below
884
- * 2^(1-C). C=4 gives 0.125; C=3 gives 0.25 — both above a 0.05 alpha, so
885
- * those designs are refused at ANY effect size, before simulation.
886
- * - Seeded simulation: per-row paired contrasts drawn under a registered
887
- * effect model, a whole-cluster percentile bootstrap on each trial, power =
888
- * the fraction of trials whose interval excludes zero.
889
- *
890
- * The refusal is a verdict INSIDE the returned artifact (the powerPreflight
891
- * shape, made cluster-aware); `assertDesignAdequate` turns it into a throw for
892
- * callers that want configuration-time failure.
893
- */
894
- /** A design refused at configuration time, before any spend. */
895
- var DesignRefusalError = class extends ValidationError {};
896
- /**
897
- * Simulate the power of a whole-cluster percentile-bootstrap design and refuse
898
- * a structure that cannot reach target power at the declared minimum effect.
899
- */
900
- function clusteredPower(options) {
901
- const clusterSizes = options.clusterSizes;
902
- if (clusterSizes.length === 0 || clusterSizes.some((n) => !Number.isInteger(n) || n <= 0)) throw new ValidationError(`clusteredPower: clusterSizes must be positive integers, got [${clusterSizes.join(", ")}]`);
903
- if (options.effects.length === 0) throw new ValidationError("clusteredPower: effects grid is empty");
904
- if (options.effects.some((effect) => !Number.isFinite(effect) || effect < 0 || effect > 1) || new Set(options.effects).size !== options.effects.length) throw new ValidationError("clusteredPower: effects must be unique finite values in [0,1]");
905
- if (!Number.isFinite(options.minimumEffect) || options.minimumEffect <= 0 || options.minimumEffect > 1) throw new ValidationError("clusteredPower: minimumEffect must be in (0,1]");
906
- if (!options.effects.includes(options.minimumEffect)) throw new ValidationError("clusteredPower: effects must contain minimumEffect exactly; no interpolation is assumed");
907
- if (!Number.isInteger(options.seed)) throw new ValidationError(`clusteredPower: seed must be an integer, got ${options.seed}`);
908
- const trials = options.trials ?? 2e3;
909
- const resamples = options.resamples ?? 4e3;
910
- if (!Number.isInteger(trials) || trials <= 0 || !Number.isInteger(resamples) || resamples <= 0) throw new ValidationError(`clusteredPower: trials and resamples must be positive integers, got ${trials}/${resamples}`);
911
- const confidence = options.confidence ?? .95;
912
- if (!Number.isFinite(confidence) || confidence <= 0 || confidence >= 1) throw new ValidationError(`clusteredPower: confidence must be in (0,1), got ${confidence}`);
913
- const alpha = options.alpha ?? .05;
914
- const targetPower = options.targetPower ?? .8;
915
- if (!Number.isFinite(alpha) || alpha <= 0 || alpha >= 1) throw new ValidationError("clusteredPower: alpha must be in (0,1)");
916
- if (!Number.isFinite(targetPower) || targetPower <= 0 || targetPower > 1) throw new ValidationError("clusteredPower: targetPower must be in (0,1]");
917
- const baseWinRate = options.baseWinRate ?? .1;
918
- const baseLossRate = options.baseLossRate ?? .1;
919
- if (!Number.isFinite(baseWinRate) || !Number.isFinite(baseLossRate) || baseWinRate < 0 || baseLossRate < 0 || baseWinRate + baseLossRate > 1) throw new ValidationError("clusteredPower: base win/loss rates must be nonnegative and sum to at most 1");
920
- if (baseWinRate !== baseLossRate) throw new ValidationError("clusteredPower: the zero-effect model requires equal baseWinRate and baseLossRate");
921
- const noisy = /* @__PURE__ */ new Map();
922
- for (const cluster of options.noisyClusters ?? []) {
923
- if (!Number.isInteger(cluster.index) || cluster.index < 0 || cluster.index >= clusterSizes.length) throw new ValidationError(`clusteredPower: noisy cluster index ${cluster.index} outside [0,${clusterSizes.length - 1}]`);
924
- if (noisy.has(cluster.index) || !Number.isFinite(cluster.flipRate) || cluster.flipRate < 0 || cluster.flipRate > 1) throw new ValidationError("clusteredPower: noisy clusters need unique indices and flipRate in [0,1]");
925
- noisy.set(cluster.index, cluster.flipRate);
926
- }
927
- const clusterCount = clusterSizes.length;
928
- const totalRows = clusterSizes.reduce((a, b) => a + b, 0);
929
- const signFlipFloor = computeSignFlipFloor(clusterCount, alpha);
930
- const curve = [];
931
- for (const effect of options.effects) curve.push(simulateEffect(effect, {
932
- clusterSizes,
933
- seed: options.seed,
934
- trials,
935
- resamples,
936
- confidence,
937
- baseWinRate,
938
- baseLossRate,
939
- noisy
940
- }));
941
- const maxPower = Math.max(...curve.map((point) => point.power));
942
- const powerAtMinimumEffect = curve.find((point) => point.effect === options.minimumEffect).power;
943
- const reasons = [];
944
- if (!signFlipFloor.certifiableAtAlpha) reasons.push(`${clusterCount} clusters cannot certify any effect size, including 1.0: the exact whole-cluster sign-flip test's smallest two-sided p is 2^(1-${clusterCount}) = ${signFlipFloor.twoSidedP} > alpha ${alpha}; at least ${signFlipFloor.minClustersForAlpha} clusters are needed`);
945
- if (powerAtMinimumEffect < targetPower) reasons.push(`simulated power ${powerAtMinimumEffect.toFixed(3)} at minimum worthwhile effect ${options.minimumEffect} is below target ${targetPower}; maximum grid power ${maxPower.toFixed(3)} does not establish adequacy at that effect`);
946
- const adequate = reasons.length === 0;
947
- return {
948
- clusterCount,
949
- totalRows,
950
- trials,
951
- resamples,
952
- seed: options.seed,
953
- confidence,
954
- targetPower,
955
- minimumEffect: options.minimumEffect,
956
- powerAtMinimumEffect,
957
- curve,
958
- maxPower,
959
- signFlipFloor,
960
- adequate,
961
- refusal: adequate ? null : {
962
- verdict: "underpowered",
963
- reasons,
964
- recommendation: `Do not spend on this structure. Add independent clusters (>= ${Math.max(signFlipFloor.minClustersForAlpha, clusterCount)}) or register a design whose simulated power reaches ${targetPower} at effect ${options.minimumEffect}, then re-run clusteredPower.`
965
- }
966
- };
967
- }
968
- /** Throw the refusal for callers that want configuration-time failure. */
969
- function assertDesignAdequate(result) {
970
- if (result.refusal) throw new DesignRefusalError(`design refused (underpowered): ${result.refusal.reasons.join("; ")}`);
971
- }
972
- function computeSignFlipFloor(clusterCount, alpha) {
973
- const twoSidedP = 2 ** (1 - clusterCount);
974
- const oneSidedP = 2 ** -clusterCount;
975
- let minClusters = 1;
976
- while (2 ** (1 - minClusters) > alpha) minClusters += 1;
977
- return {
978
- twoSidedP,
979
- oneSidedP,
980
- alpha,
981
- certifiableAtAlpha: twoSidedP <= alpha,
982
- minClustersForAlpha: minClusters
983
- };
984
- }
985
- /**
986
- * One effect point. Loss probability is min(baseLoss, (1-effect)/2) and
987
- * win probability is loss probability plus effect. Their difference equals
988
- * effect, including near the probability boundary. Noisy clusters draw win
989
- * and loss independently at their
990
- * flip rate. Each trial computes a whole-cluster percentile bootstrap of the
991
- * pooled row mean; the trial counts toward power when the interval excludes
992
- * zero.
993
- */
994
- function simulateEffect(effect, config) {
995
- const rng = mulberry32(mixSeed(config.seed, effect));
996
- const clusterCount = config.clusterSizes.length;
997
- let excludes = 0;
998
- const widths = new Array(config.trials);
999
- const sums = new Array(clusterCount);
1000
- const means = new Array(config.resamples);
1001
- for (let trial = 0; trial < config.trials; trial++) {
1002
- for (let cluster = 0; cluster < clusterCount; cluster++) {
1003
- const size = config.clusterSizes[cluster];
1004
- const flipRate = config.noisy.get(cluster);
1005
- let sum = 0;
1006
- for (let row = 0; row < size; row++) if (flipRate !== void 0) {
1007
- const win = rng() < flipRate ? 1 : 0;
1008
- const loss = rng() < flipRate ? 1 : 0;
1009
- sum += win - loss;
1010
- } else {
1011
- const lossRate = Math.min(config.baseLossRate, (1 - effect) / 2);
1012
- const winRate = lossRate + effect;
1013
- const u = rng();
1014
- sum += u < winRate ? 1 : u < winRate + lossRate ? -1 : 0;
1015
- }
1016
- sums[cluster] = sum;
1017
- }
1018
- for (let draw = 0; draw < config.resamples; draw++) {
1019
- let pooledSum = 0;
1020
- let pooledRows = 0;
1021
- for (let pick = 0; pick < clusterCount; pick++) {
1022
- const index = Math.floor(rng() * clusterCount);
1023
- pooledSum += sums[index];
1024
- pooledRows += config.clusterSizes[index];
1025
- }
1026
- means[draw] = pooledSum / pooledRows;
1027
- }
1028
- means.sort((a, b) => a - b);
1029
- const tail = 1 - config.confidence;
1030
- const lower = means[Math.floor(tail / 2 * config.resamples)];
1031
- const upper = means[Math.max(Math.floor(tail / 2 * config.resamples), Math.min(config.resamples - 1, Math.ceil((1 - tail / 2) * config.resamples) - 1))];
1032
- widths[trial] = upper - lower;
1033
- if (lower > 0 || upper < 0) excludes += 1;
1034
- }
1035
- widths.sort((a, b) => a - b);
1036
- return {
1037
- effect,
1038
- power: excludes / config.trials,
1039
- medianCiWidth: widths[Math.floor(config.trials / 2)]
1040
- };
1041
- }
1042
- /** Fold the effect into the seed so every grid point draws an independent stream. */
1043
- function mixSeed(seed, effect) {
1044
- return (seed ^ Math.round(effect * 1000003) * 2654435769) >>> 0 | 0;
1045
- }
1046
872
  // src/experiment/prospective-canary-join.ts
1047
873
  function nonEmpty$1(value, label) {
1048
874
  if (typeof value !== "string" || value.length === 0 || value.trim() !== value) throw new ValidationError(`prospective canary: ${label} must be a nonempty trimmed string`);
@@ -1463,6 +1289,6 @@ function decideRandomizedCanary(sealed, cohort, rows, verifyCohort) {
1463
1289
  estimateRiskDifference(sealed.rule, tally, result);
1464
1290
  return result;
1465
1291
  }
1466
- export { BOOTSTRAP_GATE_MIN_N, EVIDENCE_STATES, FinalEvidenceConflictError, FinalEvidenceError, amendExperiment, assertDesignAdequate, assertMatchedBudgets, benjaminiHochberg, bonferroni, buildEvidenceVector, buildFunnel, clusteredPower, comparePairedArms, composeFunnels, computeInterval, createCampaignEvidenceReceipt, createEvidenceReceipt, decideRandomizedCanary, defineEvaluationClaim, defineExperiment, eProcess, evaluateCondition, evaluatePowerFloorGate, evidenceRegistryRecordSchema, executeAdmissionRule, executeDecisionRule, hashJson, heldoutSignificance, holm, isIndependentEvidence, joinProspectiveCanaryReceipts, manifestContentDigest, mcnemar, mcnemarPower, mcnemarRequiredN, mulberry32, openFinalEvidenceLedger, openSealedExperiment, pairArms, pairHoldout, pairRunRecords, pairedBootstrap, pairedEvalueSequence, pairedMde, pairedRiskDifference, pairedRiskDifferenceExact, pairedRiskDifferenceScore, paretoPolicy, paretoSignificanceGate, powerPreflight, randomizedCanaryObservationDigest, randomizedCanaryRosterDigest, readField, renderFunnelTable, requiredPairedSampleSize, requiredSampleSize, sealExperiment, sealRandomizedCanaryRule, sequentialDecide, sequentialPairedGate, signManifest, summarizeEvaluationUnits, verifyEvidenceReceipt, verifyManifest, verifyMatchedBudgets, verifySealedExperiment, wilson };
1292
+ export { BOOTSTRAP_GATE_MIN_N, EVIDENCE_STATES, FinalEvidenceConflictError, FinalEvidenceError, amendExperiment, assertDesignAdequate, assertMatchedBudgets, benjaminiHochberg, bonferroni, buildEvidenceVector, buildFunnel, clusteredPower, comparePairedArms, composeFunnels, computeInterval, createCampaignEvidenceReceipt, createEvidenceReceipt, decideRandomizedCanary, defineEvaluationClaim, defineExperiment, eProcess, evaluateCondition, evaluatePowerFloorGate, evidenceRegistryRecordSchema, executeAdmissionRule, executeDecisionRule, hashJson, heldoutSignificance, holm, isIndependentEvidence, joinProspectiveCanaryReceipts, manifestContentDigest, mcnemar, mcnemarPower, mcnemarRequiredN, mulberry32, openFinalEvidenceLedger, openSealedExperiment, pairArms, pairHoldout, pairRunRecords, pairedBootstrap, pairedEvalueSequence, pairedMde, pairedRiskDifference, pairedRiskDifferenceExact, pairedRiskDifferenceScore, paretoPolicy, paretoSignificanceGate, powerPreflight, randomizedCanaryObservationDigest, randomizedCanaryRosterDigest, readField, renderFunnelTable, requiredPairedSampleSize, requiredSampleSize, sealExperiment, sealMeasureValidityPlan, sealRandomizedCanaryRule, sequentialDecide, sequentialPairedGate, signManifest, summarizeEvaluationUnits, verifyEvidenceReceipt, verifyManifest, verifyMatchedBudgets, verifyMeasureValidityPlan, verifySealedExperiment, wilson };
1467
1293
 
1468
1294
  //# sourceMappingURL=index.js.map