@tangle-network/agent-eval 1.0.19 → 1.0.21

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 +19 -27
  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-DYYe18Gw.d.ts} +4 -4
  9. package/dist/{analyze-runs-pJ4fhnYg.d.ts.map → analyze-runs-DYYe18Gw.d.ts.map} +1 -1
  10. package/dist/{analyze-runs-C7vWBDhl.js → analyze-runs-jLTRKuoK.js} +6 -110
  11. package/dist/analyze-runs-jLTRKuoK.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-CoNndRCk.js} +13 -14
  15. package/dist/benchmark-command-CoNndRCk.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-Cf-wpqqO.js} +2 -2
  21. package/dist/{calibration-CbZPApIO.js.map → calibration-Cf-wpqqO.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-Bl07uIaf.js} +14 -15
  25. package/dist/{campaign-BABipFel.js.map → campaign-Bl07uIaf.js.map} +1 -1
  26. package/dist/{campaign-evidence-DONEWvVY.js → campaign-evidence-NtH29ctt.js} +3 -3
  27. package/dist/{campaign-evidence-DONEWvVY.js.map → campaign-evidence-NtH29ctt.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-B0MTOBRU.js +24 -0
  36. package/dist/cluster-bootstrap-B0MTOBRU.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-Di2LATNH.js} +4 -4
  47. package/dist/{decision-point-CNyoKOkz.js.map → decision-point-Di2LATNH.js.map} +1 -1
  48. package/dist/{default-registry-BB9_jzyH.js → default-registry-CdFbxPnr.js} +5 -5
  49. package/dist/{default-registry-BB9_jzyH.js.map → default-registry-CdFbxPnr.js.map} +1 -1
  50. package/dist/{default-registry-BbXr18AT.d.ts → default-registry-aPvwtzEM.d.ts} +7 -7
  51. package/dist/{default-registry-BbXr18AT.d.ts.map → default-registry-aPvwtzEM.d.ts.map} +1 -1
  52. package/dist/{define-agent-eval-Q4FdXGj7.js → define-agent-eval-BROmIwn1.js} +6 -6
  53. package/dist/{define-agent-eval-Q4FdXGj7.js.map → define-agent-eval-BROmIwn1.js.map} +1 -1
  54. package/dist/{define-agent-eval-D_DQMH04.d.ts → define-agent-eval-Bx3b9B01.d.ts} +7 -7
  55. package/dist/{define-agent-eval-D_DQMH04.d.ts.map → define-agent-eval-Bx3b9B01.d.ts.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-Dq8DEKmy.js} +2 -2
  63. package/dist/{eval-campaign-CZSCjxVb.js.map → eval-campaign-Dq8DEKmy.js.map} +1 -1
  64. package/dist/{evaluation-SDXKL6Fx.d.ts → evaluation-CFKj_IlJ.d.ts} +4 -4
  65. package/dist/{evaluation-SDXKL6Fx.d.ts.map → evaluation-CFKj_IlJ.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-D4lT7aFu.d.ts → index-7tWvC0aW.d.ts} +28 -128
  88. package/dist/index-7tWvC0aW.d.ts.map +1 -0
  89. package/dist/{index-C3t17kHu.d.ts → index-B62BaRzH.d.ts} +7 -100
  90. package/dist/index-B62BaRzH.d.ts.map +1 -0
  91. package/dist/{index-HuSMvqR2.d.ts → index-BlTbxHlY.d.ts} +5 -5
  92. package/dist/{index-HuSMvqR2.d.ts.map → index-BlTbxHlY.d.ts.map} +1 -1
  93. package/dist/{index-AmfM3usI.d.ts → index-CM12lr9E.d.ts} +8 -8
  94. package/dist/{index-AmfM3usI.d.ts.map → index-CM12lr9E.d.ts.map} +1 -1
  95. package/dist/{index-DLVbfss9.d.ts → index-DFso1b2W.d.ts} +8 -8
  96. package/dist/{index-DLVbfss9.d.ts.map → index-DFso1b2W.d.ts.map} +1 -1
  97. package/dist/index-DNXFzSpc.d.ts +1101 -0
  98. package/dist/index-DNXFzSpc.d.ts.map +1 -0
  99. package/dist/{index-BPmj-_ta.d.ts → index-DfqAy8ct.d.ts} +10 -9
  100. package/dist/index-DfqAy8ct.d.ts.map +1 -0
  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-CrN0PaAL.js} +3 -3
  107. package/dist/{judge-gate-CIlBrn6q.js.map → judge-gate-CrN0PaAL.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-C813vmpc.js} +13 -14
  113. package/dist/{llm-judge-VD_MI6kd.js.map → llm-judge-C813vmpc.js.map} +1 -1
  114. package/dist/{matrix-Yg1lHIGI.d.ts → matrix-C-GxIgeJ.d.ts} +2 -2
  115. package/dist/{matrix-Yg1lHIGI.d.ts.map → matrix-C-GxIgeJ.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-DPkH-LHQ.js} +2 -3
  125. package/dist/{outcome-observations-DZu5hLYF.js.map → outcome-observations-DPkH-LHQ.js.map} +1 -1
  126. package/dist/paired-arms-DjMEtYI9.js +338 -0
  127. package/dist/paired-arms-DjMEtYI9.js.map +1 -0
  128. package/dist/{paired-promotion-decision-CiueaTTj.js → paired-promotion-decision-Bi9__RQS.js} +2 -3
  129. package/dist/{paired-promotion-decision-CiueaTTj.js.map → paired-promotion-decision-Bi9__RQS.js.map} +1 -1
  130. package/dist/{paired-promotion-decision-BDnqepZ1.d.ts → paired-promotion-decision-DJU3fZxH.d.ts} +3 -113
  131. package/dist/paired-promotion-decision-DJU3fZxH.d.ts.map +1 -0
  132. package/dist/{pareto-a3EOmjfe.js → pareto-fJZg8pXm.js} +3 -6
  133. package/dist/{pareto-a3EOmjfe.js.map → pareto-fJZg8pXm.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-Da0xV4sa.d.ts} +3 -67
  138. package/dist/promotion-gate-Da0xV4sa.d.ts.map +1 -0
  139. package/dist/{promotion-policy-DLPcEnCf.js → promotion-policy-DCgftbnd.js} +4 -4
  140. package/dist/{promotion-policy-DLPcEnCf.js.map → promotion-policy-DCgftbnd.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-DGtuPDxJ.js} +2 -2
  146. package/dist/{release-confidence-nfQNh3eb.js.map → release-confidence-DGtuPDxJ.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-CSlc84Bp.d.ts} +4 -4
  152. package/dist/{researcher-CLnNJ7Or.d.ts.map → researcher-CSlc84Bp.d.ts.map} +1 -1
  153. package/dist/{reward-hacking-B88f-Kh7.js → reward-hacking-BYiDFbIl.js} +2 -3
  154. package/dist/{reward-hacking-B88f-Kh7.js.map → reward-hacking-BYiDFbIl.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-DL7gJ51F.js} +2 -2
  164. package/dist/{rubric-predictive-validity-D_6ZPTNR.js.map → rubric-predictive-validity-DL7gJ51F.js.map} +1 -1
  165. package/dist/{run-record-CbUi2adH.js → run-record-CFbnkE1K.js} +2 -2
  166. package/dist/{run-record-CbUi2adH.js.map → run-record-CFbnkE1K.js.map} +1 -1
  167. package/dist/{runtime-rollouts-kGn1K5ut.js → runtime-rollouts-BNrm5nC_.js} +2 -2
  168. package/dist/{runtime-rollouts-kGn1K5ut.js.map → runtime-rollouts-BNrm5nC_.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-CQGLbmgn.d.ts} +3 -3
  174. package/dist/{search-kernel-DjqaPJqL.d.ts.map → search-kernel-CQGLbmgn.d.ts.map} +1 -1
  175. package/dist/{search-summary-RJ5zXjHN.js → search-summary-sPWiYtSl.js} +4 -4
  176. package/dist/{search-summary-RJ5zXjHN.js.map → search-summary-sPWiYtSl.js.map} +1 -1
  177. package/dist/{sequential-BPbvgzfe.js → sequential-9TVb5Nu5.js} +3 -3
  178. package/dist/{sequential-BPbvgzfe.js.map → sequential-9TVb5Nu5.js.map} +1 -1
  179. package/dist/{sequential-Bb_pdTqG.d.ts → sequential-B9p6uoV8.d.ts} +9 -2
  180. package/dist/{sequential-Bb_pdTqG.d.ts.map → sequential-B9p6uoV8.d.ts.map} +1 -1
  181. package/dist/{sequential-Bjs5roiK.js → sequential-CAksw6EU.js} +32 -2
  182. package/dist/{sequential-Bjs5roiK.js.map → sequential-CAksw6EU.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-QO1nU8Kz.js} +9 -9
  186. package/dist/{skillopt-optimization-method-D9Hlmhjg.js.map → skillopt-optimization-method-QO1nU8Kz.js.map} +1 -1
  187. package/dist/{statistical-heldout-C-tgpUuu.d.ts → statistical-heldout-CvOwNqt9.d.ts} +6 -282
  188. package/dist/statistical-heldout-CvOwNqt9.d.ts.map +1 -0
  189. package/dist/{statistical-heldout-NBxC7jGo.js → statistical-heldout-DLO4Ebos.js} +3 -3
  190. package/dist/{statistical-heldout-NBxC7jGo.js.map → statistical-heldout-DLO4Ebos.js.map} +1 -1
  191. package/dist/statistics-CvvC-MPv.js +2634 -0
  192. package/dist/statistics-CvvC-MPv.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-C3IJvp0i.js → summary-report-BEhqoxrA.js} +4 -52
  202. package/dist/summary-report-BEhqoxrA.js.map +1 -0
  203. package/dist/{summary-report-0La5vejY.d.ts → summary-report-DyZquTaH.d.ts} +2 -2
  204. package/dist/{summary-report-0La5vejY.d.ts.map → summary-report-DyZquTaH.d.ts.map} +1 -1
  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-DVk-Crtu.d.ts} +7 -7
  208. package/dist/{systemone-CpDppX8s.d.ts.map → systemone-DVk-Crtu.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-BqSmmPUz.js} +2 -3
  216. package/dist/{tool-waste-Czt3aWID.js.map → tool-waste-BqSmmPUz.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-C-N2kP-8.js} +4 -6
  225. package/dist/{tree-DIHp6UQ0.js.map → tree-C-N2kP-8.js.map} +1 -1
  226. package/dist/{types-DsuOcYsE.d.ts → types-BsdcSWnf.d.ts} +2 -2
  227. package/dist/{types-DsuOcYsE.d.ts.map → types-BsdcSWnf.d.ts.map} +1 -1
  228. package/dist/{types-DNB9hIXa.d.ts → types-DUVhW5V1.d.ts} +3 -2
  229. package/dist/types-DUVhW5V1.d.ts.map +1 -0
  230. package/dist/{types-wDBk14lj.d.ts → types-ip2D3-Ib.d.ts} +5 -4
  231. package/dist/types-ip2D3-Ib.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 +4 -4
  235. package/dist/wire/index.js +1 -1
  236. package/docs/design/statistics-decisions.md +45 -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
