@tangle-network/agent-eval 1.0.40 → 2.0.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 (372) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-hytrwAnN.d.ts → agent-profile-BSgtn-k-.d.ts} +83 -4
  4. package/dist/agent-profile-BSgtn-k-.d.ts.map +1 -0
  5. package/dist/{agent-profile-DgbRJpSi.js → agent-profile-CCw6EXWW.js} +2 -2
  6. package/dist/{agent-profile-DgbRJpSi.js.map → agent-profile-CCw6EXWW.js.map} +1 -1
  7. package/dist/{agent-profile-cell-7Mt0wBkl.js → agent-profile-cell-CUthydZB.js} +2 -2
  8. package/dist/{agent-profile-cell-7Mt0wBkl.js.map → agent-profile-cell-CUthydZB.js.map} +1 -1
  9. package/dist/analyst/index.d.ts +13 -13
  10. package/dist/analyst/index.d.ts.map +1 -1
  11. package/dist/analyst/index.js +15 -15
  12. package/dist/analyst/index.js.map +1 -1
  13. package/dist/{analyze-runs-DqHx3Q_g.js → analyze-runs-C_9cXPZn.js} +9 -9
  14. package/dist/{analyze-runs-DqHx3Q_g.js.map → analyze-runs-C_9cXPZn.js.map} +1 -1
  15. package/dist/{analyze-runs-Ctuz-dd3.d.ts → analyze-runs-zEI7yAH_.d.ts} +2 -2
  16. package/dist/{analyze-runs-Ctuz-dd3.d.ts.map → analyze-runs-zEI7yAH_.d.ts.map} +1 -1
  17. package/dist/app-grade/index.d.ts +3 -3
  18. package/dist/app-grade/index.js +3 -3
  19. package/dist/authenticity/index.d.ts.map +1 -1
  20. package/dist/authenticity/index.js.map +1 -1
  21. package/dist/{benchmark-command-CJw3ijDV.js → benchmark-command-XLXa7I98.js} +14 -13
  22. package/dist/benchmark-command-XLXa7I98.js.map +1 -0
  23. package/dist/benchmarks/index.d.ts +8 -4
  24. package/dist/benchmarks/index.d.ts.map +1 -1
  25. package/dist/benchmarks/index.js +11 -6
  26. package/dist/benchmarks/index.js.map +1 -1
  27. package/dist/builder-eval/index.d.ts +1 -1
  28. package/dist/builder-eval/index.js +3 -3
  29. package/dist/{calibration-BBhY1QM6.js → calibration-Cfoup0xz.js} +3 -3
  30. package/dist/{calibration-BBhY1QM6.js.map → calibration-Cfoup0xz.js.map} +1 -1
  31. package/dist/campaign/index.d.ts +9 -9
  32. package/dist/campaign/index.js +16 -15
  33. package/dist/{campaign-DawSkDag.js → campaign-BlmkAwFD.js} +23 -23
  34. package/dist/campaign-BlmkAwFD.js.map +1 -0
  35. package/dist/{campaign-evidence-C1c6uihA.d.ts → campaign-evidence-BVKG5o32.d.ts} +6 -6
  36. package/dist/{campaign-evidence-C1c6uihA.d.ts.map → campaign-evidence-BVKG5o32.d.ts.map} +1 -1
  37. package/dist/{campaign-evidence-BX8OveG5.js → campaign-evidence-CsUE_lwc.js} +79 -26
  38. package/dist/campaign-evidence-CsUE_lwc.js.map +1 -0
  39. package/dist/{canonical-gLeHiqzd.d.ts → canonical-CGXS21f_.d.ts} +8 -5
  40. package/dist/{canonical-gLeHiqzd.d.ts.map → canonical-CGXS21f_.d.ts.map} +1 -1
  41. package/dist/{canonical-BANK6NOj.js → canonical-DKgL_Wby.js} +30 -8
  42. package/dist/canonical-DKgL_Wby.js.map +1 -0
  43. package/dist/{chat-client-DmPB31_2.js → chat-client-DqAXFLi-.js} +2 -2
  44. package/dist/{chat-client-DmPB31_2.js.map → chat-client-DqAXFLi-.js.map} +1 -1
  45. package/dist/{chat-json-call-Rfhu7JbJ.js → chat-json-call-CB6sQ6sv.js} +2 -2
  46. package/dist/{chat-json-call-Rfhu7JbJ.js.map → chat-json-call-CB6sQ6sv.js.map} +1 -1
  47. package/dist/{claim-C6LRiwz1.js → claim-BWEXwwBk.js} +2 -2
  48. package/dist/{claim-C6LRiwz1.js.map → claim-BWEXwwBk.js.map} +1 -1
  49. package/dist/cli.js +11 -11
  50. package/dist/{client-BIFwUg7I.d.ts → client-DUMIaMob.d.ts} +2 -2
  51. package/dist/{client-BIFwUg7I.d.ts.map → client-DUMIaMob.d.ts.map} +1 -1
  52. package/dist/cluster-CSd0LE_M.d.ts.map +1 -1
  53. package/dist/{cluster-bootstrap-ClPYIWoX.js → cluster-bootstrap-DPzVy3_K.js} +2 -2
  54. package/dist/{cluster-bootstrap-ClPYIWoX.js.map → cluster-bootstrap-DPzVy3_K.js.map} +1 -1
  55. package/dist/{completion-verifier-C3q1T96h.js → completion-verifier-DiG3y43g.js} +6 -6
  56. package/dist/{completion-verifier-C3q1T96h.js.map → completion-verifier-DiG3y43g.js.map} +1 -1
  57. package/dist/containment-order-GCJ-y_FV.js +56 -0
  58. package/dist/containment-order-GCJ-y_FV.js.map +1 -0
  59. package/dist/contract/index.d.ts +11 -11
  60. package/dist/contract/index.js +16 -16
  61. package/dist/contract/index.js.map +1 -1
  62. package/dist/cost-ledger-1CwUnVOd.js.map +1 -1
  63. package/dist/{decision-point-BN1YQNqk.js → decision-point-gt5JgqZ0.js} +8 -8
  64. package/dist/{decision-point-BN1YQNqk.js.map → decision-point-gt5JgqZ0.js.map} +1 -1
  65. package/dist/{default-registry-C5x2jyD6.d.ts → default-registry-DH_tl-V1.d.ts} +7 -7
  66. package/dist/{default-registry-C5x2jyD6.d.ts.map → default-registry-DH_tl-V1.d.ts.map} +1 -1
  67. package/dist/{default-registry-BE5Rj9ba.js → default-registry-Y9AaKLmG.js} +8 -8
  68. package/dist/default-registry-Y9AaKLmG.js.map +1 -0
  69. package/dist/{define-agent-eval-C4yoCqkc.d.ts → define-agent-eval-BDxV_ONM.d.ts} +18 -9
  70. package/dist/define-agent-eval-BDxV_ONM.d.ts.map +1 -0
  71. package/dist/{define-agent-eval-CyU7eAzj.js → define-agent-eval-Cq-bdF4O.js} +13 -11
  72. package/dist/define-agent-eval-Cq-bdF4O.js.map +1 -0
  73. package/dist/diagnosis/index.d.ts +3 -3
  74. package/dist/diagnosis/index.d.ts.map +1 -1
  75. package/dist/diagnosis/index.js +1 -1
  76. package/dist/diagnosis/index.js.map +1 -1
  77. package/dist/{dspy-rlm-engine-aM1RWOUT.js → dspy-rlm-engine-CHpTzYvZ.js} +4 -3
  78. package/dist/dspy-rlm-engine-CHpTzYvZ.js.map +1 -0
  79. package/dist/{emitter-DhQ65mza.js → emitter-BjW3NnX-.js} +15 -6
  80. package/dist/emitter-BjW3NnX-.js.map +1 -0
  81. package/dist/{emitter-mAXC5PSN.d.ts → emitter-Cw8ijO3v.d.ts} +4 -4
  82. package/dist/{emitter-mAXC5PSN.d.ts.map → emitter-Cw8ijO3v.d.ts.map} +1 -1
  83. package/dist/{engine-B2w3ARpj.d.ts → engine-3y87jnX0.d.ts} +2 -2
  84. package/dist/{engine-B2w3ARpj.d.ts.map → engine-3y87jnX0.d.ts.map} +1 -1
  85. package/dist/errors-DeEEV9Vx.js.map +1 -1
  86. package/dist/{eval-campaign-CWWh-1p1.js → eval-campaign-Cyk-tkLh.js} +5 -5
  87. package/dist/{eval-campaign-CWWh-1p1.js.map → eval-campaign-Cyk-tkLh.js.map} +1 -1
  88. package/dist/{evaluation-CQ-uAbqF.d.ts → evaluation-RODuDmCe.d.ts} +4 -4
  89. package/dist/{evaluation-CQ-uAbqF.d.ts.map → evaluation-RODuDmCe.d.ts.map} +1 -1
  90. package/dist/evaluation.d.ts +1 -1
  91. package/dist/{exact-types-B0_jA3V7.d.ts → exact-types-C4Rug7fG.d.ts} +2 -2
  92. package/dist/{exact-types-B0_jA3V7.d.ts.map → exact-types-C4Rug7fG.d.ts.map} +1 -1
  93. package/dist/{execution-insight-9No6Si55.d.ts → execution-insight-iOsr1Zi8.d.ts} +2 -2
  94. package/dist/{execution-insight-9No6Si55.d.ts.map → execution-insight-iOsr1Zi8.d.ts.map} +1 -1
  95. package/dist/experiment/index.d.ts +4 -4
  96. package/dist/experiment/index.d.ts.map +1 -1
  97. package/dist/experiment/index.js +10 -10
  98. package/dist/experiment/index.js.map +1 -1
  99. package/dist/{exporters-C9AwGDDK.js → exporters-CKFtnWmX.js} +2 -2
  100. package/dist/{exporters-C9AwGDDK.js.map → exporters-CKFtnWmX.js.map} +1 -1
  101. package/dist/external-optimizer-contracts-eKQTutGZ.js +123 -0
  102. package/dist/external-optimizer-contracts-eKQTutGZ.js.map +1 -0
  103. package/dist/{external-optimizer-process-DFEPdWJY.js → external-optimizer-process-CkAc1xBa.js} +22 -26
  104. package/dist/external-optimizer-process-CkAc1xBa.js.map +1 -0
  105. package/dist/{external-optimizer-subprocess-BspZ0bZb.js → external-optimizer-subprocess-B48Ie4qQ.js} +10 -124
  106. package/dist/external-optimizer-subprocess-B48Ie4qQ.js.map +1 -0
  107. package/dist/extract-usage-ISFqhfDz.js.map +1 -1
  108. package/dist/{feedback-trajectory-CCWiFzeE.d.ts → feedback-trajectory-B5hTr9w5.d.ts} +4 -4
  109. package/dist/{feedback-trajectory-CCWiFzeE.d.ts.map → feedback-trajectory-B5hTr9w5.d.ts.map} +1 -1
  110. package/dist/{finding-composition-BMgspnVI.js → finding-composition-CyWSTcAY.js} +2 -2
  111. package/dist/{finding-composition-BMgspnVI.js.map → finding-composition-CyWSTcAY.js.map} +1 -1
  112. package/dist/{findings-store-B8pq8Rhr.js → findings-store-Rx9ZJgHV.js} +6 -6
  113. package/dist/{findings-store-B8pq8Rhr.js.map → findings-store-Rx9ZJgHV.js.map} +1 -1
  114. package/dist/fuzz.d.ts.map +1 -1
  115. package/dist/fuzz.js +1 -1
  116. package/dist/fuzz.js.map +1 -1
  117. package/dist/{harness-session-lines-Fd5aeSDV.js → harness-session-lines-CSxKR6no.js} +3 -3
  118. package/dist/{harness-session-lines-Fd5aeSDV.js.map → harness-session-lines-CSxKR6no.js.map} +1 -1
  119. package/dist/{hf-dataset-kthWy7xl.js → hf-dataset-B0s2ZAhQ.js} +4 -4
  120. package/dist/{hf-dataset-kthWy7xl.js.map → hf-dataset-B0s2ZAhQ.js.map} +1 -1
  121. package/dist/hosted/index.d.ts +2 -2
  122. package/dist/hosted/index.js +1 -1
  123. package/dist/{index-BuuUhU_V.d.ts → index-BJTUL2Ff.d.ts} +41 -29
  124. package/dist/index-BJTUL2Ff.d.ts.map +1 -0
  125. package/dist/{index-Bhc7H9e0.d.ts → index-CX8_WfqS.d.ts} +5 -5
  126. package/dist/{index-Bhc7H9e0.d.ts.map → index-CX8_WfqS.d.ts.map} +1 -1
  127. package/dist/{index-DtW7KhyE.d.ts → index-D-nKkzsI.d.ts} +3 -3
  128. package/dist/{index-DtW7KhyE.d.ts.map → index-D-nKkzsI.d.ts.map} +1 -1
  129. package/dist/{index-HdlzN11G.d.ts → index-D1NRaf5U.d.ts} +7 -7
  130. package/dist/{index-HdlzN11G.d.ts.map → index-D1NRaf5U.d.ts.map} +1 -1
  131. package/dist/{index-Bcy00QoN.d.ts → index-DcGHcBpR.d.ts} +86 -86
  132. package/dist/index-DcGHcBpR.d.ts.map +1 -0
  133. package/dist/{index-CXoFLNKI.d.ts → index-FLyheOVA.d.ts} +9 -9
  134. package/dist/index-FLyheOVA.d.ts.map +1 -0
  135. package/dist/{index-lRKqfyg4.d.ts → index-qy6buL6y.d.ts} +2 -2
  136. package/dist/{index-lRKqfyg4.d.ts.map → index-qy6buL6y.d.ts.map} +1 -1
  137. package/dist/index.d.ts +29 -29
  138. package/dist/index.js +41 -41
  139. package/dist/index.js.map +1 -1
  140. package/dist/{integrity-BSs9dgKW.js → integrity-BF0tJK21.js} +3 -3
  141. package/dist/{integrity-BSs9dgKW.js.map → integrity-BF0tJK21.js.map} +1 -1
  142. package/dist/{journal-DQsbHGjX.js → journal-3y-btqaP.js} +2 -2
  143. package/dist/{journal-DQsbHGjX.js.map → journal-3y-btqaP.js.map} +1 -1
  144. package/dist/journal-file-AekB57Er.js.map +1 -1
  145. package/dist/{json-recovery-b7O9WVTF.js → json-recovery-BRUCeQxo.js} +2 -2
  146. package/dist/{json-recovery-b7O9WVTF.js.map → json-recovery-BRUCeQxo.js.map} +1 -1
  147. package/dist/{judge-gate-LbmZU-pA.js → judge-gate-TBv2jeO0.js} +3 -3
  148. package/dist/{judge-gate-LbmZU-pA.js.map → judge-gate-TBv2jeO0.js.map} +1 -1
  149. package/dist/{kind-factory-B5FfFE5G.js → kind-factory-DfNsTe-q.js} +3 -3
  150. package/dist/kind-factory-DfNsTe-q.js.map +1 -0
  151. package/dist/ledger-core/index.d.ts +2 -2
  152. package/dist/ledger-core/index.js +3 -3
  153. package/dist/{ledger-core-7e6sXmhV.js → ledger-core-auznoaD7.js} +3 -3
  154. package/dist/ledger-core-auznoaD7.js.map +1 -0
  155. package/dist/{llm-client-CdHo3SH0.js → llm-client-gRPgIJyz.js} +2 -2
  156. package/dist/{llm-client-CdHo3SH0.js.map → llm-client-gRPgIJyz.js.map} +1 -1
  157. package/dist/{llm-judge-DHgx29ro.js → llm-judge-CThv1Rog.js} +140 -44
  158. package/dist/llm-judge-CThv1Rog.js.map +1 -0
  159. package/dist/{matrix-BKzNwIWb.d.ts → matrix-CfJ5vhfq.d.ts} +2 -2
  160. package/dist/{matrix-BKzNwIWb.d.ts.map → matrix-CfJ5vhfq.d.ts.map} +1 -1
  161. package/dist/meta-eval/index.d.ts +1 -1
  162. package/dist/meta-eval/index.js +9 -9
  163. package/dist/{mint-VN-qtJTc.js → mint-B4n1pRRd.js} +12 -6
  164. package/dist/mint-B4n1pRRd.js.map +1 -0
  165. package/dist/{model-comparison-BZr_Hu00.js → model-comparison-CgnVh4Ph.js} +3 -3
  166. package/dist/{model-comparison-BZr_Hu00.js.map → model-comparison-CgnVh4Ph.js.map} +1 -1
  167. package/dist/multishot/golden/index.d.ts +1 -1
  168. package/dist/multishot/index.d.ts +2 -2
  169. package/dist/multishot/index.js +1 -1
  170. package/dist/multishot/index.js.map +1 -1
  171. package/dist/openapi.json +1 -1
  172. package/dist/{outcome-observations-YFFmdGGW.js → outcome-observations-DL3CC8w1.js} +2 -2
  173. package/dist/{outcome-observations-YFFmdGGW.js.map → outcome-observations-DL3CC8w1.js.map} +1 -1
  174. package/dist/{paired-arms-DH376s4-.js → paired-arms-DZhH3FGu.js} +3 -3
  175. package/dist/{paired-arms-DH376s4-.js.map → paired-arms-DZhH3FGu.js.map} +1 -1
  176. package/dist/{paired-promotion-decision-BoWHWL1i.js → paired-promotion-decision-Dn3-jaq4.js} +2 -2
  177. package/dist/{paired-promotion-decision-BoWHWL1i.js.map → paired-promotion-decision-Dn3-jaq4.js.map} +1 -1
  178. package/dist/{paired-promotion-decision-BBSxTo-h.d.ts → paired-promotion-decision-Il-Nv-n4.d.ts} +2 -2
  179. package/dist/{paired-promotion-decision-BBSxTo-h.d.ts.map → paired-promotion-decision-Il-Nv-n4.d.ts.map} +1 -1
  180. package/dist/{paired-promotion-power-BXH3gzvs.js → paired-promotion-power-BlzXdgMD.js} +3 -3
  181. package/dist/{paired-promotion-power-BXH3gzvs.js.map → paired-promotion-power-BlzXdgMD.js.map} +1 -1
  182. package/dist/{pareto-BNWWbLNl.js → pareto-Bg75Gajo.js} +7 -7
  183. package/dist/{pareto-BNWWbLNl.js.map → pareto-Bg75Gajo.js.map} +1 -1
  184. package/dist/pipelines/index.d.ts +3 -3
  185. package/dist/pipelines/index.d.ts.map +1 -1
  186. package/dist/pipelines/index.js +19 -33
  187. package/dist/pipelines/index.js.map +1 -1
  188. package/dist/{prime-protocol-BR0xy0cF.d.ts → prime-protocol-CdNaCQy5.d.ts} +2 -2
  189. package/dist/{prime-protocol-BR0xy0cF.d.ts.map → prime-protocol-CdNaCQy5.d.ts.map} +1 -1
  190. package/dist/profile-cell.js +1 -1
  191. package/dist/{promotion-gate-XiTqW22r.d.ts → promotion-gate-DKAvMFlS.d.ts} +2 -2
  192. package/dist/{promotion-gate-XiTqW22r.d.ts.map → promotion-gate-DKAvMFlS.d.ts.map} +1 -1
  193. package/dist/{promotion-policy-CfgRPGx0.js → promotion-policy-CxDIh-9p.js} +4 -4
  194. package/dist/{promotion-policy-CfgRPGx0.js.map → promotion-policy-CxDIh-9p.js.map} +1 -1
  195. package/dist/{proposal-findings-DFQvA-k5.js → proposal-findings-DnR7zdUc.js} +2 -2
  196. package/dist/{proposal-findings-DFQvA-k5.js.map → proposal-findings-DnR7zdUc.js.map} +1 -1
  197. package/dist/{query-Ck6KhcDo.js → query-Dhjkwqyx.js} +2 -2
  198. package/dist/{query-Ck6KhcDo.js.map → query-Dhjkwqyx.js.map} +1 -1
  199. package/dist/{registry-D23oO0_f.d.ts → registry-LqAf_laP.d.ts} +3 -3
  200. package/dist/{registry-D23oO0_f.d.ts.map → registry-LqAf_laP.d.ts.map} +1 -1
  201. package/dist/{release-confidence-BdidB0mG.js → release-confidence-BLHOMK5Q.js} +3 -3
  202. package/dist/{release-confidence-BdidB0mG.js.map → release-confidence-BLHOMK5Q.js.map} +1 -1
  203. package/dist/reporting.d.ts +4 -4
  204. package/dist/reporting.js +5 -5
  205. package/dist/{research-report-BGKsOqkF.d.ts → research-report-BauFJiqu.d.ts} +2 -2
  206. package/dist/{research-report-BGKsOqkF.d.ts.map → research-report-BauFJiqu.d.ts.map} +1 -1
  207. package/dist/{researcher-DvFDa1o1.d.ts → researcher-B4e2Z92k.d.ts} +3 -3
  208. package/dist/{researcher-DvFDa1o1.d.ts.map → researcher-B4e2Z92k.d.ts.map} +1 -1
  209. package/dist/{reward-hacking-DNiHskry.js → reward-hacking-DKAflk2c.js} +2 -2
  210. package/dist/{reward-hacking-DNiHskry.js.map → reward-hacking-DKAflk2c.js.map} +1 -1
  211. package/dist/rl.d.ts +155 -39
  212. package/dist/rl.d.ts.map +1 -1
  213. package/dist/rl.js +420 -76
  214. package/dist/rl.js.map +1 -1
  215. package/dist/rollout/index.d.ts +4 -4
  216. package/dist/rollout/index.js +6 -6
  217. package/dist/{rollout-DDMkK_Lw.js → rollout-B6LlGRSq.js} +9 -9
  218. package/dist/rollout-B6LlGRSq.js.map +1 -0
  219. package/dist/{rollout-nodes-DzmHlPAC.js → rollout-nodes-Vas6OSxX.js} +2 -2
  220. package/dist/{rollout-nodes-DzmHlPAC.js.map → rollout-nodes-Vas6OSxX.js.map} +1 -1
  221. package/dist/{rubric-predictive-validity-Cln7r56F.js → rubric-predictive-validity--6z0q8s6.js} +2 -2
  222. package/dist/{rubric-predictive-validity-Cln7r56F.js.map → rubric-predictive-validity--6z0q8s6.js.map} +1 -1
  223. package/dist/{run-improvement-loop-BAxDnaPI.d.ts → run-improvement-loop-B1OKCm2D.d.ts} +112 -70
  224. package/dist/run-improvement-loop-B1OKCm2D.d.ts.map +1 -0
  225. package/dist/{run-record-c860wUR8.js → run-record-Bqg0NZ_e.js} +19 -4
  226. package/dist/run-record-Bqg0NZ_e.js.map +1 -0
  227. package/dist/{run-record-Dx64nPcX.js → run-record-CqUft6Yf.js} +2 -2
  228. package/dist/{run-record-Dx64nPcX.js.map → run-record-CqUft6Yf.js.map} +1 -1
  229. package/dist/{runtime-rollouts-CALol_Y4.js → runtime-rollouts-DdUijr_t.js} +7 -7
  230. package/dist/runtime-rollouts-DdUijr_t.js.map +1 -0
  231. package/dist/{schema-BTTzvMnn.d.ts → schema-BfSoJjD-.d.ts} +5 -1
  232. package/dist/schema-BfSoJjD-.d.ts.map +1 -0
  233. package/dist/{schema-b18jtzZw.js → schema-Bh9CfSZT.js} +3 -1
  234. package/dist/schema-Bh9CfSZT.js.map +1 -0
  235. package/dist/schema-CkIvnmLU.d.ts.map +1 -1
  236. package/dist/schema-D-xu3MU_.js.map +1 -1
  237. package/dist/search/index.d.ts +3 -3
  238. package/dist/search/index.d.ts.map +1 -1
  239. package/dist/search/index.js +3 -3
  240. package/dist/{search-kernel-DRHWY35J.d.ts → search-kernel-CuTvZlPS.d.ts} +5 -5
  241. package/dist/{search-kernel-DRHWY35J.d.ts.map → search-kernel-CuTvZlPS.d.ts.map} +1 -1
  242. package/dist/{search-ledger-oyqxZhry.js → search-ledger-C7t68cmy.js} +7 -7
  243. package/dist/{search-ledger-oyqxZhry.js.map → search-ledger-C7t68cmy.js.map} +1 -1
  244. package/dist/{search-ledger-file-DoHCYYLt.js → search-ledger-file-QuIbgz6b.js} +2 -2
  245. package/dist/search-ledger-file-QuIbgz6b.js.map +1 -0
  246. package/dist/{search-ledger-types-qiYRUo_N.d.ts → search-ledger-types-BhZE848w.d.ts} +2 -2
  247. package/dist/{search-ledger-types-qiYRUo_N.d.ts.map → search-ledger-types-BhZE848w.d.ts.map} +1 -1
  248. package/dist/{search-shipper-BwqeQ61l.js → search-shipper-CmDW9dU6.js} +3 -3
  249. package/dist/{search-shipper-BwqeQ61l.js.map → search-shipper-CmDW9dU6.js.map} +1 -1
  250. package/dist/{search-summary-CNHpHFfw.js → search-summary-B1x1Vmzh.js} +5 -5
  251. package/dist/{search-summary-CNHpHFfw.js.map → search-summary-B1x1Vmzh.js.map} +1 -1
  252. package/dist/{sequential-93xxuiiG.js → sequential-BphITa5b.js} +4 -4
  253. package/dist/{sequential-93xxuiiG.js.map → sequential-BphITa5b.js.map} +1 -1
  254. package/dist/{sequential-B-zx24n_.d.ts → sequential-DqOJZO2V.d.ts} +2 -2
  255. package/dist/{sequential-B-zx24n_.d.ts.map → sequential-DqOJZO2V.d.ts.map} +1 -1
  256. package/dist/{sequential-C6k0Wrb7.js → sequential-ux_XrjBf.js} +3 -3
  257. package/dist/{sequential-C6k0Wrb7.js.map → sequential-ux_XrjBf.js.map} +1 -1
  258. package/dist/{served-model-qhLmbutL.js → served-model-BXmeKm7D.js} +2 -2
  259. package/dist/{served-model-qhLmbutL.js.map → served-model-BXmeKm7D.js.map} +1 -1
  260. package/dist/{server-DnoEi4Sb.js → server-BxHJyclG.js} +4 -4
  261. package/dist/{server-DnoEi4Sb.js.map → server-BxHJyclG.js.map} +1 -1
  262. package/dist/{skillopt-optimization-method-Du3GbReg.js → skillopt-optimization-method-CHW9mphc.js} +389 -68
  263. package/dist/skillopt-optimization-method-CHW9mphc.js.map +1 -0
  264. package/dist/{statistical-heldout-BvcAVtof.js → statistical-heldout-CaS4T-43.js} +3 -3
  265. package/dist/{statistical-heldout-BvcAVtof.js.map → statistical-heldout-CaS4T-43.js.map} +1 -1
  266. package/dist/{statistics-CHs0jlsY.js → statistics-DSidA5I2.js} +184 -184
  267. package/dist/statistics-DSidA5I2.js.map +1 -0
  268. package/dist/statistics.d.ts +1 -1
  269. package/dist/statistics.js +1 -1
  270. package/dist/{store-otlp-DHc_E78m.js → store-otlp-DCQTz9lS.js} +2 -2
  271. package/dist/{store-otlp-DHc_E78m.js.map → store-otlp-DCQTz9lS.js.map} +1 -1
  272. package/dist/{store-tool-spans-C1lZKvvl.d.ts → store-tool-spans-B0UYrcl7.d.ts} +5 -5
  273. package/dist/{store-tool-spans-C1lZKvvl.d.ts.map → store-tool-spans-B0UYrcl7.d.ts.map} +1 -1
  274. package/dist/{store-tool-spans-BR4IhZYZ.js → store-tool-spans-D2-S3OdE.js} +4 -4
  275. package/dist/{store-tool-spans-BR4IhZYZ.js.map → store-tool-spans-D2-S3OdE.js.map} +1 -1
  276. package/dist/storyboard/index.d.ts.map +1 -1
  277. package/dist/storyboard/index.js.map +1 -1
  278. package/dist/{summary-report-CXiE1UrA.js → summary-report-CI4J6gxU.js} +4 -4
  279. package/dist/{summary-report-CXiE1UrA.js.map → summary-report-CI4J6gxU.js.map} +1 -1
  280. package/dist/supervisor-run/index.d.ts +2 -2
  281. package/dist/supervisor-run/index.d.ts.map +1 -1
  282. package/dist/supervisor-run/index.js +3 -3
  283. package/dist/{systemone-B_3Vd395.d.ts → systemone-nAN8fBy9.d.ts} +8 -8
  284. package/dist/{systemone-B_3Vd395.d.ts.map → systemone-nAN8fBy9.d.ts.map} +1 -1
  285. package/dist/systemone-protocol.js +1 -1
  286. package/dist/{systemone-review-ZAN-5m_2.d.ts → systemone-review-e2ElIpD_.d.ts} +3 -3
  287. package/dist/{systemone-review-ZAN-5m_2.d.ts.map → systemone-review-e2ElIpD_.d.ts.map} +1 -1
  288. package/dist/{systemone-review-CqNNZMiD.js → systemone-review-ir3Cbejl.js} +3 -3
  289. package/dist/{systemone-review-CqNNZMiD.js.map → systemone-review-ir3Cbejl.js.map} +1 -1
  290. package/dist/systemone.d.ts +3 -3
  291. package/dist/systemone.js +2 -2
  292. package/dist/{tool-groups-BOH1E-E4.d.ts → tool-groups-sRVCeevR.d.ts} +3 -3
  293. package/dist/tool-groups-sRVCeevR.d.ts.map +1 -0
  294. package/dist/tool-waste-CIhtU1ad.d.ts +217 -0
  295. package/dist/tool-waste-CIhtU1ad.d.ts.map +1 -0
  296. package/dist/{tool-waste-DzLI-JJg.js → tool-waste-u7JJ_BlE.js} +3 -3
  297. package/dist/{tool-waste-DzLI-JJg.js.map → tool-waste-u7JJ_BlE.js.map} +1 -1
  298. package/dist/{trace-questions-DBsrgY_H.d.ts → trace-questions-BN-LSfkA.d.ts} +3 -3
  299. package/dist/{trace-questions-DBsrgY_H.d.ts.map → trace-questions-BN-LSfkA.d.ts.map} +1 -1
  300. package/dist/trace-repair/index.d.ts +1 -1
  301. package/dist/trace-repair/index.d.ts.map +1 -1
  302. package/dist/trace-repair/index.js +4 -4
  303. package/dist/trace-repair/index.js.map +1 -1
  304. package/dist/traces.d.ts +4 -4
  305. package/dist/traces.js +6 -6
  306. package/dist/{training-admission-xaDOlQ_U.d.ts → training-admission-DGZCyntI.d.ts} +2 -2
  307. package/dist/{training-admission-xaDOlQ_U.d.ts.map → training-admission-DGZCyntI.d.ts.map} +1 -1
  308. package/dist/trajectory-CKVZaQoQ.js +144 -0
  309. package/dist/trajectory-CKVZaQoQ.js.map +1 -0
  310. package/dist/trajectory-replay/index.d.ts.map +1 -1
  311. package/dist/trajectory-replay/index.js +24 -11
  312. package/dist/trajectory-replay/index.js.map +1 -1
  313. package/dist/{tree-0r6gPODs.js → tree-DQMlcNFI.js} +18 -6
  314. package/dist/tree-DQMlcNFI.js.map +1 -0
  315. package/dist/{types-DmYd2Igl.d.ts → types-BJ27EWAS.d.ts} +8 -8
  316. package/dist/{types-DmYd2Igl.d.ts.map → types-BJ27EWAS.d.ts.map} +1 -1
  317. package/dist/{types-ClDpBoLt.d.ts → types-CDWfUYOq.d.ts} +2 -2
  318. package/dist/{types-ClDpBoLt.d.ts.map → types-CDWfUYOq.d.ts.map} +1 -1
  319. package/dist/{types-_dfu6Ox2.d.ts → types-DI7YKvDI.d.ts} +3 -3
  320. package/dist/{types-_dfu6Ox2.d.ts.map → types-DI7YKvDI.d.ts.map} +1 -1
  321. package/dist/{types-C8AyaiFi.js → types-_tlhWGUq.js} +2 -2
  322. package/dist/{types-C8AyaiFi.js.map → types-_tlhWGUq.js.map} +1 -1
  323. package/dist/{types-DGqGbNY4.d.ts → types-pMk2rgP9.d.ts} +20 -6
  324. package/dist/{types-DGqGbNY4.d.ts.map → types-pMk2rgP9.d.ts.map} +1 -1
  325. package/dist/{verdict-CKo1iZkI.js → verdict-5PVtsWT_.js} +2 -2
  326. package/dist/{verdict-CKo1iZkI.js.map → verdict-5PVtsWT_.js.map} +1 -1
  327. package/dist/{verdict-cache-DfzlHLdf.js → verdict-cache-BPaYxfG8.js} +2 -2
  328. package/dist/verdict-cache-BPaYxfG8.js.map +1 -0
  329. package/dist/wire/index.d.ts +1 -1
  330. package/dist/wire/index.js +1 -1
  331. package/docs/campaign-proposers.md +14 -1
  332. package/docs/public-api.md +323 -85
  333. package/docs/rollout.md +2 -2
  334. package/docs/search-ledger.md +14 -2
  335. package/docs/statistical-evidence.md +9 -3
  336. package/docs/trajectory-replay.md +4 -0
  337. package/package.json +1 -1
  338. package/dist/agent-profile-hytrwAnN.d.ts.map +0 -1
  339. package/dist/benchmark-command-CJw3ijDV.js.map +0 -1
  340. package/dist/campaign-DawSkDag.js.map +0 -1
  341. package/dist/campaign-evidence-BX8OveG5.js.map +0 -1
  342. package/dist/canonical-BANK6NOj.js.map +0 -1
  343. package/dist/default-registry-BE5Rj9ba.js.map +0 -1
  344. package/dist/define-agent-eval-C4yoCqkc.d.ts.map +0 -1
  345. package/dist/define-agent-eval-CyU7eAzj.js.map +0 -1
  346. package/dist/dspy-rlm-engine-aM1RWOUT.js.map +0 -1
  347. package/dist/emitter-DhQ65mza.js.map +0 -1
  348. package/dist/external-optimizer-process-DFEPdWJY.js.map +0 -1
  349. package/dist/external-optimizer-subprocess-BspZ0bZb.js.map +0 -1
  350. package/dist/index-Bcy00QoN.d.ts.map +0 -1
  351. package/dist/index-BuuUhU_V.d.ts.map +0 -1
  352. package/dist/index-CXoFLNKI.d.ts.map +0 -1
  353. package/dist/kind-factory-B5FfFE5G.js.map +0 -1
  354. package/dist/ledger-core-7e6sXmhV.js.map +0 -1
  355. package/dist/llm-judge-DHgx29ro.js.map +0 -1
  356. package/dist/mint-VN-qtJTc.js.map +0 -1
  357. package/dist/rollout-DDMkK_Lw.js.map +0 -1
  358. package/dist/run-improvement-loop-BAxDnaPI.d.ts.map +0 -1
  359. package/dist/run-record-c860wUR8.js.map +0 -1
  360. package/dist/runtime-rollouts-CALol_Y4.js.map +0 -1
  361. package/dist/schema-BTTzvMnn.d.ts.map +0 -1
  362. package/dist/schema-b18jtzZw.js.map +0 -1
  363. package/dist/search-ledger-file-DoHCYYLt.js.map +0 -1
  364. package/dist/skillopt-optimization-method-Du3GbReg.js.map +0 -1
  365. package/dist/statistics-CHs0jlsY.js.map +0 -1
  366. package/dist/tool-groups-BOH1E-E4.d.ts.map +0 -1
  367. package/dist/tool-waste-CUASoTtk.d.ts +0 -139
  368. package/dist/tool-waste-CUASoTtk.d.ts.map +0 -1
  369. package/dist/trajectory-O3GDHmev.js +0 -55
  370. package/dist/trajectory-O3GDHmev.js.map +0 -1
  371. package/dist/tree-0r6gPODs.js.map +0 -1
  372. package/dist/verdict-cache-DfzlHLdf.js.map +0 -1
