@tangle-network/agent-eval 1.0.19 → 1.0.20

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 (284) hide show
  1. package/CHANGELOG.md +15 -21
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-CPv4tENR.d.ts → agent-profile-BO8ruI6R.d.ts} +3 -3
  4. package/dist/{agent-profile-CPv4tENR.d.ts.map → agent-profile-BO8ruI6R.d.ts.map} +1 -1
  5. package/dist/analyst/index.d.ts +14 -14
  6. package/dist/analyst/index.js +11 -12
  7. package/dist/analyst/index.js.map +1 -1
  8. package/dist/{analyze-runs-pJ4fhnYg.d.ts → analyze-runs-DicleUI_.d.ts} +4 -4
  9. package/dist/{analyze-runs-pJ4fhnYg.d.ts.map → analyze-runs-DicleUI_.d.ts.map} +1 -1
  10. package/dist/{analyze-runs-C7vWBDhl.js → analyze-runs-e9vfXY--.js} +6 -110
  11. package/dist/analyze-runs-e9vfXY--.js.map +1 -0
  12. package/dist/app-grade/index.d.ts +4 -4
  13. package/dist/app-grade/index.js +3 -3
  14. package/dist/{benchmark-command-DSJQeYom.js → benchmark-command-BGZD77Un.js} +13 -14
  15. package/dist/benchmark-command-BGZD77Un.js.map +1 -0
  16. package/dist/benchmarks/index.d.ts +4 -4
  17. package/dist/benchmarks/index.js +4 -5
  18. package/dist/benchmarks/index.js.map +1 -1
  19. package/dist/builder-eval/index.js +1 -1
  20. package/dist/{calibration-CbZPApIO.js → calibration-Ze7SjhT9.js} +2 -2
  21. package/dist/{calibration-CbZPApIO.js.map → calibration-Ze7SjhT9.js.map} +1 -1
  22. package/dist/campaign/index.d.ts +7 -7
  23. package/dist/campaign/index.js +10 -10
  24. package/dist/{campaign-BABipFel.js → campaign-BfDMncQN.js} +14 -15
  25. package/dist/{campaign-BABipFel.js.map → campaign-BfDMncQN.js.map} +1 -1
  26. package/dist/{campaign-evidence-DONEWvVY.js → campaign-evidence-BuKlRzSA.js} +3 -3
  27. package/dist/{campaign-evidence-DONEWvVY.js.map → campaign-evidence-BuKlRzSA.js.map} +1 -1
  28. package/dist/{chat-client-D0me8iwq.js → chat-client-Zz97O3NB.js} +2 -2
  29. package/dist/{chat-client-D0me8iwq.js.map → chat-client-Zz97O3NB.js.map} +1 -1
  30. package/dist/{chat-json-call-C473CwTt.js → chat-json-call-Dgi7-RH-.js} +2 -2
  31. package/dist/{chat-json-call-C473CwTt.js.map → chat-json-call-Dgi7-RH-.js.map} +1 -1
  32. package/dist/cli.js +7 -7
  33. package/dist/{types-0KglnQ9o.d.ts → cluster-Cd0MRbr9.d.ts} +44 -2
  34. package/dist/cluster-Cd0MRbr9.d.ts.map +1 -0
  35. package/dist/cluster-bootstrap-BYIW7QJ4.js +24 -0
  36. package/dist/cluster-bootstrap-BYIW7QJ4.js.map +1 -0
  37. package/dist/{completion-verifier-7KEfroqx.d.ts → completion-verifier-BEpsr3N4.d.ts} +2 -2
  38. package/dist/{completion-verifier-7KEfroqx.d.ts.map → completion-verifier-BEpsr3N4.d.ts.map} +1 -1
  39. package/dist/{completion-verifier-ClmJV_Yc.js → completion-verifier-DFyYFezn.js} +3 -3
  40. package/dist/{completion-verifier-ClmJV_Yc.js.map → completion-verifier-DFyYFezn.js.map} +1 -1
  41. package/dist/contract/index.d.ts +10 -10
  42. package/dist/contract/index.js +14 -15
  43. package/dist/contract/index.js.map +1 -1
  44. package/dist/{cost-ledger-CS8R3IZj.js → cost-ledger-DfhStGcZ.js} +2 -2
  45. package/dist/{cost-ledger-CS8R3IZj.js.map → cost-ledger-DfhStGcZ.js.map} +1 -1
  46. package/dist/{decision-point-CNyoKOkz.js → decision-point-DJWievVw.js} +4 -4
  47. package/dist/{decision-point-CNyoKOkz.js.map → decision-point-DJWievVw.js.map} +1 -1
  48. package/dist/{default-registry-BbXr18AT.d.ts → default-registry-BpGFsSpZ.d.ts} +7 -7
  49. package/dist/{default-registry-BbXr18AT.d.ts.map → default-registry-BpGFsSpZ.d.ts.map} +1 -1
  50. package/dist/{default-registry-BB9_jzyH.js → default-registry-CdMtoY-s.js} +5 -5
  51. package/dist/{default-registry-BB9_jzyH.js.map → default-registry-CdMtoY-s.js.map} +1 -1
  52. package/dist/{define-agent-eval-D_DQMH04.d.ts → define-agent-eval-DcK8mg63.d.ts} +7 -7
  53. package/dist/{define-agent-eval-D_DQMH04.d.ts.map → define-agent-eval-DcK8mg63.d.ts.map} +1 -1
  54. package/dist/{define-agent-eval-Q4FdXGj7.js → define-agent-eval-DuQNZajG.js} +6 -6
  55. package/dist/{define-agent-eval-Q4FdXGj7.js.map → define-agent-eval-DuQNZajG.js.map} +1 -1
  56. package/dist/diagnosis/index.d.ts +2 -2
  57. package/dist/diagnosis/index.js +1 -1
  58. package/dist/{dspy-rlm-engine-CqQc0R2l.js → dspy-rlm-engine-cWyn8G1a.js} +4 -4
  59. package/dist/{dspy-rlm-engine-CqQc0R2l.js.map → dspy-rlm-engine-cWyn8G1a.js.map} +1 -1
  60. package/dist/{engine-rfV8Ff8V.d.ts → engine-BF8naBn7.d.ts} +2 -2
  61. package/dist/{engine-rfV8Ff8V.d.ts.map → engine-BF8naBn7.d.ts.map} +1 -1
  62. package/dist/{eval-campaign-CZSCjxVb.js → eval-campaign-LmpC_5fm.js} +2 -2
  63. package/dist/{eval-campaign-CZSCjxVb.js.map → eval-campaign-LmpC_5fm.js.map} +1 -1
  64. package/dist/{evaluation-SDXKL6Fx.d.ts → evaluation-BCejQgkV.d.ts} +4 -4
  65. package/dist/{evaluation-SDXKL6Fx.d.ts.map → evaluation-BCejQgkV.d.ts.map} +1 -1
  66. package/dist/{evaluation-BBI37mRe.js → evaluation-bU_bhlv-.js} +2 -2
  67. package/dist/{evaluation-BBI37mRe.js.map → evaluation-bU_bhlv-.js.map} +1 -1
  68. package/dist/evaluation.d.ts +1 -1
  69. package/dist/evaluation.js +1 -1
  70. package/dist/{exact-types-CaLLU1Pz.d.ts → exact-types-VAFjtOQN.d.ts} +2 -2
  71. package/dist/{exact-types-CaLLU1Pz.d.ts.map → exact-types-VAFjtOQN.d.ts.map} +1 -1
  72. package/dist/experiment/index.d.ts +3 -5
  73. package/dist/experiment/index.d.ts.map +1 -1
  74. package/dist/experiment/index.js +7 -12
  75. package/dist/experiment/index.js.map +1 -1
  76. package/dist/{exporters-BYBG9b1n.d.ts → exporters-dQKYD_Zo.d.ts} +2 -2
  77. package/dist/{exporters-BYBG9b1n.d.ts.map → exporters-dQKYD_Zo.d.ts.map} +1 -1
  78. package/dist/{external-optimizer-process-CfrY-nJT.js → external-optimizer-process-2ImGH_LR.js} +2 -2
  79. package/dist/{external-optimizer-process-CfrY-nJT.js.map → external-optimizer-process-2ImGH_LR.js.map} +1 -1
  80. package/dist/{external-optimizer-subprocess-BtJk8UcU.js → external-optimizer-subprocess-_C_2yriN.js} +3 -3
  81. package/dist/{external-optimizer-subprocess-BtJk8UcU.js.map → external-optimizer-subprocess-_C_2yriN.js.map} +1 -1
  82. package/dist/{feedback-trajectory-P37ju-gW.d.ts → feedback-trajectory-DTj8eVTR.d.ts} +3 -3
  83. package/dist/{feedback-trajectory-P37ju-gW.d.ts.map → feedback-trajectory-DTj8eVTR.d.ts.map} +1 -1
  84. package/dist/{findings-store-BnYN57-h.js → findings-store-BSuaV3dN.js} +7 -24
  85. package/dist/findings-store-BSuaV3dN.js.map +1 -0
  86. package/dist/fuzz.js +2 -2
  87. package/dist/{index-BPmj-_ta.d.ts → index-Bc8BZfzb.d.ts} +10 -9
  88. package/dist/index-Bc8BZfzb.d.ts.map +1 -0
  89. package/dist/index-BdLmBInV.d.ts +1099 -0
  90. package/dist/index-BdLmBInV.d.ts.map +1 -0
  91. package/dist/{index-D4lT7aFu.d.ts → index-CeYLLnfi.d.ts} +28 -128
  92. package/dist/index-CeYLLnfi.d.ts.map +1 -0
  93. package/dist/{index-C3t17kHu.d.ts → index-CzfdjM6o.d.ts} +7 -100
  94. package/dist/index-CzfdjM6o.d.ts.map +1 -0
  95. package/dist/{index-HuSMvqR2.d.ts → index-DYNHOTTB.d.ts} +5 -5
  96. package/dist/{index-HuSMvqR2.d.ts.map → index-DYNHOTTB.d.ts.map} +1 -1
  97. package/dist/{index-AmfM3usI.d.ts → index-D_eAFB3T.d.ts} +8 -8
  98. package/dist/{index-AmfM3usI.d.ts.map → index-D_eAFB3T.d.ts.map} +1 -1
  99. package/dist/{index-DLVbfss9.d.ts → index-gSu9DUiw.d.ts} +8 -8
  100. package/dist/{index-DLVbfss9.d.ts.map → index-gSu9DUiw.d.ts.map} +1 -1
  101. package/dist/index.d.ts +29 -31
  102. package/dist/index.js +28 -164
  103. package/dist/index.js.map +1 -1
  104. package/dist/{integrity-BAdVzT8u.d.ts → integrity-CrmnGB2T.d.ts} +2 -2
  105. package/dist/{integrity-BAdVzT8u.d.ts.map → integrity-CrmnGB2T.d.ts.map} +1 -1
  106. package/dist/{judge-gate-CIlBrn6q.js → judge-gate-BliY81A0.js} +3 -3
  107. package/dist/{judge-gate-CIlBrn6q.js.map → judge-gate-BliY81A0.js.map} +1 -1
  108. package/dist/{kind-factory-Cfz8DUCc.js → kind-factory-CV0FNCMM.js} +2 -2
  109. package/dist/{kind-factory-Cfz8DUCc.js.map → kind-factory-CV0FNCMM.js.map} +1 -1
  110. package/dist/{llm-client-BdSiZ4qz.js → llm-client-DMMSg-Ro.js} +2 -2
  111. package/dist/{llm-client-BdSiZ4qz.js.map → llm-client-DMMSg-Ro.js.map} +1 -1
  112. package/dist/{llm-judge-VD_MI6kd.js → llm-judge-Bnxuwjxl.js} +13 -14
  113. package/dist/{llm-judge-VD_MI6kd.js.map → llm-judge-Bnxuwjxl.js.map} +1 -1
  114. package/dist/{matrix-Yg1lHIGI.d.ts → matrix-D6zEwLvE.d.ts} +2 -2
  115. package/dist/{matrix-Yg1lHIGI.d.ts.map → matrix-D6zEwLvE.d.ts.map} +1 -1
  116. package/dist/meta-eval/index.d.ts +2 -2
  117. package/dist/meta-eval/index.js +7 -7
  118. package/dist/{metrics-DNCAUtuB.js → metrics-zALlR17s.js} +16 -17
  119. package/dist/metrics-zALlR17s.js.map +1 -0
  120. package/dist/multishot/golden/index.d.ts +1 -1
  121. package/dist/multishot/index.d.ts +2 -2
  122. package/dist/multishot/index.js +1 -1
  123. package/dist/openapi.json +1 -1
  124. package/dist/{outcome-observations-DZu5hLYF.js → outcome-observations-BpicIVQi.js} +2 -3
  125. package/dist/{outcome-observations-DZu5hLYF.js.map → outcome-observations-BpicIVQi.js.map} +1 -1
  126. package/dist/paired-arms-Dep5tbsw.js +338 -0
  127. package/dist/paired-arms-Dep5tbsw.js.map +1 -0
  128. package/dist/{paired-promotion-decision-BDnqepZ1.d.ts → paired-promotion-decision-BNzPfXDw.d.ts} +3 -113
  129. package/dist/paired-promotion-decision-BNzPfXDw.d.ts.map +1 -0
  130. package/dist/{paired-promotion-decision-CiueaTTj.js → paired-promotion-decision-Nt4CkkOT.js} +2 -3
  131. package/dist/{paired-promotion-decision-CiueaTTj.js.map → paired-promotion-decision-Nt4CkkOT.js.map} +1 -1
  132. package/dist/{pareto-a3EOmjfe.js → pareto-C445lnEH.js} +3 -6
  133. package/dist/{pareto-a3EOmjfe.js.map → pareto-C445lnEH.js.map} +1 -1
  134. package/dist/pipelines/index.js +1 -1
  135. package/dist/{prime-protocol-DKRk4l4U.d.ts → prime-protocol-D1NkJRuD.d.ts} +2 -2
  136. package/dist/{prime-protocol-DKRk4l4U.d.ts.map → prime-protocol-D1NkJRuD.d.ts.map} +1 -1
  137. package/dist/{promotion-gate-DOkgJcLW.d.ts → promotion-gate-DjAsmBSZ.d.ts} +3 -67
  138. package/dist/promotion-gate-DjAsmBSZ.d.ts.map +1 -0
  139. package/dist/{promotion-policy-DLPcEnCf.js → promotion-policy-CUWOv01m.js} +4 -4
  140. package/dist/{promotion-policy-DLPcEnCf.js.map → promotion-policy-CUWOv01m.js.map} +1 -1
  141. package/dist/{proposal-findings-BfzzZ_lN.js → proposal-findings-DWs94yT8.js} +2 -2
  142. package/dist/{proposal-findings-BfzzZ_lN.js.map → proposal-findings-DWs94yT8.js.map} +1 -1
  143. package/dist/{registry-Ck7w-rr5.d.ts → registry-BAcEbzKm.d.ts} +4 -4
  144. package/dist/{registry-Ck7w-rr5.d.ts.map → registry-BAcEbzKm.d.ts.map} +1 -1
  145. package/dist/{release-confidence-nfQNh3eb.js → release-confidence-DDrkmWxT.js} +2 -2
  146. package/dist/{release-confidence-nfQNh3eb.js.map → release-confidence-DDrkmWxT.js.map} +1 -1
  147. package/dist/reporting.d.ts +4 -5
  148. package/dist/reporting.d.ts.map +1 -1
  149. package/dist/reporting.js +5 -7
  150. package/dist/reporting.js.map +1 -1
  151. package/dist/{researcher-CLnNJ7Or.d.ts → researcher-D35yo0B8.d.ts} +4 -4
  152. package/dist/{researcher-CLnNJ7Or.d.ts.map → researcher-D35yo0B8.d.ts.map} +1 -1
  153. package/dist/{reward-hacking-B88f-Kh7.js → reward-hacking-DRb8K6N1.js} +2 -3
  154. package/dist/{reward-hacking-B88f-Kh7.js.map → reward-hacking-DRb8K6N1.js.map} +1 -1
  155. package/dist/rl.d.ts +9 -8
  156. package/dist/rl.d.ts.map +1 -1
  157. package/dist/rl.js +8 -10
  158. package/dist/rl.js.map +1 -1
  159. package/dist/rollout/index.d.ts +4 -4
  160. package/dist/rollout/index.js +1 -1
  161. package/dist/{rollout-Cu7kHGIe.js → rollout-DKa54qer.js} +2 -2
  162. package/dist/{rollout-Cu7kHGIe.js.map → rollout-DKa54qer.js.map} +1 -1
  163. package/dist/{rubric-predictive-validity-D_6ZPTNR.js → rubric-predictive-validity-BMS7SUyh.js} +2 -2
  164. package/dist/{rubric-predictive-validity-D_6ZPTNR.js.map → rubric-predictive-validity-BMS7SUyh.js.map} +1 -1
  165. package/dist/{run-record-CbUi2adH.js → run-record-CIflWk6i.js} +2 -2
  166. package/dist/{run-record-CbUi2adH.js.map → run-record-CIflWk6i.js.map} +1 -1
  167. package/dist/{runtime-rollouts-kGn1K5ut.js → runtime-rollouts-CfRyjk60.js} +2 -2
  168. package/dist/{runtime-rollouts-kGn1K5ut.js.map → runtime-rollouts-CfRyjk60.js.map} +1 -1
  169. package/dist/{schema-CfoA9U_U.d.ts → schema-PDKQ_iNE.d.ts} +2 -131
  170. package/dist/schema-PDKQ_iNE.d.ts.map +1 -0
  171. package/dist/search/index.d.ts +2 -2
  172. package/dist/search/index.js +2 -2
  173. package/dist/{search-kernel-DjqaPJqL.d.ts → search-kernel-Ds2zILpY.d.ts} +3 -3
  174. package/dist/{search-kernel-DjqaPJqL.d.ts.map → search-kernel-Ds2zILpY.d.ts.map} +1 -1
  175. package/dist/{search-summary-RJ5zXjHN.js → search-summary-BSftVrGY.js} +4 -4
  176. package/dist/{search-summary-RJ5zXjHN.js.map → search-summary-BSftVrGY.js.map} +1 -1
  177. package/dist/{sequential-Bb_pdTqG.d.ts → sequential-B9p6uoV8.d.ts} +9 -2
  178. package/dist/{sequential-Bb_pdTqG.d.ts.map → sequential-B9p6uoV8.d.ts.map} +1 -1
  179. package/dist/{sequential-Bjs5roiK.js → sequential-CAksw6EU.js} +32 -2
  180. package/dist/{sequential-Bjs5roiK.js.map → sequential-CAksw6EU.js.map} +1 -1
  181. package/dist/{sequential-BPbvgzfe.js → sequential-CqG6aLWS.js} +3 -3
  182. package/dist/{sequential-BPbvgzfe.js.map → sequential-CqG6aLWS.js.map} +1 -1
  183. package/dist/{server-CPKyf3bz.js → server-DFVwfoZq.js} +3 -3
  184. package/dist/{server-CPKyf3bz.js.map → server-DFVwfoZq.js.map} +1 -1
  185. package/dist/{skillopt-optimization-method-D9Hlmhjg.js → skillopt-optimization-method-DYwEndON.js} +9 -9
  186. package/dist/{skillopt-optimization-method-D9Hlmhjg.js.map → skillopt-optimization-method-DYwEndON.js.map} +1 -1
  187. package/dist/{statistical-heldout-C-tgpUuu.d.ts → statistical-heldout--0b1lgx4.d.ts} +6 -282
  188. package/dist/statistical-heldout--0b1lgx4.d.ts.map +1 -0
  189. package/dist/{statistical-heldout-NBxC7jGo.js → statistical-heldout-D6i58CJ5.js} +3 -3
  190. package/dist/{statistical-heldout-NBxC7jGo.js.map → statistical-heldout-D6i58CJ5.js.map} +1 -1
  191. package/dist/statistics-DCZIC-qT.js +2627 -0
  192. package/dist/statistics-DCZIC-qT.js.map +1 -0
  193. package/dist/statistics.d.ts +3 -0
  194. package/dist/statistics.js +3 -0
  195. package/dist/{store-otlp-BfPRa2p8.js → store-otlp-C-jyj3WX.js} +2 -2
  196. package/dist/{store-otlp-BfPRa2p8.js.map → store-otlp-C-jyj3WX.js.map} +1 -1
  197. package/dist/{store-tool-spans-BgwVHXma.d.ts → store-tool-spans-B3z_Qb5u.d.ts} +5 -5
  198. package/dist/{store-tool-spans-BgwVHXma.d.ts.map → store-tool-spans-B3z_Qb5u.d.ts.map} +1 -1
  199. package/dist/{store-tool-spans-BrSWHB9O.js → store-tool-spans-DalWlKY8.js} +3 -3
  200. package/dist/{store-tool-spans-BrSWHB9O.js.map → store-tool-spans-DalWlKY8.js.map} +1 -1
  201. package/dist/{summary-report-0La5vejY.d.ts → summary-report-Cv1AC-iv.d.ts} +2 -2
  202. package/dist/{summary-report-0La5vejY.d.ts.map → summary-report-Cv1AC-iv.d.ts.map} +1 -1
  203. package/dist/{summary-report-C3IJvp0i.js → summary-report-D_uussI3.js} +4 -52
  204. package/dist/summary-report-D_uussI3.js.map +1 -0
  205. package/dist/supervisor-run/index.d.ts +2 -2
  206. package/dist/supervisor-run/index.js +1 -1
  207. package/dist/{systemone-CpDppX8s.d.ts → systemone-C3xyEKvG.d.ts} +7 -7
  208. package/dist/{systemone-CpDppX8s.d.ts.map → systemone-C3xyEKvG.d.ts.map} +1 -1
  209. package/dist/{systemone-review-nbuMxxmi.d.ts → systemone-review-CToBl1oa.d.ts} +2 -2
  210. package/dist/{systemone-review-nbuMxxmi.d.ts.map → systemone-review-CToBl1oa.d.ts.map} +1 -1
  211. package/dist/systemone.d.ts +3 -3
  212. package/dist/systemone.js +2 -2
  213. package/dist/{tool-groups-BQsjZD9F.d.ts → tool-groups-R5RO9OHn.d.ts} +3 -3
  214. package/dist/tool-groups-R5RO9OHn.d.ts.map +1 -0
  215. package/dist/{tool-waste-Czt3aWID.js → tool-waste-DEhKfiIE.js} +2 -3
  216. package/dist/{tool-waste-Czt3aWID.js.map → tool-waste-DEhKfiIE.js.map} +1 -1
  217. package/dist/{trace-questions-CpTrtEcm.d.ts → trace-questions-BY6taxnl.d.ts} +3 -3
  218. package/dist/{trace-questions-CpTrtEcm.d.ts.map → trace-questions-BY6taxnl.d.ts.map} +1 -1
  219. package/dist/trace-repair/index.d.ts +1 -1
  220. package/dist/trace-repair/index.js +1 -2
  221. package/dist/trace-repair/index.js.map +1 -1
  222. package/dist/traces.d.ts +5 -5
  223. package/dist/traces.js +3 -3
  224. package/dist/{tree-DIHp6UQ0.js → tree-B2y1UR8o.js} +4 -6
  225. package/dist/{tree-DIHp6UQ0.js.map → tree-B2y1UR8o.js.map} +1 -1
  226. package/dist/{types-DNB9hIXa.d.ts → types-BAJ2Hb-d.d.ts} +3 -2
  227. package/dist/types-BAJ2Hb-d.d.ts.map +1 -0
  228. package/dist/{types-DsuOcYsE.d.ts → types-BwF--ZRz.d.ts} +2 -2
  229. package/dist/{types-DsuOcYsE.d.ts.map → types-BwF--ZRz.d.ts.map} +1 -1
  230. package/dist/{types-wDBk14lj.d.ts → types-CeMZYsNF.d.ts} +5 -4
  231. package/dist/types-CeMZYsNF.d.ts.map +1 -0
  232. package/dist/{types-B9s9Xo5_.d.ts → types-kBMNdo1X.d.ts} +3 -9
  233. package/dist/types-kBMNdo1X.d.ts.map +1 -0
  234. package/dist/wire/index.d.ts +6 -6
  235. package/dist/wire/index.js +1 -1
  236. package/docs/design/statistics-decisions.md +38 -364
  237. package/docs/design.md +1 -1
  238. package/docs/research-report-methodology.md +1 -1
  239. package/package.json +6 -1
  240. package/dist/agreement-irr-DXcXEt4I.js +0 -182
  241. package/dist/agreement-irr-DXcXEt4I.js.map +0 -1
  242. package/dist/analyze-runs-C7vWBDhl.js.map +0 -1
  243. package/dist/benchmark-command-DSJQeYom.js.map +0 -1
  244. package/dist/cluster-bootstrap-BteuR1hg.js +0 -65
  245. package/dist/cluster-bootstrap-BteuR1hg.js.map +0 -1
  246. package/dist/descriptive-B3Eb7tX0.js +0 -229
  247. package/dist/descriptive-B3Eb7tX0.js.map +0 -1
  248. package/dist/findings-store-BnYN57-h.js.map +0 -1
  249. package/dist/index-BPmj-_ta.d.ts.map +0 -1
  250. package/dist/index-C3t17kHu.d.ts.map +0 -1
  251. package/dist/index-D4lT7aFu.d.ts.map +0 -1
  252. package/dist/judge-calibration-DKR6Xi-w.js +0 -319
  253. package/dist/judge-calibration-DKR6Xi-w.js.map +0 -1
  254. package/dist/judge-calibration-DnrbQaXI.d.ts +0 -144
  255. package/dist/judge-calibration-DnrbQaXI.d.ts.map +0 -1
  256. package/dist/mean-D1d6gedE.js +0 -284
  257. package/dist/mean-D1d6gedE.js.map +0 -1
  258. package/dist/metrics-DNCAUtuB.js.map +0 -1
  259. package/dist/multiplicity-DAd4xaDC.js +0 -100
  260. package/dist/multiplicity-DAd4xaDC.js.map +0 -1
  261. package/dist/multiplicity-D_SEsc5j.d.ts +0 -41
  262. package/dist/multiplicity-D_SEsc5j.d.ts.map +0 -1
  263. package/dist/paired-arms-3-tsXvvC.js +0 -740
  264. package/dist/paired-arms-3-tsXvvC.js.map +0 -1
  265. package/dist/paired-binary-CMzmSSd5.js +0 -372
  266. package/dist/paired-binary-CMzmSSd5.js.map +0 -1
  267. package/dist/paired-promotion-decision-BDnqepZ1.d.ts.map +0 -1
  268. package/dist/paired-tests-Buh6feJ4.js +0 -211
  269. package/dist/paired-tests-Buh6feJ4.js.map +0 -1
  270. package/dist/power-and-mde-g3vOn0XK.js +0 -99
  271. package/dist/power-and-mde-g3vOn0XK.js.map +0 -1
  272. package/dist/promotion-gate-DOkgJcLW.d.ts.map +0 -1
  273. package/dist/random-BN150Q_X.d.ts +0 -79
  274. package/dist/random-BN150Q_X.d.ts.map +0 -1
  275. package/dist/schema-CfoA9U_U.d.ts.map +0 -1
  276. package/dist/sequential-eprocess-C1YLwFaz.js +0 -129
  277. package/dist/sequential-eprocess-C1YLwFaz.js.map +0 -1
  278. package/dist/statistical-heldout-C-tgpUuu.d.ts.map +0 -1
  279. package/dist/summary-report-C3IJvp0i.js.map +0 -1
  280. package/dist/tool-groups-BQsjZD9F.d.ts.map +0 -1
  281. package/dist/types-0KglnQ9o.d.ts.map +0 -1
  282. package/dist/types-B9s9Xo5_.d.ts.map +0 -1
  283. package/dist/types-DNB9hIXa.d.ts.map +0 -1
  284. package/dist/types-wDBk14lj.d.ts.map +0 -1
