@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
@@ -1,286 +1,10 @@
1
1
  import { a as RunRecord } from "./run-record-D2BFMPGl.js";
2
- import { V as FindingTreatment } from "./types-B9s9Xo5_.js";
3
- import { a as PairedPromotionDecision, i as PairedMcNemarEvidence, l as PairedBootstrapOptions, r as PairedDecisionStatistic, t as PairedDecisionMethod, u as PairedBootstrapResult } from "./paired-promotion-decision-BDnqepZ1.js";
2
+ import { B as FindingTreatment } from "./types-kBMNdo1X.js";
3
+ import { E as PairedBootstrapResult, I as McNemarResult, R as RiskDifferenceResult, T as PairedBootstrapOptions, r as EProcessState } from "./index-DNXFzSpc.js";
4
4
  import { r as LedgerHash } from "./canonical-gLeHiqzd.js";
5
- import { R as Scenario, a as CampaignResult, b as GenerationRecord, h as GateContext, j as MutableSurface, p as Gate, v as GateResult, w as JudgeScore } from "./types-wDBk14lj.js";
5
+ import { R as Scenario, a as CampaignResult, b as GenerationRecord, h as GateContext, j as MutableSurface, p as Gate, v as GateResult, w as JudgeScore } from "./types-ip2D3-Ib.js";
6
+ import { a as PairedPromotionDecision, i as PairedMcNemarEvidence, r as PairedDecisionStatistic, t as PairedDecisionMethod } from "./paired-promotion-decision-DJU3fZxH.js";
6
7
  import { z } from "zod";