@@ -1,21 +1,22 @@
1
- import { a as hashCanonical } from "./canonical-BANK6NOj.js";
2
- import { i as assertServedModelPolicy } from "./served-model-qhLmbutL.js";
3
- import { ht as meanOrZero } from "./statistics-CHs0jlsY.js";
4
- import { t as decidePairedPromotion } from "./paired-promotion-decision-BoWHWL1i.js";
5
- import { a as heldoutSignificance, o as pairHoldout } from "./statistical-heldout-BvcAVtof.js";
6
- import { a as mapConcurrent } from "./journal-DQsbHGjX.js";
7
- import { n as contentHash, t as canonicalJson } from "./verdict-cache-DfzlHLdf.js";
8
- import { C as surfaceDiff, J as captureFinalEvidencePolicy, Q as reserveFinalEvidence, T as assertSearchHistoryAdmissionOptions, X as exposeFinalEvidence, Y as evaluationUnitMap, b as SearchRecorder, c as readGepaCandidatePopulationArtifact, d as optimizationTokenUsageFromSummary, l as combineComparisonCosts, o as executeOptimizationMethod, q as assertIndependentEvaluationSplit, rt as resolveRunDir, s as assertGepaCandidatePopulationSummary, st as withUncapturedAgentSpend, tt as runCampaign, u as costFromLedgerSummary, w as surfaceNode, x as developmentClaim, z as captureJudge } from "./llm-judge-DHgx29ro.js";
9
- import { D as assertCompleteCampaign, T as assertCampaignDesign, f as campaignBreakdown, t as createCampaignEvidenceReceipt } from "./campaign-evidence-BX8OveG5.js";
1
+ import { a as hashCanonical } from "./canonical-DKgL_Wby.js";
2
+ import { i as assertServedModelPolicy } from "./served-model-BXmeKm7D.js";
3
+ import { ht as meanOrZero } from "./statistics-DSidA5I2.js";
4
+ import { t as decidePairedPromotion } from "./paired-promotion-decision-Dn3-jaq4.js";
5
+ import { a as heldoutSignificance, o as pairHoldout } from "./statistical-heldout-CaS4T-43.js";
6
+ import { a as mapConcurrent } from "./journal-3y-btqaP.js";
7
+ import { n as contentHash, t as canonicalJson } from "./verdict-cache-BPaYxfG8.js";
8
+ import { $ as reserveFinalEvidence, A as campaignCellMeasurement, B as captureJudge, C as surfaceDiff, J as assertIndependentEvaluationSplit, T as assertSearchHistoryAdmissionOptions, X as evaluationUnitMap, Y as captureFinalEvidencePolicy, Z as exposeFinalEvidence, b as SearchRecorder, c as readGepaCandidatePopulationArtifact, ct as withUncapturedAgentSpend, d as optimizationTokenUsageFromSummary, it as resolveRunDir, j as campaignCellSearchResult, l as combineComparisonCosts, nt as runCampaign, o as executeOptimizationMethod, s as assertGepaCandidatePopulationSummary, u as costFromLedgerSummary, w as surfaceNode, x as developmentClaim } from "./llm-judge-CThv1Rog.js";
9
+ import { D as assertCampaignDesign, f as campaignBreakdown, k as assertCompleteCampaign, p as campaignEvidence, t as createCampaignEvidenceReceipt, v as excerptEvidence } from "./campaign-evidence-CsUE_lwc.js";
10
10
  import { t as deepFreezeCanonicalJson } from "./deep-freeze-CK8-2W7p.js";