@@ -1,132 +1,3 @@
1
- /**
2
- * Descriptive statistics: means, bootstrap spread, correlation, and the
3
- * weighted judge-dimension composite. Nothing here is a significance test.
4
- */
5
- /** Weighted mean — falls back to uniform weights when omitted */
6
- declare function weightedMean(scores: {
7
- score: number;
8
- weight?: number;
9
- }[]): number;
10
- /**
11
- * Percentile bootstrap confidence interval on the mean of `scores`.
12
- *
13
- * Descriptive spread. It is not a significance test, and at small n its bounds
14
- * are anti-conservative in the same way {@link pairedBootstrap}'s are — see
15
- * {@link BOOTSTRAP_GATE_MIN_N}. With no `seed` the resampling is seeded from
16
- * the scores themselves, so the interval is reproducible either way.
17
- */
18
- declare function confidenceInterval(scores: number[], confidence?: number, opts?: {
19
- seed?: number;
20
- resamples?: number;
21
- }): {
22
- mean: number;
23
- lower: number;
24
- upper: number;
25
- };
26
- /**
27
- * Two-sided Student-t critical value: the `t` with `P(|T| ≤ t) = confidence`
28
- * for `df` degrees of freedom. Exact, from {@link studentTQuantile}, so any
29
- * confidence in (0, 1) and fractional `df` are supported.
30
- */
31
- declare function studentTCritical(df: number, confidence?: number): number;
32
- /** One-sample Student-t interval on the mean; see {@link meanConfidenceInterval}. */
33
- interface MeanConfidenceInterval {
34
- readonly n: number;
35
- /** Null for an empty sample. */
36
- readonly mean: number | null;
37
- /** Sample standard deviation (n − 1 denominator); null below two samples. */
38
- readonly stdev: number | null;
39
- readonly low: number | null;
40
- readonly high: number | null;
41
- /** Two-sided Student-t critical value for df = n − 1; null below two samples. */
42
- readonly criticalValue: number | null;
43
- }
44
- /**
45
- * Student-t confidence interval on the mean of one sample:
46
- * `mean ± t(df = n − 1) · s / √n`. Below two samples there is no spread to
47
- * estimate, so the bounds are null rather than a zero-width interval that
48
- * would read as certainty. Unlike {@link confidenceInterval} (a percentile
49
- * bootstrap), the width keeps the small-n t penalty that z = 1.96 drops.
50
- */
51
- declare function meanConfidenceInterval(samples: readonly number[], confidence?: number): MeanConfidenceInterval;
52
- /** Partial credit: returns 0-1 ratio of current toward target */
53
- declare function partialCredit(current: number, target: number): number;
54
- /** Distribution summary of a number series: count, extremes, quantiles, sum. */
55
- interface SeriesDistribution {
56
- readonly n: number;
57
- readonly min: number;
58
- readonly p50: number;
59
- readonly p90: number;
60
- readonly max: number;
61
- readonly sum: number;
62
- readonly percentiles?: Readonly<Record<number, number>>;
63
- readonly medianInterval?: {
64
- readonly method: 'normal-order-statistics';
65
- readonly criticalValue: number;
66
- readonly sampleSize: number;
67
- readonly lowRank: number;
68
- readonly highRank: number;
69
- readonly low: number;
70
- readonly high: number;
71
- };
72
- }
73
- interface SeriesDistributionOptions {
74
- /** Nearest-rank percentiles on a 0–100 scale, including fractional tails. */
75
- percentiles?: readonly number[];
76
- /** Descriptive median rank band, not a bootstrap interval or promotion test. */
77
- medianInterval?: {
78
- criticalValue: number;
79
- };
80
- }
81
- /**
82
- * Fold a number series into its distribution summary. Quantiles use the
83
- * nearest-rank definition — the `ceil(q·n)`-th order statistic — so every
84
- * reported quantile is a value from the series. Returns `null` for an empty
85
- * series: an empty series has no distribution, and a zero-filled summary
86
- * would read as a measured all-zero series.
87
- */
88
- declare function summarizeNumberSeries(values: readonly number[], options?: SeriesDistributionOptions): SeriesDistribution | null;
89
- /**
90
- * Average-rank-with-ties transform (1-indexed). Tied values receive the mean
91
- * of the ranks they span, the standard correction for Spearman's ρ.
92
- */
93
- declare function ranks(xs: number[]): number[];
94
- /**
95
- * Pearson product-moment correlation coefficient r ∈ [-1, 1] between two
96
- * equal-length series. See the edge-case contract above: NaN for n < 2 or
97
- * unequal lengths, 1 when both series are constant, 0 when exactly one is.
98
- */
99
- declare function pearsonR(a: number[], b: number[]): number;
100
- /**
101
- * Spearman's rank correlation ρ — Pearson over the average-rank-with-ties
102
- * transform of each series. Same edge-case contract as {@link pearsonR}.
103
- */
104
- declare function spearmanR(a: number[], b: number[]): number;
105
- interface WeightedCompositeInput {
106
- /** Per-dimension scores (typically 0..1). */
107
- dims: Record<string, number>;
108
- /** Weight per dimension. Every weighted dimension MUST be present in
109
- * `dims` — a weight for an absent dimension is a config error and throws,
110
- * because silently dropping it would renormalise the composite onto a
111
- * different denominator than intended. */
112
- weights: Record<string, number>;
113
- /** Optional pass threshold; when set, the result reports `pass`. */
114
- threshold?: number;
115
- }
116
- interface WeightedCompositeResult {
117
- composite: number;
118
- pass?: boolean;
119
- }
120
- /**
121
- * Weighted composite over judge dimensions: `Σ(score_d · w_d) / Σ(w_d)` across
122
- * the weighted dimensions. The canonical replacement for the per-consumer
123
- * hand-rolled composite math (tax/legal/creative/gtm each ship a copy).
124
- *
125
- * Fail-loud: throws if a weighted dimension is missing from `dims`, if any
126
- * weight is negative, or if the weights sum to 0 — none of which can produce
127
- * a meaningful composite.
128
- */
129
- declare function weightedComposite(input: WeightedCompositeInput): WeightedCompositeResult;
130
1
  type LicenseClass = 'open-weight-api' | 'restricted' | 'evaluation-only' | 'human';
