@tangle-network/agent-eval 0.144.6 → 0.144.7

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 (239) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +2 -0
  3. package/dist/{benchmark-J9Qe6j2_.d.ts → agent-profile-CgDTo40f.d.ts} +91 -4
  4. package/dist/agent-profile-CgDTo40f.d.ts.map +1 -0
  5. package/dist/analyst/index.d.ts +470 -88
  6. package/dist/analyst/index.d.ts.map +1 -1
  7. package/dist/analyst/index.js +24 -5
  8. package/dist/analyst/index.js.map +1 -1
  9. package/dist/{analyze-runs-DWIvOAGk.js → analyze-runs-BNNK7irB.js} +3 -3
  10. package/dist/{analyze-runs-DWIvOAGk.js.map → analyze-runs-BNNK7irB.js.map} +1 -1
  11. package/dist/{baseline-D_fT6277.d.ts → baseline-CavEbRyH.d.ts} +2 -23
  12. package/dist/baseline-CavEbRyH.d.ts.map +1 -0
  13. package/dist/{benchmark-command-CQd78YHt.js → benchmark-command-BCafwNrf.js} +662 -605
  14. package/dist/benchmark-command-BCafwNrf.js.map +1 -0
  15. package/dist/benchmarks/index.d.ts +1 -1
  16. package/dist/benchmarks/index.js +1 -1
  17. package/dist/{benchmarks-BEOkuvIg.js → benchmarks-CDSolHq7.js} +4 -4
  18. package/dist/{benchmarks-BEOkuvIg.js.map → benchmarks-CDSolHq7.js.map} +1 -1
  19. package/dist/campaign/index.d.ts +7 -5
  20. package/dist/campaign/index.js +5 -3
  21. package/dist/{campaign-CXsdyym7.js → campaign-Tdy3h62h.js} +17 -301
  22. package/dist/campaign-Tdy3h62h.js.map +1 -0
  23. package/dist/cli.js +2 -2
  24. package/dist/{client-0JI64ovJ.d.ts → client-DjXROWpx.d.ts} +3 -3
  25. package/dist/{client-0JI64ovJ.d.ts.map → client-DjXROWpx.d.ts.map} +1 -1
  26. package/dist/{completion-verifier-CBiee74w.d.ts → completion-verifier-foUCLif_.d.ts} +5 -5
  27. package/dist/{completion-verifier-CBiee74w.d.ts.map → completion-verifier-foUCLif_.d.ts.map} +1 -1
  28. package/dist/contract/index.d.ts +9 -8
  29. package/dist/contract/index.d.ts.map +1 -1
  30. package/dist/contract/index.js +7 -6
  31. package/dist/contract/index.js.map +1 -1
  32. package/dist/control.d.ts +2 -2
  33. package/dist/control.js +1 -1
  34. package/dist/counterfactual-CWPTrMH7.js +126 -0
  35. package/dist/counterfactual-CWPTrMH7.js.map +1 -0
  36. package/dist/counterfactual-CxmxAONP.d.ts +72 -0
  37. package/dist/counterfactual-CxmxAONP.d.ts.map +1 -0
  38. package/dist/{default-registry-J9m-_tya.d.ts → default-registry-BZhStdjl.d.ts} +6 -5
  39. package/dist/default-registry-BZhStdjl.d.ts.map +1 -0
  40. package/dist/{default-registry-Dta70shL.js → default-registry-BaQXW1Ow.js} +2 -2
  41. package/dist/{default-registry-Dta70shL.js.map → default-registry-BaQXW1Ow.js.map} +1 -1
  42. package/dist/{dspy-rlm-engine-19FQEMBK.js → dspy-rlm-engine-BiN49gK6.js} +4 -3
  43. package/dist/{dspy-rlm-engine-19FQEMBK.js.map → dspy-rlm-engine-BiN49gK6.js.map} +1 -1
  44. package/dist/{tool-groups-CK0JCkqO.d.ts → engine-nB64f48I.d.ts} +18 -31
  45. package/dist/engine-nB64f48I.d.ts.map +1 -0
  46. package/dist/{eval-campaign-CfLQQs9B.js → eval-campaign-DNjCvAm-.js} +7 -6
  47. package/dist/{eval-campaign-CfLQQs9B.js.map → eval-campaign-DNjCvAm-.js.map} +1 -1
  48. package/dist/{exact-types-CBYF5MGd.d.ts → exact-types-Djvzosly.d.ts} +2 -2
  49. package/dist/{exact-types-CBYF5MGd.d.ts.map → exact-types-Djvzosly.d.ts.map} +1 -1
  50. package/dist/exec-BLtYZdWo.js +49 -0
  51. package/dist/exec-BLtYZdWo.js.map +1 -0
  52. package/dist/experiment/index.d.ts +802 -0
  53. package/dist/experiment/index.d.ts.map +1 -0
  54. package/dist/experiment/index.js +1108 -0
  55. package/dist/experiment/index.js.map +1 -0
  56. package/dist/experiment-tracker-CnRICnMl.js +500 -0
  57. package/dist/experiment-tracker-CnRICnMl.js.map +1 -0
  58. package/dist/experiment-tracker-IMntXr6J.d.ts +299 -0
  59. package/dist/experiment-tracker-IMntXr6J.d.ts.map +1 -0
  60. package/dist/{external-optimizer-contracts-Q9c0L3eY.d.ts → external-optimizer-contracts-CZuJNcT5.d.ts} +2 -2
  61. package/dist/{external-optimizer-contracts-Q9c0L3eY.d.ts.map → external-optimizer-contracts-CZuJNcT5.d.ts.map} +1 -1
  62. package/dist/{feedback-trajectory-GgoS0-MK.d.ts → feedback-trajectory-Rh280oXo.d.ts} +3 -3
  63. package/dist/{feedback-trajectory-GgoS0-MK.d.ts.map → feedback-trajectory-Rh280oXo.d.ts.map} +1 -1
  64. package/dist/fuzz.d.ts +1 -1
  65. package/dist/hosted/index.d.ts +3 -3
  66. package/dist/{index-BZUe-ODI.d.ts → index-BZ3-y4YL.d.ts} +3 -3
  67. package/dist/{index-BZUe-ODI.d.ts.map → index-BZ3-y4YL.d.ts.map} +1 -1
  68. package/dist/{index-DSC51roc.d.ts → index-C3ssXVLv.d.ts} +2 -2
  69. package/dist/{index-DSC51roc.d.ts.map → index-C3ssXVLv.d.ts.map} +1 -1
  70. package/dist/{index-4XwggC10.d.ts → index-C5HOo4ZF2.d.ts} +4 -4
  71. package/dist/index-C5HOo4ZF2.d.ts.map +1 -0
  72. package/dist/{index-B6-B0zTB.d.ts → index-CvXXlyz7.d.ts} +2 -2
  73. package/dist/{index-B6-B0zTB.d.ts.map → index-CvXXlyz7.d.ts.map} +1 -1
  74. package/dist/{index-Dx1kF3Ez.d.ts → index-CwDrUMe0.d.ts} +2 -2
  75. package/dist/{index-Dx1kF3Ez.d.ts.map → index-CwDrUMe0.d.ts.map} +1 -1
  76. package/dist/{index-BIL5vxxt.d.ts → index-Sh2I0DRc.d.ts} +11 -645
  77. package/dist/index-Sh2I0DRc.d.ts.map +1 -0
  78. package/dist/index.d.ts +214 -404
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +233 -649
  81. package/dist/index.js.map +1 -1
  82. package/dist/{insight-report-DqEsugpr.d.ts → insight-report-C6h6F_4L.d.ts} +3 -3
  83. package/dist/{insight-report-DqEsugpr.d.ts.map → insight-report-C6h6F_4L.d.ts.map} +1 -1
  84. package/dist/{integrity-CNGUaGBY.d.ts → integrity-BuqEKu-x.d.ts} +2 -2
  85. package/dist/{integrity-CNGUaGBY.d.ts.map → integrity-BuqEKu-x.d.ts.map} +1 -1
  86. package/dist/integrity-MLzHOfV9.js +141 -0
  87. package/dist/integrity-MLzHOfV9.js.map +1 -0
  88. package/dist/kind-factory-BHIgPmzS.js.map +1 -1
  89. package/dist/{llm-client-Dv5BiKLE.js → llm-client-DzvMUsS_.js} +24 -6
  90. package/dist/llm-client-DzvMUsS_.js.map +1 -0
  91. package/dist/matrix/index.d.ts +2 -2
  92. package/dist/meta-eval/index.d.ts +1 -1
  93. package/dist/{mint-DD-0oQTA.js → mint-CGEkzPLf.js} +2 -2
  94. package/dist/{mint-DD-0oQTA.js.map → mint-CGEkzPLf.js.map} +1 -1
  95. package/dist/{multi-layer-verifier-BHY1gWAc.d.ts → multi-layer-verifier-DnAqwl0h.d.ts} +2 -2
  96. package/dist/{multi-layer-verifier-BHY1gWAc.d.ts.map → multi-layer-verifier-DnAqwl0h.d.ts.map} +1 -1
  97. package/dist/multishot/index.d.ts +2 -2
  98. package/dist/openapi.json +1 -1
  99. package/dist/paired-promotion-decision-B6zJ3gYM.d.ts +114 -0
  100. package/dist/paired-promotion-decision-B6zJ3gYM.d.ts.map +1 -0
  101. package/dist/pipelines/index.d.ts +2 -1
  102. package/dist/pipelines/index.d.ts.map +1 -1
  103. package/dist/pre-registration-DakwTRXk.js +96 -0
  104. package/dist/pre-registration-DakwTRXk.js.map +1 -0
  105. package/dist/prime-bridge-transport-6feEglLf.d.ts +49 -0
  106. package/dist/prime-bridge-transport-6feEglLf.d.ts.map +1 -0
  107. package/dist/prime-protocol-BfSalTfR.js +453 -0
  108. package/dist/prime-protocol-BfSalTfR.js.map +1 -0
  109. package/dist/profile-cell.js +242 -1
  110. package/dist/profile-cell.js.map +1 -0
  111. package/dist/promotion-policy-ChWhTDBH.d.ts +289 -0
  112. package/dist/promotion-policy-ChWhTDBH.d.ts.map +1 -0
  113. package/dist/promotion-policy-CrLrmys8.js +682 -0
  114. package/dist/promotion-policy-CrLrmys8.js.map +1 -0
  115. package/dist/{propose-review-control-BciUCZoh.js → propose-review-control-qgWLA6E9.js} +2 -2
  116. package/dist/{propose-review-control-BciUCZoh.js.map → propose-review-control-qgWLA6E9.js.map} +1 -1
  117. package/dist/{release-report-ChOgpIoQ.d.ts → release-report-CI8uisI1.d.ts} +2 -2
  118. package/dist/{release-report-ChOgpIoQ.d.ts.map → release-report-CI8uisI1.d.ts.map} +1 -1
  119. package/dist/{release-report-Sl0xfkFv.js → release-report-Dy39cbFF.js} +3 -3
  120. package/dist/{release-report-Sl0xfkFv.js.map → release-report-Dy39cbFF.js.map} +1 -1
  121. package/dist/{replay-Krvb114g.d.ts → replay-DFf-teiC.d.ts} +5 -4
  122. package/dist/replay-DFf-teiC.d.ts.map +1 -0
  123. package/dist/{replay-GW61ezMW.js → replay-DyBLaKFc.js} +3 -3
  124. package/dist/{replay-GW61ezMW.js.map → replay-DyBLaKFc.js.map} +1 -1
  125. package/dist/reporting.d.ts +3 -3
  126. package/dist/reporting.js +2 -2
  127. package/dist/{researcher-xLeNcpKX.d.ts → researcher-BoaxeCzP.d.ts} +4 -4
  128. package/dist/{researcher-xLeNcpKX.d.ts.map → researcher-BoaxeCzP.d.ts.map} +1 -1
  129. package/dist/{reward-hacking-CyuzxKly.js → reward-hacking-B2tPL9a3.js} +12 -3
  130. package/dist/reward-hacking-B2tPL9a3.js.map +1 -0
  131. package/dist/{reward-hacking-RZgnGWlx.d.ts → reward-hacking-Cf1PtEOz.d.ts} +33 -3
  132. package/dist/reward-hacking-Cf1PtEOz.d.ts.map +1 -0
  133. package/dist/rl.d.ts +17 -7
  134. package/dist/rl.d.ts.map +1 -1
  135. package/dist/rl.js +16 -7
  136. package/dist/rl.js.map +1 -1
  137. package/dist/rollout/index.d.ts +2 -2
  138. package/dist/rollout/index.js +2 -2
  139. package/dist/{rollout-C2fD1cf4.js → rollout-2ECTXb2N.js} +2 -2
  140. package/dist/{rollout-C2fD1cf4.js.map → rollout-2ECTXb2N.js.map} +1 -1
  141. package/dist/{run-evidence-C6G41MSI.d.ts → run-evidence-BDFFai9R.d.ts} +2 -2
  142. package/dist/{run-evidence-C6G41MSI.d.ts.map → run-evidence-BDFFai9R.d.ts.map} +1 -1
  143. package/dist/{run-record-CWN8-VsV.js → run-record-DqOw5X6_.js} +2 -2
  144. package/dist/{run-record-CWN8-VsV.js.map → run-record-DqOw5X6_.js.map} +1 -1
  145. package/dist/{schema-Cef2cFmb.d.ts → schema-Cef2cFmb2.d.ts} +1 -1
  146. package/dist/schema-Cef2cFmb2.d.ts.map +1 -0
  147. package/dist/{semantic-concept-judge-DwF6n05O.js → semantic-concept-judge-Bmrq6yqU.js} +2 -2
  148. package/dist/{semantic-concept-judge-DwF6n05O.js.map → semantic-concept-judge-Bmrq6yqU.js.map} +1 -1
  149. package/dist/sequential-D-BLJBKU.js +299 -0
  150. package/dist/sequential-D-BLJBKU.js.map +1 -0
  151. package/dist/{server-D6XJQHw7.js → server-iu0ede49.js} +2 -2
  152. package/dist/{server-D6XJQHw7.js.map → server-iu0ede49.js.map} +1 -1
  153. package/dist/{single-run-lock-D5iN0Xzb.js → single-run-lock-BMQEv1wG.js} +7 -161
  154. package/dist/single-run-lock-BMQEv1wG.js.map +1 -0
  155. package/dist/{skill-usage-GlOphAhX.d.ts → skill-usage-CJlWEUFt.d.ts} +10 -10
  156. package/dist/{skill-usage-GlOphAhX.d.ts.map → skill-usage-CJlWEUFt.d.ts.map} +1 -1
  157. package/dist/{skillopt-optimization-method-7S43rbDB.d.ts → skillopt-optimization-method-BO7NAl3b.d.ts} +8 -294
  158. package/dist/skillopt-optimization-method-BO7NAl3b.d.ts.map +1 -0
  159. package/dist/{skillopt-optimization-method-Bfb-vBKe.js → skillopt-optimization-method-CQwZ-ZX8.js} +8 -652
  160. package/dist/skillopt-optimization-method-CQwZ-ZX8.js.map +1 -0
  161. package/dist/statistical-heldout-Dn9ruizm.d.ts +555 -0
  162. package/dist/statistical-heldout-Dn9ruizm.d.ts.map +1 -0
  163. package/dist/{statistics-C-dm-J6H.d.ts → statistics-D6Uebe_4.d.ts} +2 -2
  164. package/dist/{statistics-C-dm-J6H.d.ts.map → statistics-D6Uebe_4.d.ts.map} +1 -1
  165. package/dist/steps-BArUxhna.d.ts +51 -0
  166. package/dist/steps-BArUxhna.d.ts.map +1 -0
  167. package/dist/{integrity-fdt8XPAv.js → store-DNe_Uv1Q.js} +2 -140
  168. package/dist/store-DNe_Uv1Q.js.map +1 -0
  169. package/dist/{summary-report-B0cAyA7N.d.ts → summary-report-DuUS_i7W.d.ts} +3 -114
  170. package/dist/summary-report-DuUS_i7W.d.ts.map +1 -0
  171. package/dist/{summary-report-9A5y7EsK.js → summary-report-Lf-5I7xh.js} +2 -2
  172. package/dist/{summary-report-9A5y7EsK.js.map → summary-report-Lf-5I7xh.js.map} +1 -1
  173. package/dist/supervisor-run/index.d.ts +2 -2
  174. package/dist/supervisor-run/index.js +1 -1
  175. package/dist/{supervisor-run-DiyQVczd.js → supervisor-run-D_sokXcO.js} +32 -8
  176. package/dist/{supervisor-run-DiyQVczd.js.map → supervisor-run-D_sokXcO.js.map} +1 -1
  177. package/dist/tool-groups-DIVBnJyl.d.ts +28 -0
  178. package/dist/tool-groups-DIVBnJyl.d.ts.map +1 -0
  179. package/dist/trace-repair/index.d.ts +2102 -0
  180. package/dist/trace-repair/index.d.ts.map +1 -0
  181. package/dist/trace-repair/index.js +3878 -0
  182. package/dist/trace-repair/index.js.map +1 -0
  183. package/dist/traces.d.ts +6 -6
  184. package/dist/traces.js +3 -2
  185. package/dist/trajectory-YC15QDYQ.d.ts +24 -0
  186. package/dist/trajectory-YC15QDYQ.d.ts.map +1 -0
  187. package/dist/trajectory-replay/index.d.ts +781 -0
  188. package/dist/trajectory-replay/index.d.ts.map +1 -0
  189. package/dist/trajectory-replay/index.js +2103 -0
  190. package/dist/trajectory-replay/index.js.map +1 -0
  191. package/dist/{types-XMVEdrE_.d.ts → types-D216SgwM.d.ts} +24 -6
  192. package/dist/types-D216SgwM.d.ts.map +1 -0
  193. package/dist/{types-yLK8gXE9.d.ts → types-D4mog56g.d.ts} +2 -2
  194. package/dist/{types-yLK8gXE9.d.ts.map → types-D4mog56g.d.ts.map} +1 -1
  195. package/dist/{types-BhP9q0Fq.d.ts → types-DF_Udrp-.d.ts} +52 -3
  196. package/dist/{types-BhP9q0Fq.d.ts.map → types-DF_Udrp-.d.ts.map} +1 -1
  197. package/dist/{types-DOZyvsFU.d.ts → types-DYuNHo9R.d.ts} +3 -3
  198. package/dist/{types-DOZyvsFU.d.ts.map → types-DYuNHo9R.d.ts.map} +1 -1
  199. package/dist/usage-receipt-EVI8B8Xu.js.map +1 -1
  200. package/dist/verdict-DExhxfgR.d.ts +201 -0
  201. package/dist/verdict-DExhxfgR.d.ts.map +1 -0
  202. package/dist/verdict-cache-BCcOh0kF.js +159 -0
  203. package/dist/verdict-cache-BCcOh0kF.js.map +1 -0
  204. package/dist/wire/index.d.ts +2 -2
  205. package/dist/wire/index.js +1 -1
  206. package/docs/charter.md +112 -0
  207. package/docs/experiment.md +104 -0
  208. package/docs/prime-analyst.md +1 -0
  209. package/docs/trace-analysis.md +26 -0
  210. package/docs/trace-repair-admission.md +194 -0
  211. package/docs/trace-repair-analyst-arms.md +121 -0
  212. package/docs/trace-repair-continuation.md +107 -0
  213. package/docs/trace-repair-grader.md +163 -0
  214. package/docs/trajectory-replay.md +110 -0
  215. package/docs/verification-strategies.md +103 -0
  216. package/package.json +19 -2
  217. package/dist/agent-profile-cell-CbfBm2g6.js +0 -335
  218. package/dist/agent-profile-cell-CbfBm2g6.js.map +0 -1
  219. package/dist/baseline-D_fT6277.d.ts.map +0 -1
  220. package/dist/benchmark-J9Qe6j2_.d.ts.map +0 -1
  221. package/dist/benchmark-command-CQd78YHt.js.map +0 -1
  222. package/dist/campaign-CXsdyym7.js.map +0 -1
  223. package/dist/default-registry-J9m-_tya.d.ts.map +0 -1
  224. package/dist/index-4XwggC10.d.ts.map +0 -1
  225. package/dist/index-BIL5vxxt.d.ts.map +0 -1
  226. package/dist/integrity-fdt8XPAv.js.map +0 -1
  227. package/dist/llm-client-Dv5BiKLE.js.map +0 -1
  228. package/dist/replay-Krvb114g.d.ts.map +0 -1
  229. package/dist/reward-hacking-CyuzxKly.js.map +0 -1
  230. package/dist/reward-hacking-RZgnGWlx.d.ts.map +0 -1
  231. package/dist/schema-Cef2cFmb.d.ts.map +0 -1
  232. package/dist/single-run-lock-D5iN0Xzb.js.map +0 -1
  233. package/dist/skillopt-optimization-method-7S43rbDB.d.ts.map +0 -1
  234. package/dist/skillopt-optimization-method-Bfb-vBKe.js.map +0 -1
  235. package/dist/summary-report-B0cAyA7N.d.ts.map +0 -1
  236. package/dist/tool-groups-CK0JCkqO.d.ts.map +0 -1
  237. package/dist/types-XMVEdrE_.d.ts.map +0 -1
  238. package/dist/verdict-Dps8_okt.d.ts +0 -37
  239. package/dist/verdict-Dps8_okt.d.ts.map +0 -1