11
- import { M as fsCampaignStorage, _ as resolveExternalOptimizerCallbackLimits, d as assertExternalOptimizerModelBudget, f as assertJsonValue, g as removeCredentialEnvironment, h as isExternalTextCandidate, i as startExternalOptimizerModelProxy, j as createRunCostLedger, m as isCandidateText, n as closeExternalOptimizerResources, p as assertNoCredentialValues, r as runWithCleanup, t as runExternalOptimizerProcess, v as resolveExternalOptimizerProcessLimits, y as safePathComponent } from "./external-optimizer-subprocess-BspZ0bZb.js";
12
- import { s as surfaceContentHash } from "./json-recovery-b7O9WVTF.js";
13
- import { r as summarizeEvaluationUnits, t as defineEvaluationClaim } from "./claim-C6LRiwz1.js";
14
- import { n as openSearchLedger } from "./search-ledger-oyqxZhry.js";
15
- import { t as acquireSingleRunLock } from "./single-run-lock-BSKsoeQF.js";
11
+ import { b as createRunCostLedger, i as startExternalOptimizerModelProxy, n as closeExternalOptimizerResources, r as runWithCleanup, t as runExternalOptimizerProcess, x as fsCampaignStorage } from "./external-optimizer-subprocess-B48Ie4qQ.js";
12
+ import { s as surfaceContentHash } from "./json-recovery-BRUCeQxo.js";
13
+ import { r as summarizeEvaluationUnits, t as defineEvaluationClaim } from "./claim-BWEXwwBk.js";
14
+ import { n as openSearchLedger } from "./search-ledger-C7t68cmy.js";
16
15
  import { n as isRecord } from "./json-DtvZNAU9.js";
