@tangle-network/agent-eval 0.183.0 → 0.185.0

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 (248) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-cell-s__adRnK.d.ts → agent-profile-cell-BHcB-mZX.d.ts} +8 -9
  4. package/dist/{agent-profile-cell-s__adRnK.d.ts.map → agent-profile-cell-BHcB-mZX.d.ts.map} +1 -1
  5. package/dist/{agent-profile-cell-Cv6UA-W_.js → agent-profile-cell-DcFW4vOc.js} +16 -15
  6. package/dist/agent-profile-cell-DcFW4vOc.js.map +1 -0
  7. package/dist/{agent-profile-CivaSsSy.d.ts → agent-profile-uAIQK3Nr.d.ts} +3 -3
  8. package/dist/{agent-profile-CivaSsSy.d.ts.map → agent-profile-uAIQK3Nr.d.ts.map} +1 -1
  9. package/dist/analyst/index.d.ts +11 -336
  10. package/dist/analyst/index.d.ts.map +1 -1
  11. package/dist/analyst/index.js +10 -8
  12. package/dist/analyst/index.js.map +1 -1
  13. package/dist/analyze-runs-CrYhqXop.d.ts +75 -0
  14. package/dist/analyze-runs-CrYhqXop.d.ts.map +1 -0
  15. package/dist/{define-agent-eval-CneiWyuA.js → analyze-runs-sTygaDyD.js} +6 -813
  16. package/dist/analyze-runs-sTygaDyD.js.map +1 -0
  17. package/dist/{benchmark-DQKzykkO.js → benchmark-BeQJyrRC.js} +3 -3
  18. package/dist/{benchmark-DQKzykkO.js.map → benchmark-BeQJyrRC.js.map} +1 -1
  19. package/dist/{benchmark-command-NBrqNwgy.js → benchmark-command-kvq7yFY4.js} +17 -54
  20. package/dist/benchmark-command-kvq7yFY4.js.map +1 -0
  21. package/dist/benchmarks/index.d.ts +4 -4
  22. package/dist/benchmarks/index.js +3 -3
  23. package/dist/builder-eval/index.js +1 -1
  24. package/dist/campaign/index.d.ts +6 -5
  25. package/dist/campaign/index.js +10 -9
  26. package/dist/{campaign-BwcEBC91.js → campaign-eJgtRs-W.js} +16 -15
  27. package/dist/{campaign-BwcEBC91.js.map → campaign-eJgtRs-W.js.map} +1 -1
  28. package/dist/{campaign-evidence-PYPUftRy.js → campaign-evidence-BsrCmBSE.js} +7 -258
  29. package/dist/campaign-evidence-BsrCmBSE.js.map +1 -0
  30. package/dist/{canonical-DPyQ_rpt.js → canonical-BsZVgBhW.js} +2 -4
  31. package/dist/canonical-BsZVgBhW.js.map +1 -0
  32. package/dist/cli.js +2 -2
  33. package/dist/{client-kh2jOjTK.d.ts → client-Bc8LANCG.d.ts} +4 -4
  34. package/dist/{client-kh2jOjTK.d.ts.map → client-Bc8LANCG.d.ts.map} +1 -1
  35. package/dist/contract/index.d.ts +10 -10
  36. package/dist/contract/index.js +15 -284
  37. package/dist/contract/index.js.map +1 -1
  38. package/dist/{default-registry-BwDSWVzg.d.ts → default-registry-CXv9kHMt.d.ts} +6 -6
  39. package/dist/{default-registry-BwDSWVzg.d.ts.map → default-registry-CXv9kHMt.d.ts.map} +1 -1
  40. package/dist/{default-registry-C0-N4PkG.js → default-registry-xiHrldW8.js} +6 -4
  41. package/dist/{default-registry-C0-N4PkG.js.map → default-registry-xiHrldW8.js.map} +1 -1
  42. package/dist/define-agent-eval-D4uumjl3.js +813 -0
  43. package/dist/define-agent-eval-D4uumjl3.js.map +1 -0
  44. package/dist/{define-agent-eval-CwOWWQt_.d.ts → define-agent-eval-DE67ECH1.d.ts} +7 -7
  45. package/dist/{define-agent-eval-CwOWWQt_.d.ts.map → define-agent-eval-DE67ECH1.d.ts.map} +1 -1
  46. package/dist/diagnosis/index.d.ts +319 -0
  47. package/dist/diagnosis/index.d.ts.map +1 -0
  48. package/dist/diagnosis/index.js +1328 -0
  49. package/dist/diagnosis/index.js.map +1 -0
  50. package/dist/{dspy-rlm-engine-8pgBSiy7.js → dspy-rlm-engine-BE9lCzzL.js} +3 -3
  51. package/dist/{dspy-rlm-engine-8pgBSiy7.js.map → dspy-rlm-engine-BE9lCzzL.js.map} +1 -1
  52. package/dist/{engine-DS1cysJy.d.ts → engine-cXUK-WHS.d.ts} +5 -77
  53. package/dist/engine-cXUK-WHS.d.ts.map +1 -0
  54. package/dist/equal-terms-Blx9Zk5I.js +25 -0
  55. package/dist/equal-terms-Blx9Zk5I.js.map +1 -0
  56. package/dist/{eval-campaign-CCEkwzoH.js → eval-campaign-XFHEpN86.js} +4 -4
  57. package/dist/{eval-campaign-CCEkwzoH.js.map → eval-campaign-XFHEpN86.js.map} +1 -1
  58. package/dist/evaluation.d.ts +75 -0
  59. package/dist/evaluation.d.ts.map +1 -0
  60. package/dist/evaluation.js +137 -0
  61. package/dist/evaluation.js.map +1 -0
  62. package/dist/{exact-types-BZDe0W2D.d.ts → exact-types-BEHN7tnq.d.ts} +2 -2
  63. package/dist/{exact-types-BZDe0W2D.d.ts.map → exact-types-BEHN7tnq.d.ts.map} +1 -1
  64. package/dist/experiment/index.d.ts +2 -2
  65. package/dist/experiment/index.js +6 -5
  66. package/dist/experiment/index.js.map +1 -1
  67. package/dist/{experiment-tracker-C7PfnF4b.d.ts → experiment-tracker-URRGP9ek.d.ts} +2 -2
  68. package/dist/{experiment-tracker-C7PfnF4b.d.ts.map → experiment-tracker-URRGP9ek.d.ts.map} +1 -1
  69. package/dist/{external-optimizer-process-DIB4YWEe.js → external-optimizer-process-BbhvXTFx.js} +4 -4
  70. package/dist/{external-optimizer-process-DIB4YWEe.js.map → external-optimizer-process-BbhvXTFx.js.map} +1 -1
  71. package/dist/{external-optimizer-subprocess-CjguXN2e.js → external-optimizer-subprocess-DMgmqTB6.js} +3 -3
  72. package/dist/{external-optimizer-subprocess-CjguXN2e.js.map → external-optimizer-subprocess-DMgmqTB6.js.map} +1 -1
  73. package/dist/{feedback-trajectory-CXmtITBo.d.ts → feedback-trajectory-CytTR7u4.d.ts} +3 -3
  74. package/dist/{feedback-trajectory-CXmtITBo.d.ts.map → feedback-trajectory-CytTR7u4.d.ts.map} +1 -1
  75. package/dist/hosted/index.d.ts +2 -2
  76. package/dist/{index-DoykkxW0.d.ts → index-BQWfAFeH.d.ts} +11 -11
  77. package/dist/{index-DoykkxW0.d.ts.map → index-BQWfAFeH.d.ts.map} +1 -1
  78. package/dist/{index-DbG8QbH9.d.ts → index-C8_iU8KL.d.ts} +6 -6
  79. package/dist/{index-DbG8QbH9.d.ts.map → index-C8_iU8KL.d.ts.map} +1 -1
  80. package/dist/{index--_8_Nlpn.d.ts → index-CKZa_rnt.d.ts} +4 -121
  81. package/dist/index-CKZa_rnt.d.ts.map +1 -0
  82. package/dist/{index-Bp_6sj3x.d.ts → index-ww8736Am.d.ts} +20 -315
  83. package/dist/index-ww8736Am.d.ts.map +1 -0
  84. package/dist/index.d.ts +24 -22
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +25 -24
  87. package/dist/index.js.map +1 -1
  88. package/dist/{insight-report-D1qa0HWs.d.ts → insight-report-C3Bfl762.d.ts} +3 -3
  89. package/dist/{insight-report-D1qa0HWs.d.ts.map → insight-report-C3Bfl762.d.ts.map} +1 -1
  90. package/dist/jev-protocol.d.ts +74 -0
  91. package/dist/jev-protocol.d.ts.map +1 -0
  92. package/dist/jev-protocol.js +91 -0
  93. package/dist/jev-protocol.js.map +1 -0
  94. package/dist/jev.d.ts +131 -0
  95. package/dist/jev.d.ts.map +1 -0
  96. package/dist/jev.js +312 -0
  97. package/dist/jev.js.map +1 -0
  98. package/dist/{journal-Cs9f7385.js → journal-BuRLm6ho.js} +2 -2
  99. package/dist/{journal-Cs9f7385.js.map → journal-BuRLm6ho.js.map} +1 -1
  100. package/dist/{kind-factory-DxTzg32u.js → kind-factory-V79Hw0AU.js} +7 -84
  101. package/dist/kind-factory-V79Hw0AU.js.map +1 -0
  102. package/dist/ledger-core/index.js +2 -2
  103. package/dist/{llm-judge-FfaRgz9X.js → llm-judge-FWWhEb31.js} +11 -9
  104. package/dist/{llm-judge-FfaRgz9X.js.map → llm-judge-FWWhEb31.js.map} +1 -1
  105. package/dist/{matrix-CyhW-vgJ.d.ts → matrix-CPKsRY8Y.d.ts} +2 -2
  106. package/dist/{matrix-CyhW-vgJ.d.ts.map → matrix-CPKsRY8Y.d.ts.map} +1 -1
  107. package/dist/meta-eval/index.d.ts +54 -2
  108. package/dist/meta-eval/index.d.ts.map +1 -1
  109. package/dist/meta-eval/index.js +52 -3
  110. package/dist/meta-eval/index.js.map +1 -1
  111. package/dist/{mint-ySIIkKlV.js → mint-B4zgSAJW.js} +63 -14
  112. package/dist/mint-B4zgSAJW.js.map +1 -0
  113. package/dist/mint-BI14xehJ.d.ts +285 -0
  114. package/dist/mint-BI14xehJ.d.ts.map +1 -0
  115. package/dist/multishot/golden/index.d.ts +1 -1
  116. package/dist/multishot/index.d.ts +2 -2
  117. package/dist/openapi.json +1 -1
  118. package/dist/otel-spans-CQY1pNiN.js +275 -0
  119. package/dist/otel-spans-CQY1pNiN.js.map +1 -0
  120. package/dist/otlp-attributes-BpC_blLF.js +83 -0
  121. package/dist/otlp-attributes-BpC_blLF.js.map +1 -0
  122. package/dist/{run-record-DPa2PeHx.js → paired-promotion-decision-ClJh_9nK.js} +2 -215
  123. package/dist/paired-promotion-decision-ClJh_9nK.js.map +1 -0
  124. package/dist/pipelines/index.js +2 -2
  125. package/dist/prime-bridge-transport-Z3cpKGoV.js +43 -0
  126. package/dist/prime-bridge-transport-Z3cpKGoV.js.map +1 -0
  127. package/dist/prime-protocol-CDBcL9NM.d.ts +331 -0
  128. package/dist/prime-protocol-CDBcL9NM.d.ts.map +1 -0
  129. package/dist/{prime-protocol-6tZTVsWm.js → prime-protocol-DcAK9pC8.js} +2 -23
  130. package/dist/prime-protocol-DcAK9pC8.js.map +1 -0
  131. package/dist/{produced-state-CGoVInrl.js → produced-state-CmB02tr2.js} +23 -19
  132. package/dist/{produced-state-CGoVInrl.js.map → produced-state-CmB02tr2.js.map} +1 -1
  133. package/dist/profile-cell.d.ts +1 -1
  134. package/dist/profile-cell.js +1 -1
  135. package/dist/{promotion-policy-BKFrl7CC.js → promotion-policy-DdrYWHDh.js} +3 -3
  136. package/dist/{promotion-policy-BKFrl7CC.js.map → promotion-policy-DdrYWHDh.js.map} +1 -1
  137. package/dist/{query-D1nLIKt7.js → query-DlV0pdx4.js} +2 -2
  138. package/dist/{query-D1nLIKt7.js.map → query-DlV0pdx4.js.map} +1 -1
  139. package/dist/{registry-BRbB6Y0v.d.ts → registry-D5Ly3GRV.d.ts} +3 -3
  140. package/dist/{registry-BRbB6Y0v.d.ts.map → registry-D5Ly3GRV.d.ts.map} +1 -1
  141. package/dist/{release-confidence-BcqeQTHW.d.ts → release-confidence-DsETiO4f.d.ts} +3 -3
  142. package/dist/{release-confidence-BcqeQTHW.d.ts.map → release-confidence-DsETiO4f.d.ts.map} +1 -1
  143. package/dist/{release-confidence-DMg8n18l.js → release-confidence-RanRUXRW.js} +2 -2
  144. package/dist/{release-confidence-DMg8n18l.js.map → release-confidence-RanRUXRW.js.map} +1 -1
  145. package/dist/reporting.d.ts +3 -3
  146. package/dist/reporting.js +2 -2
  147. package/dist/{researcher-64T49THL.d.ts → researcher-CJkH-6Ty.d.ts} +4 -4
  148. package/dist/{researcher-64T49THL.d.ts.map → researcher-CJkH-6Ty.d.ts.map} +1 -1
  149. package/dist/{reward-hacking-uzO_ihep.d.ts → reward-hacking-BIQ2BWLG.d.ts} +2 -2
  150. package/dist/{reward-hacking-uzO_ihep.d.ts.map → reward-hacking-BIQ2BWLG.d.ts.map} +1 -1
  151. package/dist/rl.d.ts +10 -6
  152. package/dist/rl.d.ts.map +1 -1
  153. package/dist/rl.js +22 -7
  154. package/dist/rl.js.map +1 -1
  155. package/dist/rollout/index.d.ts +2 -2
  156. package/dist/rollout/index.js +2 -2
  157. package/dist/{rollout-D_54FZVu.js → rollout-C0Ifk3vK.js} +2 -2
  158. package/dist/{rollout-D_54FZVu.js.map → rollout-C0Ifk3vK.js.map} +1 -1
  159. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts → rubric-predictive-validity-CTU8y8Cv.d.ts} +2 -2
  160. package/dist/{rubric-predictive-validity-Bmj2_cll.d.ts.map → rubric-predictive-validity-CTU8y8Cv.d.ts.map} +1 -1
  161. package/dist/run-record-CNNzWGpB.js +216 -0
  162. package/dist/run-record-CNNzWGpB.js.map +1 -0
  163. package/dist/{run-record-BiTWauyO.d.ts → run-record-D9wS35fK.d.ts} +2 -2
  164. package/dist/{run-record-BiTWauyO.d.ts.map → run-record-D9wS35fK.d.ts.map} +1 -1
  165. package/dist/{run-record-DualPTn2.js → run-record-tg_5H2IK.js} +2 -2
  166. package/dist/{run-record-DualPTn2.js.map → run-record-tg_5H2IK.js.map} +1 -1
  167. package/dist/search-ledger-types-D7KDVg-o.d.ts +302 -0
  168. package/dist/search-ledger-types-D7KDVg-o.d.ts.map +1 -0
  169. package/dist/{semantic-concept-judge-_3Fp6Q_3.js → semantic-concept-judge-Cnt0TWp0.js} +4 -4
  170. package/dist/{semantic-concept-judge-_3Fp6Q_3.js.map → semantic-concept-judge-Cnt0TWp0.js.map} +1 -1
  171. package/dist/{sequential-D_xHrBZe.js → sequential-PgLEqcTJ.js} +3 -3
  172. package/dist/{sequential-D_xHrBZe.js.map → sequential-PgLEqcTJ.js.map} +1 -1
  173. package/dist/{server-BZQR1f0C.js → server-DmpcFiVK.js} +2 -2
  174. package/dist/{server-BZQR1f0C.js.map → server-DmpcFiVK.js.map} +1 -1
  175. package/dist/{skillopt-optimization-method-DY1aQ-aL.js → skillopt-optimization-method-FSk8b5FQ.js} +8 -7
  176. package/dist/{skillopt-optimization-method-DY1aQ-aL.js.map → skillopt-optimization-method-FSk8b5FQ.js.map} +1 -1
  177. package/dist/{statistical-heldout-CpVd6FmY.d.ts → statistical-heldout-Bu4oNOJh.d.ts} +3 -3
  178. package/dist/{statistical-heldout-CpVd6FmY.d.ts.map → statistical-heldout-Bu4oNOJh.d.ts.map} +1 -1
  179. package/dist/statistical-heldout-CeWT_W7y.js +256 -0
  180. package/dist/statistical-heldout-CeWT_W7y.js.map +1 -0
  181. package/dist/{store-otlp-DAaEbMLf.js → store-otlp-2gYCy-v0.js} +2 -2
  182. package/dist/{store-otlp-DAaEbMLf.js.map → store-otlp-2gYCy-v0.js.map} +1 -1
  183. package/dist/{store-tool-spans-BZ8MPKFe.js → store-tool-spans-B1e6Auc2.js} +69 -6
  184. package/dist/store-tool-spans-B1e6Auc2.js.map +1 -0
  185. package/dist/{store-tool-spans-Dt-YdAuE.d.ts → store-tool-spans-BrdfPaVh.d.ts} +54 -6
  186. package/dist/store-tool-spans-BrdfPaVh.d.ts.map +1 -0
  187. package/dist/{summary-report-IGAOtgPd.js → summary-report-BMvou2oZ.js} +2 -2
  188. package/dist/{summary-report-IGAOtgPd.js.map → summary-report-BMvou2oZ.js.map} +1 -1
  189. package/dist/{summary-report-D1h4dlrK.d.ts → summary-report-BzFS5UhZ.d.ts} +2 -2
  190. package/dist/{summary-report-D1h4dlrK.d.ts.map → summary-report-BzFS5UhZ.d.ts.map} +1 -1
  191. package/dist/{task-failure-attributes-B_JjrOVo.js → task-failure-attributes-B34TiMBe.js} +2 -2
  192. package/dist/{task-failure-attributes-B_JjrOVo.js.map → task-failure-attributes-B34TiMBe.js.map} +1 -1
  193. package/dist/{tool-groups-B2bSNaJB.d.ts → tool-groups-eOOgYGaM.d.ts} +3 -3
  194. package/dist/tool-groups-eOOgYGaM.d.ts.map +1 -0
  195. package/dist/{tool-waste-C7MU9u1e.js → tool-waste-nbHPAxei.js} +2 -2
  196. package/dist/{tool-waste-C7MU9u1e.js.map → tool-waste-nbHPAxei.js.map} +1 -1
  197. package/dist/trace-repair/index.d.ts +2 -2
  198. package/dist/trace-repair/index.js +5 -4
  199. package/dist/trace-repair/index.js.map +1 -1
  200. package/dist/traces.d.ts +5 -5
  201. package/dist/traces.js +8 -7
  202. package/dist/traces.js.map +1 -1
  203. package/dist/trajectory-replay/index.js +1 -1
  204. package/dist/{types-CS0qk_Yp.d.ts → types-BTRcIqFr.d.ts} +3 -3
  205. package/dist/{types-CS0qk_Yp.d.ts.map → types-BTRcIqFr.d.ts.map} +1 -1
  206. package/dist/{types-D7gEdPoQ.d.ts → types-BjB2wZM9.d.ts} +2 -2
  207. package/dist/{types-D7gEdPoQ.d.ts.map → types-BjB2wZM9.d.ts.map} +1 -1
  208. package/dist/types-C8VBbiw6.js +91 -0
  209. package/dist/types-C8VBbiw6.js.map +1 -0
  210. package/dist/{types-BvZoPTGa.d.ts → types-c3ZRTbw9.d.ts} +3 -3
  211. package/dist/{types-BvZoPTGa.d.ts.map → types-c3ZRTbw9.d.ts.map} +1 -1
  212. package/dist/{types-DQ0e2E7y.js → usage-receipt-Cx3xNeyB.js} +2 -89
  213. package/dist/usage-receipt-Cx3xNeyB.js.map +1 -0
  214. package/dist/{verdict-BQ3pCFf8.js → verdict-DhPoXApk.js} +2 -2
  215. package/dist/{verdict-BQ3pCFf8.js.map → verdict-DhPoXApk.js.map} +1 -1
  216. package/dist/{verdict-cache-B3eCVQtY.js → verdict-cache-BQEsVy9n.js} +2 -2
  217. package/dist/{verdict-cache-B3eCVQtY.js.map → verdict-cache-BQEsVy9n.js.map} +1 -1
  218. package/dist/wire/index.d.ts +1 -1
  219. package/dist/wire/index.js +1 -1
  220. package/docs/changes/evaluation-definition-identity.md +27 -0
  221. package/docs/changes/jev-evidence-review.md +18 -0
  222. package/docs/changes/jev-product-adoption.md +18 -0
  223. package/docs/changes/probability-policy-audit.md +81 -0
  224. package/docs/diagnosis.md +42 -0
  225. package/docs/jev-behavior-review.md +174 -0
  226. package/docs/jev-integrations.md +50 -0
  227. package/docs/jev.md +140 -0
  228. package/docs/produced-state.md +13 -0
  229. package/docs/profile-json-identity.md +33 -0
  230. package/package.json +22 -1
  231. package/dist/agent-profile-cell-Cv6UA-W_.js.map +0 -1
  232. package/dist/benchmark-command-NBrqNwgy.js.map +0 -1
  233. package/dist/campaign-evidence-PYPUftRy.js.map +0 -1
  234. package/dist/canonical-DPyQ_rpt.js.map +0 -1
  235. package/dist/define-agent-eval-CneiWyuA.js.map +0 -1
  236. package/dist/engine-DS1cysJy.d.ts.map +0 -1
  237. package/dist/exporters-D98GPi1n.d.ts +0 -161
  238. package/dist/exporters-D98GPi1n.d.ts.map +0 -1
  239. package/dist/index--_8_Nlpn.d.ts.map +0 -1
  240. package/dist/index-Bp_6sj3x.d.ts.map +0 -1
  241. package/dist/kind-factory-DxTzg32u.js.map +0 -1
  242. package/dist/mint-ySIIkKlV.js.map +0 -1
  243. package/dist/prime-protocol-6tZTVsWm.js.map +0 -1
  244. package/dist/run-record-DPa2PeHx.js.map +0 -1
  245. package/dist/store-tool-spans-BZ8MPKFe.js.map +0 -1
  246. package/dist/store-tool-spans-Dt-YdAuE.d.ts.map +0 -1
  247. package/dist/tool-groups-B2bSNaJB.d.ts.map +0 -1
  248. package/dist/types-DQ0e2E7y.js.map +0 -1