@@ -1,16 +1,19 @@
1
1
  import { c as ValidationError, t as AgentEvalError } from "./errors-D-LKuDhb.js";
2
- import { p as canonicalize, s as buildAgentProfileCell } from "./agent-profile-cell-CbfBm2g6.js";
2
+ import { t as canonicalize } from "./pre-registration-DakwTRXk.js";
3
+ import { buildAgentProfileCell } from "./profile-cell.js";
3
4
  import { i as CostLedger, t as CostAccountingIncompleteError } from "./cost-ledger-DMFxsLKr.js";
4
- import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, u as costReceiptFromLlmError } from "./llm-client-Dv5BiKLE.js";
5
+ import { f as maximumChargeForLlmRequest, h as ModelSubstitutionError, l as costReceiptFromLlm, u as costReceiptFromLlmError, y as assertServedModel } from "./llm-client-DzvMUsS_.js";
5
6
  import { r as canonicalString } from "./canonical-D011XM8r.js";
6
- import { a as SEARCH_LEDGER_FILE_CONTEXT, c as SearchLedgerIntegrityError, o as SearchLedgerConflictError, s as SearchLedgerError, y as contentHash } from "./single-run-lock-D5iN0Xzb.js";
7
+ import { a as SEARCH_LEDGER_FILE_CONTEXT, c as SearchLedgerIntegrityError, o as SearchLedgerConflictError, s as SearchLedgerError } from "./single-run-lock-BMQEv1wG.js";
8
+ import { r as contentHash } from "./verdict-cache-BCcOh0kF.js";
7
9
  import { p as mapConcurrent, t as FileLedgerJournal } from "./ledger-core-DXZIqu17.js";