@@ -0,0 +1,1101 @@
1
+ import { p as DimensionJudgeScore, t as BootstrapInterval } from "./cluster-Cd0MRbr9.js";
2
+ /**
3
+ * Judge calibration — measure judge quality against human gold + bias.
4
+ *
5
+ * Workflow:
6
+ * 1. Build a golden set: {itemId, humanScore}[].
7
+ * 2. Run candidate judges; each produces {itemId, score}.
8
+ * 3. `calibrateJudge(golden, candidate)` reports κ + Pearson + MAE.
9
+ * 4. `calibrateJudgeContinuous(golden, candidate)` adds quadratic-weighted
10
+ * κ over the un-rounded [0,1] scores plus ICC(2,1), Pearson, Spearman,
11
+ * and bootstrap CIs — use this for fine-grained judges where rounding
12
+ * to int discards information (e.g. 0.78 vs 0.81 both round to 1 and
13
+ * look "perfectly agreed" to integer κ).
14
+ * 5. Run bias probes (positional, verbosity, self-preference) to
15
+ * detect systematic score inflation.
16
+ * 6. For N≥2 judges on the same items, `continuousAgreement(scores)`
17
+ * reports ICC(2,1) + κ_w + Pearson + Spearman with bootstrap CIs.
18
+ *
19
+ * Returns actionable diagnostics, not a single number. Consumers then
20
+ * decide whether to trust the judge, retrain it, or add a tie-breaker.
21
+ */
22
+ interface GoldenItem {
23
+ itemId: string;
24
+ humanScore: number;
25
+ /** Optional group used for per-group bias audits (e.g. model-of-output family). */
26
+ group?: string;
27
+ }
28
+ interface CandidateScore {
29
+ itemId: string;
30
+ score: number;
31
+ /** Optional — enables positional-bias analysis (did order matter?). */
32
+ positionOfAInput?: 'first' | 'second';
33
+ }
34
+ interface CalibrationResult {
35
+ n: number;
36
+ pearson: number;
37
+ /** Cohen's κ with quadratic weights over integer-rounded scores. */
38
+ kappa: number;
39
+ /** Mean absolute error vs human. */
40
+ mae: number;
41
+ /** Worst-5 miscalibrations (largest |judge - human|). */
42
+ worstItems: Array<{
43
+ itemId: string;
44
+ judge: number;
45
+ human: number;
46
+ delta: number;
47
+ }>;
48
+ }
49
+ /**
50
+ * Measure judge quality against human gold labels: computes Cohen's κ, Pearson correlation, and MAE over matched item ids.
51
+ */
52
+ declare function calibrateJudge(golden: GoldenItem[], candidate: CandidateScore[]): CalibrationResult;
53
+ interface PositionalBiasResult {
54
+ /**
55
+ * Score delta (first-position - second-position) averaged across items
56
+ * presented in both positions. Non-zero = positional bias.
57
+ */
58
+ avgDelta: number;
59
+ n: number;
60
+ }
61
+ /**
62
+ * Feed the same items to the judge twice with A/B swapped and pass all
63
+ * results here. Items that don't appear in both positions are ignored.
64
+ */
65
+ declare function positionalBias(scores: CandidateScore[]): PositionalBiasResult;
66
+ interface VerbosityBiasResult {
67
+ /** Pearson correlation between output length and score. Strong positive = verbosity bias. */
68
+ pearson: number;
69
+ n: number;
70
+ }
71
+ declare function verbosityBias(samples: Array<{
72
+ outputLen: number;
73
+ score: number;
74
+ }>): VerbosityBiasResult;
75
+ interface SelfPreferenceResult {
76
+ /** Mean judge score when judge's family matches output's family. */
77
+ inFamilyMean: number;
78
+ outOfFamilyMean: number;
79
+ deltaMean: number;
80
+ n: number;
81
+ }
82
+ /**
83
+ * Pass the same scenarios scored with judge-model X grading outputs from
84
+ * model X (in-family) and model Y (out-of-family). Non-zero delta
85
+ * indicates self-preference.
86
+ */
87
+ declare function selfPreference(samples: Array<{
88
+ score: number;
89
+ inFamily: boolean;
90
+ }>): SelfPreferenceResult;
91
+ interface ContinuousAgreement {
92
+ /** Cohen's κ_w with quadratic weights, computed on raw [0,1] scores. */
93
+ weightedKappa: number;
94
+ /** ICC(2,1): two-way random effects, absolute agreement, single rater. */
95
+ icc: number;
96
+ /** Pearson product-moment correlation (averaged over rater pairs if N>2). */
97
+ pearson: number;
98
+ /** Spearman rank correlation (averaged over rater pairs if N>2). */
99
+ spearman: number;
100
+ /** 95% bootstrap percentile CIs over items. */
101
+ ci: {
102
+ icc: [number, number];
103
+ weightedKappa: [number, number];
104
+ };
105
+ /** Number of complete items (no NaN across raters). */
106
+ n: number;
107
+ /** Number of raters. */
108
+ raters: number;
109
+ }
110
+ interface ContinuousAgreementOptions {
111
+ /** Bootstrap iterations. Default 1000. Set to 0 to skip CIs (CI = [NaN, NaN]). */
112
+ bootstrap?: number;
113
+ /** κ weighting scheme. Default 'quadratic'. */
114
+ weights?: 'linear' | 'quadratic';
115
+ /** PRNG seed for reproducible bootstrap. Default 0xC0FFEE. */
116
+ seed?: number;
117
+ /** Confidence level for percentile CI. Default 0.95. */
118
+ ciLevel?: number;
119
+ }
120
+ /**
121
+ * Inter-rater agreement on continuous (typically [0,1]) scores.
122
+ *
123
+ * `scores` has shape [n_items][n_raters]. Rows with any non-finite entry
124
+ * are dropped. Returns NaN metrics if fewer than 2 raters or 2 complete
125
+ * items remain.
126
+ */
127
+ declare function continuousAgreement(scores: number[][], opts?: ContinuousAgreementOptions): ContinuousAgreement;
128
+ interface ContinuousCalibrationResult extends CalibrationResult {
129
+ /** Cohen's κ_w computed on raw (un-rounded) scores. */
130
+ weightedKappaContinuous: number;
131
+ /** ICC(2,1) treating golden + candidate as two raters. */
132
+ icc: number;
133
+ spearman: number;
134
+ ci: {
135
+ icc: [number, number];
136
+ weightedKappa: [number, number];
137
+ };
138
+ }
139
+ /**
140
+ * Extends `calibrateJudge` with continuous-value agreement metrics while
141
+ * retaining its base calibration summary.
142
+ */
143
+ declare function calibrateJudgeContinuous(golden: GoldenItem[], candidate: CandidateScore[], opts?: ContinuousAgreementOptions): ContinuousCalibrationResult;
144
+ /**
145
+ * Inter-rater reliability — Krippendorff's α under the squared-difference
146
+ * metric, pooled across dimensions.
147
+ *
148
+ * Each inner array is one judge's scores. Items are matched by position
149
+ * WITHIN a dimension: the k-th score a judge supplies carrying dimension
150
+ * `d` is item k of `d`, and the ratings compared against each other are
151
+ * the ones different judges gave to the same item. Every judge that scores
152
+ * a dimension at all must supply the same number of scores for it —
153
+ * ragged input cannot be aligned into items and throws rather than
154
+ * comparing mismatched items.
155
+ *
156
+ * α = 1 − D_observed / D_expected: D_observed averages the squared
157
+ * difference over within-item judge pairs, D_expected over every pair of
158
+ * ratings irrespective of item. α = 1 is perfect agreement, 0 is chance,
159
+ * negative is systematic disagreement.
160
+ */
161
+ declare function interRaterReliability(judgeScores: DimensionJudgeScore[][]): number;
162
+ interface CorpusScoreRecord {
163
+ /** Stable identifier for the rated item (scenario, span, turn, …). */
164
+ itemId: string;
165
+ /** Identifier for the judge that produced this score. */
166
+ judgeName: string;
167
+ /** Dimension name (matches `DimensionJudgeScore.dimension`). */
168
+ dimension: string;
169
+ /** Numeric score; must be finite. */
170
+ score: number;
171
+ }
172
+ interface CorpusAgreementPerDimension extends ContinuousAgreement {
173
+ dimension: string;
174
+ /** Item IDs that contributed to this dimension's matrix (every judge scored them). */
175
+ itemIds: string[];
176
+ /** Judge IDs that contributed to this dimension's matrix. */
177
+ judgeIds: string[];
178
+ }
179
+ interface CorpusAgreementReport {
180
+ /** Per-dimension ICC(2,1) + κ_w + Pearson + Spearman + bootstrap CIs. */
181
+ perDimension: CorpusAgreementPerDimension[];
182
+ /** Mean ICC across dimensions (NaN if no dimension yielded a finite ICC). */
183
+ overallIcc: number;
184
+ /** Mean weighted κ across dimensions (NaN if none finite). */
185
+ overallWeightedKappa: number;
186
+ /** Dimensions evaluated (sorted). */
187
+ dimensions: string[];
188
+ /** Judges seen across the corpus (sorted). */
189
+ judgeIds: string[];
190
+ }
191
+ interface CorpusAgreementOptions extends ContinuousAgreementOptions {
192
+ /** Restrict the audit to these dimensions; default every one in the input. A named absentee throws. */
193
+ dimensions?: string[];
194
+ /** Restrict the audit to these judges; default every one in the input. A named absentee throws. */
195
+ judges?: string[];
196
+ }
197
+ /**
198
+ * Corpus-wide inter-rater agreement across N items × M judges × D dimensions, the
199
+ * question `interRaterReliability`'s within-item α cannot answer.
200
+ *
201
+ * For each dimension, builds the [n_items][n_judges] matrix of scores
202
+ * (keeping only items every judge rated on that dimension), then runs
203
+ * `continuousAgreement` to get ICC(2,1), κ_w, Pearson, Spearman, and
204
+ * bootstrap CIs. Reports a pooled mean across dimensions as a single
205
+ * "is this judge panel reliable on this corpus?" number. Empty input, fewer than 2 judges or
206
+ * items, a judge without scores on a dimension and duplicate records all throw: a silently
207
+ * shrunk matrix would corrupt the overall metric.
208
+ */
209
+ declare function corpusInterRaterAgreement(records: CorpusScoreRecord[], opts?: CorpusAgreementOptions): CorpusAgreementReport;
210
+ /**
211
+ * Convenience adapter for `DimensionJudgeScore[]` data keyed externally by item.
212
+ *
213
+ * Use when you have per-item arrays of `DimensionJudgeScore[]` (e.g. one
214
+ * `ScenarioResult.judgeScores` per scenario) and want corpus-wide
215
+ * agreement without manually flattening. `itemId` must be unique per
216
+ * row of `itemsScores`.
217
+ */
218
+ declare function corpusInterRaterAgreementFromJudgeScores(itemsScores: Array<{
219
+ itemId: string;
220
+ scores: DimensionJudgeScore[];
221
+ }>, opts?: CorpusAgreementOptions): CorpusAgreementReport;
222
+ /** Agreement between two raters who each assigned one nominal label per item. */
223
+ interface NominalAgreement {
224
+ /** Items both raters labeled. */
225
+ n: number;
226
+ /** Share of items with identical labels. */
227
+ agreement: number;
228
+ /**
229
+ * Cohen's κ = (pₒ − pₑ) / (1 − pₑ), with pₑ from each rater's own label
230
+ * marginals. NaN when n = 0, or when both raters used one identical label
231
+ * for every item (pₑ = 1): chance and observed agreement are then the same
232
+ * thing, and no number distinguishes skill from luck.
233
+ */
234
+ kappa: number;
235
+ /** Seeded percentile bootstrap of κ over clusters; NaN bounds when no resample has a finite κ. */
236
+ kappaCi: BootstrapInterval;
237
+ }
238
+ interface NominalAgreementOptions {
239
+ /** Cluster id per pair; pairs sharing one are resampled together. Default: every pair alone. */
240
+ clusters?: readonly string[];
241
+ /** Default 2000. */
242
+ resamples?: number;
243
+ seed?: number;
244
+ }
245
+ /**
246
+ * Unweighted Cohen's κ for paired nominal labels. Labels carry no order, so a
247
+ * near miss counts as a miss; use `calibrateJudge` for ordinal scores.
248
+ */
249
+ declare function nominalAgreement(pairs: ReadonlyArray<readonly [string, string]>, options?: NominalAgreementOptions): NominalAgreement;
250
+ /** Mann–Whitney ROC area: ties count half; no observed member of either class means unknown. */
251
+ declare function rocAuc(scores: number[], labels: number[]): number | null;
252
+ /**
253
+ * Descriptive statistics: means, bootstrap spread, correlation, and the
254
+ * weighted judge-dimension composite. Nothing here is a significance test.
255
+ */
256
+ /** Weighted mean — falls back to uniform weights when omitted */
257
+ declare function weightedMean(scores: {
258
+ score: number;
259
+ weight?: number;
260
+ }[]): number;
261
+ /**
262
+ * Percentile bootstrap confidence interval on the mean of `scores`.
263
+ *
264
+ * Descriptive spread. It is not a significance test, and at small n its bounds
265
+ * are anti-conservative in the same way {@link pairedBootstrap}'s are — see
266
+ * {@link BOOTSTRAP_GATE_MIN_N}. With no `seed` the resampling is seeded from
267
+ * the scores themselves, so the interval is reproducible either way.
268
+ */
269
+ declare function confidenceInterval(scores: number[], confidence?: number, opts?: {
270
+ seed?: number;
271
+ resamples?: number;
272
+ }): {
273
+ mean: number;
274
+ lower: number;
275
+ upper: number;
276
+ };
277
+ /**
278
+ * Two-sided Student-t critical value: the `t` with `P(|T| ≤ t) = confidence`
279
+ * for `df` degrees of freedom. Exact, from {@link studentTQuantile}, so any
280
+ * confidence in (0, 1) and fractional `df` are supported.
281
+ */
282
+ declare function studentTCritical(df: number, confidence?: number): number;
283
+ /** One-sample Student-t interval on the mean; see {@link meanConfidenceInterval}. */
284
+ interface MeanConfidenceInterval {
285
+ readonly n: number;
286
+ /** Null for an empty sample. */
287
+ readonly mean: number | null;
288
+ /** Sample standard deviation (n − 1 denominator); null below two samples. */
289
+ readonly stdev: number | null;
290
+ readonly low: number | null;
291
+ readonly high: number | null;
292
+ /** Two-sided Student-t critical value for df = n − 1; null below two samples. */
293
+ readonly criticalValue: number | null;
294
+ }
295
+ /**
296
+ * Student-t confidence interval on the mean of one sample:
297
+ * `mean ± t(df = n − 1) · s / √n`. Below two samples there is no spread to
298
+ * estimate, so the bounds are null rather than a zero-width interval that
299
+ * would read as certainty. Unlike {@link confidenceInterval} (a percentile
300
+ * bootstrap), the width keeps the small-n t penalty that z = 1.96 drops.
301
+ */
302
+ declare function meanConfidenceInterval(samples: readonly number[], confidence?: number): MeanConfidenceInterval;
303
+ /** Partial credit: returns 0-1 ratio of current toward target */
304
+ declare function partialCredit(current: number, target: number): number;
305
+ /** Distribution summary of a number series: count, extremes, quantiles, sum. */
306
+ interface SeriesDistribution {
307
+ readonly n: number;
308
+ readonly min: number;
309
+ readonly p50: number;
310
+ readonly p90: number;
311
+ readonly max: number;
312
+ readonly sum: number;
313
+ readonly percentiles?: Readonly<Record<number, number>>;
314
+ readonly medianInterval?: {
315
+ readonly method: 'normal-order-statistics';
316
+ readonly criticalValue: number;
317
+ readonly sampleSize: number;
318
+ readonly lowRank: number;
319
+ readonly highRank: number;
320
+ readonly low: number;
321
+ readonly high: number;
322
+ };
323
+ }
324
+ interface SeriesDistributionOptions {
325
+ /** Nearest-rank percentiles on a 0–100 scale, including fractional tails. */
326
+ percentiles?: readonly number[];
327
+ /** Descriptive median rank band, not a bootstrap interval or promotion test. */
328
+ medianInterval?: {
329
+ criticalValue: number;
330
+ };
331
+ }
332
+ /**
333
+ * Fold a number series into its distribution summary. Quantiles use the
334
+ * nearest-rank definition — the `ceil(q·n)`-th order statistic — so every
335
+ * reported quantile is a value from the series. Returns `null` for an empty
336
+ * series: an empty series has no distribution, and a zero-filled summary
337
+ * would read as a measured all-zero series.
338
+ */
339
+ declare function summarizeNumberSeries(values: readonly number[], options?: SeriesDistributionOptions): SeriesDistribution | null;
340
+ /**
341
+ * Average-rank-with-ties transform (1-indexed). Tied values receive the mean
342
+ * of the ranks they span, the standard correction for Spearman's ρ.
343
+ */
344
+ declare function ranks(xs: number[]): number[];
345
+ /**
346
+ * Pearson product-moment correlation coefficient r ∈ [-1, 1] between two
347
+ * equal-length series. See the edge-case contract above: NaN for n < 2 or
348
+ * unequal lengths, 1 when both series are constant, 0 when exactly one is.
349
+ */
350
+ declare function pearsonR(a: number[], b: number[]): number;
351
+ /**
352
+ * Spearman's rank correlation ρ — Pearson over the average-rank-with-ties
353
+ * transform of each series. Same edge-case contract as {@link pearsonR}.
354
+ */
355
+ declare function spearmanR(a: number[], b: number[]): number;
356
+ interface WeightedCompositeInput {
357
+ /** Per-dimension scores (typically 0..1). */
358
+ dims: Record<string, number>;
359
+ /** Weight per dimension. Every weighted dimension MUST be present in
360
+ * `dims` — a weight for an absent dimension is a config error and throws,
361
+ * because silently dropping it would renormalise the composite onto a
362
+ * different denominator than intended. */
363
+ weights: Record<string, number>;
364
+ /** Optional pass threshold; when set, the result reports `pass`. */
365
+ threshold?: number;
366
+ }
367
+ interface WeightedCompositeResult {
368
+ composite: number;
369
+ pass?: boolean;
370
+ }
371
+ /**
372
+ * Weighted composite over judge dimensions: `Σ(score_d · w_d) / Σ(w_d)` across
373
+ * the weighted dimensions. The canonical replacement for the per-consumer
374
+ * hand-rolled composite math (tax/legal/creative/gtm each ship a copy).
375
+ *
376
+ * Fail-loud: throws if a weighted dimension is missing from `dims`, if any
377
+ * weight is negative, or if the weights sum to 0 — none of which can produce
378
+ * a meaningful composite.
379
+ */
380
+ declare function weightedComposite(input: WeightedCompositeInput): WeightedCompositeResult;
381
+ /**
382
+ * Nearest-rank distribution summary for measurement paths (gates, dashboards,
383
+ * load harnesses): min/p50/p90/p95/p99/max + mean + sample stddev + a 95%
384
+ * Student-t CI on the mean. Consolidates the former @repo/shared
385
+ * distribution-stats: identical nearest-rank percentiles, with the CI now the
386
+ * exact t critical value for any df (the retired implementation capped its
387
+ * table at df 30 and fell back to 1.96).
388
+ */
389
+ interface SampleDistribution {
390
+ min: number;
391
+ p50: number;
392
+ p90: number;
393
+ p95: number;
394
+ p99: number;
395
+ max: number;
396
+ mean: number;
397
+ stddev?: number;
398
+ ci95Low?: number;
399
+ ci95High?: number;
400
+ n: number;
401
+ values: number[];
402
+ }
403
+ interface DistributionSummaryOptions {
404
+ lowerBound?: number;
405
+ }
406
+ /**
407
+ * Nearest-rank percentile on an arbitrary sample, `percentile` on a 0-100
408
+ * scale — the same rule `summarizeDistribution` applies, exposed for a single
409
+ * percentile the summary struct does not carry (e.g. p99.9). Returns NaN for
410
+ * an empty sample; callers that need a numeric floor guard it.
411
+ */
412
+ declare function percentileNearestRank(values: number[], percentile: number): number;
413
+ declare function summarizeDistribution(values: number[], options?: DistributionSummaryOptions): SampleDistribution;
414
+ /** Standardized effect sizes; undefined effects remain null. */
415
+ /** Independent Cohen's d, oriented b − a; null below two samples or for an unbounded effect. */
416
+ declare function cohensD(a: number[], b: number[]): number | null;
417
+ /** Paired Cohen's dz; constant nonzero deltas have no finite standardized effect. */
418
+ declare function pairedCohensDz(before: number[], after: number[]): number | null;
419
+ type CliffsMagnitude = 'negligible' | 'small' | 'medium' | 'large';
420
+ /** Cliff's delta, oriented after − before; empty samples return zero. */
421
+ declare function cliffsDelta(before: number[], after: number[]): number;
422
+ /** Romano magnitude thresholds for the absolute Cliff's delta. */
423
+ declare function interpretCliffs(delta: number): CliffsMagnitude;
424
+ /** Two-sided normal tail, evaluated without subtracting a near-one CDF. */
425
+ declare function normalTwoSidedPValue(z: number): number;
426
+ /** Two-sided Student-t tail, preserving small tail probabilities. */
427
+ declare function studentTTwoSidedPValue(t: number, df: number): number;
428
+ /** Pearson statistic for a 2x2 table; empty or fixed margins have statistic zero. */
429
+ declare function chiSquared(a: number, b: number, c: number, d: number): number;
430
+ /** One-degree-of-freedom chi-squared survival probability. */
431
+ declare function chiSquaredPValue(statistic: number): number;
432
+ /** Fisher two-sided probability: sum all fixed-margin tables no likelier than the observed table. */
433
+ declare function fisherExactTwoSided(a: number, b: number, c: number, d: number): number;
434
+ /** Fisher when any expected count is below five; otherwise Pearson's chi-squared tail. */
435
+ declare function twoByTwoPValue(a: number, b: number, c: number, d: number): number;
436
+ interface LinearRegressionResult {
437
+ slope: number;
438
+ rSquared: number;
439
+ slopePValue: number | null;
440
+ }
441
+ /** Centered least-squares slope; null p-value means no slope test was possible. */
442
+ declare function linearRegressionSlope(points: readonly {
443
+ x: number;
444
+ y: number;
445
+ }[]): LinearRegressionResult;
446
+ /**
447
+ * Multiple-comparison corrections: family-wise error (Bonferroni, Holm) and
448
+ * false discovery rate (Benjamini-Hochberg), with inclusive rejection
449
+ * boundaries throughout.
450
+ */
451
+ /**
452
+ * Bonferroni adjustment: multiply every p-value by the test count, clamp at 1.
453
+ *
454
+ * Rejects at `p_adjusted ≤ alpha` — the boundary is inclusive, matching
455
+ * {@link holm}, which uniformly dominates this correction and must therefore
456
+ * never reject less. Validates its inputs on the same terms.
457
+ */
458
+ declare function bonferroni(pValues: readonly number[], alpha?: number): {
459
+ adjusted: number[];
460
+ significant: boolean[];
461
+ };
462
+ /**
463
+ * Holm step-down family-wise error adjustment.
464
+ *
465
+ * P-values are sorted from smallest to largest, multiplied by their remaining
466
+ * hypothesis count, and made monotonically non-decreasing before being mapped
467
+ * back to input order. This uniformly dominates plain Bonferroni while keeping
468
+ * strong family-wise error control under arbitrary dependence.
469
+ */
470
+ declare function holm(pValues: readonly number[], alpha?: number): {
471
+ adjusted: number[];
472
+ significant: boolean[];
473
+ };
474
+ /**
475
+ * Benjamini–Hochberg false discovery rate. Returns adjusted q-values and
476
+ * significance at the target FDR; handles ties and preserves q monotonicity.
477
+ *
478
+ * Rejects at `q ≤ fdr` — the BH rule is inclusive at the boundary, so an
479
+ * exactly-`fdr` q-value is a discovery.
480
+ */
481
+ declare function benjaminiHochberg(pValues: readonly number[], fdr?: number): {
482
+ qValues: number[];
483
+ significant: boolean[];
484
+ };
485
+ /** A binomial proportion estimate with a confidence interval. */
486
+ interface ProportionInterval {
487
+ /** Point estimate successes / n; 0 is a compatibility placeholder when n = 0. */
488
+ estimate: number;
489
+ /** Lower bound, clamped to [0, 1]. */
490
+ lower: number;
491
+ /** Upper bound, clamped to [0, 1]. */
492
+ upper: number;
493
+ }
494
+ /**
495
+ * Wilson score interval for a binomial proportion. Correct at small n and near
496
+ * 0/1, where the normal (Wald) approximation produces bounds outside [0, 1] and
497
+ * understates coverage. Use this for any pass-rate / hit-rate / realness-rate
498
+ * CI — the continuous `confidenceInterval` assumes the wrong distribution for a
499
+ * proportion. Counts must be finite nonnegative integers, successes cannot exceed
500
+ * n, and confidence must lie strictly between zero and one. With n = 0 the
501
+ * interval is the full [0, 1] support: no rate is ruled out. The estimate stays
502
+ * 0 for compatibility, not as a measured failure rate; retain n alongside it.
503
+ */
504
+ declare function wilson(successes: number, n: number, confidence?: number): ProportionInterval;
505
+ interface IndependentRiskDifferenceResult {
506
+ before: ProportionInterval & {
507
+ successes: number;
508
+ n: number;
509
+ };
510
+ after: ProportionInterval & {
511
+ successes: number;
512
+ n: number;
513
+ };
514
+ /** After minus before; null if either arm has no observations. */
515
+ delta: number | null;
516
+ lower: number;
517
+ upper: number;
518
+ confidence: number;
519
+ }
520
+ /** Independent-binomial difference: Newcombe (1998), method 10 (Wilson, no CC).
521
+ * doi:10.1002/(SICI)1097-0258(19980430)17:8<873::AID-SIM779>3.0.CO;2-I
522
+ * Empty arms retain full difference support; no point difference is measured. */
523
+ declare function independentRiskDifference(beforeSuccesses: number, beforeN: number, afterSuccesses: number, afterN: number, confidence?: number): IndependentRiskDifferenceResult;
524
+ /** Result of a McNemar paired-binary significance test. */
525
+ interface McNemarResult {
526
+ /** Total paired observations. */
527
+ n: number;
528
+ /** Discordant pairs (b + c) — the only ones that carry signal. */
529
+ nDiscordant: number;
530
+ /** Pairs where treatment succeeded and control failed ("newly correct"). */
531
+ b: number;
532
+ /** Pairs where control succeeded and treatment failed ("newly wrong"). */
533
+ c: number;
534
+ /** Continuity-corrected chi-square statistic (reference; exact p drives the call). */
535
+ statistic: number;
536
+ /** Two-sided p-value. Exact (binomial sign test on discordant pairs). */
537
+ pValue: number;
538
+ }
539
+ /**
540
+ * McNemar's test for paired binary outcomes — the correct significance test for
541
+ * "does treatment change the success rate vs control on the SAME items". Only
542
+ * discordant pairs (one arm right, the other wrong) carry information; concordant
543
+ * pairs are uninformative, so a paired t-test / two-proportion z-test on the raw
544
+ * rates is wrong here. The p-value is exact: under H0 the b "treatment-wins" are
545
+ * Binomial(b + c, 0.5), so the two-sided p is the doubled binomial tail — correct
546
+ * at the small discordant counts typical of eval runs (no continuity-corrected
547
+ * chi-square approximation needed, though it is returned as `statistic` for
548
+ * reference). Inputs are paired 0/1 (or boolean) arrays, control first to match
549
+ * the module's (before, after) convention. Throws on unequal lengths.
550
+ */
551
+ declare function mcnemar(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>): McNemarResult;
552
+ /** A paired binary effect size (treatment rate − control rate) with a CI. */
553
+ interface RiskDifferenceResult {
554
+ /** Total paired observations. */
555
+ n: number;
556
+ /** Discordant pairs: treatment-win count. */
557
+ b: number;
558
+ /** Discordant pairs: control-win count. */
559
+ c: number;
560
+ /** Paired risk difference (b − c) / n; 0 is a placeholder when n = 0. */
561
+ riskDifference: number;
562
+ /** Lower bound of the CI, clamped to [-1, 1]. */
563
+ lower: number;
564
+ /** Upper bound of the CI, clamped to [-1, 1]. */
565
+ upper: number;
566
+ /** Confidence level used. */
567
+ confidence: number;
568
+ }
569
+ /**
570
+ * Paired risk difference (the effect-size companion to {@link mcnemar}): the
571
+ * change in success rate p(treatment) − p(control) on matched items, which for
572
+ * paired binary data equals (b − c) / n. The CI uses the paired variance from
573
+ * the discordant counts, not the independent-samples formula (which overstates
574
+ * the interval by ignoring the pairing). Inputs are paired 0/1 (or boolean)
575
+ * arrays, control first. Throws on unequal lengths. With no pairs, returns the
576
+ * full [-1, 1] support and a compatibility point estimate of 0, not equivalence.
577
+ *
578
+ * REPORTING ONLY — do NOT decide a promotion on this interval. The CI is a Wald
579
+ * normal approximation, which badly UNDERCOVERS when only a handful of pairs are
580
+ * discordant: at n = 3 with b = 2, c = 0 it returns [0.133, 1.000], excluding 0,
581
+ * while McNemar's exact test on the same data gives p = 0.50. A gate keying on
582
+ * `lower > 0` would promote noise. Use {@link pairedRiskDifferenceExact}, whose
583
+ * interval is dual to the exact test by construction, for any decision.
584
+ */
585
+ declare function pairedRiskDifference(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>, confidence?: number): RiskDifferenceResult;
586
+ /** A paired binary effect size with an EXACT interval and the exact test that
587
+ * bounds it — one object so a caller cannot read the estimate without the
588
+ * significance it is entitled to. */
589
+ interface ExactRiskDifferenceResult {
590
+ /** Total paired observations. */
591
+ n: number;
592
+ /** Discordant pairs: treatment-win count. */
593
+ b: number;
594
+ /** Discordant pairs: control-win count. */
595
+ c: number;
596
+ /** Discordant pairs (b + c) — the only ones carrying information. */
597
+ nDiscordant: number;
598
+ /** Paired risk difference (b − c) / n; 0 is a placeholder when n = 0. */
599
+ riskDifference: number;
600
+ /** Exact conditional CI lower bound: -1 with no pairs; 0 with only concordant pairs. */
601
+ lower: number;
602
+ /** Exact conditional CI upper bound: 1 with no pairs; 0 with only concordant pairs. */
603
+ upper: number;
604
+ /** Confidence level used. */
605
+ confidence: number;
606
+ /** McNemar's exact two-sided p-value on the same discordant counts. */
607
+ pValue: number;
608
+ }
609
+ /**
610
+ * Paired risk difference with the EXACT CONDITIONAL interval — the estimator a
611
+ * promotion gate may decide on.
612
+ *
613
+ * Conditional on the number of discordant pairs m = b + c, the treatment-win
614
+ * count b is Binomial(m, π) with π = P(treatment wins | discordant), and the
615
+ * risk difference is an exact reparameterisation: RD = (2π − 1)·m/n. So a
616
+ * Clopper-Pearson exact interval for π maps straight onto RD. This buys the
617
+ * property the Wald interval in {@link pairedRiskDifference} does not have:
618
+ *
619
+ * **`lower > 0` ⟺ McNemar's exact test rejects at α = 1 − confidence.**
620
+ *
621
+ * Clopper-Pearson excludes π = 0.5 exactly when the two-sided exact binomial
622
+ * test of π = 0.5 rejects, and that test IS {@link mcnemar}'s p-value — so the
623
+ * interval and the test can never disagree, and a gate keyed on `lower` cannot
624
+ * promote what the exact test refuses. The exact p is returned in the same
625
+ * object so the two are impossible to compute apart.
626
+ *
627
+ * The interval is conservative (exact intervals over-cover; conditioning on m
628
+ * discards the concordant pairs' information about m itself). That is the
629
+ * correct direction for a promotion gate: it refuses more often, never less.
630
+ *
631
+ * With n = 0, returns the full [-1, 1] support, p = 1, and a compatibility
632
+ * point estimate of 0. With n > 0 and m = 0, π is not identified: the result
633
+ * is the degenerate [0, 0] with p = 1. That is NOT evidence of equivalence —
634
+ * callers must treat a zero-width interval as "cannot decide", not as "no
635
+ * difference". Inputs are paired 0/1 (or boolean) arrays, control first.
636
+ * Throws on unequal lengths.
637
+ */
638
+ declare function pairedRiskDifferenceExact(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>, confidence?: number): ExactRiskDifferenceResult;
639
+ /** A paired binary effect size with an interval that is valid at a NONZERO
640
+ * margin — the estimator a noninferiority decision may be made on. */
641
+ interface ScoreRiskDifferenceResult {
642
+ /** Total paired observations. */
643
+ n: number;
644
+ /** Discordant pairs: treatment-win count. */
645
+ b: number;
646
+ /** Discordant pairs: control-win count. */
647
+ c: number;
648
+ /** Discordant pairs (b + c). */
649
+ nDiscordant: number;
650
+ /** Paired risk difference (b − c) / n; 0 is a placeholder when n = 0. */
651
+ riskDifference: number;
652
+ /** Score-interval lower bound on the population risk difference. */
653
+ lower: number;
654
+ /** Score-interval upper bound on the population risk difference. */
655
+ upper: number;
656
+ /** Confidence level used. */
657
+ confidence: number;
658
+ }
659
+ /**
660
+ * Paired risk difference with TANGO'S (1998) SCORE INTERVAL — the estimator a
661
+ * promotion gate may decide on **at a nonzero margin**.
662
+ *
663
+ * {@link pairedRiskDifferenceExact} conditions on the observed discordant count
664
+ * `m = b + c`, builds a Clopper-Pearson interval for the win share among those
665
+ * `m` pairs, and multiplies by the observed `m/n`. That is exact for testing
666
+ * RD = 0 — it is dual to McNemar — but it is NOT a confidence interval for the
667
+ * population risk difference at a nonzero margin, because the sampling
668
+ * variability of `m/n` itself is discarded. The gap is not academic: with the
669
+ * production caller's `pairedDeltaThreshold: -0.05`, a process whose true risk
670
+ * difference sits exactly on that margin clears a nominal-95 % `lower > margin`
671
+ * check 24.75 % of the time at n = 40 and 43.95 % at n = 76 (2000 replicates
672
+ * each) when the conditional interval decides.
673
+ *
674
+ * Tango's interval inverts the score test of RD = delta, which estimates the
675
+ * nuisance loss rate under each hypothesised delta instead of fixing it at the
676
+ * observed value, so `m` contributes its own uncertainty. It is the method
677
+ * `ratesci::scorepairci` uses for paired risk-difference noninferiority, and it
678
+ * is not conditional, so it stays valid as the margin moves away from zero.
679
+ *
680
+ * The bounds are found by bisecting `tangoScore(delta) = ±z` — the score is
681
+ * monotone decreasing in delta, so each crossing is unique. Inputs are paired
682
+ * 0/1 (or boolean) arrays, control first. Throws on unequal lengths.
683
+ */
684
+ declare function pairedRiskDifferenceScore(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>, confidence?: number): ScoreRiskDifferenceResult;
685
+ /** Common positive level of paired {0, s} outcomes; divide by s before binary tests.
686
+ * Returns null for non-finite, negative, mixed-scale or all-zero data. */
687
+ declare function pairedBinaryScale(before: ArrayLike<number>, after: ArrayLike<number>): number | null;
688
+ /**
689
+ * Unbiased pass@k for code generation (Chen et al. 2021, "Evaluating Large
690
+ * Language Models Trained on Code"). Given `n` independent samples for one
691
+ * problem of which `c` pass, the probability that at least one of a random k of
692
+ * them passes is 1 − C(n−c, k) / C(n, k). Estimating pass@k as "did any of the
693
+ * first k pass" is biased high at small n; this is the variance-reduced estimator
694
+ * averaged implicitly over all k-subsets. Average the per-problem values across
695
+ * the suite for the corpus pass@k. Computed in the numerically stable product
696
+ * form. Requires 1 ≤ k ≤ n and 0 ≤ c ≤ n.
697
+ */
698
+ declare function passAtK(n: number, c: number, k: number): number;
699
+ /**
700
+ * Paired significance tests on continuous scores: the paired t-test, the
701
+ * promotion-gate paired bootstrap, the exact sign test, and the package-wide
702
+ * paired-delta decision statistic.
703
+ */
704
+ interface PairedTTestResult {
705
+ /** Null when the statistic is undefined — see {@link pairedTTest}. */
706
+ t: number | null;
707
+ df: number;
708
+ /** Null exactly when `t` is null. */
709
+ p: number | null;
710
+ }
711
+ /**
712
+ * Paired t-test — before/after measurements on the SAME items.
713
+ * Pairing removes inter-item variance, giving tighter significance than
714
+ * an unpaired test when comparing prompt v1 vs prompt v2 on identical
715
+ * scenarios.
716
+ *
717
+ * Returns `t = p = null` where the statistic is undefined: fewer than two
718
+ * pairs, or a non-zero constant delta whose observed variance is zero. A
719
+ * constant shift carries no information about the variance it would have to
720
+ * be compared against, so the honest answer is "undefined", not `p = 0` —
721
+ * three observations cannot buy absolute certainty. This is the same contract
722
+ * {@link pairedCohensDz} states for the same condition. An all-zero delta is
723
+ * different: it is a measured null, and returns `t = 0, p = 1`.
724
+ */
725
+ declare function pairedTTest(before: number[], after: number[]): PairedTTestResult;
726
+ interface PairedBootstrapResult {
727
+ /** Number of paired observations. */
728
+ n: number;
729
+ /** Median of paired deltas (after − before). */
730
+ median: number;
731
+ /** Mean of paired deltas. */
732
+ mean: number;
733
+ /** Lower bound of the bootstrap CI on the chosen statistic. */
734
+ low: number;
735
+ /** Upper bound of the bootstrap CI on the chosen statistic. */
736
+ high: number;
737
+ /** Confidence level used (e.g. 0.95). */
738
+ confidence: number;
739
+ /** Number of bootstrap resamples used. */
740
+ resamples: number;
741
+ /** False below {@link BOOTSTRAP_GATE_MIN_N}. See {@link pairedBootstrap}. */
742
+ gateEligible: boolean;
743
+ }
744
+ /**
745
+ * Pairs below which a percentile bootstrap interval is descriptive spread only.
746
+ *
747
+ * `P(low > 0)` under a true null, against a nominal 2.5 %, measured over 4000
748
+ * seeded trials: 13.53 % at n = 3, 3.52 % at n = 10, 3.10 % at n = 20 on the
749
+ * median; 13.85 %, 4.90 %, 3.80 % on the mean. This is intrinsic to resampling
750
+ * three points, not an implementation error — scipy's BCa gives 16.0 % on the
751
+ * same n = 3 data — so no change to the estimator moves it. Below this floor
752
+ * the decision belongs to the exact sign test or exact signed-rank test.
753
+ */
754
+ declare const BOOTSTRAP_GATE_MIN_N = 20;
755
+ interface PairedBootstrapOptions {
756
+ /** Confidence level. Default 0.95. */
757
+ confidence?: number;
758
+ /** Bootstrap resample count. Default 2000. */
759
+ resamples?: number;
760
+ /** Statistic to bootstrap. Default 'median'. */
761
+ statistic?: 'median' | 'mean';
762
+ /** Deterministic seed. If omitted, derived from the deltas so the interval
763
+ * is reproducible regardless. */
764
+ seed?: number;
765
+ }
766
+ /**
767
+ * Paired bootstrap on (after − before) deltas. Returns a CI on the chosen
768
+ * statistic (median by default); pairs are resampled with replacement. Throws
769
+ * on unequal sample sizes.
770
+ *
771
+ * `low > threshold` carries the stated confidence ONLY at `n ≥
772
+ * {@link BOOTSTRAP_GATE_MIN_N}`, which `gateEligible` reports. Below it the
773
+ * check fires under a true null several times more often than nominal, so the
774
+ * interval is descriptive spread and a promotion must not turn on it.
775
+ */
776
+ declare function pairedBootstrap(before: number[], after: number[], opts?: PairedBootstrapOptions): PairedBootstrapResult;
777
+ /** Pre-registered direction for a one-sided paired sign test. */
778
+ type SignTestAlternative = 'greater' | 'less';
779
+ /** Exact one-sided sign-test result for paired numeric differences. */
780
+ interface PairedSignTestResult {
781
+ /** Total supplied differences, including zero ties. */
782
+ n: number;
783
+ /** Strictly positive differences. */
784
+ positive: number;
785
+ /** Strictly negative differences. */
786
+ negative: number;
787
+ /** Zero differences excluded from the binomial test. */
788
+ ties: number;
789
+ /** Non-zero differences used by the binomial test. */
790
+ nNonTies: number;
791
+ /** Direction of the pre-registered alternative hypothesis. */
792
+ alternative: SignTestAlternative;
793
+ /** Exact one-sided p-value under P(positive) = P(negative) = 0.5. */
794
+ pValue: number;
795
+ }
796
+ /**
797
+ * Exact one-sided sign test over paired differences.
798
+ *
799
+ * Pass `after[i] - before[i]` for each matched item. `alternative = 'greater'`
800
+ * tests whether positive signs are more likely than negative signs and returns
801
+ * `P(Binomial(nNonTies, 0.5) >= positive)`. `alternative = 'less'` treats
802
+ * negative signs as successes instead. With a continuous difference
803
+ * distribution this is the usual directional median test. Exact zero
804
+ * differences are ties and do not enter the binomial denominator. All-tie and
805
+ * empty inputs return p = 1. Every input difference must be finite, and the
806
+ * direction must be chosen explicitly so a caller cannot select it after
807
+ * seeing the signs.
808
+ */
809
+ declare function pairedSignTest(differences: readonly number[], alternative: SignTestAlternative): PairedSignTestResult;
810
+ /** Fraction of paired observations whose delta is an exact tie (|after − before|
811
+ * < 1e-9). Throws on unequal sample sizes; 0 pairs ⇒ 0. */
812
+ declare function pairedDeltaTieFraction(before: ArrayLike<number>, after: ArrayLike<number>): number;
813
+ /**
814
+ * The paired-delta statistic a DECISION is computed on, package-wide.
815
+ *
816
+ * The mean paired delta is the estimator that answers the question a promotion
817
+ * gate asks — "by how much did the candidate move the score" — in the caller's
818
+ * own units, and it equals the aggregate lift everyone quotes. The MEDIAN
819
+ * answers a different question and loses the answer to this one in every regime
820
+ * eval data actually lands in:
821
+ * - TWO-POINT (pass/fail) outcomes on any encoding: the delta vector lives in
822
+ * {−s, 0, +s} dominated by zeros, so the median and its whole bootstrap CI
823
+ * are pinned at exactly 0 however large the shift. (Decide these on
824
+ * {@link pairedRiskDifferenceExact} instead — same estimand, exact interval.)
825
+ * - TIE-DOMINATED outcomes: at half the pairs tied the sample median is 0 by
826
+ * construction, and `ci.low > threshold` then answers "no" forever at a
827
+ * non-negative threshold and "yes" forever at a negative one.
828
+ * - LOW-CARDINALITY outcomes, even well below half ties: judge dimensions on
829
+ * integer 0-100, and block scores like {⅔, 1} from averaging pass/fail
830
+ * leaves, put the median on a coarse lattice whose bootstrap percentiles
831
+ * land on atoms. Measured: 26 blocks of 3 pass/fail leaves carrying a real
832
+ * +12.8pp lift, only 23% of pairs tied, gives a median CI of [0, 0.333] —
833
+ * lower bound exactly 0, so a gate at threshold 0 refuses a real lift.
834
+ * That last case is why there is no tie-fraction threshold here: any cutoff on
835
+ * ties leaves the lattice case open on the other side of it.
836
+ *
837
+ * `heldoutSignificance` has defaulted to the mean since #316 for the same
838
+ * reason. The median remains available per call site for callers who
839
+ * specifically want outlier robustness and accept the blindness.
840
+ */
841
+ declare const DECISION_PAIRED_DELTA_STATISTIC: 'mean';
842
+ /**
843
+ * Required N per arm for a two-sample comparison at target effect size,
844
+ * alpha, and power. Normal-approximation formula:
845
+ * n = 2 * ( (z_{1-α/2} + z_{1-β}) / d )^2
846
+ * where d is Cohen's d. Returns Infinity for effect ≤ 0.
847
+ */
848
+ declare function requiredSampleSize(opts: {
849
+ effect: number;
850
+ alpha?: number;
851
+ power?: number;
852
+ twoSided?: boolean;
853
+ }): number;
854
+ /**
855
+ * Required number of paired observations for a target Cohen's dz.
856
+ * Unlike the independent-groups formula, this has no two-arm factor of two.
857
+ *
858
+ * Normal quantiles with no t correction, so treat the result as a LOWER bound:
859
+ * it returns 32 where the exact t-based answer is 34 at dz = 0.5, and 13 where
860
+ * it is 15 at dz = 0.8 — a 6–13 % shortfall precisely in the range a caller
861
+ * consults to decide whether 3–10 repetitions suffice.
862
+ */
863
+ declare function requiredPairedSampleSize(opts: {
864
+ effect: number;
865
+ alpha?: number;
866
+ power?: number;
867
+ twoSided?: boolean;
868
+ }): number;
869
+ /**
870
+ * Minimum detectable paired effect (standardised units) for a target paired
871
+ * sample size: d_min = (z_{1-α/2} + z_β) / sqrt(n_paired). Multiply by
872
+ * sd(deltas) for score units; treat as a lower bound — Wilcoxon and bootstrap
873
+ * have asymptotic relative efficiency below 1 vs the t-test on heavy tails.
874
+ */
875
+ declare function pairedMde(opts: {
876
+ nPaired: number;
877
+ alpha?: number;
878
+ power?: number;
879
+ twoSided?: boolean;
880
+ }): number;
881
+ /**
882
+ * Number of paired observations needed for a McNemar test to reach a target
883
+ * power — the pre-registration companion to {@link mcnemar}. Parametrised by the
884
+ * expected discordant-cell probabilities `p10` (P[treatment wins on a pair]) and
885
+ * `p01` (P[control wins]); concordant pairs carry no information, so the count
886
+ * is driven entirely by the discordant rate. Lachin's (1992) asymptotic normal
887
+ * approximation: with discordant rate `pDisc = p10 + p01` and marginal effect
888
+ * `δ = p10 − p01`,
889
+ * n = ( z_{1-α/2}·√pDisc + z_{1-β}·√(pDisc − δ²) )² / δ².
890
+ * Returns Infinity when there is no effect (p10 === p01). Asymptotic — at the
891
+ * tiny discordant counts where the exact {@link mcnemar} differs from the normal
892
+ * approximation, treat the result as a lower bound and prefer the discordant-pair
893
+ * floor.
894
+ */
895
+ declare function mcnemarRequiredN(opts: {
896
+ p10: number;
897
+ p01: number;
898
+ alpha?: number;
899
+ power?: number;
900
+ twoSided?: boolean;
901
+ }): number;
902
+ /**
903
+ * Power of a McNemar test at a given number of paired observations, the inverse
904
+ * of {@link mcnemarRequiredN} (same Lachin asymptotic model, same parameters).
905
+ * Returns a value in [0, 1]; equals `alpha` when there is no effect.
906
+ */
907
+ declare function mcnemarPower(opts: {
908
+ p10: number;
909
+ p01: number;
910
+ nPairs: number;
911
+ alpha?: number;
912
+ twoSided?: boolean;
913
+ }): number;
914
+ /** Tiny seedable PRNG (mulberry32) — deterministic resampling/shuffling, not
915
+ * cryptographic. Exported so e-process shuffles and bootstrap resampling
916
+ * share ONE PRNG implementation. Every distinct 32-bit seed gives a distinct
917
+ * stream, including 0. */
918
+ declare function mulberry32(seed: number): () => number;
919
+ type RankTestMethod = 'exact' | 'permutation' | 'asymptotic';
920
+ /** Auto selects bounded exact enumeration or seeded permutation; asymptotic requires an explicit request. */
921
+ type RankTestMethodRequest = 'auto' | 'exact' | 'asymptotic';
922
+ interface RankTestOptions {
923
+ /** Default `'auto'`. `'asymptotic'` inside the exact-feasible range throws. */
924
+ method?: RankTestMethodRequest;
925
+ /** Resamples on the Monte Carlo permutation path. Default 100000. */
926
+ permutations?: number;
927
+ /** Seed for the permutation path. Omitted ⇒ derived from the data itself, so
928
+ * the result is reproducible either way. */
929
+ seed?: number;
930
+ }
931
+ interface MannWhitneyResult {
932
+ /** `min(U_a, U_b)` — the conventional reported statistic. */
933
+ u: number;
934
+ /** U for sample `a`. Carries the direction of the effect, which `u` discards. */
935
+ uA: number;
936
+ /** Two-sided p-value. */
937
+ p: number;
938
+ /** How `p` was computed. */
939
+ method: RankTestMethod;
940
+ /** Smallest two-sided p this design can produce. `p` can never be below it. */
941
+ pFloor: number;
942
+ }
943
+ /**
944
+ * Mann-Whitney U — two independent samples, no distributional assumption.
945
+ *
946
+ * Exact conditional (permutation) p by default when the dynamic program fits
947
+ * {@link MANN_WHITNEY_EXACT_MAX_STATES} cells and
948
+ * {@link MANN_WHITNEY_EXACT_MAX_WORK} transitions, seeded Monte Carlo
949
+ * permutation above those limits. This keeps imbalanced designs such as 1+24
950
+ * exact without admitting expensive balanced designs merely because they have
951
+ * the same total size. Throws on non-finite input and on `method:
952
+ * 'asymptotic'` where an exact answer is available. Empty input yields `p = 1,
953
+ * pFloor = 1` — no design, no attainable evidence.
954
+ */
955
+ declare function mannWhitneyU(a: number[], b: number[], opts?: RankTestOptions): MannWhitneyResult;
956
+ interface WilcoxonSignedRankResult {
957
+ /** W⁺, the rank sum of the positive differences. (scipy reports
958
+ * `min(W⁺, W⁻)`; compare statistics only after converting.) */
959
+ w: number;
960
+ /** Two-sided p-value. */
961
+ p: number;
962
+ /** How `p` was computed. */
963
+ method: RankTestMethod;
964
+ /** Smallest two-sided p this design can produce. */
965
+ pFloor: number;
966
+ /** Non-zero differences — zero differences are dropped and carry no rank. */
967
+ nNonZero: number;
968
+ }
969
+ /**
970
+ * Wilcoxon signed-rank — paired, no distributional assumption on the deltas.
971
+ *
972
+ * Exact conditional (sign-flip) p by default at `n ≤
973
+ * {@link WILCOXON_EXACT_MAX_N}` non-zero differences, seeded Monte Carlo
974
+ * permutation above it. Throws on non-finite input and on `method:
975
+ * 'asymptotic'` where an exact answer is available.
976
+ *
977
+ * `n` is the count of NON-ZERO differences: exact ties are dropped before
978
+ * ranking, so a run of tied pairs shrinks the design and raises `pFloor`.
979
+ * All-tied input yields `p = 1, pFloor = 1` — no attainable evidence, which
980
+ * `pFloor` states rather than leaving `p = 1` to be read as a measured null.
981
+ */
982
+ declare function wilcoxonSignedRank(before: number[], after: number[], opts?: RankTestOptions): WilcoxonSignedRankResult;
983
+ interface SampleSummaryOptions {
984
+ confidence?: number;
985
+ seed?: number;
986
+ resamples?: number;
987
+ }
988
+ interface SampleSummary {
989
+ n: number;
990
+ median: number;
991
+ mean: number;
992
+ stddev: number;
993
+ q1: number;
994
+ q3: number;
995
+ iqr: number;
996
+ min: number;
997
+ max: number;
998
+ range: number;
999
+ cv: number | null;
1000
+ skewness: number | null;
1001
+ kurtosis: number | null;
1002
+ mad: number;
1003
+ outliers: number[];
1004
+ medianInterval: {
1005
+ low: number;
1006
+ high: number;
1007
+ confidence: number;
1008
+ resamples: number;
1009
+ } | null;
1010
+ }
1011
+ /** Interpolated sample median; an empty population has no measured median. */
1012
+ declare function sampleMedian(values: readonly number[]): number | null;
1013
+ /** Descriptive facts, not stability policy or a significance test. */
1014
+ declare function summarizeSample(values: readonly number[], options?: SampleSummaryOptions): SampleSummary | null;
1015
+ interface EProcessOptions {
1016
+ /** Type-I error budget. The process decides when wealth ≥ 1/alpha
1017
+ * (Ville's inequality). Default 0.05. */
1018
+ alpha?: number;
1019
+ /** Truncation bound on the predictable bet λ ∈ [0, maxBet]. Must satisfy
1020
+ * maxBet < 1/nullMean so every wealth factor stays strictly positive.
1021
+ * Default 0.5. */
1022
+ maxBet?: number;
1023
+ /** The null boundary m₀ for H0: E[x] ≤ m₀ on x ∈ [0,1]. Default 0.5
1024
+ * (the paired-delta encoding x = (d+1)/2 maps "no effect" to 1/2).
1025
+ * A pre-registered minEffect shifts this — see `sequentialPairedGate`. */
1026
+ nullMean?: number;
1027
+ /** Continue a process from a `state()` snapshot taken before a restart.
1028
+ * The snapshot never supplies the parameters: `alpha`, `maxBet`, and
1029
+ * `nullMean` resolve from this options object exactly as for a fresh
1030
+ * process, and a snapshot recorded under different parameters is refused
1031
+ * (`ValidationError`) — re-deciding the same stream under new parameters
1032
+ * would reopen optional stopping. A snapshot whose fields are not
1033
+ * mutually consistent (tampered or truncated) is refused the same way. */
1034
+ resume?: EProcessState;
1035
+ }
1036
+ interface EProcessStep {
1037
+ /** Current wealth W_n — the e-value against H0 after n observations. */
1038
+ wealth: number;
1039
+ /** Observations consumed so far. */
1040
+ n: number;
1041
+ /** True from the first n where W_n ≥ 1/alpha onward (sticky). */
1042
+ decided: boolean;
1043
+ }
1044
+ /**
1045
+ * Complete snapshot of an e-process. Together with the parameters it is
1046
+ * sufficient to continue the process after a restart: `sumX` and `varSum`
1047
+ * are the running sums the next bet is computed from, so a process rebuilt
1048
+ * from a snapshot produces the same wealth sequence and decision as one that
1049
+ * was never interrupted. Plain data: a JSON round-trip preserves it
1050
+ * (`decidedAtN` is undefined, and therefore omitted, until decided).
1051
+ */
1052
+ interface EProcessState extends EProcessStep {
1053
+ alpha: number;
1054
+ maxBet: number;
1055
+ nullMean: number;
1056
+ /** The decision boundary 1/alpha. */
1057
+ threshold: number;
1058
+ /** Observation count at the first threshold crossing; undefined until decided. */
1059
+ decidedAtN?: number;
1060
+ /** Σ x_i over the n observations consumed. */
1061
+ sumX: number;
1062
+ /** Σ (x_i − μ̂_i)² over the n observations consumed, μ̂_i the shrunk running
1063
+ * mean after observation i. */
1064
+ varSum: number;
1065
+ }
1066
+ interface EProcess {
1067
+ /** Consume one observation x ∈ [0,1]. Throws on non-finite / out-of-range
1068
+ * input — a silent clamp would corrupt the type-I guarantee. */
1069
+ update(x: number): EProcessStep;
1070
+ state(): EProcessState;
1071
+ }
1072
+ /**
1073
+ * Betting test-martingale for bounded observations — the e-process core of
1074
+ * anytime-valid sequential testing (Waudby-Smith & Ramdas, "Estimating means
1075
+ * of bounded random variables by betting", JRSS-B 2024).
1076
+ *
1077
+ * Observations x_i ∈ [0,1]; H0: E[x] ≤ m₀ (`nullMean`, default 1/2). Wealth
1078
+ *
1079
+ * W_t = Π_{i≤t} (1 + λ_i (x_i − m₀)), W_0 = 1
1080
+ *
1081
+ * with the truncated GROW-style plug-in bet computed from PRIOR observations:
1082
+ *
1083
+ * λ_i = clamp((μ̂_{i−1} − m₀) / (σ̂²_{i−1} + (μ̂_{i−1} − m₀)²), 0, maxBet)
1084
+ *
1085
+ * where μ̂/σ̂² are the shrunk running estimates μ̂_t = (1/2 + Σx_i)/(t+1),
1086
+ * σ̂²_t = (1/4 + Σ(x_i − μ̂_i)²)/(t+1).
1087
+ *
1088
+ * PREDICTABILITY INVARIANT (load-bearing): λ_i is a function of x_1..x_{i−1}
1089
+ * ONLY — it may never see x_i. With λ_i ≥ 0 predictable, each factor has
1090
+ * E[1 + λ_i(x_i − m₀) | past] ≤ 1 under H0, so W is a nonnegative
1091
+ * supermartingale and Ville's inequality gives P(∃t: W_t ≥ 1/α) ≤ α — the
1092
+ * type-I guarantee holds at ANY data-dependent stopping time. λ_1 is always 0
1093
+ * (no prior evidence), so the first observation never moves wealth.
1094
+ *
1095
+ * `decided` latches at the first crossing W_t ≥ 1/α and never un-latches;
1096
+ * wealth keeps updating after the crossing (the e-process remains valid), but
1097
+ * the decision time is the first crossing.
1098
+ */
1099
+ declare function eProcess(opts?: EProcessOptions): EProcess;
1100
+ export { chiSquaredPValue as $, selfPreference as $t, pairedBootstrap as A, CorpusAgreementOptions as At, independentRiskDifference as B, CalibrationResult as Bt, BOOTSTRAP_GATE_MIN_N as C, ranks as Ct, PairedSignTestResult as D, weightedComposite as Dt, PairedBootstrapResult as E, summarizeNumberSeries as Et, IndependentRiskDifferenceResult as F, NominalAgreementOptions as Ft, pairedRiskDifferenceScore as G, GoldenItem as Gt, pairedBinaryScale as H, ContinuousAgreement as Ht, McNemarResult as I, corpusInterRaterAgreement as It, benjaminiHochberg as J, VerbosityBiasResult as Jt, passAtK as K, PositionalBiasResult as Kt, ProportionInterval as L, corpusInterRaterAgreementFromJudgeScores as Lt, pairedSignTest as M, CorpusAgreementReport as Mt, pairedTTest as N, CorpusScoreRecord as Nt, PairedTTestResult as O, weightedMean as Ot, ExactRiskDifferenceResult as P, NominalAgreement as Pt, chiSquared as Q, positionalBias as Qt, RiskDifferenceResult as R, interRaterReliability as Rt, requiredSampleSize as S, pearsonR as St, PairedBootstrapOptions as T, studentTCritical as Tt, pairedRiskDifference as U, ContinuousAgreementOptions as Ut, mcnemar as V, CandidateScore as Vt, pairedRiskDifferenceExact as W, ContinuousCalibrationResult as Wt, holm as X, calibrateJudgeContinuous as Xt, bonferroni as Y, calibrateJudge as Yt, LinearRegressionResult as Z, continuousAgreement as Zt, mulberry32 as _, WeightedCompositeInput as _t, eProcess as a, CliffsMagnitude as at, pairedMde as b, meanConfidenceInterval as bt, sampleMedian as c, interpretCliffs as ct, RankTestMethod as d, SampleDistribution as dt, verbosityBias as en, fisherExactTwoSided as et, RankTestMethodRequest as f, percentileNearestRank as ft, wilcoxonSignedRank as g, SeriesDistributionOptions as gt, mannWhitneyU as h, SeriesDistribution as ht, EProcessStep as i, twoByTwoPValue as it, pairedDeltaTieFraction as j, CorpusAgreementPerDimension as jt, SignTestAlternative as k, rocAuc as kt, summarizeSample as l, pairedCohensDz as lt, WilcoxonSignedRankResult as m, MeanConfidenceInterval as mt, EProcessOptions as n, normalTwoSidedPValue as nt, SampleSummary as o, cliffsDelta as ot, RankTestOptions as p, summarizeDistribution as pt, wilson as q, SelfPreferenceResult as qt, EProcessState as r, studentTTwoSidedPValue as rt, SampleSummaryOptions as s, cohensD as st, EProcess as t, linearRegressionSlope as tt, MannWhitneyResult as u, DistributionSummaryOptions as ut, mcnemarPower as v, WeightedCompositeResult as vt, DECISION_PAIRED_DELTA_STATISTIC as w, spearmanR as wt, requiredPairedSampleSize as x, partialCredit as xt, mcnemarRequiredN as y, confidenceInterval as yt, ScoreRiskDifferenceResult as z, nominalAgreement as zt };
1101
+ //# sourceMappingURL=index-DNXFzSpc.d.ts.map