7
- /** A binomial proportion estimate with a confidence interval. */
8
- interface ProportionInterval {
9
- /** Point estimate successes / n; 0 is a compatibility placeholder when n = 0. */
10
- estimate: number;
11
- /** Lower bound, clamped to [0, 1]. */
12
- lower: number;
13
- /** Upper bound, clamped to [0, 1]. */
14
- upper: number;
15
- }
16
- /**
17
- * Wilson score interval for a binomial proportion. Correct at small n and near
18
- * 0/1, where the normal (Wald) approximation produces bounds outside [0, 1] and
19
- * understates coverage. Use this for any pass-rate / hit-rate / realness-rate
20
- * CI — the continuous `confidenceInterval` assumes the wrong distribution for a
21
- * proportion. Counts must be finite nonnegative integers, successes cannot exceed
22
- * n, and confidence must lie strictly between zero and one. With n = 0 the
23
- * interval is the full [0, 1] support: no rate is ruled out. The estimate stays
24
- * 0 for compatibility, not as a measured failure rate; retain n alongside it.
25
- */
26
- declare function wilson(successes: number, n: number, confidence?: number): ProportionInterval;
27
- /** Result of a McNemar paired-binary significance test. */
28
- interface McNemarResult {
29
- /** Total paired observations. */
30
- n: number;
31
- /** Discordant pairs (b + c) — the only ones that carry signal. */
32
- nDiscordant: number;
33
- /** Pairs where treatment succeeded and control failed ("newly correct"). */
34
- b: number;
35
- /** Pairs where control succeeded and treatment failed ("newly wrong"). */
36
- c: number;
37
- /** Continuity-corrected chi-square statistic (reference; exact p drives the call). */
38
- statistic: number;
39
- /** Two-sided p-value. Exact (binomial sign test on discordant pairs). */
40
- pValue: number;
41
- }
42
- /**
43
- * McNemar's test for paired binary outcomes — the correct significance test for
44
- * "does treatment change the success rate vs control on the SAME items". Only
45
- * discordant pairs (one arm right, the other wrong) carry information; concordant
46
- * pairs are uninformative, so a paired t-test / two-proportion z-test on the raw
47
- * rates is wrong here. The p-value is exact: under H0 the b "treatment-wins" are
48
- * Binomial(b + c, 0.5), so the two-sided p is the doubled binomial tail — correct
49
- * at the small discordant counts typical of eval runs (no continuity-corrected
50
- * chi-square approximation needed, though it is returned as `statistic` for
51
- * reference). Inputs are paired 0/1 (or boolean) arrays, control first to match
52
- * the module's (before, after) convention. Throws on unequal lengths.
53
- */
54
- declare function mcnemar(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>): McNemarResult;
55
- /** A paired binary effect size (treatment rate − control rate) with a CI. */
56
- interface RiskDifferenceResult {
57
- /** Total paired observations. */
58
- n: number;
59
- /** Discordant pairs: treatment-win count. */
60
- b: number;
61
- /** Discordant pairs: control-win count. */
62
- c: number;
63
- /** Paired risk difference (b − c) / n; 0 is a placeholder when n = 0. */
64
- riskDifference: number;
65
- /** Lower bound of the CI, clamped to [-1, 1]. */
66
- lower: number;
67
- /** Upper bound of the CI, clamped to [-1, 1]. */
68
- upper: number;
69
- /** Confidence level used. */
70
- confidence: number;
71
- }
72
- /**
73
- * Paired risk difference (the effect-size companion to {@link mcnemar}): the
74
- * change in success rate p(treatment) − p(control) on matched items, which for
75
- * paired binary data equals (b − c) / n. The CI uses the paired variance from
76
- * the discordant counts, not the independent-samples formula (which overstates
77
- * the interval by ignoring the pairing). Inputs are paired 0/1 (or boolean)
78
- * arrays, control first. Throws on unequal lengths. With no pairs, returns the
79
- * full [-1, 1] support and a compatibility point estimate of 0, not equivalence.
80
- *
81
- * REPORTING ONLY — do NOT decide a promotion on this interval. The CI is a Wald
82
- * normal approximation, which badly UNDERCOVERS when only a handful of pairs are
83
- * discordant: at n = 3 with b = 2, c = 0 it returns [0.133, 1.000], excluding 0,
84
- * while McNemar's exact test on the same data gives p = 0.50. A gate keying on
85
- * `lower > 0` would promote noise. Use {@link pairedRiskDifferenceExact}, whose
86
- * interval is dual to the exact test by construction, for any decision.
87
- */
88
- declare function pairedRiskDifference(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>, confidence?: number): RiskDifferenceResult;
89
- /** A paired binary effect size with an EXACT interval and the exact test that
90
- * bounds it — one object so a caller cannot read the estimate without the
91
- * significance it is entitled to. */
92
- interface ExactRiskDifferenceResult {
93
- /** Total paired observations. */
94
- n: number;
95
- /** Discordant pairs: treatment-win count. */
96
- b: number;
97
- /** Discordant pairs: control-win count. */
98
- c: number;
99
- /** Discordant pairs (b + c) — the only ones carrying information. */
100
- nDiscordant: number;
101
- /** Paired risk difference (b − c) / n; 0 is a placeholder when n = 0. */
102
- riskDifference: number;
103
- /** Exact conditional CI lower bound: -1 with no pairs; 0 with only concordant pairs. */
104
- lower: number;
105
- /** Exact conditional CI upper bound: 1 with no pairs; 0 with only concordant pairs. */
106
- upper: number;
107
- /** Confidence level used. */
108
- confidence: number;
109
- /** McNemar's exact two-sided p-value on the same discordant counts. */
110
- pValue: number;
111
- }
112
- /**
113
- * Paired risk difference with the EXACT CONDITIONAL interval — the estimator a
114
- * promotion gate may decide on.
115
- *
116
- * Conditional on the number of discordant pairs m = b + c, the treatment-win
117
- * count b is Binomial(m, π) with π = P(treatment wins | discordant), and the
118
- * risk difference is an exact reparameterisation: RD = (2π − 1)·m/n. So a
119
- * Clopper-Pearson exact interval for π maps straight onto RD. This buys the
120
- * property the Wald interval in {@link pairedRiskDifference} does not have:
121
- *
122
- * **`lower > 0` ⟺ McNemar's exact test rejects at α = 1 − confidence.**
123
- *
124
- * Clopper-Pearson excludes π = 0.5 exactly when the two-sided exact binomial
125
- * test of π = 0.5 rejects, and that test IS {@link mcnemar}'s p-value — so the
126
- * interval and the test can never disagree, and a gate keyed on `lower` cannot
127
- * promote what the exact test refuses. The exact p is returned in the same
128
- * object so the two are impossible to compute apart.
129
- *
130
- * The interval is conservative (exact intervals over-cover; conditioning on m
131
- * discards the concordant pairs' information about m itself). That is the
132
- * correct direction for a promotion gate: it refuses more often, never less.
133
- *
134
- * With n = 0, returns the full [-1, 1] support, p = 1, and a compatibility
135
- * point estimate of 0. With n > 0 and m = 0, π is not identified: the result
136
- * is the degenerate [0, 0] with p = 1. That is NOT evidence of equivalence —
137
- * callers must treat a zero-width interval as "cannot decide", not as "no
138
- * difference". Inputs are paired 0/1 (or boolean) arrays, control first.
139
- * Throws on unequal lengths.
140
- */
141
- declare function pairedRiskDifferenceExact(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>, confidence?: number): ExactRiskDifferenceResult;
142
- /** A paired binary effect size with an interval that is valid at a NONZERO
143
- * margin — the estimator a noninferiority decision may be made on. */
144
- interface ScoreRiskDifferenceResult {
145
- /** Total paired observations. */
146
- n: number;
147
- /** Discordant pairs: treatment-win count. */
148
- b: number;
149
- /** Discordant pairs: control-win count. */
150
- c: number;
151
- /** Discordant pairs (b + c). */
152
- nDiscordant: number;
153
- /** Paired risk difference (b − c) / n; 0 is a placeholder when n = 0. */
154
- riskDifference: number;
155
- /** Score-interval lower bound on the population risk difference. */
156
- lower: number;
157
- /** Score-interval upper bound on the population risk difference. */
158
- upper: number;
159
- /** Confidence level used. */
160
- confidence: number;
161
- }
162
- /**
163
- * Paired risk difference with TANGO'S (1998) SCORE INTERVAL — the estimator a
164
- * promotion gate may decide on **at a nonzero margin**.
165
- *
166
- * {@link pairedRiskDifferenceExact} conditions on the observed discordant count
167
- * `m = b + c`, builds a Clopper-Pearson interval for the win share among those
168
- * `m` pairs, and multiplies by the observed `m/n`. That is exact for testing
169
- * RD = 0 — it is dual to McNemar — but it is NOT a confidence interval for the
170
- * population risk difference at a nonzero margin, because the sampling
171
- * variability of `m/n` itself is discarded. The gap is not academic: with the
172
- * production caller's `pairedDeltaThreshold: -0.05`, a process whose true risk
173
- * difference sits exactly on that margin clears a nominal-95 % `lower > margin`
174
- * check 24.75 % of the time at n = 40 and 43.95 % at n = 76 (2000 replicates
175
- * each) when the conditional interval decides.
176
- *
177
- * Tango's interval inverts the score test of RD = delta, which estimates the
178
- * nuisance loss rate under each hypothesised delta instead of fixing it at the
179
- * observed value, so `m` contributes its own uncertainty. It is the method
180
- * `ratesci::scorepairci` uses for paired risk-difference noninferiority, and it
181
- * is not conditional, so it stays valid as the margin moves away from zero.
182
- *
183
- * The bounds are found by bisecting `tangoScore(delta) = ±z` — the score is
184
- * monotone decreasing in delta, so each crossing is unique. Inputs are paired
185
- * 0/1 (or boolean) arrays, control first. Throws on unequal lengths.
186
- */
187
- declare function pairedRiskDifferenceScore(control: ArrayLike<number | boolean>, treatment: ArrayLike<number | boolean>, confidence?: number): ScoreRiskDifferenceResult;
188
- /**
189
- * Unbiased pass@k for code generation (Chen et al. 2021, "Evaluating Large
190
- * Language Models Trained on Code"). Given `n` independent samples for one
191
- * problem of which `c` pass, the probability that at least one of a random k of
192
- * them passes is 1 − C(n−c, k) / C(n, k). Estimating pass@k as "did any of the
193
- * first k pass" is biased high at small n; this is the variance-reduced estimator
194
- * averaged implicitly over all k-subsets. Average the per-problem values across
195
- * the suite for the corpus pass@k. Computed in the numerically stable product
196
- * form. Requires 1 ≤ k ≤ n and 0 ≤ c ≤ n.
197
- */
198
- declare function passAtK(n: number, c: number, k: number): number;
199
- interface EProcessOptions {
200
- /** Type-I error budget. The process decides when wealth ≥ 1/alpha
201
- * (Ville's inequality). Default 0.05. */
202
- alpha?: number;
203
- /** Truncation bound on the predictable bet λ ∈ [0, maxBet]. Must satisfy
204
- * maxBet < 1/nullMean so every wealth factor stays strictly positive.
205
- * Default 0.5. */
206
- maxBet?: number;
207
- /** The null boundary m₀ for H0: E[x] ≤ m₀ on x ∈ [0,1]. Default 0.5
208
- * (the paired-delta encoding x = (d+1)/2 maps "no effect" to 1/2).
209
- * A pre-registered minEffect shifts this — see `sequentialPairedGate`. */
210
- nullMean?: number;
211
- /** Continue a process from a `state()` snapshot taken before a restart.
212
- * The snapshot never supplies the parameters: `alpha`, `maxBet`, and
213
- * `nullMean` resolve from this options object exactly as for a fresh
214
- * process, and a snapshot recorded under different parameters is refused
215
- * (`ValidationError`) — re-deciding the same stream under new parameters
216
- * would reopen optional stopping. A snapshot whose fields are not
217
- * mutually consistent (tampered or truncated) is refused the same way. */
218
- resume?: EProcessState;
219
- }
220
- interface EProcessStep {
221
- /** Current wealth W_n — the e-value against H0 after n observations. */
222
- wealth: number;
223
- /** Observations consumed so far. */
224
- n: number;
225
- /** True from the first n where W_n ≥ 1/alpha onward (sticky). */
226
- decided: boolean;
227
- }
228
- /**
229
- * Complete snapshot of an e-process. Together with the parameters it is
230
- * sufficient to continue the process after a restart: `sumX` and `varSum`
231
- * are the running sums the next bet is computed from, so a process rebuilt
232
- * from a snapshot produces the same wealth sequence and decision as one that
233
- * was never interrupted. Plain data: a JSON round-trip preserves it
234
- * (`decidedAtN` is undefined, and therefore omitted, until decided).
235
- */
236
- interface EProcessState extends EProcessStep {
237
- alpha: number;
238
- maxBet: number;
239
- nullMean: number;
240
- /** The decision boundary 1/alpha. */
241
- threshold: number;
242
- /** Observation count at the first threshold crossing; undefined until decided. */
243
- decidedAtN?: number;
244
- /** Σ x_i over the n observations consumed. */
245
- sumX: number;
246
- /** Σ (x_i − μ̂_i)² over the n observations consumed, μ̂_i the shrunk running
247
- * mean after observation i. */
248
- varSum: number;
249
- }
250
- interface EProcess {
251
- /** Consume one observation x ∈ [0,1]. Throws on non-finite / out-of-range
252
- * input — a silent clamp would corrupt the type-I guarantee. */
253
- update(x: number): EProcessStep;
254
- state(): EProcessState;
255
- }
256
- /**
257
- * Betting test-martingale for bounded observations — the e-process core of
258
- * anytime-valid sequential testing (Waudby-Smith & Ramdas, "Estimating means
259
- * of bounded random variables by betting", JRSS-B 2024).
260
- *
261
- * Observations x_i ∈ [0,1]; H0: E[x] ≤ m₀ (`nullMean`, default 1/2). Wealth
262
- *
263
- * W_t = Π_{i≤t} (1 + λ_i (x_i − m₀)), W_0 = 1
264
- *
265
- * with the truncated GROW-style plug-in bet computed from PRIOR observations:
266
- *
267
- * λ_i = clamp((μ̂_{i−1} − m₀) / (σ̂²_{i−1} + (μ̂_{i−1} − m₀)²), 0, maxBet)
268
- *
269
- * where μ̂/σ̂² are the shrunk running estimates μ̂_t = (1/2 + Σx_i)/(t+1),
270
- * σ̂²_t = (1/4 + Σ(x_i − μ̂_i)²)/(t+1).
271
- *
272
- * PREDICTABILITY INVARIANT (load-bearing): λ_i is a function of x_1..x_{i−1}
273
- * ONLY — it may never see x_i. With λ_i ≥ 0 predictable, each factor has
274
- * E[1 + λ_i(x_i − m₀) | past] ≤ 1 under H0, so W is a nonnegative
275
- * supermartingale and Ville's inequality gives P(∃t: W_t ≥ 1/α) ≤ α — the
276
- * type-I guarantee holds at ANY data-dependent stopping time. λ_1 is always 0
277
- * (no prior evidence), so the first observation never moves wealth.
278
- *
279
- * `decided` latches at the first crossing W_t ≥ 1/α and never un-latches;
280
- * wealth keeps updating after the crossing (the e-process remains valid), but
281
- * the decision time is the first crossing.
282
- */
283
- declare function eProcess(opts?: EProcessOptions): EProcess;
284
8
  declare const reservationSchema: z.ZodObject<{
285
9
  requestId: z.ZodString;
286
10
  claimDigest: z.ZodString;
@@ -1272,5 +996,5 @@ declare function dimensionRegressions(candidate: Map<string, Record<string, Judg
1272
996
  independentUnitByScenarioId?: ReadonlyMap<string, string>;
1273
997
  minProductiveRuns?: number;
1274
998
  }): DimensionRegression[];