17
- import { c as combineAbortSignals } from "./llm-client-CdHo3SH0.js";
18
- import { t as startExternalOptimizerCallback } from "./external-optimizer-process-DFEPdWJY.js";
16
+ import { a as assertNoCredentialValues, c as isExternalTextCandidate, d as resolveExternalOptimizerProcessLimits, f as safePathComponent, i as assertJsonValue, l as removeCredentialEnvironment, r as assertExternalOptimizerModelBudget, s as isCandidateText, u as resolveExternalOptimizerCallbackLimits } from "./external-optimizer-contracts-eKQTutGZ.js";
17
+ import { t as acquireSingleRunLock } from "./single-run-lock-BSKsoeQF.js";
18
+ import { c as combineAbortSignals } from "./llm-client-gRPgIJyz.js";
19
+ import { t as startExternalOptimizerCallback } from "./external-optimizer-process-CkAc1xBa.js";
19
20
  import { createHash, randomBytes } from "node:crypto";
20
21
  import { mkdir } from "node:fs/promises";
21
22
  import { isDeepStrictEqual } from "node:util";
@@ -72,11 +73,13 @@ function readExternalOptimizerObservationArtifact(input) {
72
73
  evaluationNumbers.add(observation.evaluationNumber);
73
74
  assertObservedCandidate(observation, proposed);
74
75
  assertJsonValue(observation.response, "external optimizer evaluation response");
76
+ if (observation.measurement?.cells.some((cell) => cell.scenarioId !== observation.exampleId)) throw new Error(`external optimizer observation artifact measures another case than it evaluated at sequence ${observation.sequence}`);
75
77
  continue;
76
78
  }