@@ -1,264 +1,13 @@
1
1
  import { s as ValidationError, t as AgentEvalError } from "./errors-Dngq5h35.js";
2
- import { a as hashCanonical, i as compareCodeUnits, r as canonicalString } from "./canonical-DPyQ_rpt.js";
3
- import { r as pairedBootstrap } from "./paired-tests-C8iCsioC.js";
4
- import { n as campaignCellExecutionEvidence, o as projectCampaignCellQuality, s as decidePairedPromotion } from "./run-record-DPa2PeHx.js";
5
- import { n as contentHash } from "./verdict-cache-B3eCVQtY.js";
6
- import { t as FileLedgerJournal } from "./journal-Cs9f7385.js";
2
+ import { a as hashCanonical, i as compareCodeUnits, r as canonicalString } from "./canonical-BsZVgBhW.js";
3
+ import { n as aggregatePairedHoldout, o as pairHoldout } from "./statistical-heldout-CeWT_W7y.js";
4
+ import { n as contentHash } from "./verdict-cache-BQEsVy9n.js";
5
+ import { n as campaignCellExecutionEvidence, o as projectCampaignCellQuality } from "./run-record-CNNzWGpB.js";
6
+ import { t as FileLedgerJournal } from "./journal-BuRLm6ho.js";
7
7
  import { g as readField } from "./ast-CP9ae9B0.js";