1275
- export { paretoPolicy as $, PairRunRecordsResult as A, EProcess as At, ArmPopulationSummary as B, mcnemar as Bt, signManifest as C, FinalEvidenceError as Ct, MatchedRunRecordPair as D, FinalEvidenceRecord as Dt, MatchedPair as E, FinalEvidenceOutcome as Et, comparePairedArms as F, ExactRiskDifferenceResult as Ft, AxisVerdict as G, wilson as Gt, PowerPreflightOptions as H, pairedRiskDifferenceExact as Ht, pairArms as I, McNemarResult as It, ObjectiveSource as J, BuildEvidenceVectorOptions as K, pairRunRecords as L, ProportionInterval as Lt, PairedArmsComparison as M, EProcessState as Mt, PairedCorrectness as N, EProcessStep as Nt, PairArmsOptions as O, FinalEvidenceReservation as Ot, PairedMetricDelta as P, eProcess as Pt, buildEvidenceVector as Q, ArmAssignment as R, RiskDifferenceResult as Rt, manifestContentDigest as S, FinalEvidenceConflictError as St, ComparePairedArmsOptions as T, FinalEvidenceMeasurement as Tt, powerPreflight as U, pairedRiskDifferenceScore as Ut, PowerPreflight as V, pairedRiskDifference as Vt, AxisEvidence as W, passAtK as Wt, PromotionObjective as X, ParetoSignificanceGateOptions as Y, PromotionPolicy as Z, HypothesisManifest as _, AttestationProvenance as _t, dimensionRegressions as a, CampaignEvidenceContext as at, SignedManifestAlgo as b, attest as bt, SequentialDecideFn as c, EvidenceAuthority as ct, SequentialObservation as d, EvidenceReceipt as dt, paretoSignificanceGate as et, SequentialPairedGate as f, EvidenceReceiptVerification as ft, sequentialPairedGate as g, ATTESTATION_ALGORITHM as gt, sequentialDecide as h, verifyEvidenceReceipt as ht, PairedHoldout as i, paretoFrontier as it, PairedArmRow as j, EProcessOptions as jt, PairArmsResult as k, openFinalEvidenceLedger as kt, SequentialDecideOptions as l, EvidenceAuthorityKind as lt, SequentialStreamState as m, isIndependentEvidence as mt, HeldoutSignificance as n, ParetoResult as nt, heldoutSignificance as o, createCampaignEvidenceReceipt as ot, SequentialPairedGateOptions as p, createEvidenceReceipt as pt, EvidenceVector as q, HeldoutSignificanceOptions as r, dominates as rt, pairHoldout as s, CreateEvidenceReceiptInput as st, DimensionRegression as t, Objective as tt, SequentialGateDecision as u, EvidenceBinding as ut, HypothesisResult as v, AttestationVerification as vt, verifyManifest as w, FinalEvidenceLedger as wt, hashJson as x, verifyAttestation as xt, SignedManifest as y, AttestedReport as yt, ArmPopulationReading as z, ScoreRiskDifferenceResult as zt };
1276
- //# sourceMappingURL=statistical-heldout-C-tgpUuu.d.ts.map
999
+ export { paretoPolicy as $, PairRunRecordsResult as A, ArmPopulationSummary as B, signManifest as C, FinalEvidenceError as Ct, MatchedRunRecordPair as D, FinalEvidenceRecord as Dt, MatchedPair as E, FinalEvidenceOutcome as Et, comparePairedArms as F, AxisVerdict as G, PowerPreflightOptions as H, pairArms as I, ObjectiveSource as J, BuildEvidenceVectorOptions as K, pairRunRecords as L, PairedArmsComparison as M, PairedCorrectness as N, PairArmsOptions as O, FinalEvidenceReservation as Ot, PairedMetricDelta as P, buildEvidenceVector as Q, ArmAssignment as R, manifestContentDigest as S, FinalEvidenceConflictError as St, ComparePairedArmsOptions as T, FinalEvidenceMeasurement as Tt, powerPreflight as U, PowerPreflight as V, AxisEvidence as W, PromotionObjective as X, ParetoSignificanceGateOptions as Y, PromotionPolicy as Z, HypothesisManifest as _, AttestationProvenance as _t, dimensionRegressions as a, CampaignEvidenceContext as at, SignedManifestAlgo as b, attest as bt, SequentialDecideFn as c, EvidenceAuthority as ct, SequentialObservation as d, EvidenceReceipt as dt, paretoSignificanceGate as et, SequentialPairedGate as f, EvidenceReceiptVerification as ft, sequentialPairedGate as g, ATTESTATION_ALGORITHM as gt, sequentialDecide as h, verifyEvidenceReceipt as ht, PairedHoldout as i, paretoFrontier as it, PairedArmRow as j, PairArmsResult as k, openFinalEvidenceLedger as kt, SequentialDecideOptions as l, EvidenceAuthorityKind as lt, SequentialStreamState as m, isIndependentEvidence as mt, HeldoutSignificance as n, ParetoResult as nt, heldoutSignificance as o, createCampaignEvidenceReceipt as ot, SequentialPairedGateOptions as p, createEvidenceReceipt as pt, EvidenceVector as q, HeldoutSignificanceOptions as r, dominates as rt, pairHoldout as s, CreateEvidenceReceiptInput as st, DimensionRegression as t, Objective as tt, SequentialGateDecision as u, EvidenceBinding as ut, HypothesisResult as v, AttestationVerification as vt, verifyManifest as w, FinalEvidenceLedger as wt, hashJson as x, verifyAttestation as xt, SignedManifest as y, AttestedReport as yt, ArmPopulationReading as z };
1000
+ //# sourceMappingURL=statistical-heldout-CvOwNqt9.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistical-heldout-CvOwNqt9.d.ts","names":["_$__evidence_receipt0.EvidenceReceipt"],"sources":["../src/experiment/final-evidence.ts","../src/attestation.ts","../src/experiment/evidence-receipt.ts","../src/experiment/campaign-evidence.ts","../src/pareto.ts","../src/campaign/gates/promotion-policy.ts","../src/campaign/gates/power-preflight.ts","../src/arm-populations.ts","../src/paired-arms.ts","../src/pre-registration.ts","../src/campaign/gates/sequential.ts","../src/campaign/gates/statistical-heldout.ts"],"mappings":";;;;;;;cASM,mBAAiB,EAAA;;;;;;GAQZ,EAAA,KAAA;;KAGC,2BAA2B,EAAE,aAAa;cAEhD,mBAAiB,EAAA;;;GAKZ,EAAA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"./paired-promotion-decision-CiueaTTj.js";
1
+ import { p as pairedBootstrap } from "./statistics-CvvC-MPv.js";
2
+ import { t as decidePairedPromotion } from "./paired-promotion-decision-Bi9__RQS.js";
3
3
  // src/campaign/gates/statistical-heldout.ts