77
79
  refusals += 1;
78
80
  if (observation.reason !== "invalid-request" && observation.reason !== "evaluation-limit" && observation.reason !== "evaluation-failed") throw new Error(`external optimizer observation artifact has invalid refusal reason at sequence ${observation.sequence}`);
79
81
  if (observation.reason === "evaluation-failed") failedEvaluations += 1;
82
+ if (observation.measurement?.cells.some((cell) => cell.scenarioId !== observation.exampleId)) throw new Error(`external optimizer observation artifact measures another case than it refused at sequence ${observation.sequence}`);
80
83
  const candidateFields = [observation.candidate, observation.candidateHash];
81
84
  if (observation.reason !== "invalid-request" && candidateFields.some((value) => value === void 0)) throw new Error(`external optimizer observation artifact omits a refused candidate at sequence ${observation.sequence}`);
82
85
  if (candidateFields.some((value) => value !== void 0)) {
@@ -166,7 +169,7 @@ function assertObservationShape(value, line) {
166
169
  return;
167
170
  }
168
171
  if (observation.kind === "evaluation") {
169
- assertExactKeys(observation, [
172
+ const required = [
170
173
  "candidate",
171
174
  "candidateHash",
172
175
  "evaluationNumber",
@@ -174,7 +177,9 @@ function assertObservationShape(value, line) {
174
177
  "kind",
175
178
  "response",
176
179
  "sequence"
177
- ], line);
180
+ ];
181
+ assertExactKeys(observation, "measurement" in observation ? [...required, "measurement"] : required, line);
182
+ if ("measurement" in observation) assertMeasurement(observation.measurement, line);
178
183
  assertCandidateFields(observation, line);
179
184
  if (typeof observation.exampleId !== "string") throw new Error(`external optimizer observation artifact line ${line} has an invalid exampleId`);
180
185
  if (!Number.isSafeInteger(observation.evaluationNumber) || Number(observation.evaluationNumber) <= 0) throw new Error(`external optimizer observation artifact line ${line} has an invalid evaluationNumber`);
@@ -187,16 +192,47 @@ function assertObservationShape(value, line) {
187
192
  "candidateHash",
188
193
  "exampleId",
189
194
  "kind",
195
+ "measurement",
190
196
  "reason",
191
197
  "sequence"
192
198
  ], line);
193
199
  if (typeof observation.reason !== "string") throw new Error(`external optimizer observation artifact line ${line} has an invalid reason`);
200
+ if ("measurement" in observation) {
201
+ if (observation.reason !== "evaluation-failed") throw new Error(`external optimizer observation artifact line ${line} measures a refusal that never ran`);
202
+ assertMeasurement(observation.measurement, line);
203
+ }
194
204
  if (observation.candidate !== void 0 || observation.candidateHash !== void 0) assertCandidateFields(observation, line);
195
205
  if (observation.exampleId !== void 0 && typeof observation.exampleId !== "string") throw new Error(`external optimizer observation artifact line ${line} has an invalid exampleId`);
196
206
  return;
197
207
  }
198
208
  throw new Error(`external optimizer observation artifact line ${line} has an invalid kind`);
199
209
  }