8
- import { B as surfaceContentHash, E as pairHoldout, F as assertCodeSurfaceIdentity, J as planCampaignRun, Mt as JudgeParseError, St as recoverTruncatedJson, Y as runCampaign, h as labelTrustRank, jt as summarizeBackendIntegrity, kt as assertRealBackend } from "./skillopt-optimization-method-Bfb-vBKe.js";
9
- import { C as mulberry32, E as pairedBootstrap, m as eProcess } from "./statistics-ByxzSiOM.js";
10
+ import { B as planCampaignRun, D as assertCodeSurfaceIdentity, M as surfaceContentHash, V as runCampaign, _t as assertRealBackend, bt as JudgeParseError, h as labelTrustRank, mt as recoverTruncatedJson, yt as summarizeBackendIntegrity } from "./skillopt-optimization-method-CQwZ-ZX8.js";
11
+ import { E as pairedBootstrap } from "./statistics-ByxzSiOM.js";
10
12
  import { t as comparePairedArms } from "./paired-arms-iZ08VFMN.js";
11
- import { o as runTaskScore, r as modelHasSnapshot, s as validateRunRecord } from "./run-record-CWN8-VsV.js";
13
+ import { o as runTaskScore, r as modelHasSnapshot, s as validateRunRecord } from "./run-record-DqOw5X6_.js";
14
+ import { l as pairHoldout } from "./promotion-policy-CrLrmys8.js";
12
15
  import { a as scoreAnalystFindings } from "./benchmark-B181aMF9.js";