4
4
  /**
5
5
  * Held-out inference pairs execution cells and judge identities before taking
@@ -252,4 +252,4 @@ function dimensionRegressions(candidate, baseline, scenarioIds, criticalDimensio
252
252
  }
253
253
  export { heldoutSignificance as a, dimensionRegressions as i, aggregatePairedHoldout as n, pairHoldout as o, detectScale as r, TIE_WARN_FRACTION as t };
254
254
 
255
- //# sourceMappingURL=statistical-heldout-NBxC7jGo.js.map
255
+ //# sourceMappingURL=statistical-heldout-DLO4Ebos.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"statistical-heldout-NBxC7jGo.js","names":[],"sources":["../src/campaign/gates/statistical-heldout.ts"],"sourcesContent":["/**\n * Held-out inference pairs execution cells and judge identities before taking\n * means within registered independent units. Repetitions can improve a unit's\n * precision without increasing n. Ungrouped inference concerns independently\n * sampled execution cells conditional on a fixed scenario roster.\n *\n * The shared paired decision rule selects the estimator and statistical test.\n * Dimension reports retain missing coverage so required safety checks cannot\n * pass through absent evidence. Thresholds use the judge's native score scale.\n */\n\nimport {\n decidePairedPromotion,\n type PairedDecisionMethod,\n type PairedDecisionStatistic,\n type PairedMcNemarEvidence,\n type PairedPromotionDecision,\n} from '../../paired-promotion-decision'\nimport {\n DECISION_PAIRED_DELTA_STATISTIC,\n type PairedBootstrapResult,\n pairedBootstrap,\n} from '../../statistics'\nimport type { JudgeScore } from '../types'\n\n/** Tie fraction at/above which a gate annotates its verdict with the tie share.\n * Tie-domination of the median bites structurally at >= 0.5 (the median is then\n * 0 by construction); 0.4 is a softer warn threshold that flags a run APPROACHING\n * that regime, so an operator sees it before the median goes fully blind. */\nexport const TIE_WARN_FRACTION = 0.4\n\nexport interface PairedHoldout {\n /** Baseline scalar per paired cell (same order as `after`/`cellIds`). */\n before: number[]\n /** Candidate scalar per paired cell. */\n after: number[]\n /** The full cellIds (`scenario:rep`) that paired, in order. */\n cellIds: string[]\n}\n\n/** Campaign cell IDs append a numeric repetition after the scenario's full ID. */\nfunction scenarioIdFromCellId(cellId: string): string {\n const separator = cellId.lastIndexOf(':')\n const repetition = cellId.slice(separator + 1)\n if (\n separator < 1 ||\n cellId.trim() !== cellId ||\n !/^(0|[1-9]\\d*)$/.test(repetition) ||\n !Number.isSafeInteger(Number(repetition))\n ) {\n throw new Error(`pairHoldout: malformed cellId '${cellId}'; expected scenarioId:rep`)\n }\n return cellId.slice(0, separator)\n}\n\n/** Preserve cell pairing before taking equal-weight independent-unit means. */\nexport function aggregatePairedHoldout(\n paired: PairedHoldout,\n independentUnitByScenarioId?: ReadonlyMap<string, string>,\n): { before: number[]; after: number[]; unitIds: string[] } {\n if (\n paired.before.length !== paired.after.length ||\n paired.before.length !== paired.cellIds.length\n ) {\n throw new Error('aggregatePairedHoldout: scores and cellIds must have the same length')\n }\n if (new Set(paired.cellIds).size !== paired.cellIds.length) {\n throw new Error('aggregatePairedHoldout: duplicate cellIds cannot count as new observations')\n }\n if (\n paired.before.some((value) => !Number.isFinite(value)) ||\n paired.after.some((value) => !Number.isFinite(value))\n ) {\n throw new Error('aggregatePairedHoldout: paired scores must be finite')\n }\n if (independentUnitByScenarioId === undefined) {\n return { before: [...paired.before], after: [...paired.after], unitIds: [...paired.cellIds] }\n }\n const scenarioIds = paired.cellIds.map(scenarioIdFromCellId)\n const groups = new Map<string, { before: number; after: number; n: number }>()\n for (let i = 0; i < paired.cellIds.length; i++) {\n const scenarioId = scenarioIds[i]!\n const unitId = independentUnitByScenarioId.get(scenarioId)\n if (typeof unitId !== 'string' || unitId.length === 0 || unitId.trim() !== unitId) {\n throw new Error(\n `aggregatePairedHoldout: missing independent unit for scenario '${scenarioId}'`,\n )\n }\n const group = groups.get(unitId) ?? { before: 0, after: 0, n: 0 }\n group.before += paired.before[i]!\n group.after += paired.after[i]!\n group.n += 1\n groups.set(unitId, group)\n }\n const unitIds = [...groups.keys()].sort()\n return {\n before: unitIds.map((id) => groups.get(id)!.before / groups.get(id)!.n),\n after: unitIds.map((id) => groups.get(id)!.after / groups.get(id)!.n),\n unitIds,\n }\n}\n\n/**\n * Pair candidate vs baseline holdout observations by FULL cellId. `select`\n * pulls the scalar from a cell's judge reports (composite, or a named\n * dimension); a cell contributes the mean of `select` across its judges. Cells\n * whose scenario is not in `scenarioIds`, or where `select` is undefined for\n * every judge on both sides, are skipped. The selected judge IDs must agree\n * within each pair. Throws when the two maps disagree on holdout cell IDs — a\n * load-bearing invariant: the baseline + winner holdout campaigns run the same\n * scenarios with the same seed base, so their cellIds MUST align; a mismatch\n * means a silent pairing bug, not a soft fallback.\n */\nexport function pairHoldout(\n candidate: Map<string, Record<string, JudgeScore>>,\n baseline: Map<string, Record<string, JudgeScore>>,\n scenarioIds: Set<string>,\n select: (s: JudgeScore) => number | undefined,\n): PairedHoldout {\n const cellValues = (\n byCell: Map<string, Record<string, JudgeScore>>,\n cellId: string,\n ): Map<string, number> => {\n const scores = byCell.get(cellId)\n const values = new Map<string, number>()\n if (!scores) return values\n for (const [judgeId, s] of Object.entries(scores)) {\n if (s.failed === true) {\n throw new Error(`pairHoldout: cell '${cellId}' contains a failed judge score`)\n }\n const v = select(s)\n if (typeof v === 'number' && !Number.isFinite(v)) {\n throw new Error(`pairHoldout: cell '${cellId}' contains a non-finite selected score`)\n }\n if (typeof v === 'number') values.set(judgeId, v)\n }\n return values\n }\n\n const inScope = (cellId: string) => scenarioIds.has(scenarioIdFromCellId(cellId))\n const candCells = [...candidate.keys()].filter(inScope).sort()\n const baseCells = [...baseline.keys()].filter(inScope).sort()\n // Alignment invariant — the holdout campaigns share scenarios + seed, so the\n // cell sets must be identical. Differ ⇒ a real pairing bug; fail loud.\n if (candCells.length !== baseCells.length || candCells.some((c, i) => c !== baseCells[i])) {\n throw new Error(\n `pairHoldout: candidate/baseline holdout cells do not align — ` +\n `candidate=[${candCells.join(',')}] baseline=[${baseCells.join(',')}]. ` +\n `Both holdout campaigns must run the same scenarios with the same seed base.`,\n )\n }\n\n const before: number[] = []\n const after: number[] = []\n const cellIds: string[] = []\n for (const cellId of candCells) {\n const b = cellValues(baseline, cellId)\n const a = cellValues(candidate, cellId)\n // A scalar absent on both sides means that dimension was not scored. A\n // one-sided absence is asymmetric evidence loss, never a row to discard.\n if (b.size === 0 && a.size === 0) continue\n if (b.size === 0 || a.size === 0) {\n throw new Error(`pairHoldout: cell '${cellId}' has a selected score on only one arm`)\n }\n if (b.size !== a.size || [...b.keys()].some((id) => !a.has(id))) {\n throw new Error(`pairHoldout: cell '${cellId}' selected judge IDs do not align`)\n }\n const judgeIds = [...b.keys()].sort()\n before.push(meanSelectedScores(judgeIds.map((id) => b.get(id)!)))\n after.push(meanSelectedScores(judgeIds.map((id) => a.get(id)!)))\n cellIds.push(cellId)\n }\n return { before, after, cellIds }\n}\n\nfunction meanSelectedScores(values: number[]): number {\n const first = values[0]!\n // Summing identical fractional scores can round their mean outside the\n // declared binary support. An agreeing judge set preserves its exact value.\n return values.every((value) => value === first)\n ? first\n : values.reduce((sum, value) => sum + value, 0) / values.length\n}\n\nexport interface HeldoutSignificance {\n paired: PairedHoldout\n /**\n * The paired bootstrap on the requested statistic (MEAN by default — see the\n * tie note on `heldoutSignificance`).\n *\n * DIAGNOSTIC, not necessarily the interval the verdict keyed on. On a\n * two-point (pass/fail) outcome the decision routes to Tango's score interval\n * instead, because a percentile bootstrap of the mean over a three-atom\n * lattice is not a valid interval at a nonzero margin. Read\n * `decision.low`/`decision.high` for the interval that actually decided, and\n * `decisionStatistic` for which one it is.\n */\n bootstrap: PairedBootstrapResult\n /** The MEDIAN paired-delta bootstrap, reported as a diagnostic. When many\n * scenarios are tied (both sides solve them), the median is pinned near 0\n * regardless of the mean lift — comparing the two exposes tie-domination. */\n medianBootstrap: PairedBootstrapResult\n /**\n * The full promotion decision: which estimator the outcome's shape admits,\n * the interval it produced, McNemar's exact veto on the two-point path, and\n * whether the interval was zero-width (no evidence in either direction). The\n * single source of `significant`.\n */\n decision: PairedPromotionDecision\n /** Which paired estimator the verdict was decided on. */\n decisionStatistic: PairedDecisionStatistic\n /** McNemar's exact evidence on the two-point path; null otherwise. */\n mcnemar: PairedMcNemarEvidence | null\n /** Fraction of paired observations that are exact ties (|delta| < 1e-9). A\n * high tie fraction is WHY a median-based gate would have missed a real lift;\n * it is the observability the tie fix adds. */\n tieFraction: number\n /** Number of paired observation units, after configured aggregation. */\n n: number\n /** Original matched execution cells, before aggregation. */\n pairedCellN: number\n observationUnit: 'registered' | 'cell'\n /** Registered unit IDs, or cell IDs on the ungrouped path. */\n unitIds: string[]\n /** Effective minimum for the requested target and chosen estimator. */\n minimumRequired: number\n /** Statistical method that carried the decision. */\n decisionMethod: PairedDecisionMethod\n /** Exact one-sided p-value on the small-sample path; otherwise null. */\n pValue: number | null\n /** True iff n >= minimumRequired, the DECIDING interval has nonzero width,\n * its lower bound clears the threshold, and McNemar's exact test does not\n * veto at a non-negative threshold. */\n significant: boolean\n /** Set when n < minimumRequired — too little evidence to claim significance. */\n fewRuns: boolean\n}\n\nexport interface HeldoutSignificanceOptions {\n deltaThreshold?: number\n minProductiveRuns?: number\n confidence?: number\n resamples?: number\n /** Fixed by default for a deterministic, reproducible gate verdict. */\n seed?: number\n statistic?: 'mean' | 'median'\n /** Group full cell pairs into equal-weight independent units before inference. */\n independentUnitByScenarioId?: ReadonlyMap<string, string>\n}\n\n/**\n * Significance of the held-out composite lift: ship only when the lower bound\n * of the interval the outcome's shape ADMITS exceeds `deltaThreshold` (default\n * 0 ⇒ \"confidently positive\"). Interpret `deltaThreshold` in the judge's native\n * scale.\n *\n * The decision is delegated whole to {@link decidePairedPromotion}, the one\n * copy of the rule (`src/paired-promotion-decision.ts`), which `HeldOutGate`\n * also calls. That module's header carries the measurements; the short version\n * is three guards a bare `bootstrap.low > threshold` does not have:\n *\n * - a two-point (pass/fail) outcome decides on Tango's SCORE interval, the\n * only paired-binary construction that stays valid at a nonzero margin;\n * - McNemar's exact test VETOES at any non-negative threshold;\n * - a ZERO-WIDTH interval is refused rather than promoted, in either\n * direction — [0,0] clears every negative threshold and [g,g] clears every\n * threshold below g, and both are an absence of evidence, not a result.\n *\n * Measured on this function before those guards landed, at a nominal 5 %:\n * 14.60 % false promotion at n = 40 on a paired-binary noninferiority boundary,\n * and 88.50 % at n = 6 under a bounded asymmetric null whose true mean paired\n * delta is exactly 0.\n *\n * Continuous mean targets require bootstrap eligibility. Explicit median\n * targets can use the exact sign test at its confidence-dependent minimum.\n */\nexport function heldoutSignificance(\n paired: PairedHoldout,\n opts: HeldoutSignificanceOptions = {},\n): HeldoutSignificance {\n const deltaThreshold = opts.deltaThreshold ?? 0\n const confidence = opts.confidence ?? 0.95\n const resamples = opts.resamples ?? 2000\n const seed = opts.seed ?? 1337\n // DEFAULT to the MEAN paired delta, not the median. The median is destroyed by\n // TIES: whenever both baseline and candidate solve a holdout scenario (a common\n // case once the agent is decent — and INCREASINGLY common as you add holdout\n // scenarios for statistical power), that scenario contributes delta 0. When\n // >=50% of paired cells are ties the median is pinned at 0 regardless of a large,\n // consistent lift on the rest, and the gate holds a genuinely better candidate.\n // (Measured live, supervisor-lab run 6: 40 cells, 20 ties, MEAN +0.177, MEDIAN 0\n // → false hold. Doubling the holdout for \"power\" made it WORSE by adding ties.)\n // The mean equals the reported aggregate lift, ties correctly contribute 0\n // without dominating, and it is the textbook paired-comparison estimator; the\n // median is kept as a reported diagnostic. Callers wanting outlier-robustness at\n // the cost of tie-blindness can still pass `statistic: 'median'`.\n const statistic = opts.statistic ?? 'mean'\n const observations = aggregatePairedHoldout(paired, opts.independentUnitByScenarioId)\n const decision = decidePairedPromotion(observations.before, observations.after, {\n confidence,\n resamples,\n statistic,\n seed,\n threshold: deltaThreshold,\n minPairs: opts.minProductiveRuns,\n })\n // `decision.bootstrap` is null exactly when the score interval decided, so\n // the requested-statistic bootstrap is computed here for the diagnostic\n // field. Same two bootstraps as before on every path.\n const bootstrap =\n decision.bootstrap ??\n pairedBootstrap(observations.before, observations.after, {\n confidence,\n resamples,\n statistic,\n seed,\n })\n const medianBootstrap =\n statistic === 'median'\n ? bootstrap\n : pairedBootstrap(observations.before, observations.after, {\n confidence,\n resamples,\n statistic: 'median',\n seed,\n })\n const n = observations.before.length\n let ties = 0\n for (let i = 0; i < n; i += 1) {\n const after = observations.after[i]!\n const before = observations.before[i]!\n if (Math.abs(after - before) < 1e-9) ties += 1\n }\n const tieFraction = n === 0 ? 0 : ties / n\n return {\n paired,\n bootstrap,\n medianBootstrap,\n decision,\n decisionStatistic: decision.statistic,\n mcnemar: decision.mcnemar,\n tieFraction,\n n,\n pairedCellN: paired.cellIds.length,\n observationUnit: opts.independentUnitByScenarioId === undefined ? 'cell' : 'registered',\n unitIds: observations.unitIds,\n minimumRequired: decision.minimumPairs,\n decisionMethod: decision.method,\n pValue: decision.pValue,\n significant: decision.promote,\n fewRuns: !decision.sufficient,\n }\n}\n\nexport interface DimensionRegression {\n dimension: string\n /** Paired bootstrap on (candidate − baseline). DIAGNOSTIC on a pass/fail\n * dimension, where `ci` carries the interval that decided instead. */\n bootstrap: PairedBootstrapResult\n /** Which paired statistic `bootstrap.low` is the lower bound of. `'mean'`\n * unless the caller asked for the median. `bootstrap.median` still carries\n * the median point estimate either way. */\n bootstrapStatistic: 'median' | 'mean'\n /** The interval `regressed` was decided on, in the dimension's native units. */\n ci: { low: number; high: number }\n /** Which estimator produced `ci`. */\n decisionStatistic: PairedDecisionStatistic\n /** McNemar's exact evidence on a pass/fail dimension; null otherwise. */\n mcnemar: PairedMcNemarEvidence | null\n /** `ci` has zero width — no evidence in either direction. */\n indeterminate: boolean\n /** The bootstrap lower bound is below negative tolerance, or the shared\n * paired test supports a drop exceeding tolerance. Missing coverage and\n * insufficient observations are reported separately. */\n regressed: boolean\n tolerance: number\n n: number\n pairedCellN: number\n observationUnit: 'registered' | 'cell'\n /** Statistical minimum for the configured independent observation unit. */\n minimumRequired: number\n fewRuns: boolean\n /** Both arms lack this dimension on these otherwise matched execution cells. */\n missingCellIds: string[]\n /** Configured scenarios with no paired dimension measurement at all. */\n missingScenarioIds: string[]\n}\n\n/** Detect the native scale of a set of scores: 0-100 when any magnitude clears\n * 1.5, else [0,1]. Used to auto-scale the regression tolerance so a default\n * expressed for [0,1] is not silently a no-op on a 0-100 dimension. */\nexport function detectScale(values: number[]): 1 | 100 {\n return values.some((v) => Math.abs(v) > 1.5) ? 100 : 1\n}\n\n/**\n * Report required-dimension evidence after full pairing and optional unit means.\n * A bootstrap floor breach or a shared paired test supporting a drop marks\n * regression. These two criteria are distinct; `ci` records the shared\n * estimator and `bootstrap` records the floor interval. Missing observations\n * and insufficient n remain explicit for the caller's evidence policy.\n * The default tolerance is 0.05 on [0,1] and 5 on a detected 0-100 scale.\n */\nexport function dimensionRegressions(\n candidate: Map<string, Record<string, JudgeScore>>,\n baseline: Map<string, Record<string, JudgeScore>>,\n scenarioIds: Set<string>,\n criticalDimensions: string[],\n opts: {\n tolerance?: number\n confidence?: number\n resamples?: number\n seed?: number\n /** Paired statistic the CI is computed on. Default `'mean'` — see\n * {@link DECISION_PAIRED_DELTA_STATISTIC} for why the median is not. */\n statistic?: 'mean' | 'median'\n independentUnitByScenarioId?: ReadonlyMap<string, string>\n minProductiveRuns?: number\n } = {},\n): DimensionRegression[] {\n const out: DimensionRegression[] = []\n const expectedCellIds = [...baseline.keys()]\n .filter((cellId) => scenarioIds.has(scenarioIdFromCellId(cellId)))\n .sort()\n for (const dim of criticalDimensions) {\n const paired = pairHoldout(candidate, baseline, scenarioIds, (s) => s.dimensions[dim])\n if (paired.before.length === 0) continue // dimension not scored on this judge\n const observations = aggregatePairedHoldout(paired, opts.independentUnitByScenarioId)\n const measuredCells = new Set(paired.cellIds)\n const measuredScenarios = new Set(paired.cellIds.map(scenarioIdFromCellId))\n const tolerance = opts.tolerance ?? 0.05 * detectScale([...paired.before, ...paired.after])\n const bootstrapStatistic = opts.statistic ?? DECISION_PAIRED_DELTA_STATISTIC\n const shared = {\n confidence: opts.confidence ?? 0.95,\n resamples: opts.resamples ?? 2000,\n statistic: bootstrapStatistic,\n seed: opts.seed ?? 1337,\n minPairs: opts.minProductiveRuns,\n }\n const guard = decidePairedPromotion(observations.before, observations.after, shared)\n const regression = decidePairedPromotion(observations.after, observations.before, {\n ...shared,\n threshold: tolerance,\n })\n const bootstrap =\n guard.bootstrap ?? pairedBootstrap(observations.before, observations.after, shared)\n out.push({\n dimension: dim,\n bootstrap,\n bootstrapStatistic,\n ci: { low: guard.low, high: guard.high },\n decisionStatistic: guard.statistic,\n mcnemar: guard.mcnemar,\n indeterminate: guard.indeterminate,\n // Fires on EITHER burden of proof — see `floorBreached` in\n // `promotion-policy.ts` for the same rule and the reasoning. The CI arm\n // is the contract this interface and `default-production-gate`'s reason\n // string both state (\"CI.low < -tolerance\"), read off the DECIDING\n // interval; the exact-test arm adds the small-sample path where the\n // bootstrap interval is descriptive only.\n // The credible-worst-case arm stays on the BOOTSTRAP — see the same\n // decision in `floorBreached` (`promotion-policy.ts`). On a pass/fail\n // dimension the score interval is ±z²/(n+z²) even when every pair is\n // concordant, so reading the floor off it would flag an unchanged safety\n // dimension as regressed at any realistic n. The PROVEN-drop arm does use\n // the shared rule, which is what closes the fail-open hole that mattered:\n // a genuine pass/fail regression is now judged on an interval valid at\n // the nonzero `tolerance`, instead of a bootstrap that is pinned wherever\n // ties dominate.\n regressed: bootstrap.low < -tolerance || regression.promote,\n tolerance,\n n: observations.before.length,\n pairedCellN: paired.cellIds.length,\n observationUnit: opts.independentUnitByScenarioId === undefined ? 'cell' : 'registered',\n minimumRequired: guard.minimumPairs,\n fewRuns: !guard.sufficient,\n missingCellIds: expectedCellIds.filter((cellId) => !measuredCells.has(cellId)),\n missingScenarioIds: [...scenarioIds].filter((id) => !measuredScenarios.has(id)).sort(),\n })\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,MAAa,oBAAoB;;AAYjC,SAAS,qBA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AChB,gBAAgB,gBAAgB,QAAQ,WAAW,CAAC,cAAc,IAAI,MAAM,CAAC;GAC7E,oBAAoB,CAAC,GAAG,WAAW,CAAC,CAAC,QAAQ,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK;EACvF,CAAC;CACH;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"statistical-heldout-DLO4Ebos.js","names":[],"sources":["../src/campaign/gates/statistical-heldout.ts"],"sourcesContent":["/**\n * Held-out inference pairs execution cells and judge identities before taking\n * means within registered independent units. Repetitions can improve a unit's\n * precision without increasing n. Ungrouped inference concerns independently\n * sampled execution cells conditional on a fixed scenario roster.\n *\n * The shared paired decision rule selects the estimator and statistical test.\n * Dimension reports retain missing coverage so required safety checks cannot\n * pass through absent evidence. Thresholds use the judge's native score scale.\n */\n\nimport {\n decidePairedPromotion,\n type PairedDecisionMethod,\n type PairedDecisionStatistic,\n type PairedMcNemarEvidence,\n type PairedPromotionDecision,\n} from '../../paired-promotion-decision'\nimport {\n DECISION_PAIRED_DELTA_STATISTIC,\n type PairedBootstrapResult,\n pairedBootstrap,\n} from '../../statistics'\nimport type { JudgeScore } from '../types'\n\n/** Tie fraction at/above which a gate annotates its verdict with the tie share.\n * Tie-domination of the median bites structurally at >= 0.5 (the median is then\n * 0 by construction); 0.4 is a softer warn threshold that flags a run APPROACHING\n * that regime, so an operator sees it before the median goes fully blind. */\nexport const TIE_WARN_FRACTION = 0.4\n\nexport interface PairedHoldout {\n /** Baseline scalar per paired cell (same order as `after`/`cellIds`). */\n before: number[]\n /** Candidate scalar per paired cell. */\n after: number[]\n /** The full cellIds (`scenario:rep`) that paired, in order. */\n cellIds: string[]\n}\n\n/** Campaign cell IDs append a numeric repetition after the scenario's full ID. */\nfunction scenarioIdFromCellId(cellId: string): string {\n const separator = cellId.lastIndexOf(':')\n const repetition = cellId.slice(separator + 1)\n if (\n separator < 1 ||\n cellId.trim() !== cellId ||\n !/^(0|[1-9]\\d*)$/.test(repetition) ||\n !Number.isSafeInteger(Number(repetition))\n ) {\n throw new Error(`pairHoldout: malformed cellId '${cellId}'; expected scenarioId:rep`)\n }\n return cellId.slice(0, separator)\n}\n\n/** Preserve cell pairing before taking equal-weight independent-unit means. */\nexport function aggregatePairedHoldout(\n paired: PairedHoldout,\n independentUnitByScenarioId?: ReadonlyMap<string, string>,\n): { before: number[]; after: number[]; unitIds: string[] } {\n if (\n paired.before.length !== paired.after.length ||\n paired.before.length !== paired.cellIds.length\n ) {\n throw new Error('aggregatePairedHoldout: scores and cellIds must have the same length')\n }\n if (new Set(paired.cellIds).size !== paired.cellIds.length) {\n throw new Error('aggregatePairedHoldout: duplicate cellIds cannot count as new observations')\n }\n if (\n paired.before.some((value) => !Number.isFinite(value)) ||\n paired.after.some((value) => !Number.isFinite(value))\n ) {\n throw new Error('aggregatePairedHoldout: paired scores must be finite')\n }\n if (independentUnitByScenarioId === undefined) {\n return { before: [...paired.before], after: [...paired.after], unitIds: [...paired.cellIds] }\n }\n const scenarioIds = paired.cellIds.map(scenarioIdFromCellId)\n const groups = new Map<string, { before: number; after: number; n: number }>()\n for (let i = 0; i < paired.cellIds.length; i++) {\n const scenarioId = scenarioIds[i]!\n const unitId = independentUnitByScenarioId.get(scenarioId)\n if (typeof unitId !== 'string' || unitId.length === 0 || unitId.trim() !== unitId) {\n throw new Error(\n `aggregatePairedHoldout: missing independent unit for scenario '${scenarioId}'`,\n )\n }\n const group = groups.get(unitId) ?? { before: 0, after: 0, n: 0 }\n group.before += paired.before[i]!\n group.after += paired.after[i]!\n group.n += 1\n groups.set(unitId, group)\n }\n const unitIds = [...groups.keys()].sort()\n return {\n before: unitIds.map((id) => groups.get(id)!.before / groups.get(id)!.n),\n after: unitIds.map((id) => groups.get(id)!.after / groups.get(id)!.n),\n unitIds,\n }\n}\n\n/**\n * Pair candidate vs baseline holdout observations by FULL cellId. `select`\n * pulls the scalar from a cell's judge reports (composite, or a named\n * dimension); a cell contributes the mean of `select` across its judges. Cells\n * whose scenario is not in `scenarioIds`, or where `select` is undefined for\n * every judge on both sides, are skipped. The selected judge IDs must agree\n * within each pair. Throws when the two maps disagree on holdout cell IDs — a\n * load-bearing invariant: the baseline + winner holdout campaigns run the same\n * scenarios with the same seed base, so their cellIds MUST align; a mismatch\n * means a silent pairing bug, not a soft fallback.\n */\nexport function pairHoldout(\n candidate: Map<string, Record<string, JudgeScore>>,\n baseline: Map<string, Record<string, JudgeScore>>,\n scenarioIds: Set<string>,\n select: (s: JudgeScore) => number | undefined,\n): PairedHoldout {\n const cellValues = (\n byCell: Map<string, Record<string, JudgeScore>>,\n cellId: string,\n ): Map<string, number> => {\n const scores = byCell.get(cellId)\n const values = new Map<string, number>()\n if (!scores) return values\n for (const [judgeId, s] of Object.entries(scores)) {\n if (s.failed === true) {\n throw new Error(`pairHoldout: cell '${cellId}' contains a failed judge score`)\n }\n const v = select(s)\n if (typeof v === 'number' && !Number.isFinite(v)) {\n throw new Error(`pairHoldout: cell '${cellId}' contains a non-finite selected score`)\n }\n if (typeof v === 'number') values.set(judgeId, v)\n }\n return values\n }\n\n const inScope = (cellId: string) => scenarioIds.has(scenarioIdFromCellId(cellId))\n const candCells = [...candidate.keys()].filter(inScope).sort()\n const baseCells = [...baseline.keys()].filter(inScope).sort()\n // Alignment invariant — the holdout campaigns share scenarios + seed, so the\n // cell sets must be identical. Differ ⇒ a real pairing bug; fail loud.\n if (candCells.length !== baseCells.length || candCells.some((c, i) => c !== baseCells[i])) {\n throw new Error(\n `pairHoldout: candidate/baseline holdout cells do not align — ` +\n `candidate=[${candCells.join(',')}] baseline=[${baseCells.join(',')}]. ` +\n `Both holdout campaigns must run the same scenarios with the same seed base.`,\n )\n }\n\n const before: number[] = []\n const after: number[] = []\n const cellIds: string[] = []\n for (const cellId of candCells) {\n const b = cellValues(baseline, cellId)\n const a = cellValues(candidate, cellId)\n // A scalar absent on both sides means that dimension was not scored. A\n // one-sided absence is asymmetric evidence loss, never a row to discard.\n if (b.size === 0 && a.size === 0) continue\n if (b.size === 0 || a.size === 0) {\n throw new Error(`pairHoldout: cell '${cellId}' has a selected score on only one arm`)\n }\n if (b.size !== a.size || [...b.keys()].some((id) => !a.has(id))) {\n throw new Error(`pairHoldout: cell '${cellId}' selected judge IDs do not align`)\n }\n const judgeIds = [...b.keys()].sort()\n before.push(meanSelectedScores(judgeIds.map((id) => b.get(id)!)))\n after.push(meanSelectedScores(judgeIds.map((id) => a.get(id)!)))\n cellIds.push(cellId)\n }\n return { before, after, cellIds }\n}\n\nfunction meanSelectedScores(values: number[]): number {\n const first = values[0]!\n // Summing identical fractional scores can round their mean outside the\n // declared binary support. An agreeing judge set preserves its exact value.\n return values.every((value) => value === first)\n ? first\n : values.reduce((sum, value) => sum + value, 0) / values.length\n}\n\nexport interface HeldoutSignificance {\n paired: PairedHoldout\n /**\n * The paired bootstrap on the requested statistic (MEAN by default — see the\n * tie note on `heldoutSignificance`).\n *\n * DIAGNOSTIC, not necessarily the interval the verdict keyed on. On a\n * two-point (pass/fail) outcome the decision routes to Tango's score interval\n * instead, because a percentile bootstrap of the mean over a three-atom\n * lattice is not a valid interval at a nonzero margin. Read\n * `decision.low`/`decision.high` for the interval that actually decided, and\n * `decisionStatistic` for which one it is.\n */\n bootstrap: PairedBootstrapResult\n /** The MEDIAN paired-delta bootstrap, reported as a diagnostic. When many\n * scenarios are tied (both sides solve them), the median is pinned near 0\n * regardless of the mean lift — comparing the two exposes tie-domination. */\n medianBootstrap: PairedBootstrapResult\n /**\n * The full promotion decision: which estimator the outcome's shape admits,\n * the interval it produced, McNemar's exact veto on the two-point path, and\n * whether the interval was zero-width (no evidence in either direction). The\n * single source of `significant`.\n */\n decision: PairedPromotionDecision\n /** Which paired estimator the verdict was decided on. */\n decisionStatistic: PairedDecisionStatistic\n /** McNemar's exact evidence on the two-point path; null otherwise. */\n mcnemar: PairedMcNemarEvidence | null\n /** Fraction of paired observations that are exact ties (|delta| < 1e-9). A\n * high tie fraction is WHY a median-based gate would have missed a real lift;\n * it is the observability the tie fix adds. */\n tieFraction: number\n /** Number of paired observation units, after configured aggregation. */\n n: number\n /** Original matched execution cells, before aggregation. */\n pairedCellN: number\n observationUnit: 'registered' | 'cell'\n /** Registered unit IDs, or cell IDs on the ungrouped path. */\n unitIds: string[]\n /** Effective minimum for the requested target and chosen estimator. */\n minimumRequired: number\n /** Statistical method that carried the decision. */\n decisionMethod: PairedDecisionMethod\n /** Exact one-sided p-value on the small-sample path; otherwise null. */\n pValue: number | null\n /** True iff n >= minimumRequired, the DECIDING interval has nonzero width,\n * its lower bound clears the threshold, and McNemar's exact test does not\n * veto at a non-negative threshold. */\n significant: boolean\n /** Set when n < minimumRequired — too little evidence to claim significance. */\n fewRuns: boolean\n}\n\nexport interface HeldoutSignificanceOptions {\n deltaThreshold?: number\n minProductiveRuns?: number\n confidence?: number\n resamples?: number\n /** Fixed by default for a deterministic, reproducible gate verdict. */\n seed?: number\n statistic?: 'mean' | 'median'\n /** Group full cell pairs into equal-weight independent units before inference. */\n independentUnitByScenarioId?: ReadonlyMap<string, string>\n}\n\n/**\n * Significance of the held-out composite lift: ship only when the lower bound\n * of the interval the outcome's shape ADMITS exceeds `deltaThreshold` (default\n * 0 ⇒ \"confidently positive\"). Interpret `deltaThreshold` in the judge's native\n * scale.\n *\n * The decision is delegated whole to {@link decidePairedPromotion}, the one\n * copy of the rule (`src/paired-promotion-decision.ts`), which `HeldOutGate`\n * also calls. That module's header carries the measurements; the short version\n * is three guards a bare `bootstrap.low > threshold` does not have:\n *\n * - a two-point (pass/fail) outcome decides on Tango's SCORE interval, the\n * only paired-binary construction that stays valid at a nonzero margin;\n * - McNemar's exact test VETOES at any non-negative threshold;\n * - a ZERO-WIDTH interval is refused rather than promoted, in either\n * direction — [0,0] clears every negative threshold and [g,g] clears every\n * threshold below g, and both are an absence of evidence, not a result.\n *\n * Measured on this function before those guards landed, at a nominal 5 %:\n * 14.60 % false promotion at n = 40 on a paired-binary noninferiority boundary,\n * and 88.50 % at n = 6 under a bounded asymmetric null whose true mean paired\n * delta is exactly 0.\n *\n * Continuous mean targets require bootstrap eligibility. Explicit median\n * targets can use the exact sign test at its confidence-dependent minimum.\n */\nexport function heldoutSignificance(\n paired: PairedHoldout,\n opts: HeldoutSignificanceOptions = {},\n): HeldoutSignificance {\n const deltaThreshold = opts.deltaThreshold ?? 0\n const confidence = opts.confidence ?? 0.95\n const resamples = opts.resamples ?? 2000\n const seed = opts.seed ?? 1337\n // DEFAULT to the MEAN paired delta, not the median. The median is destroyed by\n // TIES: whenever both baseline and candidate solve a holdout scenario (a common\n // case once the agent is decent — and INCREASINGLY common as you add holdout\n // scenarios for statistical power), that scenario contributes delta 0. When\n // >=50% of paired cells are ties the median is pinned at 0 regardless of a large,\n // consistent lift on the rest, and the gate holds a genuinely better candidate.\n // (Measured live, supervisor-lab run 6: 40 cells, 20 ties, MEAN +0.177, MEDIAN 0\n // → false hold. Doubling the holdout for \"power\" made it WORSE by adding ties.)\n // The mean equals the reported aggregate lift, ties correctly contribute 0\n // without dominating, and it is the textbook paired-comparison estimator; the\n // median is kept as a reported diagnostic. Callers wanting outlier-robustness at\n // the cost of tie-blindness can still pass `statistic: 'median'`.\n const statistic = opts.statistic ?? 'mean'\n const observations = aggregatePairedHoldout(paired, opts.independentUnitByScenarioId)\n const decision = decidePairedPromotion(observations.before, observations.after, {\n confidence,\n resamples,\n statistic,\n seed,\n threshold: deltaThreshold,\n minPairs: opts.minProductiveRuns,\n })\n // `decision.bootstrap` is null exactly when the score interval decided, so\n // the requested-statistic bootstrap is computed here for the diagnostic\n // field. Same two bootstraps as before on every path.\n const bootstrap =\n decision.bootstrap ??\n pairedBootstrap(observations.before, observations.after, {\n confidence,\n resamples,\n statistic,\n seed,\n })\n const medianBootstrap =\n statistic === 'median'\n ? bootstrap\n : pairedBootstrap(observations.before, observations.after, {\n confidence,\n resamples,\n statistic: 'median',\n seed,\n })\n const n = observations.before.length\n let ties = 0\n for (let i = 0; i < n; i += 1) {\n const after = observations.after[i]!\n const before = observations.before[i]!\n if (Math.abs(after - before) < 1e-9) ties += 1\n }\n const tieFraction = n === 0 ? 0 : ties / n\n return {\n paired,\n bootstrap,\n medianBootstrap,\n decision,\n decisionStatistic: decision.statistic,\n mcnemar: decision.mcnemar,\n tieFraction,\n n,\n pairedCellN: paired.cellIds.length,\n observationUnit: opts.independentUnitByScenarioId === undefined ? 'cell' : 'registered',\n unitIds: observations.unitIds,\n minimumRequired: decision.minimumPairs,\n decisionMethod: decision.method,\n pValue: decision.pValue,\n significant: decision.promote,\n fewRuns: !decision.sufficient,\n }\n}\n\nexport interface DimensionRegression {\n dimension: string\n /** Paired bootstrap on (candidate − baseline). DIAGNOSTIC on a pass/fail\n * dimension, where `ci` carries the interval that decided instead. */\n bootstrap: PairedBootstrapResult\n /** Which paired statistic `bootstrap.low` is the lower bound of. `'mean'`\n * unless the caller asked for the median. `bootstrap.median` still carries\n * the median point estimate either way. */\n bootstrapStatistic: 'median' | 'mean'\n /** The interval `regressed` was decided on, in the dimension's native units. */\n ci: { low: number; high: number }\n /** Which estimator produced `ci`. */\n decisionStatistic: PairedDecisionStatistic\n /** McNemar's exact evidence on a pass/fail dimension; null otherwise. */\n mcnemar: PairedMcNemarEvidence | null\n /** `ci` has zero width — no evidence in either direction. */\n indeterminate: boolean\n /** The bootstrap lower bound is below negative tolerance, or the shared\n * paired test supports a drop exceeding tolerance. Missing coverage and\n * insufficient observations are reported separately. */\n regressed: boolean\n tolerance: number\n n: number\n pairedCellN: number\n observationUnit: 'registered' | 'cell'\n /** Statistical minimum for the configured independent observation unit. */\n minimumRequired: number\n fewRuns: boolean\n /** Both arms lack this dimension on these otherwise matched execution cells. */\n missingCellIds: string[]\n /** Configured scenarios with no paired dimension measurement at all. */\n missingScenarioIds: string[]\n}\n\n/** Detect the native scale of a set of scores: 0-100 when any magnitude clears\n * 1.5, else [0,1]. Used to auto-scale the regression tolerance so a default\n * expressed for [0,1] is not silently a no-op on a 0-100 dimension. */\nexport function detectScale(values: number[]): 1 | 100 {\n return values.some((v) => Math.abs(v) > 1.5) ? 100 : 1\n}\n\n/**\n * Report required-dimension evidence after full pairing and optional unit means.\n * A bootstrap floor breach or a shared paired test supporting a drop marks\n * regression. These two criteria are distinct; `ci` records the shared\n * estimator and `bootstrap` records the floor interval. Missing observations\n * and insufficient n remain explicit for the caller's evidence policy.\n * The default tolerance is 0.05 on [0,1] and 5 on a detected 0-100 scale.\n */\nexport function dimensionRegressions(\n candidate: Map<string, Record<string, JudgeScore>>,\n baseline: Map<string, Record<string, JudgeScore>>,\n scenarioIds: Set<string>,\n criticalDimensions: string[],\n opts: {\n tolerance?: number\n confidence?: number\n resamples?: number\n seed?: number\n /** Paired statistic the CI is computed on. Default `'mean'` — see\n * {@link DECISION_PAIRED_DELTA_STATISTIC} for why the median is not. */\n statistic?: 'mean' | 'median'\n independentUnitByScenarioId?: ReadonlyMap<string, string>\n minProductiveRuns?: number\n } = {},\n): DimensionRegression[] {\n const out: DimensionRegression[] = []\n const expectedCellIds = [...baseline.keys()]\n .filter((cellId) => scenarioIds.has(scenarioIdFromCellId(cellId)))\n .sort()\n for (const dim of criticalDimensions) {\n const paired = pairHoldout(candidate, baseline, scenarioIds, (s) => s.dimensions[dim])\n if (paired.before.length === 0) continue // dimension not scored on this judge\n const observations = aggregatePairedHoldout(paired, opts.independentUnitByScenarioId)\n const measuredCells = new Set(paired.cellIds)\n const measuredScenarios = new Set(paired.cellIds.map(scenarioIdFromCellId))\n const tolerance = opts.tolerance ?? 0.05 * detectScale([...paired.before, ...paired.after])\n const bootstrapStatistic = opts.statistic ?? DECISION_PAIRED_DELTA_STATISTIC\n const shared = {\n confidence: opts.confidence ?? 0.95,\n resamples: opts.resamples ?? 2000,\n statistic: bootstrapStatistic,\n seed: opts.seed ?? 1337,\n minPairs: opts.minProductiveRuns,\n }\n const guard = decidePairedPromotion(observations.before, observations.after, shared)\n const regression = decidePairedPromotion(observations.after, observations.before, {\n ...shared,\n threshold: tolerance,\n })\n const bootstrap =\n guard.bootstrap ?? pairedBootstrap(observations.before, observations.after, shared)\n out.push({\n dimension: dim,\n bootstrap,\n bootstrapStatistic,\n ci: { low: guard.low, high: guard.high },\n decisionStatistic: guard.statistic,\n mcnemar: guard.mcnemar,\n indeterminate: guard.indeterminate,\n // Fires on EITHER burden of proof — see `floorBreached` in\n // `promotion-policy.ts` for the same rule and the reasoning. The CI arm\n // is the contract this interface and `default-production-gate`'s reason\n // string both state (\"CI.low < -tolerance\"), read off the DECIDING\n // interval; the exact-test arm adds the small-sample path where the\n // bootstrap interval is descriptive only.\n // The credible-worst-case arm stays on the BOOTSTRAP — see the same\n // decision in `floorBreached` (`promotion-policy.ts`). On a pass/fail\n // dimension the score interval is ±z²/(n+z²) even when every pair is\n // concordant, so reading the floor off it would flag an unchanged safety\n // dimension as regressed at any realistic n. The PROVEN-drop arm does use\n // the shared rule, which is what closes the fail-open hole that mattered:\n // a genuine pass/fail regression is now judged on an interval valid at\n // the nonzero `tolerance`, instead of a bootstrap that is pinned wherever\n // ties dominate.\n regressed: bootstrap.low < -tolerance || regression.promote,\n tolerance,\n n: observations.before.length,\n pairedCellN: paired.cellIds.length,\n observationUnit: opts.independentUnitByScenarioId === undefined ? 'cell' : 'registered',\n minimumRequired: guard.minimumPairs,\n fewRuns: !guard.sufficient,\n missingCellIds: expectedCellIds.filter((cellId) => !measuredCells.has(cellId)),\n missingScenarioIds: [...scenarioIds].filter((id) => !measuredScenarios.has(id)).sort(),\n })\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,MAAa,oBAAoB;;AAYjC,SAAS,qBAAqB,QAAwB;CACpD,MAAM,YAAY,OAAO,YAAY,GAAG;CACxC,MAAM,aAAa,OAAO,MAAM,YAAY,CAAC;CAC7C,IACE,YAAY,KACZ,OAAO,KAAK,MAAM,UAClB,CAAC,iBAAiB,KAAK,UAAU,KACjC,CAAC,OAAO,cAAc,OAAO,UAAU,CAAC,GAExC,MAAM,IAAI,MAAM,kCAAkC,OAAO,2BAA2B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