210
+ /**
211
+ * The reference an evaluation keeps to its campaign cells. This checks what
212
+ * the importer reads to tell cells apart; the search ledger's own event schema
213
+ * checks each cell's outcome and accounting when the importer records it.
214
+ */
215
+ function assertMeasurement(value, line) {
216
+ const cells = isPlainRecord(value) && Array.isArray(value.cells) ? value.cells : [];
217
+ if (!(isPlainRecord(value) && (value.source === "measured" || value.source === "reused") && cells.length > 0 && cells.every((cell) => isPlainRecord(cell) && typeof cell.cellId === "string" && typeof cell.scenarioId === "string" && Number.isSafeInteger(cell.rep) && typeof cell.cached === "boolean" && typeof cell.durationMs === "number" && (cell.resolvedModel === void 0 || typeof cell.resolvedModel === "string") && (cell.traceRef === void 0 || isPlainRecord(cell.traceRef) && (typeof cell.traceRef.traceId === "string" || typeof cell.traceRef.unknown === "string")) && (cell.attempt === null || isPlainRecord(cell.attempt) && typeof cell.attempt.runAttemptId === "string" && Number.isSafeInteger(cell.attempt.number))))) throw new Error(`external optimizer observation artifact line ${line} has an invalid measurement`);
218
+ assertAllowedKeys(value, ["cells", "source"], line);
219
+ for (const cell of cells) assertAllowedKeys(cell, [...MEASUREMENT_CELL_KEYS], line);
220
+ }
221
+ const MEASUREMENT_CELL_KEYS = [
222
+ "accounting",
223
+ "attempt",
224
+ "cached",
225
+ "cellId",
226
+ "durationMs",
227
+ "outcome",
228
+ "rep",
229
+ "resolvedModel",
230
+ "scenarioId",
231
+ "traceRef"
232
+ ];
233
+ function isPlainRecord(value) {
234
+ return typeof value === "object" && value !== null && !Array.isArray(value);
235
+ }
200
236
  function assertCandidateFields(observation, line) {
201
237
  if (!isExternalTextCandidate(observation.candidate)) throw new Error(`external optimizer observation artifact line ${line} has an invalid candidate`);
202
238
  if (typeof observation.candidateHash !== "string" || !/^[a-f0-9]{64}$/u.test(observation.candidateHash)) throw new Error(`external optimizer observation artifact line ${line} has an invalid candidateHash`);
@@ -258,8 +294,11 @@ function openExternalOptimizerExecutionLog(input) {
258
294
  }
259
295
  // src/campaign/external-text-evaluation.ts
260
296
  function createExternalTextEvaluator(args) {
297
+ const shared = args.input.describeArtifact;
298
+ if (args.describeArtifact && shared && args.describeArtifact !== shared) throw new Error(`${args.label}: describeArtifact is set both on the method and by its caller; set it once`);
299
+ const describeArtifact = args.describeArtifact ?? shared;
261
300
  const cached = /* @__PURE__ */ new Map();
262
- return async ({ candidate, exampleId }, signal) => {
301
+ return async ({ candidate, exampleId }, signal, measured) => {
263
302
  if (!args.scenarioById.has(exampleId)) throw new Error(`${args.label} requested unknown train or selection case '${exampleId}'`);
264
303
  const detachedCandidate = cloneExternalTextCandidate$1(candidate);
265
304
  const surface = typeof detachedCandidate === "string" ? detachedCandidate : {
@@ -271,7 +310,14 @@ function createExternalTextEvaluator(args) {
271
310
  const scenario = args.scenarioById.get(exampleId);
272
311
  const cacheKey = `${args.compatibleRunId}:${surfaceContentHash(surface)}:${exampleId}`;
273
312
  const existing = cached.get(cacheKey);
274
- if (existing) return existing;
313
+ if (existing) {
314
+ const reused = await existing;
315
+ if (reused.cells.length > 0) measured?.({
316
+ source: "reused",
317
+ cells: reused.cells
318
+ });
319
+ return answer(reused);
320
+ }
275
321
  const result = scoreOneScenario({
276
322
  input: args.input,
277
323
  label: args.label,
@@ -283,18 +329,27 @@ function createExternalTextEvaluator(args) {
283
329
  costTags: args.costTags,
284
330
  costLedger: args.costLedger,
285
331
  maxEvidenceChars: args.maxEvidenceChars,
286
- describeArtifact: args.describeArtifact,
332
+ ...describeArtifact ? { describeArtifact } : {},
287
333
  signal
288
334
  });
289
335
  cached.set(cacheKey, result);
290
- result.then((response) => {
291
- if (response.info.status === "failed" && cached.get(cacheKey) === result) cached.delete(cacheKey);
336
+ result.then((scored) => {
337
+ if (!("response" in scored && scored.response.info.status !== "failed") && cached.get(cacheKey) === result) cached.delete(cacheKey);
292
338
  }, () => {
293
339
  if (cached.get(cacheKey) === result) cached.delete(cacheKey);
294
340
  });
295
- return result;
341
+ const scored = await result;
342
+ if (scored.cells.length > 0) measured?.({
343
+ source: "measured",
344
+ cells: scored.cells
345
+ });
346
+ return answer(scored);
296
347
  };
297
348
  }
349
+ function answer(scored) {
350
+ if ("refusal" in scored) throw scored.refusal;
351
+ return scored.response;
352
+ }
298
353
  function mapExternalScenarios(train, selection, label) {
299
354
  const out = /* @__PURE__ */ new Map();
300
355
  for (const scenario of [...train, ...selection]) {
@@ -325,25 +380,62 @@ function decodeExternalTextCandidate(candidate) {
325
380
  };
326
381
  }
327
382
  async function scoreOneScenario(args) {
328
- const campaign = await runCampaign({
329
- ...args.input.runOptions,
330
- scenarios: [structuredClone(args.scenario)],
331
- dispatch: (scenario, context) => args.input.dispatchWithSurface(args.candidate, scenario, context),
332
- dispatchRef: `external-text:${args.compatibleRunId}:${surfaceContentHash(args.candidate)}`,
333
- judges: [...args.input.judges],
334
- runDir: `${args.runDir}/evaluations/${safePathComponent(args.compatibleRunId)}/${safePathComponent(surfaceContentHash(args.candidate))}/${safePathComponent(args.scenario.id)}`,
335
- seed: args.input.seed,
336
- costLedger: args.costLedger,
337
- costPhase: args.costPhase,
338
- ...args.costTags ? { costTags: args.costTags } : {},
339
- maxConcurrency: 1,
340
- ...args.signal ? { signal: args.signal } : {}
341
- });
383
+ const { runOptions } = args.input;
384
+ const settled = [];
385
+ const started = /* @__PURE__ */ new Map();
386
+ let campaign;
387
+ try {
388
+ campaign = await runCampaign({
389
+ ...runOptions,
390
+ scenarios: [structuredClone(args.scenario)],
391
+ dispatch: (scenario, context) => {
392
+ noteDispatch(started, scenario.id, context);
393
+ return args.input.dispatchWithSurface(args.candidate, scenario, context);
394
+ },
395
+ onCellSettled: async (cell, scenario) => {
396
+ settled.push(cell);
397
+ await runOptions.onCellSettled?.(cell, scenario);
398
+ },
399
+ dispatchRef: `external-text:${args.compatibleRunId}:${surfaceContentHash(args.candidate)}`,
400
+ judges: [...args.input.judges],
401
+ runDir: [
402
+ args.runDir,
403
+ "evaluations",
404
+ safePathComponent(args.compatibleRunId),
405
+ safePathComponent(surfaceContentHash(args.candidate)),
406
+ safePathComponent(args.scenario.id)
407
+ ].join("/"),
408
+ seed: args.input.seed,
409
+ costLedger: args.costLedger,
410
+ costPhase: args.costPhase,
411
+ ...args.costTags ? { costTags: args.costTags } : {},
412
+ maxConcurrency: 1,
413
+ ...args.signal ? { signal: args.signal } : {}
414
+ });
415
+ } catch (error) {
416
+ const refusal = error instanceof Error ? error : new Error(String(error));
417
+ return {
418
+ cells: [...measureByRep(settled), ...interruptedCells(started, settled, args.costLedger, refusal.message)],
419
+ refusal
420
+ };
421
+ }
422
+ const cells = measureByRep(campaign.cells);
423
+ const respond = (response) => {
424
+ const bounded = boundEvidence(response, args.maxEvidenceChars);
425
+ if (bounded) return {
426
+ cells,
427
+ response: bounded
428
+ };
429
+ return {
430
+ cells,
431
+ refusal: /* @__PURE__ */ new Error(`${args.label} evaluation evidence for '${args.scenario.id}' exceeds maxEvidenceChars (${args.maxEvidenceChars}) in fields no excerpt can shorten`)
432
+ };
433
+ };
342
434
  const failedCell = campaign.cells.find((cell) => cell.error !== void 0);
343
435
  if (failedCell) {
344
436
  const stage = failedCell.errorStage ?? "unknown";
345
437
  const message = failedCell.error?.slice(0, 2e3) ?? "cell failed without an error message";
346
- const response = {
438
+ return respond({
347
439
  score: 0,
348
440
  info: {
349
441
  scenarioId: failedCell.scenarioId,
@@ -355,16 +447,19 @@ async function scoreOneScenario(args) {
355
447
  message
356
448
  }
357
449
  }
358
- };
359
- if (JSON.stringify(response).length > args.maxEvidenceChars) throw new Error(`${args.label} failed evaluation evidence for '${args.scenario.id}' exceeds maxEvidenceChars`);
360
- return response;
450
+ });
361
451
  }
362
452
  const breakdown = campaignBreakdown(campaign);
363
453
  const row = breakdown.scenarios[0];
364
- if (!row) throw new Error(`${args.label} evaluation produced no score for '${args.scenario.id}'`);
365
- const artifact = args.describeArtifact && campaign.cells[0] ? args.describeArtifact(campaign.cells[0].artifact, args.scenario) : void 0;
366
- if (artifact !== void 0) assertJsonValue(artifact, `${args.label} described artifact for '${args.scenario.id}'`);
367
- const response = {
454
+ if (!row) return {
455
+ cells,
456
+ refusal: /* @__PURE__ */ new Error(`${args.label} evaluation produced no score for '${args.scenario.id}'`)
457
+ };
458
+ const artifact = campaignEvidence(campaign.cells, {
459
+ scenarios: [args.scenario],
460
+ ...args.describeArtifact ? { describeArtifact: args.describeArtifact } : {}
461
+ }).get(args.scenario.id);
462
+ return respond({
368
463
  score: row.composite,
369
464
  info: {
370
465
  scenarioId: row.scenarioId,
@@ -374,9 +469,153 @@ async function scoreOneScenario(args) {
374
469
  ...row.notes ? { notes: row.notes } : {},
375
470
  ...artifact !== void 0 ? { artifact } : {}
376
471
  }
472
+ });
473
+ }
474
+ function measureByRep(cells) {
475
+ return [...cells].sort((left, right) => left.rep - right.rep).map(campaignCellMeasurement);
476
+ }
477
+ function noteDispatch(started, scenarioId, context) {
478
+ const known = started.get(context.cellId);
479
+ if (known) {
480
+ known.dispatches += 1;
481
+ return;
482
+ }
483
+ started.set(context.cellId, {
484
+ cellId: context.cellId,
485
+ scenarioId,
486
+ rep: context.rep,
487
+ runAttemptId: context.runAttemptId,
488
+ dispatches: 1,
489
+ startedMs: Date.now()
490
+ });
491
+ }
492
+ /**
493
+ * Every cell that started but never settled before runCampaign threw. No cell
494
+ * result exists for it, so its outcome is the throw and its accounting is
495
+ * unknown: the agent spend the cost ledger holds for its attempt is a lower
496
+ * bound, since a dispatch that ignored cancellation may still be paying.
497
+ */
498
+ function interruptedCells(started, settled, costLedger, thrown) {
499
+ const settledIds = new Set(settled.map((cell) => cell.cellId));
500
+ return [...started.values()].filter((cell) => !settledIds.has(cell.cellId)).sort((left, right) => left.rep - right.rep).map((cell) => {
501
+ const reason = `runCampaign threw before campaign cell ${cell.cellId} settled`;
502
+ const spent = costLedger.summary({
503
+ channel: "agent",
504
+ tags: {
505
+ runAttemptId: cell.runAttemptId,
506
+ cellId: cell.cellId
507
+ }
508
+ });
509
+ return {
510
+ cellId: cell.cellId,
511
+ scenarioId: cell.scenarioId,
512
+ rep: cell.rep,
513
+ attempt: {
514
+ runAttemptId: cell.runAttemptId,
515
+ number: cell.dispatches
516
+ },
517
+ cached: false,
518
+ outcome: {
519
+ status: "errored",
520
+ metrics: {},
521
+ error: {
522
+ code: "campaign-threw",
523
+ message: `${reason}: ${thrown.slice(0, 2e3)}`,
524
+ retryable: false
525
+ }
526
+ },
527
+ accounting: {
528
+ tokens: {
529
+ status: "unknown",
530
+ reason
531
+ },
532
+ cost: {
533
+ status: "unknown",
534
+ knownLowerBoundUsd: spent.totalCostUsd,
535
+ reason: `${reason}; the agent spend its receipts proved by then is a lower bound`
536
+ }
537
+ },
538
+ durationMs: Date.now() - cell.startedMs,
539
+ traceRef: { unknown: `${reason}, so no trace was named for it` }
540
+ };
541
+ });
542
+ }
543
+ /**
544
+ * The response within `maxChars` of JSON, or undefined when it cannot be.
545
+ *
546
+ * The bound limits how much evidence the optimizer reads per evaluation, and
547
+ * an excerpt meets it without hiding that anything was cut: the judge notes,
548
+ * the error message and a text artifact keep their head and tail around an
549
+ * omitted-count marker (`excerptEvidence`), sharing the room the other fields
550
+ * leave. A described artifact stays whole when the text fields alone can make
551
+ * room; otherwise it is shown as its excerpted JSON text, as the native
552
+ * reflective path shows it. Only the fields no excerpt can shorten (the
553
+ * scores, the dimensions and the ids) can make a response not fit.
554
+ */
555
+ function boundEvidence(response, maxChars) {
556
+ if (JSON.stringify(response).length <= maxChars) return response;
557
+ const { info } = response;
558
+ const fit = (artifactAsText) => {
559
+ const artifact = typeof info.artifact === "string" ? info.artifact : artifactAsText && info.artifact !== void 0 ? JSON.stringify(info.artifact) : void 0;
560
+ const fields = [];
561
+ if (info.notes !== void 0) fields.push(["notes", info.notes]);
562
+ if (info.error) fields.push(["message", info.error.message]);
563
+ if (artifact !== void 0) fields.push(["artifact", artifact]);
564
+ const build = (texts) => {
565
+ const text = new Map(fields.map(([name], index) => [name, texts[index]]));
566
+ const notes = text.get("notes");
567
+ const message = text.get("message");
568
+ const excerpted = text.get("artifact");
569
+ return {
570
+ ...response,
571
+ info: {
572
+ ...info,
573
+ ...notes === void 0 ? {} : { notes },
574
+ ...message === void 0 || !info.error ? {} : { error: {
575
+ ...info.error,
576
+ message
577
+ } },
578
+ ...excerpted === void 0 ? {} : { artifact: excerpted }
579
+ }
580
+ };
581
+ };
582
+ const texts = fitTexts(fields.map(([, value]) => value), (candidate) => JSON.stringify(build(candidate)).length, maxChars);
583
+ return texts && build(texts);
377
584
  };
378
- if (JSON.stringify(response).length > args.maxEvidenceChars) throw new Error(`${args.label} evaluation evidence for '${args.scenario.id}' exceeds maxEvidenceChars`);
379
- return response;
585
+ const describedArtifact = info.artifact !== void 0 && typeof info.artifact !== "string";
586
+ return fit(false) ?? (describedArtifact ? fit(true) : void 0);
587
+ }
588
+ /**
589
+ * Excerpts of `texts` whose `size` is at most `maxChars`, or undefined when
590
+ * the rest of the value alone exceeds it. The room left by the rest is shared
591
+ * evenly, and a text shorter than its share leaves the remainder to the
592
+ * others. Sizes count JSON-encoded characters, so escapes are paid for.
593
+ */
594
+ function fitTexts(texts, size, maxChars) {
595
+ const fixed = size(texts.map(() => ""));
596
+ if (fixed > maxChars) return void 0;
597
+ const encoded = (text) => JSON.stringify(text).length - 2;
598
+ const shares = new Array(texts.length).fill(0);
599
+ let room = maxChars - fixed;
600
+ let remaining = texts.length;
601
+ const shortestFirst = texts.map((_, index) => index).sort((left, right) => encoded(texts[left]) - encoded(texts[right]));
602
+ for (const index of shortestFirst) {
603
+ shares[index] = Math.min(encoded(texts[index]), Math.floor(room / remaining));
604
+ room -= shares[index];
605
+ remaining -= 1;
606
+ }
607
+ return texts.map((text, index) => excerptWithin(text, shares[index]));
608
+ }
609
+ /** The longest `excerptEvidence` of `text` whose JSON-encoded content fits `maxEncoded`. */
610
+ function excerptWithin(text, maxEncoded) {
611
+ let limit = maxEncoded;
612
+ while (limit > 0) {
613
+ const excerpt = excerptEvidence(text, limit);
614
+ const over = JSON.stringify(excerpt).length - 2 - maxEncoded;
615
+ if (over <= 0) return excerpt;
616
+ limit -= over;
617
+ }
618
+ return "";
380
619
  }
381
620
  function cloneExternalTextCandidate$1(candidate) {
382
621
  return typeof candidate === "string" ? candidate : { ...candidate };
@@ -1015,6 +1254,7 @@ function heldOutGate(options) {
1015
1254
  const minProductiveRuns = options.minProductiveRuns ?? 3;
1016
1255
  const resamples = options.resamples ?? 2e3;
1017
1256
  const seed = options.bootstrapSeed ?? 1337;
1257
+ const independentUnitByScenarioId = options.independentUnitByScenarioId === void 0 ? void 0 : new Map(options.independentUnitByScenarioId);
1018
1258
  return {
1019
1259
  name: "heldOutGate",
1020
1260
  async decide(ctx) {
@@ -1025,19 +1265,24 @@ function heldOutGate(options) {
1025
1265
  confidence,
1026
1266
  minProductiveRuns,
1027
1267
  resamples,
1028
- seed
1268
+ seed,
1269
+ independentUnitByScenarioId
1029
1270
  });
1030
1271
  const dec = sig.decision;
1031
1272
  const delta = dec.delta;
1032
1273
  const passed = sig.significant;
1033
1274
  const status = sig.fewRuns ? "not_evaluated" : passed ? "pass" : "fail";
1275
+ const registered = sig.observationUnit === "registered";
1276
+ const units = `${sig.n} independent units from ${sig.pairedCellN} paired cells`;
1277
+ const observed = registered ? units : `${sig.n} paired runs`;
1278
+ const count = registered ? `n=${units}` : `n=${sig.n}`;
1034
1279
  const tieNote = sig.tieFraction >= .4 ? `, ${(sig.tieFraction * 100).toFixed(0)}% tied` : "";
1035
1280
  const ci = `${(dec.confidence * 100).toFixed(0)}% CI [${dec.low.toFixed(3)}, ${dec.high.toFixed(3)}]`;
1036
1281
  const held = `held-out ${dec.label} Δ ${delta.toFixed(3)}`;
1037
- const holdReason = sig.fewRuns ? `held-out: only ${sig.n} paired runs; ${sig.minimumRequired} required — too few to claim significance` : dec.indeterminate ? `held-out: ${dec.indeterminateCause}, so the paired CI is ${ci} and carries no direction — it cannot clear ${deltaThreshold} on evidence (n=${sig.n}${tieNote})` : dec.exactTestVetoes ? `${held}, McNemar exact p=${dec.mcnemar?.pValue.toExponential(2)} does not reject at α=${(1 - dec.confidence).toFixed(4)} (${ci}, n=${sig.n}${tieNote})` : `${held}, CI.low ${dec.low.toFixed(3)} ≤ ${deltaThreshold} (${ci}, n=${sig.n}${tieNote})`;
1282
+ const holdReason = sig.fewRuns ? `held-out: only ${observed}; ${sig.minimumRequired} required — too few to claim significance` : dec.indeterminate ? `held-out: ${dec.indeterminateCause}, so the paired CI is ${ci} and carries no direction — it cannot clear ${deltaThreshold} on evidence (${count}${tieNote})` : dec.exactTestVetoes ? `${held}, McNemar exact p=${dec.mcnemar?.pValue.toExponential(2)} does not reject at α=${(1 - dec.confidence).toFixed(4)} (${ci}, ${count}${tieNote})` : `${held}, CI.low ${dec.low.toFixed(3)} ≤ ${deltaThreshold} (${ci}, ${count}${tieNote})`;
1038
1283
  return {
1039
1284
  decision: passed ? "ship" : "hold",
1040
- reasons: passed ? [`${held}, CI.low ${dec.low.toFixed(3)} > ${deltaThreshold} (${ci}, n=${sig.n}${tieNote})`] : [holdReason],
1285
+ reasons: passed ? [`${held}, CI.low ${dec.low.toFixed(3)} > ${deltaThreshold} (${ci}, ${count}${tieNote})`] : [holdReason],
1041
1286
  contributingGates: [{
1042
1287
  name: "heldOutGate",
1043
1288
  status,
@@ -1057,6 +1302,11 @@ function heldOutGate(options) {
1057
1302
  bootstrapCiHigh: sig.bootstrap.high,
1058
1303
  confidence: dec.confidence,
1059
1304
  n: sig.n,
1305
+ ...registered ? {
1306
+ pairedCellN: sig.pairedCellN,
1307
+ observationUnit: sig.observationUnit,
1308
+ unitIds: sig.unitIds
1309
+ } : {},
1060
1310
  deltaThreshold,
1061
1311
  fewRuns: sig.fewRuns,
1062
1312
  seed
@@ -1408,7 +1658,8 @@ function isGepaCandidate(value, maxChars) {
1408
1658
  * GEPA's candidate population also names each candidate's parents by index.
1409
1659
  * The importer turns both into ledger events: one node per distinct candidate,
1410
1660
  * one `correlated` edge per population entry (joined by content digest from
1411
- * GEPA's own parent record), and one cell per evaluation. Nothing is inferred
1661
+ * GEPA's own parent record), and one cell per campaign cell an evaluation
1662
+ * measured (one per evaluation for a log that names no cells). Nothing is inferred
1412
1663
  * from timing or order: a candidate with no parent record (every SkillOpt
1413
1664
  * candidate, and a candidate GEPA kept out of its population) has an `unknown`
1414
1665
  * edge and no parents.
@@ -1491,20 +1742,34 @@ async function importGepaPopulation(input) {
1491
1742
  };
1492
1743
  }
1493
1744
  /**
1494
- * Record every evaluation in the callback's observation log as an `external`
1495
- * cell attempt. A candidate that is not yet a node (GEPA evaluated it on a
1745
+ * Record the callback's evaluations as `external` cells. An evaluation that
1746
+ * carries its measurement records each campaign cell it names once, through
1747
+ * `campaignCellSearchResult`, so the ledger holds the cell's own outcome,
1748
+ * dimensions, tokens, cost, model, duration, attempt and trace; a request
1749
+ * answered from an earlier request's cells adds none. A refusal that measured
1750
+ * cells before it was refused records them the same way, with their real
1751
+ * accounting and an `evaluation-refused` outcome; for an evaluation whose
1752
+ * campaign threw, that is every cell it settled, and each cell the throw
1753
+ * interrupted with unknown accounting. An evaluation logged
1754
+ * without cells (a log written before the callback recorded them, or a
1755
+ * refusal that measured nothing) records one cell whose accounting is
1756
+ * unknown. A candidate that is not yet a node (GEPA evaluated it on a
1496
1757
  * minibatch and discarded it, or SkillOpt, which reports no parents, proposed
1497
1758
  * it) is registered with an `unknown` edge.
1498
1759
  */
1499
1760
  async function importExternalEvaluations(input) {
1500
1761
  const { recorder } = input;
1501
1762
  const optimizer = input.optimizer ?? "GEPA";
1763
+ const lane = `${optimizer.toLowerCase()}-evaluation-callback`;
1502
1764
  const reps = /* @__PURE__ */ new Map();
1765
+ const recordedCells = /* @__PURE__ */ new Set();
1503
1766
  const unrecorded = [];
1504
1767
  let cells = 0;
1768
+ let reusedRequests = 0;
1505
1769
  for (const observation of input.observations.observations) {
1506
1770
  if (!(observation.kind === "evaluation" || observation.kind === "refusal" && observation.reason === "evaluation-failed") || observation.candidate === void 0 || observation.exampleId === void 0) continue;
1507
1771
  const candidateHash = observation.candidateHash;
1772
+ const exampleId = observation.exampleId;
1508
1773
  const surface = externalSurface(observation.candidate);
1509
1774
  const registered = await recorder.registerNode(surfaceNode(recorder, surface));
1510
1775
  if (((await recorder.state()).node(registered.nodeId)?.edgeIds.length ?? 0) === 0) {
@@ -1521,19 +1786,49 @@ async function importExternalEvaluations(input) {
1521
1786
  });
1522
1787
  unrecorded.push(registered.nodeId);
1523
1788
  }
1524
- const split = input.splitOf(observation.exampleId);
1525
- const repKey = `${registered.nodeId}\u0000${observation.exampleId}`;
1526
- const rep = reps.get(repKey) ?? 0;
1527
- reps.set(repKey, rep + 1);
1528
- const cellId = await recorder.allocateCell({
1529
- nodeId: registered.nodeId,
1530
- taskId: observation.exampleId,
1531
- split,
1532
- rep,
1533
- stage: "external"
1534
- });
1789
+ const split = input.splitOf(exampleId);
1790
+ const { measurement } = observation;
1791
+ const refused = observation.kind === "refusal";
1792
+ const allocate = async () => {
1793
+ const repKey = `${registered.nodeId}\u0000${exampleId}`;
1794
+ const rep = reps.get(repKey) ?? 0;
1795
+ reps.set(repKey, rep + 1);
1796
+ return recorder.allocateCell({
1797
+ nodeId: registered.nodeId,
1798
+ taskId: exampleId,
1799
+ split,
1800
+ rep,
1801
+ stage: "external",
1802
+ ...measurement === void 0 ? {} : { lane }
1803
+ });
1804
+ };
1805
+ if (measurement !== void 0) {
1806
+ if (measurement.source === "reused") reusedRequests += 1;
1807
+ for (const cell of measurement.cells) {
1808
+ const key = hashCanonical({
1809
+ candidateHash,
1810
+ exampleId,
1811
+ cellId: cell.cellId,
1812
+ attempt: cell.attempt
1813
+ });
1814
+ if (recordedCells.has(key)) continue;
1815
+ recordedCells.add(key);
1816
+ const result = campaignCellSearchResult(cell, {
1817
+ execution: input.identity,
1818
+ lane
1819
+ });
1820
+ await recorder.settleCell({
1821
+ cellId: await allocate(),
1822
+ attempt: 1,
1823
+ ...result,
1824
+ ...refused ? { outcome: refusedAfterMeasurement(result.outcome) } : {}
1825
+ });
1826
+ cells += 1;
1827
+ }
1828
+ continue;
1829
+ }
1535
1830
  await recorder.settleCell({
1536
- cellId,
1831
+ cellId: await allocate(),
1537
1832
  attempt: 1,
1538
1833
  outcome: observation.kind === "evaluation" ? evaluationOutcome(observation.response) : {
1539
1834
  status: "errored",
@@ -1561,9 +1856,30 @@ async function importExternalEvaluations(input) {
1561
1856
  }
1562
1857
  return {
1563
1858
  cells,
1859
+ measuredCells: recordedCells.size,
1860
+ reusedRequests,
1564
1861
  unrecordedParentNodeIds: unrecorded
1565
1862
  };
1566
1863
  }
1864
+ /**
1865
+ * A cell the callback measured and then refused to return to the optimizer,
1866
+ * for example because its evidence did not fit the bound. Its accounting and
1867
+ * metrics are the measurement's, since the spend was real; it is unscored,
1868
+ * because the optimizer received no score, and the error names what the
1869
+ * measurement found.
1870
+ */
1871
+ function refusedAfterMeasurement(measured) {
1872
+ const found = measured.status === "errored" ? `an unscored cell (${measured.error.code}: ${measured.error.message})` : `a ${measured.status} cell scoring ${measured.score}`;
1873
+ return {
1874
+ status: "errored",
1875
+ metrics: measured.metrics,
1876
+ error: {
1877
+ code: "evaluation-refused",
1878
+ message: `the evaluation callback refused the evaluation after measuring ${found}; the optimizer received no score`,
1879
+ retryable: false
1880
+ }
1881
+ };
1882
+ }
1567
1883
  /** GEPA's callback response. A `failed` evaluation carries a penalty score for
1568
1884
  * the optimizer that is not a measurement, so the cell is unscored. */
1569
1885
  function evaluationOutcome(response) {
@@ -1634,6 +1950,8 @@ async function recordSkillOptSearch(input) {
1634
1950
  async function recordExternalSearch(input) {
1635
1951
  const { identity, population, optimizer } = input;
1636
1952
  const policyName = optimizer.toLowerCase();
1953
+ const repsPerEvaluation = input.repsPerEvaluation ?? 1;
1954
+ if (!Number.isSafeInteger(repsPerEvaluation) || repsPerEvaluation <= 0) throw new Error(`${input.name}: repsPerEvaluation must be a positive safe integer`);
1637
1955
  const tasks = (scenarios) => scenarios.map((scenario) => ({
1638
1956
  taskId: scenario.id,
1639
1957
  unitId: scenario.id,
@@ -1680,7 +1998,7 @@ async function recordExternalSearch(input) {
1680
1998
  },
1681
1999
  budget: {
1682
2000
  maxUsd: null,
1683
- maxCells: input.evaluationLimit,
2001
+ maxCells: input.evaluationLimit * repsPerEvaluation,
1684
2002
  maxNodes: null,
1685
2003
  deadline: null,
1686
2004
  maxConcurrency: null,
@@ -2147,6 +2465,7 @@ async function recordGepaSearchHistory(ctx, result, population) {
2147
2465
  trainScenarios: input.trainScenarios,
2148
2466
  selectionScenarios: input.selectionScenarios,
2149
2467
  evaluationLimit,
2468
+ repsPerEvaluation: input.runOptions.reps ?? 1,
2150
2469
  ...population ? { population } : {
2151
2470
  population: null,
2152
2471
  selected: decodeExternalTextCandidate(result.bestCandidate)
@@ -2788,6 +3107,7 @@ function createOptimizationMethodInput(opts, methodName, resolvedRunDir, seed, b
2788
3107
  selectionScenarios: opts.selectionScenarios,
2789
3108
  dispatchWithSurface: opts.dispatchWithSurface,
2790
3109
  judges: opts.judges,
3110
+ ...opts.describeArtifact ? { describeArtifact: opts.describeArtifact } : {},
2791
3111
  runDir: methodRunDir,
2792
3112
  seed,
2793
3113
  runOptions: Object.freeze({
@@ -3182,6 +3502,7 @@ async function finishSkillOptRun(context, result, outputDir, modelProxy) {
3182
3502
  trainScenarios: input.trainScenarios,
3183
3503
  selectionScenarios: input.selectionScenarios,
3184
3504
  evaluationLimit: config.maxEvaluations,
3505
+ repsPerEvaluation: input.runOptions.reps ?? 1,
3185
3506
  observations: readExternalOptimizerObservationArtifact({
3186
3507
  summary: observationLog.summary(),
3187
3508
  storage: context.storage
@@ -3230,4 +3551,4 @@ async function finishSkillOptRun(context, result, outputDir, modelProxy) {
3230
3551
  }
3231
3552
  export { importExternalEvaluations as a, composeGate as c, readExternalOptimizerObservationArtifact as d, externalSurface as i, externalTextOptimizationMethod as l, compareOptimizationMethods as n, importGepaPopulation as o, gepaOptimizationMethod as r, heldOutGate as s, skillOptOptimizationMethod as t, decodeExternalTextCandidate as u };
3232
3553
 
3233
- //# sourceMappingURL=skillopt-optimization-method-Du3GbReg.js.map
3554
+ //# sourceMappingURL=skillopt-optimization-method-CHW9mphc.js.map