13
- import { l as campaignCellToRunRecord } from "./reward-hacking-CyuzxKly.js";
16
+ import { l as campaignCellToRunRecord } from "./reward-hacking-B2tPL9a3.js";
14
17
  import { z } from "zod";
15
18
  import { closeSync, constants, existsSync, fstatSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
16
19
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -336,6 +339,10 @@ function createLlmCorrectnessChecker(chat, opts = {}) {
336
339
  });
337
340
  if (!paid.succeeded) throw paid.error;
338
341
  const resp = paid.value;
342
+ assertServedModel(model, resp.servedModel, {
343
+ allowUnreported: true,
344
+ context: `correctness checker for requirement ${requirement.reqId}`
345
+ });
339
346
  const raw = resp.content;
340
347
  await record({
341
348
  eventId: randomUUID(),
@@ -366,6 +373,7 @@ function createLlmCorrectnessChecker(chat, opts = {}) {
366
373
  errorMessage: err instanceof Error ? err.message : String(err),
367
374
  redactedFields: []
368
375
  });
376
+ if (err instanceof ModelSubstitutionError) throw err;
369
377
  }
370
378
  }
371
379
  throw lastErr instanceof Error ? lastErr : new Error(String(lastErr));
@@ -1647,298 +1655,6 @@ function neutralizationGate(options) {
1647
1655
  };