8
8
  import { createHash } from "node:crypto";
9
9
  import { z } from "zod";
10
10
  import { join } from "node:path";
11
- //#region src/campaign/gates/statistical-heldout.ts
12
- /**
13
- * Held-out inference pairs execution cells and judge identities before taking
14
- * means within registered independent units. Repetitions can improve a unit's
15
- * precision without increasing n. Ungrouped inference concerns independently
16
- * sampled execution cells conditional on a fixed scenario roster.
17
- *
18
- * The shared paired decision rule selects the estimator and statistical test.
19
- * Dimension reports retain missing coverage so required safety checks cannot
20
- * pass through absent evidence. Thresholds use the judge's native score scale.
21
- */
22
- /** Tie fraction at/above which a gate annotates its verdict with the tie share.
23
- * Tie-domination of the median bites structurally at >= 0.5 (the median is then
24
- * 0 by construction); 0.4 is a softer warn threshold that flags a run APPROACHING
25
- * that regime, so an operator sees it before the median goes fully blind. */
26
- const TIE_WARN_FRACTION = .4;
27
- /** Campaign cell IDs append a numeric repetition after the scenario's full ID. */
28
- function scenarioIdFromCellId(cellId) {
29
- const separator = cellId.lastIndexOf(":");
30
- const repetition = cellId.slice(separator + 1);
31
- if (separator < 1 || cellId.trim() !== cellId || !/^(0|[1-9]\d*)$/.test(repetition) || !Number.isSafeInteger(Number(repetition))) throw new Error(`pairHoldout: malformed cellId '${cellId}'; expected scenarioId:rep`);
32
- return cellId.slice(0, separator);
33
- }
34
- /** Preserve cell pairing before taking equal-weight independent-unit means. */
35
- function aggregatePairedHoldout(paired, independentUnitByScenarioId) {
36
- if (paired.before.length !== paired.after.length || paired.before.length !== paired.cellIds.length) throw new Error("aggregatePairedHoldout: scores and cellIds must have the same length");
37
- if (new Set(paired.cellIds).size !== paired.cellIds.length) throw new Error("aggregatePairedHoldout: duplicate cellIds cannot count as new observations");
38
- if (paired.before.some((value) => !Number.isFinite(value)) || paired.after.some((value) => !Number.isFinite(value))) throw new Error("aggregatePairedHoldout: paired scores must be finite");
39
- if (independentUnitByScenarioId === void 0) return {
40
- before: [...paired.before],
41
- after: [...paired.after],
42
- unitIds: [...paired.cellIds]
43
- };
44
- const scenarioIds = paired.cellIds.map(scenarioIdFromCellId);
45
- const groups = /* @__PURE__ */ new Map();
46
- for (let i = 0; i < paired.cellIds.length; i++) {
47
- const scenarioId = scenarioIds[i];
48
- const unitId = independentUnitByScenarioId.get(scenarioId);
49
- if (typeof unitId !== "string" || unitId.length === 0 || unitId.trim() !== unitId) throw new Error(`aggregatePairedHoldout: missing independent unit for scenario '${scenarioId}'`);
50
- const group = groups.get(unitId) ?? {
51
- before: 0,
52
- after: 0,
53
- n: 0
54
- };
55
- group.before += paired.before[i];
56
- group.after += paired.after[i];
57
- group.n += 1;
58
- groups.set(unitId, group);
59
- }
60
- const unitIds = [...groups.keys()].sort();
61
- return {
62
- before: unitIds.map((id) => groups.get(id).before / groups.get(id).n),
63
- after: unitIds.map((id) => groups.get(id).after / groups.get(id).n),
64
- unitIds
65
- };
66
- }
67
- /**
68
- * Pair candidate vs baseline holdout observations by FULL cellId. `select`
69
- * pulls the scalar from a cell's judge reports (composite, or a named
70
- * dimension); a cell contributes the mean of `select` across its judges. Cells
71
- * whose scenario is not in `scenarioIds`, or where `select` is undefined for
72
- * every judge on both sides, are skipped. The selected judge IDs must agree
73
- * within each pair. Throws when the two maps disagree on holdout cell IDs — a
74
- * load-bearing invariant: the baseline + winner holdout campaigns run the same
75
- * scenarios with the same seed base, so their cellIds MUST align; a mismatch
76
- * means a silent pairing bug, not a soft fallback.
77
- */
78
- function pairHoldout(candidate, baseline, scenarioIds, select) {
79
- const cellValues = (byCell, cellId) => {
80
- const scores = byCell.get(cellId);
81
- const values = /* @__PURE__ */ new Map();
82
- if (!scores) return values;
83
- for (const [judgeId, s] of Object.entries(scores)) {
84
- if (s.failed === true) throw new Error(`pairHoldout: cell '${cellId}' contains a failed judge score`);
85
- const v = select(s);
86
- if (typeof v === "number" && !Number.isFinite(v)) throw new Error(`pairHoldout: cell '${cellId}' contains a non-finite selected score`);
87
- if (typeof v === "number") values.set(judgeId, v);
88
- }
89
- return values;
90
- };
91
- const inScope = (cellId) => scenarioIds.has(scenarioIdFromCellId(cellId));
92
- const candCells = [...candidate.keys()].filter(inScope).sort();
93
- const baseCells = [...baseline.keys()].filter(inScope).sort();
94
- if (candCells.length !== baseCells.length || candCells.some((c, i) => c !== baseCells[i])) throw new Error(`pairHoldout: candidate/baseline holdout cells do not align — candidate=[${candCells.join(",")}] baseline=[${baseCells.join(",")}]. Both holdout campaigns must run the same scenarios with the same seed base.`);
95
- const before = [];
96
- const after = [];
97
- const cellIds = [];
98
- for (const cellId of candCells) {
99
- const b = cellValues(baseline, cellId);
100
- const a = cellValues(candidate, cellId);
101
- if (b.size === 0 && a.size === 0) continue;
102
- if (b.size === 0 || a.size === 0) throw new Error(`pairHoldout: cell '${cellId}' has a selected score on only one arm`);
103
- if (b.size !== a.size || [...b.keys()].some((id) => !a.has(id))) throw new Error(`pairHoldout: cell '${cellId}' selected judge IDs do not align`);
104
- const judgeIds = [...b.keys()].sort();
105
- before.push(meanSelectedScores(judgeIds.map((id) => b.get(id))));
106
- after.push(meanSelectedScores(judgeIds.map((id) => a.get(id))));
107
- cellIds.push(cellId);
108
- }
109
- return {
110
- before,
111
- after,
112
- cellIds
113
- };
114
- }
115
- function meanSelectedScores(values) {
116
- const first = values[0];
117
- return values.every((value) => value === first) ? first : values.reduce((sum, value) => sum + value, 0) / values.length;
118
- }
119
- /**
120
- * Significance of the held-out composite lift: ship only when the lower bound
121
- * of the interval the outcome's shape ADMITS exceeds `deltaThreshold` (default
122
- * 0 ⇒ "confidently positive"). Interpret `deltaThreshold` in the judge's native
123
- * scale.
124
- *
125
- * The decision is delegated whole to {@link decidePairedPromotion}, the one
126
- * copy of the rule (`src/paired-promotion-decision.ts`), which `HeldOutGate`
127
- * also calls. That module's header carries the measurements; the short version
128
- * is three guards a bare `bootstrap.low > threshold` does not have:
129
- *
130
- * - a two-point (pass/fail) outcome decides on Tango's SCORE interval, the
131
- * only paired-binary construction that stays valid at a nonzero margin;
132
- * - McNemar's exact test VETOES at any non-negative threshold;
133
- * - a ZERO-WIDTH interval is refused rather than promoted, in either
134
- * direction — [0,0] clears every negative threshold and [g,g] clears every
135
- * threshold below g, and both are an absence of evidence, not a result.
136
- *
137
- * Measured on this function before those guards landed, at a nominal 5 %:
138
- * 14.60 % false promotion at n = 40 on a paired-binary noninferiority boundary,
139
- * and 88.50 % at n = 6 under a bounded asymmetric null whose true mean paired
140
- * delta is exactly 0.
141
- *
142
- * Continuous mean targets require bootstrap eligibility. Explicit median
143
- * targets can use the exact sign test at its confidence-dependent minimum.
144
- */
145
- function heldoutSignificance(paired, opts = {}) {
146
- const deltaThreshold = opts.deltaThreshold ?? 0;
147
- const confidence = opts.confidence ?? .95;
148
- const resamples = opts.resamples ?? 2e3;
149
- const seed = opts.seed ?? 1337;
150
- const statistic = opts.statistic ?? "mean";
151
- const observations = aggregatePairedHoldout(paired, opts.independentUnitByScenarioId);
152
- const decision = decidePairedPromotion(observations.before, observations.after, {
153
- confidence,
154
- resamples,
155
- statistic,
156
- seed,
157
- threshold: deltaThreshold,
158
- minPairs: opts.minProductiveRuns
159
- });
160
- const bootstrap = decision.bootstrap ?? pairedBootstrap(observations.before, observations.after, {
161
- confidence,
162
- resamples,
163
- statistic,
164
- seed
165
- });
166
- const medianBootstrap = statistic === "median" ? bootstrap : pairedBootstrap(observations.before, observations.after, {
167
- confidence,
168
- resamples,
169
- statistic: "median",
170
- seed
171
- });
172
- const n = observations.before.length;
173
- let ties = 0;
174
- for (let i = 0; i < n; i += 1) {
175
- const after = observations.after[i];
176
- const before = observations.before[i];
177
- if (Math.abs(after - before) < 1e-9) ties += 1;
178
- }
179
- const tieFraction = n === 0 ? 0 : ties / n;
180
- return {
181
- paired,
182
- bootstrap,
183
- medianBootstrap,
184
- decision,
185
- decisionStatistic: decision.statistic,
186
- mcnemar: decision.mcnemar,
187
- tieFraction,
188
- n,
189
- pairedCellN: paired.cellIds.length,
190
- observationUnit: opts.independentUnitByScenarioId === void 0 ? "cell" : "registered",
191
- unitIds: observations.unitIds,
192
- minimumRequired: decision.minimumPairs,
193
- decisionMethod: decision.method,
194
- pValue: decision.pValue,
195
- significant: decision.promote,
196
- fewRuns: !decision.sufficient
197
- };
198
- }
199
- /** Detect the native scale of a set of scores: 0-100 when any magnitude clears
200
- * 1.5, else [0,1]. Used to auto-scale the regression tolerance so a default
201
- * expressed for [0,1] is not silently a no-op on a 0-100 dimension. */
202
- function detectScale(values) {
203
- return values.some((v) => Math.abs(v) > 1.5) ? 100 : 1;
204
- }
205
- /**
206
- * Report required-dimension evidence after full pairing and optional unit means.
207
- * A bootstrap floor breach or a shared paired test supporting a drop marks
208
- * regression. These two criteria are distinct; `ci` records the shared
209
- * estimator and `bootstrap` records the floor interval. Missing observations
210
- * and insufficient n remain explicit for the caller's evidence policy.
211
- * The default tolerance is 0.05 on [0,1] and 5 on a detected 0-100 scale.
212
- */
213
- function dimensionRegressions(candidate, baseline, scenarioIds, criticalDimensions, opts = {}) {
214
- const out = [];
215
- const expectedCellIds = [...baseline.keys()].filter((cellId) => scenarioIds.has(scenarioIdFromCellId(cellId))).sort();
216
- for (const dim of criticalDimensions) {
217
- const paired = pairHoldout(candidate, baseline, scenarioIds, (s) => s.dimensions[dim]);
218
- if (paired.before.length === 0) continue;
219
- const observations = aggregatePairedHoldout(paired, opts.independentUnitByScenarioId);
220
- const measuredCells = new Set(paired.cellIds);
221
- const measuredScenarios = new Set(paired.cellIds.map(scenarioIdFromCellId));
222
- const tolerance = opts.tolerance ?? .05 * detectScale([...paired.before, ...paired.after]);
223
- const bootstrapStatistic = opts.statistic ?? "mean";
224
- const shared = {
225
- confidence: opts.confidence ?? .95,
226
- resamples: opts.resamples ?? 2e3,
227
- statistic: bootstrapStatistic,
228
- seed: opts.seed ?? 1337,
229
- minPairs: opts.minProductiveRuns
230
- };
231
- const guard = decidePairedPromotion(observations.before, observations.after, shared);
232
- const regression = decidePairedPromotion(observations.after, observations.before, {
233
- ...shared,
234
- threshold: tolerance
235
- });
236
- const bootstrap = guard.bootstrap ?? pairedBootstrap(observations.before, observations.after, shared);
237
- out.push({
238
- dimension: dim,
239
- bootstrap,
240
- bootstrapStatistic,
241
- ci: {
242
- low: guard.low,
243
- high: guard.high
244
- },
245
- decisionStatistic: guard.statistic,
246
- mcnemar: guard.mcnemar,
247
- indeterminate: guard.indeterminate,
248
- regressed: bootstrap.low < -tolerance || regression.promote,
249
- tolerance,
250
- n: observations.before.length,
251
- pairedCellN: paired.cellIds.length,
252
- observationUnit: opts.independentUnitByScenarioId === void 0 ? "cell" : "registered",
253
- minimumRequired: guard.minimumPairs,
254
- fewRuns: !guard.sufficient,
255
- missingCellIds: expectedCellIds.filter((cellId) => !measuredCells.has(cellId)),
256
- missingScenarioIds: [...scenarioIds].filter((id) => !measuredScenarios.has(id)).sort()
257
- });
258
- }
259
- return out;
260
- }
261
- //#endregion
262
11
  //#region src/campaign/coverage.ts