131
2
  declare const LICENSE_CLASSES: readonly LicenseClass[];
132
3
  /** Classify a model or harness name; `null` when it names no known family. */
@@ -527,5 +398,5 @@ type MintedRolloutLine = Omit<RolloutLine, 'outcome'> & {
527
398
  declare function assertMinted(value: unknown, context?: string): MintedRolloutLine;
528
399
  /** `assertMinted` over a batch, naming the offending index in the error. */
529
400
  declare function assertMintedLines(values: readonly unknown[], context?: string): MintedRolloutLine[];
530
- export { isTrainableSplit as A, WeightedCompositeInput as B, RolloutWorkspaceCapture as C, assertRolloutLine as D, assertMintedLines as E, licenseClassOf as F, pearsonR as G, confidenceInterval as H, licenseClassOfName as I, studentTCritical as J, ranks as K, MeanConfidenceInterval as L, LICENSE_CLASSES as M, LicenseClass as N, gateGamedOutcome as O, isLicenseEligible as P, SeriesDistribution as R, RolloutTask as S, assertMinted as T, meanConfidenceInterval as U, WeightedCompositeResult as V, partialCredit as W, weightedComposite as X, summarizeNumberSeries as Y, weightedMean as Z, RolloutPolicy as _, MintedRolloutLine as a, RolloutSplit as b, ROLLOUT_ROLES as c, RolloutArtifacts as d, RolloutCapture as f, RolloutOutcome as g, RolloutLine as h, GatedEvidence as i, validateRolloutLine as j, isRolloutLine as k, ROLLOUT_SCHEMA as l, RolloutEvidenceAttempt as m, ChatRole as n, MintedRolloutOutcome as o, RolloutCostBlock as p, spearmanR as q, ChatToolCall as r, ROLLOUT_CAPTURES as s, ChatMessage as t, ROLLOUT_SPLITS as u, RolloutProvenance as v, ToolDef as w, RolloutStep as x, RolloutRole as y, SeriesDistributionOptions as z };
531
- //# sourceMappingURL=schema-CfoA9U_U.d.ts.map
401
+ export { isTrainableSplit as A, RolloutWorkspaceCapture as C, assertRolloutLine as D, assertMintedLines as E, licenseClassOf as F, licenseClassOfName as I, LICENSE_CLASSES as M, LicenseClass as N, gateGamedOutcome as O, isLicenseEligible as P, RolloutTask as S, assertMinted as T, RolloutPolicy as _, MintedRolloutLine as a, RolloutSplit as b, ROLLOUT_ROLES as c, RolloutArtifacts as d, RolloutCapture as f, RolloutOutcome as g, RolloutLine as h, GatedEvidence as i, validateRolloutLine as j, isRolloutLine as k, ROLLOUT_SCHEMA as l, RolloutEvidenceAttempt as m, ChatRole as n, MintedRolloutOutcome as o, RolloutCostBlock as p, ChatToolCall as r, ROLLOUT_CAPTURES as s, ChatMessage as t, ROLLOUT_SPLITS as u, RolloutProvenance as v, ToolDef as w, RolloutStep as x, RolloutRole as y };
402
+ //# sourceMappingURL=schema-PDKQ_iNE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-PDKQ_iNE.d.ts","names":[],"sources":["../src/rollout/license.ts","../src/rollout/schema.ts"],"mappings":"A,KAyBY;cACC,0BAA0B;;iBAYvB,mBAAmB,kCAAkC;;iBAQrD,eAAe,MAAM,KAAK,yBAAyB;;iBASnD,kBACd,MAAM,KAAK,wBACX,mBAAmB;cCLR;;KAGD;cACC,wBAAwB;;KAUzB;cACC,yBAAyB;iBAItB,iBAAiB,OAAO;;KAK5B;cACC,2BAA2B;KAM5B;UAGK;EACf;EACA;EACA;IACE;;IAEA;;;UAIa;EACf,MAAM;EACN;;EAEA;EACA,aAAa;;EAEb;EACA;;;;;;;;EAQA;;UAGe;EACf;EACA;IACE;IACA;IACA,aAAa;;;;;;;;UASA;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;;;EAUA;;EAEA;;EAEA;;;;;;EAMA;;UAOe;;EAEf;EACA;EACA,OAAO;;EAEP;;EAEA;;UAGe;;EAEf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,UAAU;;EAEV,gBAAgB;;UAGD;;;;;EAKf;;EAEA;;EAEA;;EAEA,SAAS;EACT;EACA;EACA;;;;;;;;;;;;;EAaA;;;;;;;;;;;;;;;;;;;;;EAqBA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;EAKA;;UAGe;EACf;EACA;;;EAGA;;;;;;;UAQe;;EAEf,UAAU;;EAEV;;;;;;;;;EASA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;UAIe;WACN;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;;UAGM;EACf;EACA,SAAS;;EAET;IAAW;IAAkB;IAAgB;IAAgB;;;EAE7D,WAAW;;EAEX,8BAA8B;;EAE9B;;;;;;;EAOA;;;;;;;EAOA,iBAAiB;;UAGF;EACf,eAAe;EACf;;;EAGA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,MAAM;EACN,MAAM;EACN,QAAQ;;EAER,UAAU;EACV,WAAW;;EAEX,QAAQ;EACR,SAAS;EACT,MAAM;EACN,WAAW;EACX,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0GE,iBAAiB,MAAM,cAAc;iBAgXrC,oBAAoB;iBAmBpB,kBACd,gBACA,2BACS,SAAS;iBAOJ,cAAc,iBAAiB,SAAS;;;;;;cAa1C;;;;;;UAOG,6BAA6B;EAC5C;;;;;;;;;;;;;;;;;;;;;;KAuBU,oBAAoB,KAAK;YACzB;EACV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCK,aAAa,gBAAgB,mBAA2B;;iBAiBxD,kBACd,4BACA,mBACC"}
@@ -1,6 +1,6 @@
1
1
  import { A as SearchLedgerHash, C as SearchEdgeOperator, G as SearchSplit, H as SearchProposerKind, I as SearchNodeStatus, L as SearchOpenedEvent, T as SearchEstimateMethod, W as SearchSourceRef, i as SearchArtifactRef, j as SearchModelIdentity, l as SearchCandidateSurface, m as SearchClaim, t as NodeEstimate, y as SearchCloseReason } from "../search-ledger-types-qiYRUo_N.js";
2
- import { X as SearchStateView, st as SearchNode } from "../types-wDBk14lj.js";
3
- import { $ as ExpansionOperator, I as SearchPolicy, R as SearchPolicyView, a as SearchArtifactCodec, at as OperatorYieldSignal, ct as LensSampleSummary, et as MIN_OUTCOMES_FOR_WEIGHT, h as SearchRunResult, i as RunSearchOptions, it as OperatorYieldRow, j as SearchUnitExtension, l as SearchLane, lt as LensSignal, nt as OperatorYieldData, ot as operatorYield, rt as OperatorYieldOptions, st as LensResult, tt as OperatorOutcomeCounts, ut as summarizeSamples } from "../search-kernel-DjqaPJqL.js";
2
+ import { X as SearchStateView, st as SearchNode } from "../types-CeMZYsNF.js";
3
+ import { $ as ExpansionOperator, I as SearchPolicy, R as SearchPolicyView, a as SearchArtifactCodec, at as OperatorYieldSignal, ct as LensSampleSummary, et as MIN_OUTCOMES_FOR_WEIGHT, h as SearchRunResult, i as RunSearchOptions, it as OperatorYieldRow, j as SearchUnitExtension, l as SearchLane, lt as LensSignal, nt as OperatorYieldData, ot as operatorYield, rt as OperatorYieldOptions, st as LensResult, tt as OperatorOutcomeCounts, ut as summarizeSamples } from "../search-kernel-Ds2zILpY.js";
4
4
  import { AgentProfileResourceRef } from "@tangle-network/agent-interface";
5
5
  interface EditCreditOptions {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { a as hashCanonical } from "../canonical-CicJlINA.js";
2
- import { c as MIN_OUTCOMES_FOR_WEIGHT, f as summarizeSamples, i as runSearch, l as operatorYield } from "../pareto-a3EOmjfe.js";
3
- import { _ as vectorEmbedding, a as skillCalibration, b as editCreditText, c as META_SEARCH_SCORE_SOURCE, d as searchPolicyGenome, f as landscape, g as surfaceTextEdits, h as lineageEdits, i as nextUnitExtension, l as metaSearch, n as taskMatrix, o as skillManifold, p as draftOnPlateau, s as renderMetaSearchText, t as tree, u as metaSearchScore, v as front, y as editCredit } from "../tree-DIHp6UQ0.js";
2
+ import { c as MIN_OUTCOMES_FOR_WEIGHT, f as summarizeSamples, i as runSearch, l as operatorYield } from "../pareto-C445lnEH.js";
3
+ import { _ as vectorEmbedding, a as skillCalibration, b as editCreditText, c as META_SEARCH_SCORE_SOURCE, d as searchPolicyGenome, f as landscape, g as surfaceTextEdits, h as lineageEdits, i as nextUnitExtension, l as metaSearch, n as taskMatrix, o as skillManifold, p as draftOnPlateau, s as renderMetaSearchText, t as tree, u as metaSearchScore, v as front, y as editCredit } from "../tree-B2y1UR8o.js";
4
4
  // src/search/nested-search.ts
5
5
  /** The deterministic id of the inner search one outer cell attempt runs. */
6
6
  function nestedSearchId(containment) {
@@ -1,9 +1,9 @@
1
1
  import { t as CostLedger } from "./cost-ledger-Czro9wmo.js";
2
2
  import { a as RunRecord } from "./run-record-D2BFMPGl.js";
3
- import { a as PairedPromotionDecision } from "./paired-promotion-decision-BDnqepZ1.js";
4
3
  import { A as SearchLedgerHash, C as SearchEdgeOperator, E as SearchExecutionIdentity, G as SearchSplit, H as SearchProposerKind, I as SearchNodeStatus, L as SearchOpenedEvent, N as SearchNodeDecision, O as SearchLedgerEntry, P as SearchNodeRef, Q as SearchTaskOutcome, R as SearchOperationKind, S as SearchEdgeAttribution, T as SearchEstimateMethod, U as SearchReservation, V as SearchProposer, W as SearchSourceRef, Y as SearchSurfaceEvidence, Z as SearchTask, _ as SearchClaimPower, a as SearchAttemptAccounting, et as SearchTraceRef, i as SearchArtifactRef, j as SearchModelIdentity, k as SearchLedgerEvent, l as SearchCandidateSurface, m as SearchClaim, nt as EvaluationClaim, o as SearchAudit, p as SearchCellStage, t as NodeEstimate, tt as SearchUnknown, y as SearchCloseReason, z as SearchOperationRecordedEvent } from "./search-ledger-types-qiYRUo_N.js";
5
4
  import { C as LedgerTrustedHead, v as LedgerLineContext, w as LedgerTrustedHeadRemoval, x as LedgerTextStore } from "./index-lRKqfyg4.js";
6
- import { X as SearchStateView, dt as SearchUnitScore, j as MutableSurface, lt as SearchScoredCell, st as SearchNode } from "./types-wDBk14lj.js";
5
+ import { X as SearchStateView, dt as SearchUnitScore, j as MutableSurface, lt as SearchScoredCell, st as SearchNode } from "./types-CeMZYsNF.js";
6
+ import { a as PairedPromotionDecision } from "./paired-promotion-decision-BNzPfXDw.js";
7
7
  /**
8
8
  * `CampaignStorage` — the filesystem seam `runCampaign` writes through
9
9
  * (run/cell dirs, the resumability cache, per-cell artifacts, trace spans).
@@ -1166,4 +1166,4 @@ declare function searchDivergence(state: SearchStateView, nodeId: string): {
1166
1166
  /** Run a search to its close, or continue one from its ledger. */
1167
1167
  declare function runSearch<TArtifact>(options: RunSearchOptions<TArtifact>): Promise<SearchRunResult>;
1168
1168
  export { ExpansionOperator as $, SearchRungDecision as A, SearchHistoryReceipt as At, beam as B, openSearchLedger as Bt, searchClaimDecision as C, surfaceNode as Ct, SearchAllocationView as D, SearchHistoryCoverage as Dt, AshaOptions as E, SearchHistoryAuditSummary as Et, SearchExpansion as F, FileSearchLedger as Ft, NodePosterior as G, createRunCostLedger as Gt, incumbent as H, replaySearchLedgerText as Ht, SearchPolicy as I, OpenSearchLedgerOptions as It, estimateNode as J, SEARCH_ESTIMATOR as K, fsCampaignStorage as Kt, SearchPolicyNode as L, SearchLedger as Lt, asha as M, createSearchHistoryReceipt as Mt, uniform as N, verifySearchHistoryArtifact as Nt, SearchAllocator as O, SearchHistoryCoverageRow as Ot, AideOptions as P, verifySearchHistoryReceipt as Pt, searchPosterior as Q, SearchPolicyView as R, SearchLedgerAppendResult as Rt, planSearchClaim as S, surfaceDiff as St, verifySearchClaim as T, SearchHistoryAdmissionOptions as Tt, incumbentWithOperatorBandit as U, validateSearchLedgerEvent as Ut, crowdedFrontierParent as V, parseSearchLedgerLine as Vt, EstimateNodeCellsInput as W, CampaignStorage as Wt, searchCellSetDigest as X, estimateNodeFromCells as Y, searchEstimateMethod as Z, SEARCH_CLAIM_RULE as _, SearchRecorderOptions as _t, SearchArtifactCodec as a, OperatorYieldSignal as at, SearchClaimVerification as b, developmentClaim as bt, SearchExecutor as c, LensSampleSummary as ct, SearchProposalRequest as d, AllocateSearchCellInput as dt, MIN_OUTCOMES_FOR_WEIGHT as et, SearchProposalResult as f, RecordSearchEdgeInput as ft, PlanSearchClaimInput as g, SearchRecorder as gt, SearchRunResult as h, SearchOpening as ht, RunSearchOptions as i, OperatorYieldRow as it, SearchUnitExtension as j, assertSearchHistoryMatchesState as jt, SearchCellPlan as k, SearchHistoryPolicy as kt, SearchLane as l, LensSignal as lt, SearchProposerPort as m, SearchLedgerBinding as mt, searchDivergence as n, OperatorYieldData as nt, SearchCellResult as o, operatorYield as ot, SearchProposedChild as p, RegisterSearchNodeInput as pt, SearchPosterior as q, inMemoryCampaignStorage as qt, searchPolicyView as r, OperatorYieldOptions as rt, SearchCellWork as s, LensResult as st, runSearch as t, OperatorOutcomeCounts as tt, SearchProposalBlob as u, summarizeSamples as ut, SearchClaimDecision as v, SearchRunIdentity as vt, searchClaimReserveUsd as w, CreateSearchHistoryReceiptInput as wt, decideSearchClaim as x, searchEdgeId as xt, SearchClaimPlan as y, SettleSearchCellInput as yt, aide as z, SearchLedgerTrustedHeadMode as zt };
1169
- //# sourceMappingURL=search-kernel-DjqaPJqL.d.ts.map
1169
+ //# sourceMappingURL=search-kernel-Ds2zILpY.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-kernel-DjqaPJqL.d.ts","names":[],"sources":["../src/campaign/storage.ts","../src/campaign/search-ledger.ts","../src/campaign/search-history-receipt.ts","../src/campaign/search-ledger-recording.ts","../src/search/lenses/shared.ts","../src/search/lenses/operator-yield.ts","../src/campaign/estimate-node.ts","../src/campaign/search-policy.ts","../src/campaign/allocation.ts","../src/campaign/search-claim.ts","../src/campaign/search-kernel-contract.ts","../src/campaign/search-kernel-policy-view.ts","../src/campaign/search-kernel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAoBiB;;;;WAIN;;EAET,UAAU;;EAEV,OAAO;;EAEP,KAAK;;EAEL,MAAM,cAAc,kBAAkB;;;EAGtC,OAAO,cAAc,iBAAiB;;;;;;;;;iBAUxB,qBAAqB;;;;iBA2CrB,2BAA2B;;iBAoC3B,oBAAoB;EAClC,SAAS;EACT;EACA;;EAEA;IACE;;;iBC0ZY,0BAA0B,iBAAiB;;;;;;;;;;;;;;KAqB/C;UAEK;EACf;EACA;EACA,cAAc;;;;;;;EAOd,QAAQ;;UAGO;EACf,OAAO;;EAEP;EACA,OAAO;;UAGQ;WACN;WACA;;WAEA;EACT,OAAO,OAAO,oBAAoB,QAAQ;;EAE1C,SAAS,QAAQ;;EAEjB,eAAe,QAAQ;;EAEvB,kBAAkB,QAAQ;;;EAG1B,oBAAoB,QAAQ;;;;iBAKd,iBAAiB,SAAS,0BAA0B;;;iBAOpD,uBACd,cACA,kBACA,iBACC;;;;;;;;iBAWa,sBACd,cACA,kBACA,SAAS,oBACR;;cAwDU,4BAA4B;WAC9B;WACA;WACA;mBACQ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../src/campaign/search-history-receipt.ts","../src/campaign/search-ledger-recording.ts","../src/search/lenses/shared.ts","../src/search/lenses/operator-yield.ts","../src/campaign/estimate-node.ts","../src/campaign/search-policy.ts","../src/campaign/allocation.ts","../src/campaign/search-claim.ts","../src/campaign/search-kernel-contract.ts","../src/campaign/search-kernel-policy-view.ts","../src/campaign/search-kernel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAoBiB;;;;WAIN;;EAET,UAAU;;EAEV,OAAO;;EAEP,KAAK;;EAEL,MAAM,cAAc,kBAAkB;;;EAGtC,OAAO,cAAc,iBAAiB;;;;;;;;;iBAUxB,qBAAqB;;;;iBA2CrB,2BAA2B;;iBAoC3B,oBAAoB;EAClC,SAAS;EACT;EACA;;EAEA;IACE;;;iBC0ZY,0BAA0B,iBAAiB;;;;;;;;;;;;;;KAqB/C;UAEK;EACf;EACA;EACA,cAAc;;;;;;;EAOd,QAAQ;;UAGO;EACf,OAAO;;EAEP;EACA,OAAO;;UAGQ;WACN;WACA;;WAEA;EACT,OAAO,OAAO,oBAAoB,QAAQ;;EAE1C,SAAS,QAAQ;;EAEjB,eAAe,QAAQ;;EAEvB,kBAAkB,QAAQ;;;EAG1B,oBAAoB,QAAQ;;;;iBAKd,iBAAiB,SAAS,0BAA0B;;;iBAOpD,uBACd,cACA,kBACA,iBACC;;;;;;;;iBAWa,sBACd,cACA,kBACA,SAAS,oBACR;;cAwDU,4BAA4B;WAC9B;WACA;WACA;mBACQ;mBACA;EAML,YAAA,cAAc,kBAAkB,cAAa;EAcnD,SAAS,QAAQ;EAIjB,OAAO,OAAO,oBAAoB,QAAQ;EAU1C,eAAe,QAAQ;EAIvB,kBAAkB,QAAQ;EAI1B,oBAAoB,QAAQ;;cCntB9B;cACA;;UAGW;WACN;WACA,UAAU;WACV,QAAQ;WACR,aAAa;WACb;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;;;;;;;UAaM;WACN,sBAAsB;WACtB;WACA,wBAAwB;WAC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;;UAIO,oBAAoB;EACnC,UAAU;EACV;;EAEA;;;EAGA,cAAc,SAAS;;UAGR,qBAAqB;EACpC,UAAU,cAAc,oBAAoB;;EAE5C;;EAEA,YAAY;EACZ,YAAY;;;UAIG,mBAAmB;WACzB;WACA,MAAM;WACN,QAAQ;WACR,WAAW;;WAEX;;;WAGA;EACT,QAAQ,SAAS,sBAAsB,aAAa,QAAQ,qBAAqB;;UAGlE,iBAAiB;;EAEhC,UAAU;;EAEV,MAAM;EACN,OAAO,oBAAoB;EAC3B,QAAQ;EACR,YAAY;EACZ,UAAU,mBAAmB;EAC7B,UAAU,eAAe;;;EAGzB,SAAS,UAAU;;EAEnB;;EAEA;;;;EAIA,SAAS;;EAET;;UAGe;;EAEf,OAAO;;;EAGP;EACA,QAAQ;;EAER,OAAO;;;;EAIP,mBAAmB;;;UAIJ;EACf;EACA,UAAU;EACV;EACA;IAAa;IAAc,UAAU;;EACrC,UAAU;IACR,MAAM;IACN,OAAO,MAAM,oBAAoB;IACjC;IACA;IACA,aAAa,SAAS;IACtB;;;;;;;;;;;iBChOY,iBACd,OAAO,iBACP;EACE;EACA;EACA;EACA;IAED;;;;;;;;iBA4Fa,iBACd,OAAO,iBACP;EACG,OAAO;EAAc;;;iBCnEJ,UAAU,WAC9B,SAAS,iBAAiB,aACzB,QAAQ"}
@@ -1,7 +1,7 @@
1
- import "./paired-tests-Buh6feJ4.js";
2
- import { r as minimumPairsForPairedDeltaTest } from "./paired-promotion-decision-CiueaTTj.js";
1
+ import "./statistics-DCZIC-qT.js";
2
+ import { r as minimumPairsForPairedDeltaTest } from "./paired-promotion-decision-Nt4CkkOT.js";
3
3
  import { a as SearchLedgerError } from "./search-ledger-file-BhOdgYIt.js";
4
- import { w as estimateNode } from "./pareto-a3EOmjfe.js";
4
+ import { w as estimateNode } from "./pareto-C445lnEH.js";
5
5
  // src/campaign/search-summary.ts
6
6
  /**
7
7
  * The agent's view of a search: the same projection a human reads.
@@ -129,4 +129,4 @@ function formatEstimate(estimate) {
129
129
  }
130
130
  export { searchProposerView as n, renderSearchSummary as t };
131
131
 
132
- //# sourceMappingURL=search-summary-RJ5zXjHN.js.map
132
+ //# sourceMappingURL=search-summary-BSftVrGY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search-summary-RJ5zXjHN.js","names":[],"sources":["../src/campaign/search-summary.ts"],"sourcesContent":["/**\n * The agent's view of a search: the same projection a human reads.\n *\n * `renderSearchSummary` turns a `SearchStateView` into compact text — the\n * leading nodes with their estimates, the most recently discarded ideas with\n * why they were discarded, and a log of recent proposals — as AIDE's journal\n * summary does for its own search. `agent-eval search show <ledger>` prints\n * the same text for a terminal; `runOptimization` puts it on every\n * `ProposeContext` a proposer receives.\n *\n * `searchProposerView` is the train-only read `ProposeContext.train` carries.\n * It has no parameter that can select another split, so a proposer built on\n * it cannot reach the selection or test split even by mistake: the sealed\n * splits (§6.6 of the search-tree design) are unreachable by construction,\n * not by convention.\n */\n\nimport { minimumPairsForPairedDeltaTest } from '../paired-delta-test'\nimport { BOOTSTRAP_GATE_MIN_N } from '../statistics'\nimport { estimateNode } from './estimate-node'\nimport { SearchLedgerError } from './search-ledger-errors'\nimport type { NodeEstimate, SearchSplit } from './search-ledger-types'\nimport type { SearchNode, SearchScoredCell, SearchStateView, SearchUnitScore } from './search-state'\n\nconst DESCRIPTIVE_FROM = minimumPairsForPairedDeltaTest(0.95)\n\n/** The proposer's own read of a search: its node's cells on the train split,\n * the only split a proposer may ever see. */\nexport interface SearchProposerView {\n readonly searchId: string\n readonly direction: 'maximize' | 'minimize'\n /** `nodeId`'s scored train cells. Unscored cells (errored, cancelled or in\n * flight) are absent, never zero. */\n scoredCells(nodeId: string): readonly SearchScoredCell[]\n /** Per-unit train-split means of `nodeId`, in unitId order. */\n unitScores(nodeId: string): readonly SearchUnitScore[]\n}\n\n/** The train-only view `ProposeContext.train` carries. */\nexport function searchProposerView(state: SearchStateView): SearchProposerView {\n const header = state.header\n if (!header) throw new SearchLedgerError(`search ${state.searchId} has not been opened`)\n return {\n searchId: state.searchId,\n direction: header.objective.direction,\n scoredCells: (nodeId) => state.scoredCells(nodeId, 'train'),\n unitScores: (nodeId) => state.unitScores(nodeId, 'train'),\n }\n}\n\nexport interface SearchSummaryOptions {\n /**\n * The split every estimate in the summary is computed on. A proposer's\n * context must always pass `'train'`: the selection and test splits stay\n * unread by anything a proposer's text can reach. The CLI passes the\n * search's own ranking split, `'selection'` when the search declares one\n * else `'train'`, matching `searchPolicyView`.\n */\n split: SearchSplit\n /** Nodes shown under \"Leading\" and under \"Recently discarded\". Default 5. */\n limit?: number\n}\n\n/**\n * `SearchState` as compact text: a header line with the search's shape and\n * spend, the leading nodes against the root with their estimates, the most\n * recently discarded nodes with the measurement that discarded them, and a\n * log of recent proposals (operator and label — the ledger's inline,\n * redacted summary of each rationale; the full rationale is a blob this\n * function never reads, so it stays a pure, I/O-free projection of the\n * state already in hand).\n */\nexport function renderSearchSummary(state: SearchStateView, options: SearchSummaryOptions): string {\n const header = state.header\n if (!header) return `search ${state.searchId}: not yet opened`\n const limit = options.limit ?? 5\n if (limit < 1 || !Number.isInteger(limit)) {\n throw new SearchLedgerError(\n `renderSearchSummary: limit must be a positive integer, got ${limit}`,\n )\n }\n const split = options.split\n const direction = header.objective.direction\n const root = state.rootNodeId\n const lines: string[] = [headerLine(state), spendLine(state), statusLine(state)]\n\n if (root === null) {\n lines.push('', 'No nodes yet.')\n return lines.join('\\n')\n }\n\n const others = state.nodes().filter((node) => node.nodeId !== root)\n const estimated = others\n .filter((node) => node.status !== 'invalid')\n .map((node) => ({ node, estimate: estimateNode(state, node.nodeId, { against: root, split }) }))\n\n const leading = estimated\n .filter(({ estimate }) => estimate.delta !== null)\n .sort((a, b) => signed(b.estimate, direction) - signed(a.estimate, direction))\n .slice(0, limit)\n lines.push('', `Leading nodes (vs root, ${split} split):`)\n if (leading.length === 0) lines.push(' none measured yet')\n for (const { node, estimate } of leading)\n lines.push(` ${nodeLine(node)}: ${formatEstimate(estimate)}`)\n\n const discarded = others\n .filter(\n (node) => node.status === 'pruned' || node.status === 'rejected' || node.status === 'invalid',\n )\n .sort((a, b) => b.updatedSequence - a.updatedSequence)\n .slice(0, limit)\n lines.push('', 'Recently discarded:')\n if (discarded.length === 0) lines.push(' none yet')\n for (const node of discarded) lines.push(` ${nodeLine(node)}: ${discardLine(node)}`)\n\n const recent = [...state.edges()].reverse().slice(0, limit)\n lines.push('', 'Recent proposals:')\n if (recent.length === 0) lines.push(' none yet')\n for (const edge of recent) {\n const childId = edge.childNodeId\n const label = edge.label.length > 0 ? edge.label : '(no label)'\n lines.push(` ${edge.operator} → ${childId}: ${label}`)\n }\n\n return lines.join('\\n')\n}\n\nfunction headerLine(state: SearchStateView): string {\n const header = state.header!\n return `search ${state.searchId} — ${header.subject} — ${header.objective.direction} ${header.objective.metric}`\n}\n\nfunction spendLine(state: SearchStateView): string {\n const { audit } = state\n const known = audit.spend.knownUsd.toFixed(2)\n const floor = audit.spend.floorUsd.toFixed(2)\n const unknown = audit.spend.unknownCostCells\n const floorPart =\n unknown > 0\n ? ` + floor $${floor} across ${unknown} unknown-cost cell${unknown === 1 ? '' : 's'}`\n : ''\n return ` ${audit.nodes} nodes · ${audit.cells.settled} settled cells (${audit.cells.open} open) · $${known} known${floorPart}`\n}\n\nfunction statusLine(state: SearchStateView): string {\n if (!state.closed) return ' status: open'\n const claim = state.closed.claim\n const claimText =\n claim === null\n ? ''\n : claim.decision === 'ship'\n ? ` · claim: ship ${claim.selected}`\n : ` · claim: ${claim.decision}`\n return ` status: closed (${state.closed.reason})${claimText}`\n}\n\nfunction nodeLine(node: SearchNode): string {\n const rung = node.status === 'advanced' ? ` rung ${node.rung}` : ''\n return `${node.nodeId} (${node.status ?? 'undecided'}${rung})`\n}\n\nfunction discardLine(node: SearchNode): string {\n const decision = node.decisions.at(-1)\n if (!decision) return 'no decision recorded'\n const basis = decision.basis === null ? 'no measured basis' : formatEstimate(decision.basis)\n return `${basis} — ${decision.rule}: ${decision.reason}`\n}\n\n/** `estimate.delta` in the objective's own units; positive is always better. */\nfunction signed(estimate: NodeEstimate, direction: 'maximize' | 'minimize'): number {\n if (estimate.delta === null) return Number.NEGATIVE_INFINITY\n return direction === 'maximize' ? estimate.delta : -estimate.delta\n}\n\n/** The display rules of search-tree-design §6.4: no whisker below 6 shared\n * units, a dashed descriptive interval with its exact sign p from 6 to 19,\n * a decision-grade whisker from `BOOTSTRAP_GATE_MIN_N`. */\nfunction formatEstimate(estimate: NodeEstimate): string {\n const unit = (n: number) => `${n} unit${n === 1 ? '' : 's'}`\n if (estimate.method === 'none') return `unknown (${unit(estimate.pairs)})`\n if (estimate.indeterminate)\n return `no measurable difference (indeterminate, ${unit(estimate.pairs)})`\n const delta =\n estimate.delta === null ? 'null' : (estimate.delta >= 0 ? '+' : '') + estimate.delta.toFixed(4)\n if (estimate.method === 'insufficient') {\n return `Δ=${delta} (${estimate.pairs} of ${DESCRIPTIVE_FROM} units, insufficient)`\n }\n const interval = estimate.interval\n ? ` [${estimate.interval[0].toFixed(4)}, ${estimate.interval[1].toFixed(4)}]`\n : ''\n if (estimate.method === 'descriptive') {\n const signP = estimate.exactSignP === null ? 'null' : estimate.exactSignP.toPrecision(3)\n return `Δ=${delta}${interval} dashed, sign p=${signP} (${unit(estimate.pairs)})`\n }\n return `Δ=${delta}${interval} (${unit(estimate.pairs)}, ≥${BOOTSTRAP_GATE_MIN_N})`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,mBAAmB,+BAA+B,GAAI;;AAe5D,SAAgB,mBAAmB,OAA4C;CAC7E,MAAM,SAAS,MAAM;CACrB,IAAI,CAAC,QAAQ,MAAM,IAAI,kBAAkB,UAAU,MAAM,SAAS,qBAAqB;CACvF,OAAO;EACL,UAAU,MAAM;EAChB,WAAW,OAAO,UAAU;EAC5B,cAAc,WAAW,MAAM,YAAY,QAAQ,OAAO;EAC1D,aAAa,WAAW,MAAM,WAAW,QAAQ,OAAO;CAC1D;AACF;;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AAS,eAAe,OAAO,SAAS,SAAS,WAAW,YAAY,CAAC,EAClC,IAAI,KAAK,SAAS,KAAK,EAAE;CAEhF,OAAO,KAAK,QAAQ,SAAS,IAAI,KAAK,SAAS,KAAK,EAAE;AACxD"}
1
+ {"version":3,"file":"search-summary-BSftVrGY.js","names":[],"sources":["../src/campaign/search-summary.ts"],"sourcesContent":["/**\n * The agent's view of a search: the same projection a human reads.\n *\n * `renderSearchSummary` turns a `SearchStateView` into compact text — the\n * leading nodes with their estimates, the most recently discarded ideas with\n * why they were discarded, and a log of recent proposals — as AIDE's journal\n * summary does for its own search. `agent-eval search show <ledger>` prints\n * the same text for a terminal; `runOptimization` puts it on every\n * `ProposeContext` a proposer receives.\n *\n * `searchProposerView` is the train-only read `ProposeContext.train` carries.\n * It has no parameter that can select another split, so a proposer built on\n * it cannot reach the selection or test split even by mistake: the sealed\n * splits (§6.6 of the search-tree design) are unreachable by construction,\n * not by convention.\n */\n\nimport { minimumPairsForPairedDeltaTest } from '../paired-delta-test'\nimport { BOOTSTRAP_GATE_MIN_N } from '../statistics'\nimport { estimateNode } from './estimate-node'\nimport { SearchLedgerError } from './search-ledger-errors'\nimport type { NodeEstimate, SearchSplit } from './search-ledger-types'\nimport type { SearchNode, SearchScoredCell, SearchStateView, SearchUnitScore } from './search-state'\n\nconst DESCRIPTIVE_FROM = minimumPairsForPairedDeltaTest(0.95)\n\n/** The proposer's own read of a search: its node's cells on the train split,\n * the only split a proposer may ever see. */\nexport interface SearchProposerView {\n readonly searchId: string\n readonly direction: 'maximize' | 'minimize'\n /** `nodeId`'s scored train cells. Unscored cells (errored, cancelled or in\n * flight) are absent, never zero. */\n scoredCells(nodeId: string): readonly SearchScoredCell[]\n /** Per-unit train-split means of `nodeId`, in unitId order. */\n unitScores(nodeId: string): readonly SearchUnitScore[]\n}\n\n/** The train-only view `ProposeContext.train` carries. */\nexport function searchProposerView(state: SearchStateView): SearchProposerView {\n const header = state.header\n if (!header) throw new SearchLedgerError(`search ${state.searchId} has not been opened`)\n return {\n searchId: state.searchId,\n direction: header.objective.direction,\n scoredCells: (nodeId) => state.scoredCells(nodeId, 'train'),\n unitScores: (nodeId) => state.unitScores(nodeId, 'train'),\n }\n}\n\nexport interface SearchSummaryOptions {\n /**\n * The split every estimate in the summary is computed on. A proposer's\n * context must always pass `'train'`: the selection and test splits stay\n * unread by anything a proposer's text can reach. The CLI passes the\n * search's own ranking split, `'selection'` when the search declares one\n * else `'train'`, matching `searchPolicyView`.\n */\n split: SearchSplit\n /** Nodes shown under \"Leading\" and under \"Recently discarded\". Default 5. */\n limit?: number\n}\n\n/**\n * `SearchState` as compact text: a header line with the search's shape and\n * spend, the leading nodes against the root with their estimates, the most\n * recently discarded nodes with the measurement that discarded them, and a\n * log of recent proposals (operator and label — the ledger's inline,\n * redacted summary of each rationale; the full rationale is a blob this\n * function never reads, so it stays a pure, I/O-free projection of the\n * state already in hand).\n */\nexport function renderSearchSummary(state: SearchStateView, options: SearchSummaryOptions): string {\n const header = state.header\n if (!header) return `search ${state.searchId}: not yet opened`\n const limit = options.limit ?? 5\n if (limit < 1 || !Number.isInteger(limit)) {\n throw new SearchLedgerError(\n `renderSearchSummary: limit must be a positive integer, got ${limit}`,\n )\n }\n const split = options.split\n const direction = header.objective.direction\n const root = state.rootNodeId\n const lines: string[] = [headerLine(state), spendLine(state), statusLine(state)]\n\n if (root === null) {\n lines.push('', 'No nodes yet.')\n return lines.join('\\n')\n }\n\n const others = state.nodes().filter((node) => node.nodeId !== root)\n const estimated = others\n .filter((node) => node.status !== 'invalid')\n .map((node) => ({ node, estimate: estimateNode(state, node.nodeId, { against: root, split }) }))\n\n const leading = estimated\n .filter(({ estimate }) => estimate.delta !== null)\n .sort((a, b) => signed(b.estimate, direction) - signed(a.estimate, direction))\n .slice(0, limit)\n lines.push('', `Leading nodes (vs root, ${split} split):`)\n if (leading.length === 0) lines.push(' none measured yet')\n for (const { node, estimate } of leading)\n lines.push(` ${nodeLine(node)}: ${formatEstimate(estimate)}`)\n\n const discarded = others\n .filter(\n (node) => node.status === 'pruned' || node.status === 'rejected' || node.status === 'invalid',\n )\n .sort((a, b) => b.updatedSequence - a.updatedSequence)\n .slice(0, limit)\n lines.push('', 'Recently discarded:')\n if (discarded.length === 0) lines.push(' none yet')\n for (const node of discarded) lines.push(` ${nodeLine(node)}: ${discardLine(node)}`)\n\n const recent = [...state.edges()].reverse().slice(0, limit)\n lines.push('', 'Recent proposals:')\n if (recent.length === 0) lines.push(' none yet')\n for (const edge of recent) {\n const childId = edge.childNodeId\n const label = edge.label.length > 0 ? edge.label : '(no label)'\n lines.push(` ${edge.operator} → ${childId}: ${label}`)\n }\n\n return lines.join('\\n')\n}\n\nfunction headerLine(state: SearchStateView): string {\n const header = state.header!\n return `search ${state.searchId} — ${header.subject} — ${header.objective.direction} ${header.objective.metric}`\n}\n\nfunction spendLine(state: SearchStateView): string {\n const { audit } = state\n const known = audit.spend.knownUsd.toFixed(2)\n const floor = audit.spend.floorUsd.toFixed(2)\n const unknown = audit.spend.unknownCostCells\n const floorPart =\n unknown > 0\n ? ` + floor $${floor} across ${unknown} unknown-cost cell${unknown === 1 ? '' : 's'}`\n : ''\n return ` ${audit.nodes} nodes · ${audit.cells.settled} settled cells (${audit.cells.open} open) · $${known} known${floorPart}`\n}\n\nfunction statusLine(state: SearchStateView): string {\n if (!state.closed) return ' status: open'\n const claim = state.closed.claim\n const claimText =\n claim === null\n ? ''\n : claim.decision === 'ship'\n ? ` · claim: ship ${claim.selected}`\n : ` · claim: ${claim.decision}`\n return ` status: closed (${state.closed.reason})${claimText}`\n}\n\nfunction nodeLine(node: SearchNode): string {\n const rung = node.status === 'advanced' ? ` rung ${node.rung}` : ''\n return `${node.nodeId} (${node.status ?? 'undecided'}${rung})`\n}\n\nfunction discardLine(node: SearchNode): string {\n const decision = node.decisions.at(-1)\n if (!decision) return 'no decision recorded'\n const basis = decision.basis === null ? 'no measured basis' : formatEstimate(decision.basis)\n return `${basis} — ${decision.rule}: ${decision.reason}`\n}\n\n/** `estimate.delta` in the objective's own units; positive is always better. */\nfunction signed(estimate: NodeEstimate, direction: 'maximize' | 'minimize'): number {\n if (estimate.delta === null) return Number.NEGATIVE_INFINITY\n return direction === 'maximize' ? estimate.delta : -estimate.delta\n}\n\n/** The display rules of search-tree-design §6.4: no whisker below 6 shared\n * units, a dashed descriptive interval with its exact sign p from 6 to 19,\n * a decision-grade whisker from `BOOTSTRAP_GATE_MIN_N`. */\nfunction formatEstimate(estimate: NodeEstimate): string {\n const unit = (n: number) => `${n} unit${n === 1 ? '' : 's'}`\n if (estimate.method === 'none') return `unknown (${unit(estimate.pairs)})`\n if (estimate.indeterminate)\n return `no measurable difference (indeterminate, ${unit(estimate.pairs)})`\n const delta =\n estimate.delta === null ? 'null' : (estimate.delta >= 0 ? '+' : '') + estimate.delta.toFixed(4)\n if (estimate.method === 'insufficient') {\n return `Δ=${delta} (${estimate.pairs} of ${DESCRIPTIVE_FROM} units, insufficient)`\n }\n const interval = estimate.interval\n ? ` [${estimate.interval[0].toFixed(4)}, ${estimate.interval[1].toFixed(4)}]`\n : ''\n if (estimate.method === 'descriptive') {\n const signP = estimate.exactSignP === null ? 'null' : estimate.exactSignP.toPrecision(3)\n return `Δ=${delta}${interval} dashed, sign p=${signP} (${unit(estimate.pairs)})`\n }\n return `Δ=${delta}${interval} (${unit(estimate.pairs)}, ≥${BOOTSTRAP_GATE_MIN_N})`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,mBAAmB,+BAA+B,GAAI;;AAe5D,SAAgB,mBAAmB,OAA4C;CAC7E,MAAM,SAAS,MAAM;CACrB,IAAI,CAAC,QAAQ,MAAM,IAAI,kBAAkB,UAAU,MAAM,SAAS,qBAAqB;CACvF,OAAO;EACL,UAAU,MAAM;EAChB,WAAW,OAAO,UAAU;EAC5B,cAAc,WAAW,MAAM,YAAY,QAAQ,OAAO;EAC1D,aAAa,WAAW,MAAM,WAAW,QAAQ,OAAO;CAC1D;AACF;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SAAS,eAAe,OAAO,SAAS,SAAS,WAAW,YAAY,CAAC,EAClC,IAAI,KAAK,SAAS,KAAK,EAAE;CAEhF,OAAO,KAAK,QAAQ,SAAS,IAAI,KAAK,SAAS,KAAK,EAAE;AACxD"}
@@ -113,6 +113,13 @@ interface SequentialCrossingHorizon {
113
113
  readonly decisionThreshold: number;
114
114
  readonly maxPairs: number;
115
115
  }
116
+ /**
117
+ * Compute the minimum pair count at which even perfect, all-at-bound data can
118
+ * reach the evidence and decision thresholds. The calculation intentionally
119
+ * calls the canonical sequence implementation rather than maintaining a
120
+ * second approximation that can drift from its bet schedule.
121
+ */
122
+ declare function sequentialCrossingHorizon(opts?: SequentialCrossingHorizonOptions): SequentialCrossingHorizon;
116
123
  interface InterimReleaseConfidenceInput {
117
124
  /**
118
125
  * One delta series per candidate (paired deltas vs comparator). Order
@@ -157,5 +164,5 @@ interface InterimReleaseConfidence {
157
164
  * every campaign tick — the recommendation is anytime-valid.
158
165
  */
159
166
  declare function evaluateInterimReleaseConfidence(input: InterimReleaseConfidenceInput): InterimReleaseConfidence;
160
- export { PairedEvalueStep as a, SequentialDecision as c, PairedEvalueSequence as i, evaluateInterimReleaseConfidence as l, InterimReleaseConfidenceInput as n, SequentialCrossingHorizon as o, PairedEvalueOptions as r, SequentialCrossingHorizonOptions as s, InterimReleaseConfidence as t, pairedEvalueSequence as u };
161
- //# sourceMappingURL=sequential-Bb_pdTqG.d.ts.map
167
+ export { PairedEvalueStep as a, SequentialDecision as c, sequentialCrossingHorizon as d, PairedEvalueSequence as i, evaluateInterimReleaseConfidence as l, InterimReleaseConfidenceInput as n, SequentialCrossingHorizon as o, PairedEvalueOptions as r, SequentialCrossingHorizonOptions as s, InterimReleaseConfidence as t, pairedEvalueSequence as u };
168
+ //# sourceMappingURL=sequential-B9p6uoV8.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequential-Bb_pdTqG.d.ts","names":[],"sources":["../src/sequential.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCY;UAEK;;;;;;EAMf;;EAEA;;;;;;EAMA;IAAS;IAAa;;;EAEtB;;UAGe;;EAEf;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA,UAAU;;UAGK;EACf,OAAO;;EAEP,eAAe;;EAEf;;EAEA;;;;;;;;;;;iBAYc,qBACd,kBACA,OAAM,sBACL;;UA0Ec,yCACP,KAAK;;EAEb;;;;;;;;;;;;UAae;WACN;WACA;WACA;WACA;WACA;;UAgDM;;;;;EAKf,aAAa;IAAQ;IAAqB;;EAC1C;EACA;EACA;IAAS;IAAa;;;UAGP;EACf,YAAY;IACV;IACA,UAAU;IACV;IACA;IACA;IACA;IACA;IACA;;;;;;;EAOF;IAAkB,UAAU;IAAoB;;;;;;;;;iBASlC,iCACd,OAAO,gCACN"}
1
+ {"version":3,"file":"sequential-B9p6uoV8.d.ts","names":[],"sources":["../src/sequential.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCY;UAEK;;;;;;EAMf;;EAEA;;;;;;EAMA;IAAS;IAAa;;;EAEtB;;UAGe;;EAEf;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA,UAAU;;UAGK;EACf,OAAO;;EAEP,eAAe;;EAEf;;EAEA;;;;;;;;;;;iBAYc,qBACd,kBACA,OAAM,sBACL;;UA0Ec,yCACP,KAAK;;EAEb;;;;;;;;;;;;UAae;WACN;WACA;WACA;WACA;WACA;;;;;;;;iBAWK,0BACd,OAAM,mCACL;UAmCc;;;;;EAKf,aAAa;IAAQ;IAAqB;;EAC1C;EACA;EACA;IAAS;IAAa;;;UAGP;EACf,YAAY;IACV;IACA,UAAU;IACV;IACA;IACA;IACA;IACA;IACA;;;;;;;EAOF;IAAkB,UAAU;IAAoB;;;;;;;;;iBASlC,iCACd,OAAO,gCACN"}
@@ -68,6 +68,36 @@ function pairedEvalueSequence(deltas, opts = {}) {
68
68
  clipped
69
69
  };
70
70
  }
71
+ const MAX_SEQUENTIAL_CROSSING_PAIRS = 1e6;
72
+ /**
73
+ * Compute the minimum pair count at which even perfect, all-at-bound data can
74
+ * reach the evidence and decision thresholds. The calculation intentionally
75
+ * calls the canonical sequence implementation rather than maintaining a
76
+ * second approximation that can drift from its bet schedule.
77
+ */
78
+ function sequentialCrossingHorizon(opts = {}) {
79
+ const bound = opts.bound ?? 1;
80
+ const alpha = opts.alpha ?? .05;
81
+ const initialBetShrinkage = opts.initialBetShrinkage ?? .5;
82
+ const maxPairs = opts.maxPairs ?? 1e4;
83
+ assertSequentialScalarConfiguration(bound, alpha, initialBetShrinkage, "sequentialCrossingHorizon");
84
+ if (!Number.isSafeInteger(maxPairs) || maxPairs < 1) throw new Error("sequentialCrossingHorizon: maxPairs must be a positive safe integer");
85
+ if (maxPairs > MAX_SEQUENTIAL_CROSSING_PAIRS) throw new Error(`sequentialCrossingHorizon: maxPairs must be <= ${MAX_SEQUENTIAL_CROSSING_PAIRS}`);
86
+ const sequence = pairedEvalueSequence(Array(maxPairs).fill(bound), {
87
+ bound,
88
+ alpha,
89
+ initialBetShrinkage
90
+ });
91
+ const { evidenceThreshold, decisionThreshold } = sequentialThresholds(alpha);
92
+ const evidencePairs = sequence.steps.find((step) => step.evalue >= evidenceThreshold)?.t ?? null;
93
+ return Object.freeze({
94
+ evidencePairs,
95
+ decisionPairs: sequence.decisionFiredAt,
96
+ evidenceThreshold,
97
+ decisionThreshold,
98
+ maxPairs
99
+ });
100
+ }
71
101
  /**
72
102
  * Run interim sequential analyses across many candidates at once,
73
103
  * preserving the time-uniform α guarantee for each candidate's series and
@@ -154,6 +184,6 @@ function empiricalBernsteinCs(sum, sumSq, n, bound, alpha) {
154
184
  high: mean + radius
155
185
  };
156
186
  }
157
- export { pairedEvalueSequence as n, evaluateInterimReleaseConfidence as t };
187
+ export { pairedEvalueSequence as n, sequentialCrossingHorizon as r, evaluateInterimReleaseConfidence as t };
158
188
 
159
- //# sourceMappingURL=sequential-Bjs5roiK.js.map
189
+ //# sourceMappingURL=sequential-CAksw6EU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequential-Bjs5roiK.js","names":[],"sources":["../src/sequential.ts"],"sourcesContent":["/**\n * Always-valid sequential evaluation.\n *\n * `researchReport` assumes a single pre-specified analysis. Real\n * consumers run campaigns weekly / nightly / per-PR; each new run silently\n * inflates the false-discovery rate, because the BH-FDR guarantee is for\n * the *first* look, not the 47th. Without time-uniform inference,\n * launch-decision teams either (a) don't peek, which forfeits the cost\n * advantage of stop-when-decisive, or (b) peek and pretend they didn't,\n * which forfeits scientific validity.\n *\n * This module ships **e-value-based confidence sequences** for paired\n * bounded outcomes. The methodology is the predictable plug-in betting\n * martingale of Waudby-Smith & Ramdas (2024) — provably valid at *any*\n * stopping time. Concretely:\n *\n * For paired deltas D_1, D_2, … ∈ [-c, c] with the null H_0: E[D] ≤ 0,\n * a betting fraction λ_i is chosen using only D_{1..i-1} (predictable\n * plug-in), and the running e-value is\n *\n * E_t = ∏_{i=1}^{t} (1 + λ_i · D_i)\n *\n * E_t is a non-negative martingale under H_0 with E[E_t] ≤ 1, so by\n * Ville's inequality, P(∃ t : E_t ≥ 1/α) ≤ α — we can reject the null\n * at any time without inflating the type-I error.\n *\n * Combined with `runEvalCampaign`, every consumer running rolling\n * campaigns gains the ability to ship the moment evidence is decisive,\n * stop-early on dead-on-arrival variants, and accumulate evidence across\n * partial runs without spending the FDR budget. No new sweep is wasted.\n *\n * References:\n * - Howard, S. R., Ramdas, A., McAuliffe, J., Sekhon, J. (2021).\n * Time-uniform, nonparametric, nonasymptotic confidence sequences.\n * Annals of Statistics, 49(2), 1055–1080.\n * - Waudby-Smith, I., Ramdas, A. (2024). Estimating means of bounded\n * random variables by betting. JRSS B, 86(1), 1–27.\n */\n\nexport type SequentialDecision = 'promote_now' | 'continue' | 'reject_now' | 'equivalent'\n\nexport interface PairedEvalueOptions {\n /**\n * Bound on |delta|. Default 1 (matching most score scales). Must satisfy\n * c > 0; deltas outside [-c, c] are clipped with a warning attached to\n * the return value.\n */\n bound?: number\n /** Target Type-I error. Default 0.05. */\n alpha?: number\n /**\n * Region of Practical Equivalence on the *mean* paired delta. When\n * supplied, the verdict can return `'equivalent'` once the running\n * confidence sequence on the mean is fully contained in [low, high].\n */\n rope?: { low: number; high: number }\n /** Initial bet shrinkage (0 < scale ≤ 1). Default 0.5 — empirically robust. */\n initialBetShrinkage?: number\n}\n\nexport interface PairedEvalueStep {\n /** 1-indexed observation count. */\n t: number\n delta: number\n /** Running e-value E_t = ∏ (1 + λ_i · D_i). */\n evalue: number\n /** Time-uniform p-value at stopping time t. */\n pValue: number\n /** Lower bound of the empirical Bernstein confidence sequence at level 1-α. */\n csLow: number\n csHigh: number\n /** Verdict at this stopping time. */\n decision: SequentialDecision\n}\n\nexport interface PairedEvalueSequence {\n steps: PairedEvalueStep[]\n /** The decision at the final step. */\n finalDecision: SequentialDecision\n /** Index (1-based) at which a non-`continue` decision first fired, or null. */\n decisionFiredAt: number | null\n /** True if any deltas were clipped to [-bound, bound]. */\n clipped: boolean\n}\n\n/**\n * Run the paired e-value sequence over an in-order delta stream.\n *\n * Use for *streaming* / interim analyses: pass the deltas you have so\n * far, get the verdict at every prefix length. The decision is\n * monotone-stable in the sense that once `'reject_now'` or `'promote_now'`\n * fires, the verdict at later steps remains decisive (the e-value is a\n * non-negative martingale; once it crosses the threshold, it's crossed).\n */\nexport function pairedEvalueSequence(\n deltas: number[],\n opts: PairedEvalueOptions = {},\n): PairedEvalueSequence {\n const c = opts.bound ?? 1\n const alpha = opts.alpha ?? 0.05\n const initialShrink = opts.initialBetShrinkage ?? 0.5\n const rope = opts.rope ?? null\n assertSequentialScalarConfiguration(c, alpha, initialShrink, 'pairedEvalueSequence')\n if (rope && !(Number.isFinite(rope.low) && Number.isFinite(rope.high) && rope.low <= rope.high)) {\n throw new Error('pairedEvalueSequence: rope must satisfy low ≤ high')\n }\n const { decisionThreshold } = sequentialThresholds(alpha)\n\n const steps: PairedEvalueStep[] = []\n let clipped = false\n let evalue = 1\n let decisionFiredAt: number | null = null\n\n // Running statistics (using only D_{1..i-1} for the bet → predictable plug-in).\n let sum = 0\n let sumSq = 0\n let count = 0\n\n for (let i = 0; i < deltas.length; i++) {\n let d = deltas[i]!\n if (!Number.isFinite(d)) {\n throw new Error(`pairedEvalueSequence: delta[${i}] must be finite`)\n }\n if (d < -c || d > c) {\n d = Math.max(-c, Math.min(c, d))\n clipped = true\n }\n\n // Predictable plug-in bet (positive λ tests for E[D] > 0; we run a two-sided\n // test by tracking the symmetric e-value via |bet|).\n // λ_i ∝ mean / (variance + bound^2). Shrink early to avoid overbetting.\n const muHat = count === 0 ? 0 : sum / count\n const varHat = count === 0 ? c * c : Math.max(1e-12, sumSq / count - muHat * muHat)\n const t = i + 1\n const shrink = initialShrink * Math.min(1, count / 32) // anneal toward 1\n let lambda = (muHat / (varHat + c * c)) * shrink\n // Clip to ensure 1 + λ·D > 0 for all |D| ≤ c (so the e-value stays non-negative).\n const lambdaMax = 0.99 / c\n if (lambda > lambdaMax) lambda = lambdaMax\n if (lambda < -lambdaMax) lambda = -lambdaMax\n\n evalue = evalue * (1 + lambda * d)\n if (!Number.isFinite(evalue) || evalue < 0) evalue = 0\n\n sum += d\n sumSq += d * d\n count += 1\n\n const pValue = Math.min(1, 1 / Math.max(evalue, 1e-300))\n\n // Empirical Bernstein confidence sequence on the mean. Howard et al.\n // (2021), Theorem 4.4 with σ̂² the running sample variance and a\n // calibration constant tuned for two-sided coverage at level 1 - α.\n const cs = empiricalBernsteinCs(sum, sumSq, count, c, alpha)\n\n let decision: SequentialDecision = 'continue'\n if (rope && cs.low >= rope.low && cs.high <= rope.high) decision = 'equivalent'\n else if (evalue >= decisionThreshold && muHat > 0) decision = 'promote_now'\n else if (evalue >= decisionThreshold && muHat < 0) decision = 'reject_now'\n else if (rope && cs.high < rope.low) decision = 'reject_now'\n\n if (decision !== 'continue' && decisionFiredAt === null) decisionFiredAt = t\n\n steps.push({ t, delta: d, evalue, pValue, csLow: cs.low, csHigh: cs.high, decision })\n }\n\n const finalDecision = steps.length === 0 ? 'continue' : steps[steps.length - 1]!.decision\n return { steps, finalDecision, decisionFiredAt, clipped }\n}\n\n/** Configuration for the best-case reachability preflight. */\nexport interface SequentialCrossingHorizonOptions\n extends Pick<PairedEvalueOptions, 'alpha' | 'bound' | 'initialBetShrinkage'> {\n /** Maximum pairs to simulate before returning `null`. Default 10,000. */\n maxPairs?: number\n}\n\n/**\n * Best-case horizons under the exact betting policy used by\n * {@link pairedEvalueSequence}.\n *\n * `evidencePairs` is the first all-at-bound pair count whose e-value reaches\n * `1/alpha`. `decisionPairs` is the first count whose actual two-sided\n * sequence verdict fires (`2/alpha` in the current policy). A design whose\n * pair cap is below either relevant horizon is undecidable by construction and\n * should be refused before model spend.\n */\nexport interface SequentialCrossingHorizon {\n readonly evidencePairs: number | null\n readonly decisionPairs: number | null\n readonly evidenceThreshold: number\n readonly decisionThreshold: number\n readonly maxPairs: number\n}\n\nconst MAX_SEQUENTIAL_CROSSING_PAIRS = 1_000_000\n\n/**\n * Compute the minimum pair count at which even perfect, all-at-bound data can\n * reach the evidence and decision thresholds. The calculation intentionally\n * calls the canonical sequence implementation rather than maintaining a\n * second approximation that can drift from its bet schedule.\n */\nexport function sequentialCrossingHorizon(\n opts: SequentialCrossingHorizonOptions = {},\n): SequentialCrossingHorizon {\n const bound = opts.bound ?? 1\n const alpha = opts.alpha ?? 0.05\n const initialBetShrinkage = opts.initialBetShrinkage ?? 0.5\n const maxPairs = opts.maxPairs ?? 10_000\n assertSequentialScalarConfiguration(\n bound,\n alpha,\n initialBetShrinkage,\n 'sequentialCrossingHorizon',\n )\n if (!Number.isSafeInteger(maxPairs) || maxPairs < 1) {\n throw new Error('sequentialCrossingHorizon: maxPairs must be a positive safe integer')\n }\n if (maxPairs > MAX_SEQUENTIAL_CROSSING_PAIRS) {\n throw new Error(\n `sequentialCrossingHorizon: maxPairs must be <= ${MAX_SEQUENTIAL_CROSSING_PAIRS}`,\n )\n }\n const sequence = pairedEvalueSequence(Array<number>(maxPairs).fill(bound), {\n bound,\n alpha,\n initialBetShrinkage,\n })\n const { evidenceThreshold, decisionThreshold } = sequentialThresholds(alpha)\n const evidencePairs = sequence.steps.find((step) => step.evalue >= evidenceThreshold)?.t ?? null\n return Object.freeze({\n evidencePairs,\n decisionPairs: sequence.decisionFiredAt,\n evidenceThreshold,\n decisionThreshold,\n maxPairs,\n })\n}\n\nexport interface InterimReleaseConfidenceInput {\n /**\n * One delta series per candidate (paired deltas vs comparator). Order\n * within a series is the order the campaigns were run.\n */\n deltaSeries: Array<{ candidateId: string; deltas: number[] }>\n alpha?: number\n bound?: number\n rope?: { low: number; high: number }\n}\n\nexport interface InterimReleaseConfidence {\n candidates: Array<{\n candidateId: string\n decision: SequentialDecision\n decisionFiredAt: number | null\n finalEvalue: number\n finalPValue: number\n pairs: number\n csLow: number\n csHigh: number\n }>\n /**\n * Campaign-level recommendation: pick the strongest 'promote_now', else\n * 'continue' if any candidate is still live, else 'reject_now' if every\n * candidate is dead, else 'equivalent'.\n */\n recommendation: { decision: SequentialDecision; candidateId: string | null }\n}\n\n/**\n * Run interim sequential analyses across many candidates at once,\n * preserving the time-uniform α guarantee for each candidate's series and\n * synthesising a campaign-level recommendation. Designed to be called on\n * every campaign tick — the recommendation is anytime-valid.\n */\nexport function evaluateInterimReleaseConfidence(\n input: InterimReleaseConfidenceInput,\n): InterimReleaseConfidence {\n const candidates = input.deltaSeries.map((s) => {\n const seq = pairedEvalueSequence(s.deltas, {\n alpha: input.alpha,\n bound: input.bound,\n rope: input.rope,\n })\n const last = seq.steps[seq.steps.length - 1]\n return {\n candidateId: s.candidateId,\n decision: seq.finalDecision,\n decisionFiredAt: seq.decisionFiredAt,\n finalEvalue: last?.evalue ?? 1,\n finalPValue: last?.pValue ?? 1,\n pairs: seq.steps.length,\n csLow: last?.csLow ?? Number.NEGATIVE_INFINITY,\n csHigh: last?.csHigh ?? Number.POSITIVE_INFINITY,\n }\n })\n\n const promote = candidates.find((c) => c.decision === 'promote_now')\n if (promote)\n return {\n candidates,\n recommendation: { decision: 'promote_now', candidateId: promote.candidateId },\n }\n const live = candidates.find((c) => c.decision === 'continue')\n if (live) return { candidates, recommendation: { decision: 'continue', candidateId: null } }\n const equiv = candidates.find((c) => c.decision === 'equivalent')\n if (equiv)\n return {\n candidates,\n recommendation: { decision: 'equivalent', candidateId: equiv.candidateId },\n }\n return { candidates, recommendation: { decision: 'reject_now', candidateId: null } }\n}\n\n// ── Internals ────────────────────────────────────────────────────────────\n\nfunction assertSequentialScalarConfiguration(\n bound: number,\n alpha: number,\n initialBetShrinkage: number,\n context: string,\n): void {\n if (!Number.isFinite(bound) || bound <= 0) {\n throw new Error(`${context}: bound must be a finite number > 0`)\n }\n if (!Number.isFinite(alpha) || alpha <= 0 || alpha >= 1) {\n throw new Error(`${context}: alpha must be a finite number in (0,1)`)\n }\n if (\n !Number.isFinite(initialBetShrinkage) ||\n initialBetShrinkage <= 0 ||\n initialBetShrinkage > 1\n ) {\n throw new Error(`${context}: initialBetShrinkage must be a finite number in (0,1]`)\n }\n}\n\nfunction sequentialThresholds(alpha: number): {\n evidenceThreshold: number\n decisionThreshold: number\n} {\n return { evidenceThreshold: 1 / alpha, decisionThreshold: 2 / alpha }\n}\n\n/**\n * Empirical Bernstein confidence sequence on the mean of bounded variables.\n * Adapted from Howard et al. (2021) §4.4. Provides a time-uniform CI on\n * the running mean; valid at every stopping time.\n */\nfunction empiricalBernsteinCs(\n sum: number,\n sumSq: number,\n n: number,\n bound: number,\n alpha: number,\n): { low: number; high: number } {\n if (n === 0) return { low: -bound, high: bound }\n const mean = sum / n\n const variance = Math.max(0, sumSq / n - mean * mean)\n // Iterated-log calibration constant. The 1.7 exponent matches the\n // recommended choice in Howard et al. for two-sided coverage at level\n // 1 - α with mild log-corrections; tightening further requires a\n // tuned mixture and is out of scope.\n const psi = Math.log(2 / alpha) + 1.7 * Math.log(Math.log(Math.max(Math.E, n)) + 1)\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IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;CAClF,MAAM,SAAS,KAAK,KAAM,IAAI,WAAW,MAAO,CAAC,IAAK,IAAI,QAAQ,MAAO;CACzE,OAAO;EAAE,KAAK,OAAO;EAAQ,MAAM,OAAO;CAAO;AACnD"}
1
+ {"version":3,"file":"sequential-CAksw6EU.js","names":[],"sources":["../src/sequential.ts"],"sourcesContent":["/**\n * Always-valid sequential evaluation.\n *\n * `researchReport` assumes a single pre-specified analysis. Real\n * consumers run campaigns weekly / nightly / per-PR; each new run silently\n * inflates the false-discovery rate, because the BH-FDR guarantee is for\n * the *first* look, not the 47th. Without time-uniform inference,\n * launch-decision teams either (a) don't peek, which forfeits the cost\n * advantage of stop-when-decisive, or (b) peek and pretend they didn't,\n * which forfeits scientific validity.\n *\n * This module ships **e-value-based confidence sequences** for paired\n * bounded outcomes. The methodology is the predictable plug-in betting\n * martingale of Waudby-Smith & Ramdas (2024) — provably valid at *any*\n * stopping time. Concretely:\n *\n * For paired deltas D_1, D_2, … ∈ [-c, c] with the null H_0: E[D] ≤ 0,\n * a betting fraction λ_i is chosen using only D_{1..i-1} (predictable\n * plug-in), and the running e-value is\n *\n * E_t = ∏_{i=1}^{t} (1 + λ_i · D_i)\n *\n * E_t is a non-negative martingale under H_0 with E[E_t] ≤ 1, so by\n * Ville's inequality, P(∃ t : E_t ≥ 1/α) ≤ α — we can reject the null\n * at any time without inflating the type-I error.\n *\n * Combined with `runEvalCampaign`, every consumer running rolling\n * campaigns gains the ability to ship the moment evidence is decisive,\n * stop-early on dead-on-arrival variants, and accumulate evidence across\n * partial runs without spending the FDR budget. No new sweep is wasted.\n *\n * References:\n * - Howard, S. R., Ramdas, A., McAuliffe, J., Sekhon, J. (2021).\n * Time-uniform, nonparametric, nonasymptotic confidence sequences.\n * Annals of Statistics, 49(2), 1055–1080.\n * - Waudby-Smith, I., Ramdas, A. (2024). Estimating means of bounded\n * random variables by betting. JRSS B, 86(1), 1–27.\n */\n\nexport type SequentialDecision = 'promote_now' | 'continue' | 'reject_now' | 'equivalent'\n\nexport interface PairedEvalueOptions {\n /**\n * Bound on |delta|. Default 1 (matching most score scales). Must satisfy\n * c > 0; deltas outside [-c, c] are clipped with a warning attached to\n * the return value.\n */\n bound?: number\n /** Target Type-I error. Default 0.05. */\n alpha?: number\n /**\n * Region of Practical Equivalence on the *mean* paired delta. When\n * supplied, the verdict can return `'equivalent'` once the running\n * confidence sequence on the mean is fully contained in [low, high].\n */\n rope?: { low: number; high: number }\n /** Initial bet shrinkage (0 < scale ≤ 1). Default 0.5 — empirically robust. */\n initialBetShrinkage?: number\n}\n\nexport interface PairedEvalueStep {\n /** 1-indexed observation count. */\n t: number\n delta: number\n /** Running e-value E_t = ∏ (1 + λ_i · D_i). */\n evalue: number\n /** Time-uniform p-value at stopping time t. */\n pValue: number\n /** Lower bound of the empirical Bernstein confidence sequence at level 1-α. */\n csLow: number\n csHigh: number\n /** Verdict at this stopping time. */\n decision: SequentialDecision\n}\n\nexport interface PairedEvalueSequence {\n steps: PairedEvalueStep[]\n /** The decision at the final step. */\n finalDecision: SequentialDecision\n /** Index (1-based) at which a non-`continue` decision first fired, or null. */\n decisionFiredAt: number | null\n /** True if any deltas were clipped to [-bound, bound]. */\n clipped: boolean\n}\n\n/**\n * Run the paired e-value sequence over an in-order delta stream.\n *\n * Use for *streaming* / interim analyses: pass the deltas you have so\n * far, get the verdict at every prefix length. The decision is\n * monotone-stable in the sense that once `'reject_now'` or `'promote_now'`\n * fires, the verdict at later steps remains decisive (the e-value is a\n * non-negative martingale; once it crosses the threshold, it's crossed).\n */\nexport function pairedEvalueSequence(\n deltas: number[],\n opts: PairedEvalueOptions = {},\n): PairedEvalueSequence {\n const c = opts.bound ?? 1\n const alpha = opts.alpha ?? 0.05\n const initialShrink = opts.initialBetShrinkage ?? 0.5\n const rope = opts.rope ?? null\n assertSequentialScalarConfiguration(c, alpha, initialShrink, 'pairedEvalueSequence')\n if (rope && !(Number.isFinite(rope.low) && Number.isFinite(rope.high) && rope.low <= rope.high)) {\n throw new Error('pairedEvalueSequence: rope must satisfy low ≤ high')\n }\n const { decisionThreshold } = sequentialThresholds(alpha)\n\n const steps: PairedEvalueStep[] = []\n let clipped = false\n let evalue = 1\n let decisionFiredAt: number | null = null\n\n // Running statistics (using only D_{1..i-1} for the bet → predictable plug-in).\n let sum = 0\n let sumSq = 0\n let count = 0\n\n for (let i = 0; i < deltas.length; i++) {\n let d = deltas[i]!\n if (!Number.isFinite(d)) {\n throw new Error(`pairedEvalueSequence: delta[${i}] must be finite`)\n }\n if (d < -c || d > c) {\n d = Math.max(-c, Math.min(c, d))\n clipped = true\n }\n\n // Predictable plug-in bet (positive λ tests for E[D] > 0; we run a two-sided\n // test by tracking the symmetric e-value via |bet|).\n // λ_i ∝ mean / (variance + bound^2). Shrink early to avoid overbetting.\n const muHat = count === 0 ? 0 : sum / count\n const varHat = count === 0 ? c * c : Math.max(1e-12, sumSq / count - muHat * muHat)\n const t = i + 1\n const shrink = initialShrink * Math.min(1, count / 32) // anneal toward 1\n let lambda = (muHat / (varHat + c * c)) * shrink\n // Clip to ensure 1 + λ·D > 0 for all |D| ≤ c (so the e-value stays non-negative).\n const lambdaMax = 0.99 / c\n if (lambda > lambdaMax) lambda = lambdaMax\n if (lambda < -lambdaMax) lambda = -lambdaMax\n\n evalue = evalue * (1 + lambda * d)\n if (!Number.isFinite(evalue) || evalue < 0) evalue = 0\n\n sum += d\n sumSq += d * d\n count += 1\n\n const pValue = Math.min(1, 1 / Math.max(evalue, 1e-300))\n\n // Empirical Bernstein confidence sequence on the mean. Howard et al.\n // (2021), Theorem 4.4 with σ̂² the running sample variance and a\n // calibration constant tuned for two-sided coverage at level 1 - α.\n const cs = empiricalBernsteinCs(sum, sumSq, count, c, alpha)\n\n let decision: SequentialDecision = 'continue'\n if (rope && cs.low >= rope.low && cs.high <= rope.high) decision = 'equivalent'\n else if (evalue >= decisionThreshold && muHat > 0) decision = 'promote_now'\n else if (evalue >= decisionThreshold && muHat < 0) decision = 'reject_now'\n else if (rope && cs.high < rope.low) decision = 'reject_now'\n\n if (decision !== 'continue' && decisionFiredAt === null) decisionFiredAt = t\n\n steps.push({ t, delta: d, evalue, pValue, csLow: cs.low, csHigh: cs.high, decision })\n }\n\n const finalDecision = steps.length === 0 ? 'continue' : steps[steps.length - 1]!.decision\n return { steps, finalDecision, decisionFiredAt, clipped }\n}\n\n/** Configuration for the best-case reachability preflight. */\nexport interface SequentialCrossingHorizonOptions\n extends Pick<PairedEvalueOptions, 'alpha' | 'bound' | 'initialBetShrinkage'> {\n /** Maximum pairs to simulate before returning `null`. Default 10,000. */\n maxPairs?: number\n}\n\n/**\n * Best-case horizons under the exact betting policy used by\n * {@link pairedEvalueSequence}.\n *\n * `evidencePairs` is the first all-at-bound pair count whose e-value reaches\n * `1/alpha`. `decisionPairs` is the first count whose actual two-sided\n * sequence verdict fires (`2/alpha` in the current policy). A design whose\n * pair cap is below either relevant horizon is undecidable by construction and\n * should be refused before model spend.\n */\nexport interface SequentialCrossingHorizon {\n readonly evidencePairs: number | null\n readonly decisionPairs: number | null\n readonly evidenceThreshold: number\n readonly decisionThreshold: number\n readonly maxPairs: number\n}\n\nconst MAX_SEQUENTIAL_CROSSING_PAIRS = 1_000_000\n\n/**\n * Compute the minimum pair count at which even perfect, all-at-bound data can\n * reach the evidence and decision thresholds. The calculation intentionally\n * calls the canonical sequence implementation rather than maintaining a\n * second approximation that can drift from its bet schedule.\n */\nexport function sequentialCrossingHorizon(\n opts: SequentialCrossingHorizonOptions = {},\n): SequentialCrossingHorizon {\n const bound = opts.bound ?? 1\n const alpha = opts.alpha ?? 0.05\n const initialBetShrinkage = opts.initialBetShrinkage ?? 0.5\n const maxPairs = opts.maxPairs ?? 10_000\n assertSequentialScalarConfiguration(\n bound,\n alpha,\n initialBetShrinkage,\n 'sequentialCrossingHorizon',\n )\n if (!Number.isSafeInteger(maxPairs) || maxPairs < 1) {\n throw new Error('sequentialCrossingHorizon: maxPairs must be a positive safe integer')\n }\n if (maxPairs > MAX_SEQUENTIAL_CROSSING_PAIRS) {\n throw new Error(\n `sequentialCrossingHorizon: maxPairs must be <= ${MAX_SEQUENTIAL_CROSSING_PAIRS}`,\n )\n }\n const sequence = pairedEvalueSequence(Array<number>(maxPairs).fill(bound), {\n bound,\n alpha,\n initialBetShrinkage,\n })\n const { evidenceThreshold, decisionThreshold } = sequentialThresholds(alpha)\n const evidencePairs = sequence.steps.find((step) => step.evalue >= evidenceThreshold)?.t ?? null\n return Object.freeze({\n evidencePairs,\n decisionPairs: sequence.decisionFiredAt,\n evidenceThreshold,\n decisionThreshold,\n maxPairs,\n })\n}\n\nexport interface InterimReleaseConfidenceInput {\n /**\n * One delta series per candidate (paired deltas vs comparator). Order\n * within a series is the order the campaigns were run.\n */\n deltaSeries: Array<{ candidateId: string; deltas: number[] }>\n alpha?: number\n bound?: number\n rope?: { low: number; high: number }\n}\n\nexport interface InterimReleaseConfidence {\n candidates: Array<{\n candidateId: string\n decision: SequentialDecision\n decisionFiredAt: number | null\n finalEvalue: number\n finalPValue: number\n pairs: number\n csLow: number\n csHigh: number\n }>\n /**\n * Campaign-level recommendation: pick the strongest 'promote_now', else\n * 'continue' if any candidate is still live, else 'reject_now' if every\n * candidate is dead, else 'equivalent'.\n */\n recommendation: { decision: SequentialDecision; candidateId: string | null }\n}\n\n/**\n * Run interim sequential analyses across many candidates at once,\n * preserving the time-uniform α guarantee for each candidate's series and\n * synthesising a campaign-level recommendation. Designed to be called on\n * every campaign tick — the recommendation is anytime-valid.\n */\nexport function evaluateInterimReleaseConfidence(\n input: InterimReleaseConfidenceInput,\n): InterimReleaseConfidence {\n const candidates = input.deltaSeries.map((s) => {\n const seq = pairedEvalueSequence(s.deltas, {\n alpha: input.alpha,\n bound: input.bound,\n rope: input.rope,\n })\n const last = seq.steps[seq.steps.length - 1]\n return {\n candidateId: s.candidateId,\n decision: seq.finalDecision,\n decisionFiredAt: seq.decisionFiredAt,\n finalEvalue: last?.evalue ?? 1,\n finalPValue: last?.pValue ?? 1,\n pairs: seq.steps.length,\n csLow: last?.csLow ?? Number.NEGATIVE_INFINITY,\n csHigh: last?.csHigh ?? Number.POSITIVE_INFINITY,\n }\n })\n\n const promote = candidates.find((c) => c.decision === 'promote_now')\n if (promote)\n return {\n candidates,\n recommendation: { decision: 'promote_now', candidateId: promote.candidateId },\n }\n const live = candidates.find((c) => c.decision === 'continue')\n if (live) return { candidates, recommendation: { decision: 'continue', candidateId: null } }\n const equiv = candidates.find((c) => c.decision === 'equivalent')\n if (equiv)\n return {\n candidates,\n recommendation: { decision: 'equivalent', candidateId: equiv.candidateId },\n }\n return { candidates, recommendation: { decision: 'reject_now', candidateId: null } }\n}\n\n// ── Internals ────────────────────────────────────────────────────────────\n\nfunction assertSequentialScalarConfiguration(\n bound: number,\n alpha: number,\n initialBetShrinkage: number,\n context: string,\n): void {\n if (!Number.isFinite(bound) || bound <= 0) {\n throw new Error(`${context}: bound must be a finite number > 0`)\n }\n if (!Number.isFinite(alpha) || alpha <= 0 || alpha >= 1) {\n throw new Error(`${context}: alpha must be a finite number in (0,1)`)\n }\n if (\n !Number.isFinite(initialBetShrinkage) ||\n initialBetShrinkage <= 0 ||\n initialBetShrinkage > 1\n ) {\n throw new Error(`${context}: initialBetShrinkage must be a finite number in (0,1]`)\n }\n}\n\nfunction sequentialThresholds(alpha: number): {\n evidenceThreshold: number\n decisionThreshold: number\n} {\n return { evidenceThreshold: 1 / alpha, decisionThreshold: 2 / alpha }\n}\n\n/**\n * Empirical Bernstein confidence sequence on the mean of bounded variables.\n * Adapted from Howard et al. (2021) §4.4. Provides a time-uniform CI on\n * the running mean; valid at every stopping time.\n */\nfunction empiricalBernsteinCs(\n sum: number,\n sumSq: number,\n n: number,\n bound: number,\n alpha: number,\n): { low: number; high: number } {\n if (n === 0) return { low: -bound, high: bound }\n const mean = sum / n\n const variance = Math.max(0, sumSq / n - mean * mean)\n // Iterated-log calibration constant. The 1.7 exponent matches the\n // recommended choice in Howard et al. for two-sided coverage at level\n // 1 - α with mild log-corrections; tightening further requires a\n // tuned mixture and is out of scope.\n const psi = Math.log(2 / alpha) + 1.7 * Math.log(Math.log(Math.max(Math.E, n)) + 1)\n const radius = Math.sqrt((2 * variance * psi) / n) + (3 * bound * psi) / n\n return { low: mean - radius, high: mean + radius }\n}\n"],"mappings":";;;;;;;;;;AA8FA,SAAgB,qBACd,QACA,OAA4B,CAAC,GACP;CACtB,MAAM,IAAI,KAAK,SAAS;CACxB,MAAM,QAAQ,KAAK,SAAS;CAC5B,MAAM,gBAAgB,KAAK,uBAAuB;CAClD,MAAM,OAAO,KAAK,QAAQ;CAC1B,oCAAoC,GAAG,OAAO,eAAe,sBAAsB;CACnF,IAAI,QAAQ,EAAE,OAAO,SAAS,KAAK,GAAG,KAAK,OAAO,SAAS,KAAK,IAAI,KAAK,KAAK,OAAO,KAAK,OACxF,MAAM,IAAI,MAAM,oDAAoD;CAEtE,MAAM,EAAE,sBAAsB,qBAAqB,KAAK;CAExD,MAAM,QAA4B,CAAC;CACnC,IAAI,UAAU;CACd,IAAI,SAAS;CACb,IAAI,kBAAiC;CAGrC,IAAI,MAAM;CACV,IAAI,QAAQ;CACZ,IAAI,QAAQ;CAEZ,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;EACtC,IAAI,IAAI,OAAO;EACf,IAAI,CAAC,OAAO,SAAS,CAAC,GACpB,MAAM,IAAI,MAAM,+BAA+B,EAAE,iBAAiB;EAEpE,IAAI,IAAI,CAAC,KAAK,IAAI,GAAG;GACnB,IAAI,KAAK,IAAI,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;GAC/B,UAAU;EACZ;EAKA,MAAM,QAAQ,UAAU,IAAI,IAAI,MAAM;EACtC,MAAM,SAAS,UAAU,IAAI,IAAI,IAAI,KAAK,IAAI,OAAO,QAAQ,QAAQ,QAAQ,KAAK;EAClF,MAAM,IAAI,IAAI;EACd,MAAM,SAAS,gBAAgB,KAAK,I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AO;EAAE;EAAY,gBAAgB;GAAE,UAAU;GAAc,aAAa;EAAK;CAAE;AACrF;AAIA,SAAS,oCACP,OACA,OACA,qBACA,SACM;CACN,IAAI,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,GACtC,MAAM,IAAI,MAAM,GAAG,QAAQ,oCAAoC;CAEjE,IAAI,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,KAAK,SAAS,GACpD,MAAM,IAAI,MAAM,GAAG,QAAQ,yCAAyC;CAEtE,IACE,CAAC,OAAO,SAAS,mBAAmB,KACpC,uBAAuB,KACvB,sBAAsB,GAEtB,MAAM,IAAI,MAAM,GAAG,QAAQ,uDAAuD;AAEtF;AAEA,SAAS,qBAAqB,OAG5B;CACA,OAAO;EAAE,mBAAmB,IAAI;EAAO,mBAAmB,IAAI;CAAM;AACtE;;;;;;AAOA,SAAS,qBACP,KACA,OACA,GACA,OACA,OAC+B;CAC/B,IAAI,MAAM,GAAG,OAAO;EAAE,KAAK,CAAC;EAAO,MAAM;CAAM;CAC/C,MAAM,OAAO,MAAM;CACnB,MAAM,WAAW,KAAK,IAAI,GAAG,QAAQ,IAAI,OAAO,IAAI;CAKpD,MAAM,MAAM,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;CAClF,MAAM,SAAS,KAAK,KAAM,IAAI,WAAW,MAAO,CAAC,IAAK,IAAI,QAAQ,MAAO;CACzE,OAAO;EAAE,KAAK,OAAO;EAAQ,MAAM,OAAO;CAAO;AACnD"}
@@ -1,7 +1,7 @@
1
1
  import { u as manifestContentDigest } from "./agent-profile-cell-CT5JYueM.js";
2
+ import { t as eProcess } from "./statistics-DCZIC-qT.js";
2
3
  import { t as mulberry32 } from "./random-DrzcgC7F.js";
3
- import { t as eProcess } from "./sequential-eprocess-C1YLwFaz.js";
4
- import { n as aggregatePairedHoldout, o as pairHoldout } from "./statistical-heldout-NBxC7jGo.js";
4
+ import { n as aggregatePairedHoldout, o as pairHoldout } from "./statistical-heldout-D6i58CJ5.js";
5
5
  // src/campaign/gates/sequential.ts
6
6
  /**
7
7
  * Anytime-valid sequential promotion gate — an e-process (betting
@@ -337,4 +337,4 @@ function sequentialDecide(options = {}) {
337
337
  }
338
338
  export { sequentialPairedGate as n, sequentialDecide as t };
339
339
 
340
- //# sourceMappingURL=sequential-BPbvgzfe.js.map
340
+ //# sourceMappingURL=sequential-CqG6aLWS.js.map