1648
1656
  }
1649
1657
  //#endregion
1650
- //#region src/campaign/gates/sequential.ts
1651
- /**
1652
- * Anytime-valid sequential promotion gate — an e-process (betting
1653
- * test-martingale, see `eProcess` in `statistics.ts`) over paired
1654
- * per-scenario deltas, so a campaign stops the MOMENT evidence decides
1655
- * instead of burning a fixed-n budget. Decisions remain valid at any
1656
- * data-dependent stopping time (Ville's inequality), which is exactly what
1657
- * fixed-n machinery cannot offer: peeking at a bootstrap CI after every
1658
- * observation and stopping on the first significant peek inflates type-I
1659
- * error far beyond alpha.
1660
- *
1661
- * REPLACES, never layers on, a fixed-n gate. Running `heldoutSignificance`
1662
- * or `paretoSignificanceGate` repeatedly on a growing sample and stopping
1663
- * early is optional stopping no matter how it is dressed up; this gate is
1664
- * the valid way to stop early. Use one or the other per evidence stream.
1665
- *
1666
- * Pre-registration binding: anytime validity holds only for the
1667
- * PRE-REGISTERED statistic. When a `SignedManifest` is bound, the gate takes
1668
- * alpha from `manifest.alpha`, the observation budget from
1669
- * `manifest.preRegisteredN`, orients deltas by `manifest.direction`, and
1670
- * shifts the null boundary by `manifest.minEffect` — re-deciding the same
1671
- * stream under different parameters after seeing data would reopen optional
1672
- * stopping under a fancier name. The manifest's content hash is verified at
1673
- * construction (sync, same `sha256-content` scheme as `signManifest`).
1674
- *
1675
- * Non-iid caveat (stated honestly): the supermartingale guarantee needs each
1676
- * delta's conditional mean under H0 to stay ≤ the null boundary given the
1677
- * past — exchangeable scenario deltas suffice. Scenario streams ordered by
1678
- * difficulty or by scenario family violate this; `decide(ctx)` therefore
1679
- * shuffles the paired deltas with a SEEDED permutation by default (the
1680
- * permutation is data-independent, so bet predictability is preserved).
1681
- * Stratified betting (per-stratum λ) is future work, not implemented here.
1682
- */
1683
- /** Sync twin of `verifyManifest` — same `sha256-content` scheme
1684
- * (sha256 over the canonicalized manifest minus contentHash/algo), via
1685
- * node:crypto so gate construction can stay synchronous and fail loud
1686
- * before any observation is consumed. */
1687
- function verifyManifestSync(m) {
1688
- if (m.algo !== void 0 && m.algo !== "sha256-content") throw new Error(`sequentialPairedGate: unrecognized manifest hash algo '${m.algo}'`);
1689
- const { contentHash, algo: _algo, ...rest } = m;
1690
- const bytes = JSON.stringify(canonicalize(rest));
1691
- return createHash("sha256").update(bytes, "utf8").digest("hex") === contentHash;
1692
- }
1693
- function resolveConfig(opts) {
1694
- const m = opts.preRegistration;
1695
- let alpha;
1696
- let maxN;
1697
- let direction;
1698
- let minEffect;
1699
- if (m) {
1700
- if (!verifyManifestSync(m)) throw new Error(`sequentialPairedGate: pre-registration manifest '${m.id}' content hash mismatch (tampered)`);
1701
- if (opts.alpha !== void 0 && opts.alpha !== m.alpha) throw new Error(`sequentialPairedGate: alpha ${opts.alpha} conflicts with pre-registered alpha ${m.alpha} — the registered statistic is the only one anytime validity covers`);
1702
- if (opts.maxN !== void 0 && opts.maxN !== m.preRegisteredN) throw new Error(`sequentialPairedGate: maxN ${opts.maxN} conflicts with pre-registered N ${m.preRegisteredN}`);
1703
- alpha = m.alpha;
1704
- maxN = m.preRegisteredN;
1705
- direction = m.direction;
1706
- minEffect = m.minEffect;
1707
- } else {
1708
- alpha = opts.alpha ?? .05;
1709
- if (opts.maxN === void 0) throw new Error("sequentialPairedGate: maxN is required (or bind a preRegistration manifest whose preRegisteredN is the budget) — an unbounded stream has no pre-registered budget");
1710
- maxN = opts.maxN;
1711
- direction = "increase";
1712
- minEffect = 0;
1713
- }
1714
- const scale = opts.scale ?? 1;
1715
- if (!Number.isFinite(scale) || scale <= 0) throw new Error(`sequentialPairedGate: scale must be > 0, got ${scale}`);
1716
- if (!Number.isInteger(maxN) || maxN < 1) throw new Error(`sequentialPairedGate: maxN must be a positive integer, got ${maxN}`);
1717
- const minN = opts.minN ?? 5;
1718
- if (!Number.isInteger(minN) || minN < 1 || minN > maxN) throw new Error(`sequentialPairedGate: minN must be an integer in [1, maxN=${maxN}], got ${minN}`);
1719
- if (!Number.isFinite(minEffect) || minEffect < 0 || minEffect >= scale) throw new Error(`sequentialPairedGate: minEffect must be in [0, scale=${scale}), got ${minEffect}`);
1720
- const nullMean = .5 + minEffect / (2 * scale);
1721
- return {
1722
- alpha,
1723
- minN,
1724
- maxN,
1725
- maxBet: opts.maxBet ?? .5,
1726
- scale,
1727
- shuffleSeed: opts.shuffleSeed ?? 1337,
1728
- direction,
1729
- nullMean,
1730
- minEffect
1731
- };
1732
- }
1733
- function makeStream(cfg) {
1734
- const proc = eProcess({
1735
- alpha: cfg.alpha,
1736
- maxBet: cfg.maxBet,
1737
- nullMean: cfg.nullMean
1738
- });
1739
- const threshold = 1 / cfg.alpha;
1740
- let terminal;
1741
- return {
1742
- observe(delta) {
1743
- if (terminal === "undecided-at-maxN") throw new Error(`sequentialPairedGate: pre-registered maxN=${cfg.maxN} exhausted — extending the stream after seeing the result reopens optional stopping; start a NEW pre-registered test`);
1744
- if (!Number.isFinite(delta) || Math.abs(delta) > cfg.scale) throw new Error(`sequentialPairedGate: delta ${delta} outside ±scale=${cfg.scale} — pass the judge's native scale explicitly (detectScale helps pick 1 vs 100)`);
1745
- const d = cfg.direction === "decrease" ? -delta : delta;
1746
- const step = proc.update((d / cfg.scale + 1) / 2);
1747
- if (terminal === void 0 && step.n >= cfg.minN && step.wealth >= threshold) terminal = "promote";
1748
- if (terminal === "promote") return {
1749
- decision: "promote",
1750
- eValue: step.wealth,
1751
- n: step.n,
1752
- reason: `e-value ${step.wealth.toFixed(2)} ≥ 1/α=${threshold.toFixed(2)} at n=${step.n} (minN=${cfg.minN}): the paired improvement exceeds ${cfg.minEffect} at anytime-valid level α=${cfg.alpha}`
1753
- };
1754
- if (step.n >= cfg.maxN) {
1755
- terminal = "undecided-at-maxN";
1756
- return {
1757
- decision: "undecided-at-maxN",
1758
- eValue: step.wealth,
1759
- n: step.n,
1760
- reason: `undecided at pre-registered maxN=${cfg.maxN} (e-value ${step.wealth.toFixed(2)} < 1/α=${threshold.toFixed(2)}). This is NOT evidence of no effect — the effect may be real but smaller than this budget can detect; re-register with a larger N to test that`
1761
- };
1762
- }
1763
- return {
1764
- decision: "continue",
1765
- eValue: step.wealth,
1766
- n: step.n,
1767
- reason: `e-value ${step.wealth.toFixed(2)} < 1/α=${threshold.toFixed(2)} at n=${step.n}/${cfg.maxN} — keep observing`
1768
- };
1769
- },
1770
- state() {
1771
- return {
1772
- ...proc.state(),
1773
- decision: terminal ?? "continue"
1774
- };
1775
- }
1776
- };
1777
- }
1778
- /** Data-independent in-place Fisher–Yates with a seeded PRNG — the permutation
1779
- * depends only on the seed, never the values, so bet predictability survives. */
1780
- function seededShuffle(items, seed) {
1781
- const rng = mulberry32(seed);
1782
- for (let i = items.length - 1; i > 0; i--) {
1783
- const j = Math.floor(rng() * (i + 1));
1784
- const tmp = items[i];
1785
- items[i] = items[j];
1786
- items[j] = tmp;
1787
- }
1788
- return items;
1789
- }
1790
- /**
1791
- * Anytime-valid sequential paired gate. Conforms to the existing `Gate`
1792
- * contract (`decide(ctx)` consumes candidate vs baseline judge scores via
1793
- * `pairHoldout` — same pairing granularity as the fixed-n gates: full cellId,
1794
- * never scenarioId) and adds a streaming `observe(delta)` entry for campaigns
1795
- * that score cells incrementally and want to stop mid-stream.
1796
- *
1797
- * Decision mapping onto the substrate's five-valued `GateDecision`:
1798
- * - 'promote' → 'ship'
1799
- * - 'continue' → 'need_more_work' (stream ended before maxN with
1800
- * the e-value undecided — more reps could decide)
1801
- * - 'undecided-at-maxN' → 'hold', with the reason stating it is NOT
1802
- * evidence of no effect (never a silent default)
1803
- */
1804
- function sequentialPairedGate(options) {
1805
- const cfg = resolveConfig(options);
1806
- const name = options.name ?? "sequentialPairedGate";
1807
- const manifest = options.preRegistration;
1808
- const observeStream = makeStream(cfg);
1809
- return {
1810
- name,
1811
- observe(delta) {
1812
- return observeStream.observe(delta);
1813
- },
1814
- state() {
1815
- return observeStream.state();
1816
- },
1817
- async decide(ctx) {
1818
- if (!ctx.baselineJudgeScores) throw new Error(`${name}: ctx.baselineJudgeScores is required — falling back to the candidate's own scores would compare the candidate against itself (delta 0, silent no-op)`);
1819
- const scenarioIds = new Set(ctx.scenarios.map((s) => s.id));
1820
- const paired = pairHoldout(ctx.judgeScores, ctx.baselineJudgeScores, scenarioIds, (s) => s.composite);
1821
- const deltas = paired.after.map((a, i) => a - paired.before[i]);
1822
- seededShuffle(deltas, cfg.shuffleSeed);
1823
- const stream = makeStream(cfg);
1824
- let last;
1825
- for (const d of deltas) {
1826
- last = stream.observe(d);
1827
- if (last.decision !== "continue") break;
1828
- }
1829
- const detail = {
1830
- ...stream.state(),
1831
- minN: cfg.minN,
1832
- maxN: cfg.maxN,
1833
- scale: cfg.scale,
1834
- shuffleSeed: cfg.shuffleSeed,
1835
- direction: cfg.direction,
1836
- minEffect: cfg.minEffect,
1837
- pairedN: deltas.length,
1838
- ...manifest ? {
1839
- preRegisteredId: manifest.id,
1840
- metric: manifest.metric
1841
- } : {}
1842
- };
1843
- const meanDelta = deltas.length === 0 ? void 0 : deltas.reduce((s, d) => s + d, 0) / deltas.length;
1844
- if (last === void 0) return {
1845
- decision: "need_more_work",
1846
- reasons: [`${name}: no paired holdout observations — nothing to test`],
1847
- contributingGates: [{
1848
- name,
1849
- status: "not_evaluated",
1850
- detail
1851
- }]
1852
- };
1853
- const decision = last.decision === "promote" ? "ship" : last.decision === "continue" ? "need_more_work" : "hold";
1854
- return {
1855
- decision,
1856
- reasons: [`${name}: ${last.reason}`],
1857
- contributingGates: [{
1858
- name,
1859
- status: decision === "ship" ? "pass" : decision === "need_more_work" ? "not_evaluated" : "fail",
1860
- detail
1861
- }],
1862
- delta: meanDelta
1863
- };
1864
- }
1865
- };
1866
- }
1867
- /**
1868
- * `SurfaceProposer.decide` adapter — stops the optimization loop the moment
1869
- * the e-process decides the loop has produced a real improvement, instead of
1870
- * always running `maxGenerations`.
1871
- *
1872
- * Stream: for each generation g ≥ 1, the per-scenario composite deltas of
1873
- * generation g's top candidate vs the generation-0 top candidate (the
1874
- * incumbent the loop set out to beat), paired by scenarioId. H0: no proposed
1875
- * surface improves any scenario's expected composite over the incumbent —
1876
- * under it every delta has conditional mean ≤ 0 and the e-process is valid.
1877
- * Once wealth ≥ 1/alpha the loop stops and hands the winner to the promotion
1878
- * gate (which re-scores on HELD-OUT data — this adapter only spends the
1879
- * exploration budget, it never promotes).
1880
- *
1881
- * Honesty caveats: (1) the incumbent's scores are measured once and shared
1882
- * across all generations' deltas, so type-I control is exact only insofar as
1883
- * those scores approximate the incumbent's true per-scenario means (more reps
1884
- * → tighter); (2) an UNDECIDED process never stops the loop — absence of a
1885
- * crossing is NOT evidence of no effect, so the loop simply runs its normal
1886
- * course. Calling the adapter repeatedly with a growing history consumes each
1887
- * generation exactly once (re-feeding an already-seen record would double-count
1888
- * evidence).
1889
- */
1890
- function sequentialDecide(options = {}) {
1891
- const alpha = options.alpha ?? .05;
1892
- const minN = options.minN ?? 5;
1893
- const scale = options.scale ?? 1;
1894
- if (!Number.isFinite(scale) || scale <= 0) throw new Error(`sequentialDecide: scale must be > 0, got ${scale}`);
1895
- const proc = eProcess({
1896
- alpha,
1897
- maxBet: options.maxBet ?? .5,
1898
- nullMean: .5
1899
- });
1900
- const threshold = 1 / alpha;
1901
- let processedGenerations = 0;
1902
- let reference;
1903
- let stopped;
1904
- const topCandidate = (record) => {
1905
- if (record.candidates.length === 0) throw new Error(`sequentialDecide: generation ${record.generationIndex} has no candidates — cannot extract a top candidate`);
1906
- return record.candidates.reduce((best, candidate) => {
1907
- if (best.composite === null) return candidate;
1908
- if (candidate.composite === null) return best;
1909
- return candidate.composite > best.composite ? candidate : best;
1910
- });
1911
- };
1912
- const decide = ({ history }) => {
1913
- if (stopped) return stopped;
1914
- if (history.length === 0) return { stop: false };
1915
- if (reference === void 0) reference = new Map(topCandidate(history[0]).scenarios.map((s) => [s.scenarioId, s.composite]));
1916
- for (let g = Math.max(1, processedGenerations); g < history.length; g++) {
1917
- const top = topCandidate(history[g]);
1918
- const byScenario = new Map(top.scenarios.map((s) => [s.scenarioId, s.composite]));
1919
- for (const [scenarioId, refComposite] of reference) {
1920
- const candComposite = byScenario.get(scenarioId);
1921
- if (candComposite === void 0) throw new Error(`sequentialDecide: generation ${history[g].generationIndex} top candidate is missing scenario '${scenarioId}' — generations must score the same scenario set to pair`);
1922
- const delta = candComposite - refComposite;
1923
- if (!Number.isFinite(delta) || Math.abs(delta) > scale) throw new Error(`sequentialDecide: paired delta ${delta} outside ±scale=${scale} on scenario '${scenarioId}' — pass the composite scale explicitly`);
1924
- const step = proc.update((delta / scale + 1) / 2);
1925
- if (step.n >= minN && step.wealth >= threshold) {
1926
- stopped = {
1927
- stop: true,
1928
- reason: `sequential e-process decided at generation ${history[g].generationIndex}: e-value ${step.wealth.toFixed(2)} ≥ 1/α=${threshold.toFixed(2)} after n=${step.n} paired deltas vs the generation-0 incumbent — the improvement is real at α=${alpha}; stop exploring and promote via the gate`
1929
- };
1930
- processedGenerations = history.length;
1931
- return stopped;
1932
- }
1933
- }
1934
- }
1935
- processedGenerations = history.length;
1936
- return { stop: false };
1937
- };
1938
- decide.state = () => proc.state();
1939
- return decide;
1940
- }
1941
- //#endregion
1942
1658
  //#region src/campaign/grounded-reflection.ts