263
12
  /** Reject campaign designs whose denominator cannot be identified exactly. */
264
13
  function assertCampaignDesign(scenarios, reps) {
@@ -2122,6 +1871,6 @@ function createCampaignEvidenceReceipt(input) {
2122
1871
  });
2123
1872
  }
2124
1873
  //#endregion
2125
- export { formatCoverageFailures as $, FinalEvidenceConflictError as A, surfaceDispatchRef as B, campaignMeanCompositeOrNull as C, parseReflectionResponse as D, buildReflectionPrompt as E, assertCodeSurfaceIdentity as F, summarizeBackendIntegrity as G, surfaceHashMatches as H, codeSurfaceIdentityMaterial as I, assertCompleteCampaign as J, assertCampaignDesign as K, componentSurfaceIdentityMaterial as L, openFinalEvidenceLedger as M, defineEvaluationClaim as N, recoverTruncatedJson as O, summarizeEvaluationUnits as P, campaignSplitDigestFromIdentities as Q, renderSurfaceDiff as R, campaignMeanComposite as S, pairedCampaignComposites as T, BackendIntegrityError as U, surfaceHash as V, assertRealBackend as W, campaignScenarioIdentity as X, campaignCoverage as Y, campaignSplitDigest as Z, provenanceRecordPath as _, createEvidenceReceipt as a, pairHoldout as at, assertFiniteRankKey as b, ATTESTATION_ALGORITHM as c, buildLoopProvenanceRecord as d, TIE_WARN_FRACTION as et, campaignMeasurementDigest as f, loopProvenanceSpans as g, loopProvenanceArgsFromResult as h, INDEPENDENT_EVIDENCE_AUTHORITY_KINDS as i, heldoutSignificance as it, FinalEvidenceError as j, powerPreflight as k, attest as l, emitLoopProvenance as m, EVIDENCE_AUTHORITY_KINDS as n, detectScale as nt, isIndependentEvidence as o, canonicalDigest as p, assertCampaignSplitIdentity as q, EVIDENCE_RECEIPT_VERSION as r, dimensionRegressions as rt, verifyEvidenceReceipt as s, createCampaignEvidenceReceipt as t, aggregatePairedHoldout as tt, verifyAttestation as u, provenanceSpansPath as v, compareRankKeys as w, campaignBreakdown as x, verifyLoopProvenanceRecord as y, surfaceContentHash as z };
1874
+ export { formatCoverageFailures as $, FinalEvidenceConflictError as A, surfaceDispatchRef as B, campaignMeanCompositeOrNull as C, parseReflectionResponse as D, buildReflectionPrompt as E, assertCodeSurfaceIdentity as F, summarizeBackendIntegrity as G, surfaceHashMatches as H, codeSurfaceIdentityMaterial as I, assertCompleteCampaign as J, assertCampaignDesign as K, componentSurfaceIdentityMaterial as L, openFinalEvidenceLedger as M, defineEvaluationClaim as N, recoverTruncatedJson as O, summarizeEvaluationUnits as P, campaignSplitDigestFromIdentities as Q, renderSurfaceDiff as R, campaignMeanComposite as S, pairedCampaignComposites as T, BackendIntegrityError as U, surfaceHash as V, assertRealBackend as W, campaignScenarioIdentity as X, campaignCoverage as Y, campaignSplitDigest as Z, provenanceRecordPath as _, createEvidenceReceipt as a, assertFiniteRankKey as b, ATTESTATION_ALGORITHM as c, buildLoopProvenanceRecord as d, campaignMeasurementDigest as f, loopProvenanceSpans as g, loopProvenanceArgsFromResult as h, INDEPENDENT_EVIDENCE_AUTHORITY_KINDS as i, FinalEvidenceError as j, powerPreflight as k, attest as l, emitLoopProvenance as m, EVIDENCE_AUTHORITY_KINDS as n, isIndependentEvidence as o, canonicalDigest as p, assertCampaignSplitIdentity as q, EVIDENCE_RECEIPT_VERSION as r, verifyEvidenceReceipt as s, createCampaignEvidenceReceipt as t, verifyAttestation as u, provenanceSpansPath as v, compareRankKeys as w, campaignBreakdown as x, verifyLoopProvenanceRecord as y, surfaceContentHash as z };
2126
1875
 
2127
- //# sourceMappingURL=campaign-evidence-PYPUftRy.js.map
1876
+ //# sourceMappingURL=campaign-evidence-BsrCmBSE.js.map