1943
1659
  /**
1944
1660
  * Deterministic per-field diff of call arguments between passing and failing
@@ -4074,6 +3790,6 @@ function resolveWorktreePath(surface, worktreeDir) {
4074
3790
  return verifyCodeSurface(surface, worktreeDir).path;
4075
3791
  }
4076
3792
  //#endregion
4077
- export { loadEvalFixture as A, agentProfileModelId as B, LabeledScenarioStoreError as C, sequentialPairedGate as D, sequentialDecide as E, traceAnalystQualityJudge as F, createLlmCorrectnessChecker as G, harnessAxisOf as H, CODING_HARNESSES as I, verifyCompletion as J, createTokenRecallChecker as K, HARNESS_NATIVE_MODEL as L, planEvalFixtureRun as M, analyzeCrossSurfaceInteractions as N, neutralizationGate as O, buildTraceAnalystSurfaceDispatch as P, agentProfileHash as R, FsLabeledScenarioStore as S, rolloutArgumentDiff as T, extractProducedState as U, expandProfileAxes as V, completionVerdict as W, renderScoreboardMarkdown as _, autoevalsScorerJudge as a, userStoryScoreboard as b, FileSearchLedger as c, validateSearchLedgerEvent as d, scoreDiscrimination as f, makePlaybackDispatch as g, runProfileMatrix as h, verifyCodeSurface as i, loadEvalFixtureScenarios as j, discoverEvalFixtures as k, SEARCH_LEDGER_SCHEMA as l, ProfileMatrixError as m, gitWorktreeAdapter as n, phoenixEvaluatorJudge as o, selectDiscriminative as p, parseCorrectnessResponse as q, resolveWorktreePath as r, isTransientTransportFailure as s, WorktreeAdapterError as t, openSearchLedger as u, scoreUserStory as v, classifyUngroundedLiterals as w, neutralizeText as x, scoreboardSummary as y, agentProfileId as z };
3793
+ export { planEvalFixtureRun as A, harnessAxisOf as B, LabeledScenarioStoreError as C, discoverEvalFixtures as D, neutralizationGate as E, HARNESS_NATIVE_MODEL as F, parseCorrectnessResponse as G, completionVerdict as H, agentProfileHash as I, verifyCompletion as K, agentProfileId as L, buildTraceAnalystSurfaceDispatch as M, traceAnalystQualityJudge as N, loadEvalFixture as O, CODING_HARNESSES as P, agentProfileModelId as R, FsLabeledScenarioStore as S, rolloutArgumentDiff as T, createLlmCorrectnessChecker as U, extractProducedState as V, createTokenRecallChecker as W, renderScoreboardMarkdown as _, autoevalsScorerJudge as a, userStoryScoreboard as b, FileSearchLedger as c, validateSearchLedgerEvent as d, scoreDiscrimination as f, makePlaybackDispatch as g, runProfileMatrix as h, verifyCodeSurface as i, analyzeCrossSurfaceInteractions as j, loadEvalFixtureScenarios as k, SEARCH_LEDGER_SCHEMA as l, ProfileMatrixError as m, gitWorktreeAdapter as n, phoenixEvaluatorJudge as o, selectDiscriminative as p, resolveWorktreePath as r, isTransientTransportFailure as s, WorktreeAdapterError as t, openSearchLedger as u, scoreUserStory as v, classifyUngroundedLiterals as w, neutralizeText as x, scoreboardSummary as y, expandProfileAxes as z };
4078
3794
 
4079
- //# sourceMappingURL=campaign-CXsdyym7.js.map
3795
+ //# sourceMappingURL=campaign-Tdy3h62h.js.map