@tangle-network/agent-eval 1.0.11 → 1.0.13

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 (227) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/{agent-profile-CoD1Dotf.d.ts → agent-profile-CPv4tENR.d.ts} +2 -2
  4. package/dist/{agent-profile-CoD1Dotf.d.ts.map → agent-profile-CPv4tENR.d.ts.map} +1 -1
  5. package/dist/{agreement-irr-w-t3XUTD.js → agreement-irr-DXcXEt4I.js} +20 -23
  6. package/dist/agreement-irr-DXcXEt4I.js.map +1 -0
  7. package/dist/analyst/index.d.ts +59 -13
  8. package/dist/analyst/index.d.ts.map +1 -1
  9. package/dist/analyst/index.js +144 -57
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/{analyze-runs-dGYmYNtb.js → analyze-runs-C7vWBDhl.js} +11 -11
  12. package/dist/{analyze-runs-dGYmYNtb.js.map → analyze-runs-C7vWBDhl.js.map} +1 -1
  13. package/dist/{analyze-runs-BYyMShsj.d.ts → analyze-runs-pJ4fhnYg.d.ts} +2 -2
  14. package/dist/{analyze-runs-BYyMShsj.d.ts.map → analyze-runs-pJ4fhnYg.d.ts.map} +1 -1
  15. package/dist/{benchmark-command-Did8Of2O.js → benchmark-command-BRRhjX2k.js} +12 -14
  16. package/dist/benchmark-command-BRRhjX2k.js.map +1 -0
  17. package/dist/benchmarks/index.d.ts +4 -4
  18. package/dist/benchmarks/index.js +5 -5
  19. package/dist/builder-eval/index.js +1 -1
  20. package/dist/{calibration-DLzckXnn.js → calibration-CbZPApIO.js} +2 -2
  21. package/dist/{calibration-DLzckXnn.js.map → calibration-CbZPApIO.js.map} +1 -1
  22. package/dist/campaign/index.d.ts +6 -6
  23. package/dist/campaign/index.js +12 -12
  24. package/dist/{campaign-VKtf8HRr.js → campaign-DzLlT0So.js} +17 -17
  25. package/dist/{campaign-VKtf8HRr.js.map → campaign-DzLlT0So.js.map} +1 -1
  26. package/dist/{campaign-evidence-BICB3a9Z.js → campaign-evidence-CcA7a67m.js} +3 -3
  27. package/dist/{campaign-evidence-BICB3a9Z.js.map → campaign-evidence-CcA7a67m.js.map} +1 -1
  28. package/dist/cli.js +16 -10
  29. package/dist/cli.js.map +1 -1
  30. package/dist/{cluster-bootstrap-hNXESoc1.js → cluster-bootstrap-BteuR1hg.js} +2 -2
  31. package/dist/{cluster-bootstrap-hNXESoc1.js.map → cluster-bootstrap-BteuR1hg.js.map} +1 -1
  32. package/dist/contract/index.d.ts +9 -9
  33. package/dist/contract/index.js +14 -14
  34. package/dist/{decision-point-CErE7GnP.js → decision-point-CNyoKOkz.js} +13 -7
  35. package/dist/{decision-point-CErE7GnP.js.map → decision-point-CNyoKOkz.js.map} +1 -1
  36. package/dist/{default-registry-DKlKVXMx.d.ts → default-registry-BNv7eB1C.d.ts} +10 -7
  37. package/dist/default-registry-BNv7eB1C.d.ts.map +1 -0
  38. package/dist/{default-registry-gmDeN0KT.js → default-registry-eCkZFfuF.js} +6 -6
  39. package/dist/default-registry-eCkZFfuF.js.map +1 -0
  40. package/dist/{define-agent-eval-DyzJ0wOo.js → define-agent-eval-CjF2nTA3.js} +8 -8
  41. package/dist/{define-agent-eval-DyzJ0wOo.js.map → define-agent-eval-CjF2nTA3.js.map} +1 -1
  42. package/dist/{define-agent-eval-B9zPWFSK.d.ts → define-agent-eval-DKVYlm-T.d.ts} +7 -7
  43. package/dist/{define-agent-eval-B9zPWFSK.d.ts.map → define-agent-eval-DKVYlm-T.d.ts.map} +1 -1
  44. package/dist/{descriptive-BTzLL-aj.js → descriptive-B3Eb7tX0.js} +2 -2
  45. package/dist/{descriptive-BTzLL-aj.js.map → descriptive-B3Eb7tX0.js.map} +1 -1
  46. package/dist/diagnosis/index.d.ts +2 -2
  47. package/dist/diagnosis/index.js +1 -1
  48. package/dist/{dspy-rlm-engine-Xt3znknf.js → dspy-rlm-engine-_MEe2jIO.js} +3 -3
  49. package/dist/{dspy-rlm-engine-Xt3znknf.js.map → dspy-rlm-engine-_MEe2jIO.js.map} +1 -1
  50. package/dist/{engine-CaHaCc3W.d.ts → engine-rfV8Ff8V.d.ts} +2 -2
  51. package/dist/{engine-CaHaCc3W.d.ts.map → engine-rfV8Ff8V.d.ts.map} +1 -1
  52. package/dist/{eval-campaign-B-dQl_lA.js → eval-campaign-CZSCjxVb.js} +3 -3
  53. package/dist/{eval-campaign-B-dQl_lA.js.map → eval-campaign-CZSCjxVb.js.map} +1 -1
  54. package/dist/{evaluation-B0-KVXaV.d.ts → evaluation-DYAIkPQB.d.ts} +4 -4
  55. package/dist/{evaluation-B0-KVXaV.d.ts.map → evaluation-DYAIkPQB.d.ts.map} +1 -1
  56. package/dist/evaluation.d.ts +1 -1
  57. package/dist/{exact-types-CIViGj98.d.ts → exact-types-CaLLU1Pz.d.ts} +2 -2
  58. package/dist/{exact-types-CIViGj98.d.ts.map → exact-types-CaLLU1Pz.d.ts.map} +1 -1
  59. package/dist/experiment/index.d.ts +1 -1
  60. package/dist/experiment/index.js +9 -9
  61. package/dist/{external-optimizer-process-BgitfZ-Q.js → external-optimizer-process-za-SsIap.js} +2 -2
  62. package/dist/{external-optimizer-process-BgitfZ-Q.js.map → external-optimizer-process-za-SsIap.js.map} +1 -1
  63. package/dist/{external-optimizer-subprocess-CeHuAaMJ.js → external-optimizer-subprocess-B44kOfZb.js} +3 -3
  64. package/dist/external-optimizer-subprocess-B44kOfZb.js.map +1 -0
  65. package/dist/{feedback-trajectory-BgomnFOe.d.ts → feedback-trajectory-P37ju-gW.d.ts} +3 -3
  66. package/dist/{feedback-trajectory-BgomnFOe.d.ts.map → feedback-trajectory-P37ju-gW.d.ts.map} +1 -1
  67. package/dist/{finding-composition-DlvE1Qul.js → finding-composition-Belh_qU3.js} +12 -3
  68. package/dist/finding-composition-Belh_qU3.js.map +1 -0
  69. package/dist/{findings-store-Bp-0Guuv.js → findings-store-DWiBvJVM.js} +22 -5
  70. package/dist/findings-store-DWiBvJVM.js.map +1 -0
  71. package/dist/fuzz.js +1 -1
  72. package/dist/hosted/index.js +1 -1
  73. package/dist/{index-BwutH5i7.d.ts → index-BJM4rwP2.d.ts} +6 -6
  74. package/dist/{index-BwutH5i7.d.ts.map → index-BJM4rwP2.d.ts.map} +1 -1
  75. package/dist/{index-DAk2quYu.d.ts → index-C3t17kHu.d.ts} +16 -21
  76. package/dist/index-C3t17kHu.d.ts.map +1 -0
  77. package/dist/{index-Bn-P_XAl.d.ts → index-Dt6E4BHX.d.ts} +6 -6
  78. package/dist/{index-Bn-P_XAl.d.ts.map → index-Dt6E4BHX.d.ts.map} +1 -1
  79. package/dist/{index-ByJ20lyu.d.ts → index-chNyKroE.d.ts} +8 -8
  80. package/dist/{index-ByJ20lyu.d.ts.map → index-chNyKroE.d.ts.map} +1 -1
  81. package/dist/{index-CtcCSO1Y.d.ts → index-f09MX_H_.d.ts} +2 -2
  82. package/dist/{index-CtcCSO1Y.d.ts.map → index-f09MX_H_.d.ts.map} +1 -1
  83. package/dist/index.d.ts +52 -146
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +80 -193
  86. package/dist/index.js.map +1 -1
  87. package/dist/{integrity-B1V6klyO.js → integrity-Vx5xgn3s.js} +2 -2
  88. package/dist/{integrity-B1V6klyO.js.map → integrity-Vx5xgn3s.js.map} +1 -1
  89. package/dist/{judge-calibration-D93UCm1k.js → judge-calibration-DKR6Xi-w.js} +13 -36
  90. package/dist/judge-calibration-DKR6Xi-w.js.map +1 -0
  91. package/dist/judge-calibration-DnrbQaXI.d.ts.map +1 -1
  92. package/dist/{judge-gate-DMlX38B7.js → judge-gate-CIlBrn6q.js} +2 -2
  93. package/dist/{judge-gate-DMlX38B7.js.map → judge-gate-CIlBrn6q.js.map} +1 -1
  94. package/dist/{kind-factory-VKysp1ds.js → kind-factory-Cfz8DUCc.js} +2 -2
  95. package/dist/{kind-factory-VKysp1ds.js.map → kind-factory-Cfz8DUCc.js.map} +1 -1
  96. package/dist/{llm-judge-CyDyqb6V.js → llm-judge-CHLvjbVR.js} +14 -14
  97. package/dist/{llm-judge-CyDyqb6V.js.map → llm-judge-CHLvjbVR.js.map} +1 -1
  98. package/dist/{matrix-4DcRFJ7Q.d.ts → matrix-Cy3oy7Rq.d.ts} +2 -2
  99. package/dist/{matrix-4DcRFJ7Q.d.ts.map → matrix-Cy3oy7Rq.d.ts.map} +1 -1
  100. package/dist/{mean-DDFhslBt.js → mean-D1d6gedE.js} +28 -2
  101. package/dist/{mean-DDFhslBt.js.map → mean-D1d6gedE.js.map} +1 -1
  102. package/dist/meta-eval/index.d.ts +1 -1
  103. package/dist/meta-eval/index.js +6 -6
  104. package/dist/{mint-D9ZysYtY.js → mint-BH_3Ak2x.js} +3 -3
  105. package/dist/{mint-D9ZysYtY.js.map → mint-BH_3Ak2x.js.map} +1 -1
  106. package/dist/multishot/golden/index.d.ts +1 -1
  107. package/dist/multishot/index.d.ts +2 -2
  108. package/dist/openapi.json +1 -1
  109. package/dist/{outcome-observations-ahbNtxuP.js → outcome-observations-DZu5hLYF.js} +3 -3
  110. package/dist/{outcome-observations-ahbNtxuP.js.map → outcome-observations-DZu5hLYF.js.map} +1 -1
  111. package/dist/{paired-arms-C0Vd9bGG.js → paired-arms-3-tsXvvC.js} +5 -5
  112. package/dist/{paired-arms-C0Vd9bGG.js.map → paired-arms-3-tsXvvC.js.map} +1 -1
  113. package/dist/{paired-binary-B477lksS.js → paired-binary-CMzmSSd5.js} +2 -2
  114. package/dist/{paired-binary-B477lksS.js.map → paired-binary-CMzmSSd5.js.map} +1 -1
  115. package/dist/{paired-promotion-decision-5Pl_qJLX.js → paired-promotion-decision-CiueaTTj.js} +3 -3
  116. package/dist/{paired-promotion-decision-5Pl_qJLX.js.map → paired-promotion-decision-CiueaTTj.js.map} +1 -1
  117. package/dist/{paired-tests-kASEKpc-.js → paired-tests-Buh6feJ4.js} +2 -2
  118. package/dist/{paired-tests-kASEKpc-.js.map → paired-tests-Buh6feJ4.js.map} +1 -1
  119. package/dist/{pareto-DY_x3HHg.js → pareto-B34N-vnn.js} +7 -7
  120. package/dist/{pareto-DY_x3HHg.js.map → pareto-B34N-vnn.js.map} +1 -1
  121. package/dist/pipelines/index.js +1 -1
  122. package/dist/{power-and-mde-CRxepy8y.js → power-and-mde-g3vOn0XK.js} +3 -3
  123. package/dist/{power-and-mde-CRxepy8y.js.map → power-and-mde-g3vOn0XK.js.map} +1 -1
  124. package/dist/{prime-protocol-COFkxas6.d.ts → prime-protocol-DKRk4l4U.d.ts} +2 -2
  125. package/dist/{prime-protocol-COFkxas6.d.ts.map → prime-protocol-DKRk4l4U.d.ts.map} +1 -1
  126. package/dist/{promotion-policy-f79oklG_.js → promotion-policy-DLPcEnCf.js} +4 -4
  127. package/dist/{promotion-policy-f79oklG_.js.map → promotion-policy-DLPcEnCf.js.map} +1 -1
  128. package/dist/{proposal-findings-BclX0PFh.js → proposal-findings-CZJkS_GY.js} +2 -2
  129. package/dist/{proposal-findings-BclX0PFh.js.map → proposal-findings-CZJkS_GY.js.map} +1 -1
  130. package/dist/{registry-CMtGAxOw.d.ts → registry-Ck7w-rr5.d.ts} +3 -3
  131. package/dist/{registry-CMtGAxOw.d.ts.map → registry-Ck7w-rr5.d.ts.map} +1 -1
  132. package/dist/{release-confidence--1iP-d3x.js → release-confidence-nfQNh3eb.js} +4 -4
  133. package/dist/{release-confidence--1iP-d3x.js.map → release-confidence-nfQNh3eb.js.map} +1 -1
  134. package/dist/{render-CFrJ7M0o.js → render-BVPfP7dc.js} +52 -36
  135. package/dist/{render-CFrJ7M0o.js.map → render-BVPfP7dc.js.map} +1 -1
  136. package/dist/reporting.js +5 -5
  137. package/dist/{reward-P0VD_Aft.js → reward-DqMfaEax.js} +10 -2
  138. package/dist/{reward-P0VD_Aft.js.map → reward-DqMfaEax.js.map} +1 -1
  139. package/dist/{reward-hacking-D-Vi9-fE.js → reward-hacking-B88f-Kh7.js} +4 -4
  140. package/dist/{reward-hacking-D-Vi9-fE.js.map → reward-hacking-B88f-Kh7.js.map} +1 -1
  141. package/dist/rl.d.ts +3 -3
  142. package/dist/rl.js +12 -12
  143. package/dist/rollout/index.d.ts +2 -2
  144. package/dist/rollout/index.js +3 -3
  145. package/dist/{rollout-BC4u-d_I.js → rollout-CbOGxuHl.js} +2 -2
  146. package/dist/{rollout-BC4u-d_I.js.map → rollout-CbOGxuHl.js.map} +1 -1
  147. package/dist/{rollout-nodes-BHR9Q5jP.js → rollout-nodes-DKZ3vAYY.js} +2 -2
  148. package/dist/{rollout-nodes-BHR9Q5jP.js.map → rollout-nodes-DKZ3vAYY.js.map} +1 -1
  149. package/dist/{rubric-predictive-validity-BdxXDN6h.js → rubric-predictive-validity-D_6ZPTNR.js} +2 -2
  150. package/dist/{rubric-predictive-validity-BdxXDN6h.js.map → rubric-predictive-validity-D_6ZPTNR.js.map} +1 -1
  151. package/dist/{run-record-B-G2Tu11.js → run-record-CbUi2adH.js} +3 -3
  152. package/dist/{run-record-B-G2Tu11.js.map → run-record-CbUi2adH.js.map} +1 -1
  153. package/dist/{run-record-DEjx43cI.js → run-record-CpLS4Uid.js} +2 -2
  154. package/dist/{run-record-DEjx43cI.js.map → run-record-CpLS4Uid.js.map} +1 -1
  155. package/dist/search/index.d.ts +2 -2
  156. package/dist/search/index.js +2 -2
  157. package/dist/{search-kernel-BjR2Sr7w.d.ts → search-kernel-kwO-sgCq.d.ts} +2 -2
  158. package/dist/{search-kernel-BjR2Sr7w.d.ts.map → search-kernel-kwO-sgCq.d.ts.map} +1 -1
  159. package/dist/{search-ledger-BsVi-Ngv.js → search-ledger-CV_bQQed.js} +2 -2
  160. package/dist/{search-ledger-BsVi-Ngv.js.map → search-ledger-CV_bQQed.js.map} +1 -1
  161. package/dist/{search-shipper-pdg4viK7.js → search-shipper-CA3ooBbC.js} +2 -2
  162. package/dist/{search-shipper-pdg4viK7.js.map → search-shipper-CA3ooBbC.js.map} +1 -1
  163. package/dist/{search-summary-DedyTdiM.js → search-summary-DBMjdecs.js} +4 -4
  164. package/dist/{search-summary-DedyTdiM.js.map → search-summary-DBMjdecs.js.map} +1 -1
  165. package/dist/{sequential-Zp1tsxqI.js → sequential-BPbvgzfe.js} +2 -2
  166. package/dist/{sequential-Zp1tsxqI.js.map → sequential-BPbvgzfe.js.map} +1 -1
  167. package/dist/{skillopt-optimization-method-O35aMdxU.js → skillopt-optimization-method-D72XZZfR.js} +9 -9
  168. package/dist/{skillopt-optimization-method-O35aMdxU.js.map → skillopt-optimization-method-D72XZZfR.js.map} +1 -1
  169. package/dist/{statistical-heldout-DYF5f10K.js → statistical-heldout-NBxC7jGo.js} +3 -3
  170. package/dist/{statistical-heldout-DYF5f10K.js.map → statistical-heldout-NBxC7jGo.js.map} +1 -1
  171. package/dist/{statistical-heldout-bU7FBNjR.d.ts → statistical-heldout-_dXihc9T.d.ts} +3 -3
  172. package/dist/{statistical-heldout-bU7FBNjR.d.ts.map → statistical-heldout-_dXihc9T.d.ts.map} +1 -1
  173. package/dist/{store-otlp-DmLm65XW.js → store-otlp-BfPRa2p8.js} +2 -2
  174. package/dist/{store-otlp-DmLm65XW.js.map → store-otlp-BfPRa2p8.js.map} +1 -1
  175. package/dist/{store-tool-spans-lWf6INTH.d.ts → store-tool-spans-BgwVHXma.d.ts} +4 -4
  176. package/dist/{store-tool-spans-lWf6INTH.d.ts.map → store-tool-spans-BgwVHXma.d.ts.map} +1 -1
  177. package/dist/{store-tool-spans-GGaCijFy.js → store-tool-spans-BrSWHB9O.js} +3 -3
  178. package/dist/{store-tool-spans-GGaCijFy.js.map → store-tool-spans-BrSWHB9O.js.map} +1 -1
  179. package/dist/{summary-report-B4BLQb88.js → summary-report-C3IJvp0i.js} +7 -7
  180. package/dist/{summary-report-B4BLQb88.js.map → summary-report-C3IJvp0i.js.map} +1 -1
  181. package/dist/supervisor-run/index.d.ts +6 -0
  182. package/dist/supervisor-run/index.d.ts.map +1 -1
  183. package/dist/supervisor-run/index.js +3 -3
  184. package/dist/{systemone-BDVgb6XV.d.ts → systemone-CBvL1gx-.d.ts} +14 -8
  185. package/dist/systemone-CBvL1gx-.d.ts.map +1 -0
  186. package/dist/{systemone-review-S49gsy_y.js → systemone-review-BusEIzsg.js} +2 -2
  187. package/dist/{systemone-review-S49gsy_y.js.map → systemone-review-BusEIzsg.js.map} +1 -1
  188. package/dist/{systemone-review-BLgxt-4Q.d.ts → systemone-review-nbuMxxmi.d.ts} +2 -2
  189. package/dist/{systemone-review-BLgxt-4Q.d.ts.map → systemone-review-nbuMxxmi.d.ts.map} +1 -1
  190. package/dist/systemone.d.ts +4 -4
  191. package/dist/systemone.js +3 -3
  192. package/dist/{tool-groups-C3K-d3gd.d.ts → tool-groups-BQsjZD9F.d.ts} +3 -3
  193. package/dist/tool-groups-BQsjZD9F.d.ts.map +1 -0
  194. package/dist/{tool-waste-CRJqOASv.js → tool-waste-Czt3aWID.js} +3 -3
  195. package/dist/{tool-waste-CRJqOASv.js.map → tool-waste-Czt3aWID.js.map} +1 -1
  196. package/dist/{trace-questions-ej5AEJ5X.d.ts → trace-questions-CpTrtEcm.d.ts} +3 -3
  197. package/dist/{trace-questions-ej5AEJ5X.d.ts.map → trace-questions-CpTrtEcm.d.ts.map} +1 -1
  198. package/dist/trace-repair/index.d.ts +1 -1
  199. package/dist/trace-repair/index.js +2 -2
  200. package/dist/traces.d.ts +3 -3
  201. package/dist/traces.js +4 -4
  202. package/dist/{tree-C2N31CoI.js → tree-DPwgM2LX.js} +6 -6
  203. package/dist/{tree-C2N31CoI.js.map → tree-DPwgM2LX.js.map} +1 -1
  204. package/dist/{types-DzCO-S1m.d.ts → types-B9s9Xo5_.d.ts} +24 -2
  205. package/dist/types-B9s9Xo5_.d.ts.map +1 -0
  206. package/dist/{types-BF-xQGQn.d.ts → types-CBkDo7ja.d.ts} +2 -2
  207. package/dist/{types-BF-xQGQn.d.ts.map → types-CBkDo7ja.d.ts.map} +1 -1
  208. package/dist/{types-BK0blWhe.js → types-CL1_N7AZ.js} +2 -2
  209. package/dist/{types-BK0blWhe.js.map → types-CL1_N7AZ.js.map} +1 -1
  210. package/dist/{types-yofaDmQa.d.ts → types-D91tnhzf.d.ts} +2 -2
  211. package/dist/{types-yofaDmQa.d.ts.map → types-D91tnhzf.d.ts.map} +1 -1
  212. package/dist/wire/index.d.ts +3 -3
  213. package/docs/behavioral-trace-questions.md +23 -0
  214. package/docs/public-api.md +1 -1
  215. package/package.json +2 -2
  216. package/dist/agreement-irr-w-t3XUTD.js.map +0 -1
  217. package/dist/benchmark-command-Did8Of2O.js.map +0 -1
  218. package/dist/default-registry-DKlKVXMx.d.ts.map +0 -1
  219. package/dist/default-registry-gmDeN0KT.js.map +0 -1
  220. package/dist/external-optimizer-subprocess-CeHuAaMJ.js.map +0 -1
  221. package/dist/finding-composition-DlvE1Qul.js.map +0 -1
  222. package/dist/findings-store-Bp-0Guuv.js.map +0 -1
  223. package/dist/index-DAk2quYu.d.ts.map +0 -1
  224. package/dist/judge-calibration-D93UCm1k.js.map +0 -1
  225. package/dist/systemone-BDVgb6XV.d.ts.map +0 -1
  226. package/dist/tool-groups-C3K-d3gd.d.ts.map +0 -1
  227. package/dist/types-DzCO-S1m.d.ts.map +0 -1
package/dist/cli.js CHANGED
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import { c as errorMessage } from "./errors-DeEEV9Vx.js";
3
- import { l as operatorYield, u as INSUFFICIENT_FROM } from "./pareto-DY_x3HHg.js";
4
- import { i as replaySearchLedgerText } from "./search-ledger-BsVi-Ngv.js";
5
- import { t as renderSearchSummary } from "./search-summary-DedyTdiM.js";
6
- import { l as SEARCH_LEDGER_BATCH_MAX_BYTES, m as SearchRunKindSchema, r as shipSearchLedger, s as hostedTenantFromEnv, t as SearchShipConflictError } from "./search-shipper-pdg4viK7.js";
3
+ import { l as operatorYield, u as INSUFFICIENT_FROM } from "./pareto-B34N-vnn.js";
4
+ import { i as replaySearchLedgerText } from "./search-ledger-CV_bQQed.js";
5
+ import { t as renderSearchSummary } from "./search-summary-DBMjdecs.js";
6
+ import { l as SEARCH_LEDGER_BATCH_MAX_BYTES, m as SearchRunKindSchema, r as shipSearchLedger, s as hostedTenantFromEnv, t as SearchShipConflictError } from "./search-shipper-CA3ooBbC.js";
7
7
  import { a as privacyHit, f as harnessSessionRolloutLines, m as appendRolloutLines, n as runRolloutReleaseCli, p as gateReceiptRolloutLines, r as PRIVACY_RULE_NAMES, u as harnessSessionRefs } from "./hf-dataset-DPVQXW5n.js";
8
8
  import { t as createChatClient } from "./chat-client-D0me8iwq.js";
9
- import { t as runAnalystBenchmarkCommand } from "./benchmark-command-Did8Of2O.js";
9
+ import { t as runAnalystBenchmarkCommand } from "./benchmark-command-BRRhjX2k.js";
10
10
  import { i as buildOpenApi, l as handleVersion, o as runRpcBatch, r as startServerAsync, s as runRpcOnce } from "./server-CPKyf3bz.js";
11
- import { b as editCreditText, f as landscape, g as surfaceTextEdits, l as metaSearch, m as formatLandscape, n as taskMatrix, o as skillManifold, r as formatSkillManifold, s as renderMetaSearchText, t as tree, v as front, y as editCredit } from "./tree-C2N31CoI.js";
12
- import { c as discoveryRunRolloutLines, i as analyzeSupervisorRun, n as renderSupervisorRunHeadline, r as renderSupervisorRunMarkdown } from "./render-CFrJ7M0o.js";
11
+ import { b as editCreditText, f as landscape, g as surfaceTextEdits, l as metaSearch, m as formatLandscape, n as taskMatrix, o as skillManifold, r as formatSkillManifold, s as renderMetaSearchText, t as tree, v as front, y as editCredit } from "./tree-DPwgM2LX.js";
12
+ import { c as discoveryRunRolloutLines, i as analyzeSupervisorRun, n as renderSupervisorRunHeadline, r as renderSupervisorRunMarkdown } from "./render-BVPfP7dc.js";
13
13
  import { createHash } from "node:crypto";
14
14
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
15
15
  import { dirname, join, resolve } from "node:path";
16
16
  import { fileURLToPath } from "node:url";
17
- import { open, readFile, rm, stat } from "node:fs/promises";
17
+ import { appendFile, open, readFile, rm, stat } from "node:fs/promises";
18
18
  // src/cli-config.ts
19
19
  /**
20
20
  * Provider configuration for the `agent-eval` binary.
@@ -445,19 +445,21 @@ async function firstLineSearchId(path) {
445
445
  * --since <ISO> limit --sessions to stores changed since then
446
446
  * --gate-receipts <file> beelink-gate receipts.jsonl, as verifiable labels
447
447
  * --denylist <file> literal private terms, one per line
448
+ * --otlp <file> also write each kept run row's session as OTLP spans
448
449
  *
449
450
  * Every row passes the privacy screen before it is written: a row with any
450
451
  * secret or private detail is dropped whole and counted by rule, so the
451
452
  * ledger never holds one. Rows are written under the write policy and read
452
453
  * back with `readRolloutJournal`; their rewards are unscreened.
453
454
  */
454
- const ROLLOUTS_USAGE = "usage: agent-eval supervisor-run rollouts [<runDir>...] [--sessions [<harness>:]<path>]... [--since <ISO>] [--gate-receipts <file>]... [--denylist <file>] --out <ledger.jsonl>";
455
+ const ROLLOUTS_USAGE = "usage: agent-eval supervisor-run rollouts [<runDir>...] [--sessions [<harness>:]<path>]... [--since <ISO>] [--gate-receipts <file>]... [--denylist <file>] [--otlp <file>] --out <ledger.jsonl>";
455
456
  function parseArgs$1(argv) {
456
457
  const args = {
457
458
  runDirs: [],
458
459
  sessions: [],
459
460
  gateReceipts: [],
460
461
  denylist: null,
462
+ otlp: null,
461
463
  out: ""
462
464
  };
463
465
  const value = (i, flag) => {
@@ -481,6 +483,7 @@ function parseArgs$1(argv) {
481
483
  args.sinceMs = ms;
482
484
  } else if (arg === "--gate-receipts") args.gateReceipts.push(value(++i, arg));
483
485
  else if (arg === "--denylist") args.denylist = value(++i, arg);
486
+ else if (arg === "--otlp") args.otlp = value(++i, arg);
484
487
  else if (arg.startsWith("--")) throw new Error(`unknown flag "${arg}"`);
485
488
  else args.runDirs.push(arg);
486
489
  }
@@ -506,6 +509,7 @@ async function runRolloutsCommand(argv, io) {
506
509
  sources: []
507
510
  };
508
511
  await rm(out, { force: true });
512
+ if (args.otlp !== null) await rm(args.otlp, { force: true });
509
513
  const write = async (source, lines) => {
510
514
  source.read += lines.length;
511
515
  const kept = lines.filter((line) => {
@@ -516,6 +520,7 @@ async function runRolloutsCommand(argv, io) {
516
520
  await appendRolloutLines(out, kept);
517
521
  source.written += kept.length;
518
522
  summary.written += kept.length;
523
+ return kept;
519
524
  };
520
525
  for (const runDir of args.runDirs) {
521
526
  const source = {
@@ -529,7 +534,8 @@ async function runRolloutsCommand(argv, io) {
529
534
  try {
530
535
  const run = await discoveryRunRolloutLines(resolve(runDir), { capturedAt });
531
536
  source.errors.push(...run.gaps.map((gap) => `${gap.code}: ${gap.message}`), ...run.notes);
532
- await write(source, run.lines);
537
+ const spans = (await write(source, run.lines)).map((line) => run.otlp.get(line.rollout_id) ?? "");
538
+ if (args.otlp !== null) await appendFile(args.otlp, spans.join(""));
533
539
  } catch (error) {
534
540
  source.errors.push(errorMessage(error));
535
541
  }
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","names":["parseArgs"],"sources":["../src/cli-config.ts","../src/search-command.ts","../src/supervisor-run/rollouts-command.ts","../src/supervisor-run/report-command.ts","../src/cli.ts"],"sourcesContent":["/**\n * Provider configuration for the `agent-eval` binary.\n *\n * The binary reads endpoint and credential values from its environment.\n * TypeScript library callers bind a transport explicitly. The maintained\n * HTTP transport accepts their credential and sends provider requests.\n */\n\nimport { type ChatClient, createChatClient } from './analyst/chat-client'\n\ninterface CliLlmConfig {\n /** Judge transport for the wire handlers. Absent when no provider is configured. */\n chat?: ChatClient\n model?: string\n}\n\n/** The endpoint the binary resolved from its environment. */\ninterface CliProviderRoute {\n baseUrl: string\n apiKey: string\n model?: string\n}\n\n/**\n * Environment precedence for the binary's provider route, with no client built.\n *\n * Both halves are required: a base URL without a key, or a key without an\n * endpoint, is a half-configured server. `/v1/judge` then refuses with\n * `llm_not_configured` instead of calling an unintended endpoint.\n */\nfunction resolveCliProviderRoute(\n env: NodeJS.ProcessEnv = process.env,\n): CliProviderRoute | undefined {\n const explicitBaseUrl = nonEmpty(env.AGENT_EVAL_LLM_BASE_URL)\n const explicitApiKey = nonEmpty(env.AGENT_EVAL_LLM_API_KEY)\n const openAiApiKey = nonEmpty(env.OPENAI_API_KEY)\n const tangleApiKey = nonEmpty(env.TANGLE_API_KEY)\n const baseUrl =\n explicitBaseUrl ??\n nonEmpty(env.OPENAI_BASE_URL) ??\n nonEmpty(env.TANGLE_ROUTER_URL) ??\n (openAiApiKey ? 'https://api.openai.com/v1' : undefined) ??\n (tangleApiKey ? 'https://router.tangle.tools/v1' : undefined)\n const apiKey = explicitApiKey ?? openAiApiKey ?? tangleApiKey\n const model =\n nonEmpty(env.AGENT_EVAL_LLM_MODEL) ?? nonEmpty(env.OPENAI_MODEL) ?? nonEmpty(env.TANGLE_MODEL)\n\n if (!baseUrl || !apiKey) return undefined\n return { baseUrl, apiKey, ...(model ? { model } : {}) }\n}\n\nexport function resolveCliLlmConfig(env: NodeJS.ProcessEnv = process.env): CliLlmConfig {\n const route = resolveCliProviderRoute(env)\n if (!route) return {}\n return {\n chat: cliChatClient({ baseUrl: route.baseUrl, apiKey: route.apiKey }, route.model),\n ...(route.model ? { model: route.model } : {}),\n }\n}\n\n/**\n * The binary's transport IS the published one — `createChatClient({ transport:\n * 'openai-compatible' })` — so the server and a library consumer cannot drift\n * onto two different clients for the same endpoint.\n *\n * The one thing kept local is the error text. A generic \"no model on the\n * request\" tells a server operator nothing; this names the variable to set.\n */\nfunction cliChatClient(\n route: { baseUrl: string; apiKey: string },\n defaultModel: string | undefined,\n): ChatClient {\n const client = createChatClient({\n transport: 'openai-compatible',\n baseUrl: route.baseUrl,\n apiKey: route.apiKey,\n ...(defaultModel ? { defaultModel } : {}),\n })\n return {\n ...client,\n chat: (req, callOpts) => {\n if (!req.model && !defaultModel) {\n throw new Error(\n 'agent-eval: no model on the request and no AGENT_EVAL_LLM_MODEL configured',\n )\n }\n return client.chat(req, callOpts)\n },\n }\n}\n\nfunction nonEmpty(value: string | undefined): string | undefined {\n const trimmed = value?.trim()\n return trimmed ? trimmed : undefined\n}\n","/**\n * `agent-eval search <subcommand>`: work with a search ledger from a terminal.\n *\n * agent-eval search ship <search-ledger.jsonl> --run-kind optimization|eval [--content full|digests]\n * agent-eval search show <search-ledger.jsonl> [--tree] [--operator-yield] [--front] [--task-matrix]\n * [--edit-credit] [--landscape] [--skill-manifold] [--json]\n * agent-eval search show <search-ledger.jsonl> [<search-ledger.jsonl> ...] --meta [--objective <key>] [--json]\n *\n * `ship` sends the ledger to the hosted store named by `TANGLE_INGEST_URL`,\n * `TANGLE_INGEST_API_KEY` and `TANGLE_TENANT_ID`, starting from the store's\n * head, so it finishes or resumes a ship that a loop could not complete.\n *\n * `show` verifies the ledger and prints `renderSearchSummary`: the same\n * compact text a proposer reads, on the search's own ranking split (the\n * selection split when the search declares one, else train). There is no\n * local HTML renderer; the hosted store's page is the visual view (§5 of the\n * search-tree design). A lens flag adds that lens's text form after the\n * summary, so an agent reads what a person sees; `--json` prints the lens\n * results as JSON instead, the shape a view renders.\n *\n * `show --meta` reads every ledger it is given and prints the `metaSearch`\n * lens over them instead of one search's summary: each search as one node\n * scored by its held-out lift per known dollar, the configurations best first,\n * and the searches arranged by derivation and containment.\n */\n\nimport { createHash } from 'node:crypto'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { open, readFile } from 'node:fs/promises'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { replaySearchLedgerText } from './campaign/search-ledger'\nimport type { SearchArtifactRef } from './campaign/search-ledger-types'\nimport type { SearchStateView } from './campaign/search-state'\nimport { renderSearchSummary } from './campaign/search-summary'\nimport { hostedTenantFromEnv } from './hosted/client'\nimport { SEARCH_LEDGER_BATCH_MAX_BYTES, SearchRunKindSchema } from './hosted/search-ledger-wire'\nimport { SearchShipConflictError, shipSearchLedger } from './hosted/search-shipper'\nimport { editCredit, editCreditText } from './search/lenses/edit-credit'\nimport { type FrontData, front } from './search/lenses/front'\nimport { formatLandscape, landscape, surfaceTextEdits } from './search/lenses/landscape'\nimport { metaSearch } from './search/lenses/meta-search'\nimport { renderMetaSearchText } from './search/lenses/meta-search-text'\nimport { type OperatorYieldData, operatorYield } from './search/lenses/operator-yield'\nimport { INSUFFICIENT_FROM } from './search/lenses/shared'\nimport { formatSkillManifold, skillManifold } from './search/lenses/skill-manifold'\nimport { type TaskMatrixData, taskMatrix } from './search/lenses/task-matrix'\nimport { type TreeData, type TreeNode, tree } from './search/lenses/tree'\n\nconst USAGE = `usage: agent-eval search <subcommand> ...\n\n ship <search-ledger.jsonl> --run-kind optimization|eval [--content full|digests]\n Ships the ledger's entries, and the blobs they name, to the hosted store in\n TANGLE_INGEST_URL (or TANGLE_ORCHESTRATOR_URL) as tenant TANGLE_TENANT_ID with\n TANGLE_INGEST_API_KEY (or TANGLE_API_KEY). It starts from the store's head, so\n running it again sends only what the store lacks. Prints the result as JSON.\n Exits 1 when the store holds a different chain for the search.\n\n show <search-ledger.jsonl> [--tree] [--operator-yield] [--front] [--task-matrix]\n [--edit-credit] [--landscape] [--skill-manifold] [--json]\n Verifies the ledger and prints its search summary: the leading nodes\n against the root, the most recently discarded nodes and why, and a log\n of recent proposals. The same text a proposer reads as context, on the\n search's own ranking split. Each lens flag adds that lens's text form\n (search-tree-design §12) below the summary — the same JSON\n Intelligence, discovery lab, VerticalBench and agent-runtime read.\n --tree the tidy tree of nodes and edges.\n --operator-yield outcome counts and yield per known dollar, by edge operator.\n --front the Pareto front over score and known cost per cell.\n --task-matrix nodes × units, clustered, with specialist gain per cluster.\n --edit-credit every edit as a gene followed down the lineage, its\n credit, interacting pairs, and skill candidates. It\n reads node artifacts from the blobs the ledger names,\n verified by digest.\n --landscape nodes placed by line edits between their profile\n surfaces (read from the blobs, verified by digest), the\n kriged score surface, its basins, and the plateau score\n a policy drafts on.\n --skill-manifold the node × unit score matrix factored into skill axes,\n its cross-validated intrinsic dimension, and the unit\n that best separates the leaders.\n --json prints the requested lenses as JSON instead of text.\n\n show <search-ledger.jsonl> [<search-ledger.jsonl> ...] --meta [--objective <key>] [--json]\n Verifies every ledger and prints the meta-search lens over them: each\n search as one node, scored by its claim's held-out lift per known\n dollar (unscored searches say why), configurations best first with\n their interval, method and n, and the searches arranged by derivation\n and containment. --objective names the objective the best\n configuration is chosen within when the searches span several.`\n\nexport async function runSearchCommand(argv: string[]): Promise<number> {\n const [subcommand, ...rest] = argv\n if (subcommand === undefined || subcommand === '--help' || subcommand === '-h') {\n process.stdout.write(`${USAGE}\\n`)\n return 0\n }\n if (subcommand === 'show') return await runShowCommand(rest)\n if (subcommand !== 'ship') {\n process.stderr.write(`unknown search subcommand: ${subcommand}\\n${USAGE}\\n`)\n return 1\n }\n if (rest.some((arg) => arg === undefined || arg === '--help' || arg === '-h')) {\n process.stdout.write(`${USAGE}\\n`)\n return 0\n }\n const { path, flags } = parseShipArgs(rest)\n const runKind = SearchRunKindSchema.safeParse(flags['run-kind'])\n if (!runKind.success) throw new Error(`--run-kind must be optimization or eval\\n${USAGE}`)\n const content = flags.content ?? 'full'\n if (content !== 'full' && content !== 'digests') {\n throw new Error(`--content must be full or digests\\n${USAGE}`)\n }\n const tenant = hostedTenantFromEnv()\n if (!tenant) {\n throw new Error(\n 'set TANGLE_INGEST_URL, TANGLE_INGEST_API_KEY and TANGLE_TENANT_ID to name the store',\n )\n }\n const searchId = await firstLineSearchId(path)\n try {\n const shipped = await shipSearchLedger({\n tenant,\n ledger: { path, searchId },\n runKind: runKind.data,\n content,\n })\n process.stdout.write(`${JSON.stringify(shipped, null, 2)}\\n`)\n return shipped.head.nextSequence === shipped.localLines ? 0 : 1\n } catch (error) {\n if (!(error instanceof SearchShipConflictError)) throw error\n process.stderr.write(`${error.message}\\n`)\n return 1\n }\n}\n\nasync function runShowCommand(argv: string[]): Promise<number> {\n if (argv.includes('--help') || argv.includes('-h')) {\n process.stdout.write(`${USAGE}\\n`)\n return 0\n }\n if (argv.includes('--meta')) return await runShowMetaCommand(argv)\n const positional = argv.filter((arg) => !arg.startsWith('--'))\n const flags = new Set(argv.filter((arg) => arg.startsWith('--')))\n const unknown = [...flags].filter((flag) => !SHOW_FLAGS.has(flag))\n if (positional.length !== 1 || unknown.length > 0) {\n if (unknown.length > 0) process.stderr.write(`unknown flag ${unknown.join(', ')}\\n`)\n process.stdout.write(`${USAGE}\\n`)\n return 1\n }\n const path = positional[0]!\n const searchId = await firstLineSearchId(path)\n const text = await readFile(path, 'utf8')\n const state = replaySearchLedgerText(text, searchId, path)\n const split =\n state.header && state.header.splits.selection.tasks.length > 0 ? 'selection' : 'train'\n const lenses = showLenses(state, path, flags)\n if (flags.has('--json')) {\n if (lenses.length === 0) {\n process.stderr.write('--json needs a lens flag\\n')\n return 1\n }\n const json = Object.fromEntries(lenses.map((lens) => [lens.name, lens.result]))\n process.stdout.write(`${JSON.stringify(json, null, 2)}\\n`)\n return 0\n }\n const sections = [renderSearchSummary(state, { split }), ...lenses.map((lens) => lens.text)]\n process.stdout.write(`${sections.join('\\n\\n')}\\n`)\n return 0\n}\n\nasync function runShowMetaCommand(argv: string[]): Promise<number> {\n const paths: string[] = []\n let objective: string | undefined\n let json = false\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index]!\n if (token === '--meta') continue\n if (token === '--json') {\n json = true\n continue\n }\n if (token === '--objective') {\n objective = argv[++index]\n if (objective === undefined) throw new Error(`--objective needs a value\\n${USAGE}`)\n continue\n }\n if (token.startsWith('--')) throw new Error(`unknown flag ${token}\\n${USAGE}`)\n paths.push(token)\n }\n if (paths.length === 0) throw new Error(`show --meta needs at least one ledger\\n${USAGE}`)\n const states = []\n for (const path of paths) {\n const searchId = await firstLineSearchId(path)\n states.push(replaySearchLedgerText(await readFile(path, 'utf8'), searchId, path))\n }\n const lens = metaSearch(states, objective === undefined ? {} : { objective })\n process.stdout.write(\n json ? `${JSON.stringify({ metaSearch: lens }, null, 2)}\\n` : `${renderMetaSearchText(lens)}\\n`,\n )\n return 0\n}\n\nconst SHOW_FLAGS = new Set([\n '--edit-credit',\n '--json',\n '--tree',\n '--operator-yield',\n '--front',\n '--task-matrix',\n '--landscape',\n '--skill-manifold',\n])\n\nfunction showLenses(\n state: SearchStateView,\n ledgerPath: string,\n flags: ReadonlySet<string>,\n): Array<{ name: string; result: unknown; text: string }> {\n const lenses: Array<{ name: string; result: unknown; text: string }> = []\n if (flags.has('--tree')) {\n const result = tree(state)\n lenses.push({ name: 'tree', result, text: renderTreeText(result.data) })\n }\n if (flags.has('--operator-yield')) {\n const result = operatorYield(state)\n lenses.push({ name: 'operatorYield', result, text: renderOperatorYieldText(result.data) })\n }\n if (flags.has('--front')) {\n const result = front(state)\n lenses.push({ name: 'front', result, text: renderFrontText(result.data) })\n }\n if (flags.has('--task-matrix')) {\n const result = taskMatrix(state)\n lenses.push({ name: 'taskMatrix', result, text: renderTaskMatrixText(result.data) })\n }\n if (flags.has('--edit-credit')) {\n const result = editCredit(state, { readArtifact: ledgerBlobReader(ledgerPath) })\n lenses.push({ name: 'editCredit', result, text: editCreditText(result) })\n }\n if (flags.has('--landscape')) {\n const read = ledgerBlobReader(ledgerPath)\n const result = landscape(\n state,\n surfaceTextEdits((surface) => read(surface.artifact) ?? null),\n )\n lenses.push({ name: 'landscape', result, text: formatLandscape(result) })\n }\n if (flags.has('--skill-manifold')) {\n const result = skillManifold(state)\n lenses.push({ name: 'skillManifold', result, text: formatSkillManifold(result) })\n }\n return lenses\n}\n\n/**\n * Reads a blob a ledger names: at its `file:` URI, else under `blobs/` beside\n * the ledger, where `SearchRecorder` writes them. Bytes that do not hash to the\n * reference's digest and length read as unavailable, never as content.\n */\nfunction ledgerBlobReader(ledgerPath: string): (ref: SearchArtifactRef) => unknown | undefined {\n const cache = new Map<string, unknown>()\n return (ref) => {\n if (cache.has(ref.sha256)) return cache.get(ref.sha256)\n const hex = ref.sha256.slice('sha256:'.length)\n const candidates = [join(dirname(ledgerPath), 'blobs', `${hex}.json`)]\n if (ref.uri.startsWith('file:')) candidates.unshift(fileURLToPath(ref.uri))\n let value: unknown\n for (const candidate of candidates) {\n if (!existsSync(candidate)) continue\n const bytes = readFileSync(candidate)\n const digest = createHash('sha256').update(bytes).digest('hex')\n if (digest !== hex || bytes.byteLength !== ref.byteLength) continue\n try {\n value = JSON.parse(bytes.toString('utf8'))\n } catch {\n // Verified bytes that are not JSON are not content a lens can read.\n }\n break\n }\n cache.set(ref.sha256, value)\n return value\n }\n}\n\nfunction renderTreeText(data: TreeData): string {\n const lines = [\n `tree: ${data.nodeCount} node${data.nodeCount === 1 ? '' : 's'}, ${data.edgeCount} edge${data.edgeCount === 1 ? '' : 's'}`,\n ]\n const walk = (node: TreeNode, prefix: string, isLast: boolean): void => {\n const branch = prefix === '' ? '' : isLast ? '└─ ' : '├─ '\n const op = node.operator ? `${node.operator} → ` : ''\n const rung = node.rung === null ? '' : ` rung ${node.rung}`\n const depth = node.depth === null ? ' depth unknown' : ''\n const cost =\n node.unknownCostCells === 0\n ? `$${node.knownCostUsd.toFixed(2)}`\n : `$${node.knownCostUsd.toFixed(2)} known + at least $${node.floorUsd.toFixed(2)} over ${node.unknownCostCells} unknown-cost cell${node.unknownCostCells === 1 ? '' : 's'}`\n lines.push(\n `${prefix}${branch}${op}${node.nodeId} (${node.status ?? 'undecided'}${rung}${depth}) ${cost}`,\n )\n const childPrefix = prefix + (prefix === '' ? '' : isLast ? ' ' : '│ ')\n node.children.forEach((child, index) => {\n walk(child, childPrefix, index === node.children.length - 1)\n })\n }\n data.roots.forEach((root, index) => {\n walk(root, '', index === data.roots.length - 1)\n })\n return lines.join('\\n')\n}\n\nfunction renderOperatorYieldText(data: OperatorYieldData): string {\n const lines = [`operator yield (${data.split} split, gain per known $ of proposal + screen):`]\n if (data.rows.length === 0) lines.push(' no edges yet')\n for (const row of data.rows) {\n const y = row.yield\n const outcomes = Object.entries(row.outcomes)\n .filter(([, count]) => count > 0)\n .map(([status, count]) => `${status}=${count}`)\n .join(' ')\n const yieldText =\n y.method === 'none'\n ? y.n === 0\n ? 'yield: no measured children'\n : `yield unknown (${y.n} of ${INSUFFICIENT_FROM}, none)`\n : y.method === 'insufficient'\n ? `yield≈${y.mean!.toFixed(4)}/$ (${y.n} of ${INSUFFICIENT_FROM}, insufficient)`\n : `yield≈${y.mean!.toFixed(4)}/$ [${y.interval![0].toFixed(4)}, ${y.interval![1].toFixed(4)}] (${y.method}, ${y.intervalMethod}, n=${y.n})`\n const nodes = Object.values(row.outcomes).reduce((sum, count) => sum + count, 0)\n const reproposals = row.reproposals > 0 ? `, ${row.reproposals} re-proposals` : ''\n lines.push(\n ` ${row.operator}: ${row.proposals} proposals${reproposals} → ${nodes} node${nodes === 1 ? '' : 's'} (${outcomes || 'no decisions yet'}); ${yieldText}; ${row.excluded} excluded`,\n )\n }\n return lines.join('\\n')\n}\n\nfunction renderFrontText(data: FrontData): string {\n const onFront = data.rows.filter((row) => row.onFront)\n const reasons = Object.entries(data.exclusions)\n .filter(([, count]) => count > 0)\n .map(([reason, count]) => `${reason} ${count}`)\n .join(', ')\n const lines = [\n `front (${data.split} split, axes: ${data.axes.join(', ')}): ${data.frontierSize} of ${data.rows.length} node(s) on the frontier, ${data.excludedCount} excluded${reasons ? ` (${reasons})` : ''}`,\n ]\n for (const row of onFront) {\n lines.push(\n ` ${row.nodeId}: score=${row.score!.toFixed(4)} on ${row.units} units (${row.method}) costPerCell=$${row.costPerCellUsd!.toFixed(4)}`,\n )\n }\n return lines.join('\\n')\n}\n\nfunction renderTaskMatrixText(data: TaskMatrixData): string {\n const lines = [\n `task matrix (${data.split} split, ${data.direction}): ${data.nodeIds.length} node(s) × ${data.unitIds.length} unit(s), ${data.nodeClusters.length} node cluster(s), ${data.unitClusters.length} unit cluster(s)`,\n ]\n if (data.sampling) {\n lines.push(\n ` clustered ${data.sampling.nodesClustered} of ${data.sampling.nodesTotal} nodes (cap ${data.sampling.cap}), evenly sampled in registration order; unit clusters and specialist gains use the same nodes`,\n )\n }\n for (const row of data.specialistGain) {\n const gain =\n row.gain === null\n ? `insufficient (${row.insufficient})`\n : `${row.gain.toFixed(4)} (best ${row.bestNodeId}, ${row.nodesContributing} nodes on ${row.unitIds.length} units)`\n lines.push(` cluster ${row.clusterId} [${row.unitIds.join(', ')}]: specialist gain ${gain}`)\n }\n return lines.join('\\n')\n}\n\nfunction parseShipArgs(argv: string[]): { path: string; flags: Record<string, string> } {\n const flags: Record<string, string> = {}\n const positional: string[] = []\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index]!\n if (!token.startsWith('--')) {\n positional.push(token)\n continue\n }\n const [name, inline] = token.slice(2).split('=', 2) as [string, string | undefined]\n if (name !== 'run-kind' && name !== 'content') throw new Error(`unknown flag --${name}`)\n const value = inline ?? argv[++index]\n if (value === undefined) throw new Error(`--${name} needs a value`)\n flags[name] = value\n }\n if (positional.length !== 1) throw new Error(USAGE)\n return { path: positional[0]!, flags }\n}\n\n/** The ledger names its search on every line; read the first. */\nasync function firstLineSearchId(path: string): Promise<string> {\n const handle = await open(path, 'r')\n try {\n // A line longer than one request's limit cannot ship anyway.\n const bytes = Buffer.alloc(SEARCH_LEDGER_BATCH_MAX_BYTES + 1)\n const { bytesRead } = await handle.read(bytes, 0, bytes.byteLength, 0)\n const newline = bytes.subarray(0, bytesRead).indexOf(0x0a)\n if (newline < 0) throw new Error(`${path} holds no complete ledger line`)\n const first = JSON.parse(bytes.toString('utf8', 0, newline)) as { searchId?: unknown }\n if (typeof first.searchId !== 'string') throw new Error(`${path} line 1 names no searchId`)\n return first.searchId\n } finally {\n await handle.close()\n }\n}\n","/**\n * `agent-eval supervisor-run rollouts` writes one rollout ledger from the\n * places the fleet's work is recorded:\n *\n * <runDir...> Discovery / Runtime run directories (`discoveryRunRolloutLines`)\n * --sessions [<harness>:]<path> a HOME, store directory, session file or OpenCode .db;\n * the prefix limits a directory to one harness and names a file's\n * --since <ISO> limit --sessions to stores changed since then\n * --gate-receipts <file> beelink-gate receipts.jsonl, as verifiable labels\n * --denylist <file> literal private terms, one per line\n *\n * Every row passes the privacy screen before it is written: a row with any\n * secret or private detail is dropped whole and counted by rule, so the\n * ledger never holds one. Rows are written under the write policy and read\n * back with `readRolloutJournal`; their rewards are unscreened.\n */\n\nimport { readFile, rm } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport { errorMessage } from '../errors'\nimport { appendRolloutLines } from '../rollout/ledger'\nimport { gateReceiptRolloutLines } from '../rollout/readers/gate-receipts'\nimport {\n harnessSessionRefs,\n harnessSessionRolloutLines,\n} from '../rollout/readers/harness-session-lines'\nimport { PRIVACY_RULE_NAMES, privacyHit } from '../rollout/release/scrub'\nimport type { RolloutLine } from '../rollout/schema'\nimport { discoveryRunRolloutLines } from './discovery-rollouts'\nimport type { SupervisorRunCommandIo } from './report-command'\n\nexport const ROLLOUTS_USAGE =\n 'usage: agent-eval supervisor-run rollouts [<runDir>...] [--sessions [<harness>:]<path>]... [--since <ISO>] [--gate-receipts <file>]... [--denylist <file>] --out <ledger.jsonl>'\n\ninterface RolloutsArgs {\n runDirs: string[]\n sessions: Array<{ path: string; harness?: string }>\n sinceMs?: number\n gateReceipts: string[]\n denylist: string | null\n out: string\n}\n\nfunction parseArgs(argv: readonly string[]): RolloutsArgs {\n const args: RolloutsArgs = {\n runDirs: [],\n sessions: [],\n gateReceipts: [],\n denylist: null,\n out: '',\n }\n const value = (i: number, flag: string): string => {\n const v = argv[i]\n if (v === undefined || v.startsWith('--')) throw new Error(`${flag} expects a value`)\n return v\n }\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i] as string\n if (arg === '--out') args.out = value(++i, arg)\n else if (arg === '--sessions') {\n const raw = value(++i, arg)\n const prefixed = /^([a-z][a-z-]*):(.+)$/u.exec(raw)\n args.sessions.push(prefixed ? { harness: prefixed[1]!, path: prefixed[2]! } : { path: raw })\n } else if (arg === '--since') {\n const ms = Date.parse(value(++i, arg))\n if (Number.isNaN(ms)) throw new Error(`--since expects an ISO time, got ${argv[i]}`)\n args.sinceMs = ms\n } else if (arg === '--gate-receipts') args.gateReceipts.push(value(++i, arg))\n else if (arg === '--denylist') args.denylist = value(++i, arg)\n else if (arg.startsWith('--')) throw new Error(`unknown flag \"${arg}\"`)\n else args.runDirs.push(arg)\n }\n if (!args.out) throw new Error(ROLLOUTS_USAGE)\n if (args.runDirs.length + args.sessions.length + args.gateReceipts.length === 0) {\n throw new Error(`no sources given\\n${ROLLOUTS_USAGE}`)\n }\n return args\n}\n\nexport interface RolloutsSummary {\n out: string\n written: number\n dropped: Record<string, number>\n sources: Array<{ source: string; kind: string; read: number; written: number; errors: string[] }>\n}\n\nexport async function runRolloutsCommand(\n argv: readonly string[],\n io: SupervisorRunCommandIo,\n): Promise<number> {\n let args: RolloutsArgs\n try {\n args = parseArgs(argv)\n } catch (error) {\n io.stderr(`${errorMessage(error)}\\n`)\n return 2\n }\n const out = resolve(args.out)\n const denylist =\n args.denylist === null\n ? []\n : (await readFile(args.denylist, 'utf8'))\n .split('\\n')\n .map((line) => line.replace(/#.*/u, '').trim())\n .filter(Boolean)\n const capturedAt = new Date().toISOString()\n const summary: RolloutsSummary = {\n out,\n written: 0,\n dropped: Object.fromEntries(PRIVACY_RULE_NAMES.map((name) => [name, 0])),\n sources: [],\n }\n await rm(out, { force: true })\n\n const write = async (source: RolloutsSummary['sources'][number], lines: RolloutLine[]) => {\n source.read += lines.length\n const kept = lines.filter((line) => {\n const hit = privacyHit(line, denylist)\n if (hit !== null) summary.dropped[hit] = (summary.dropped[hit] ?? 0) + 1\n return hit === null\n })\n await appendRolloutLines(out, kept)\n source.written += kept.length\n summary.written += kept.length\n }\n\n for (const runDir of args.runDirs) {\n const source = { source: runDir, kind: 'run-dir', read: 0, written: 0, errors: [] as string[] }\n summary.sources.push(source)\n try {\n const run = await discoveryRunRolloutLines(resolve(runDir), { capturedAt })\n source.errors.push(...run.gaps.map((gap) => `${gap.code}: ${gap.message}`), ...run.notes)\n await write(source, run.lines)\n } catch (error) {\n source.errors.push(errorMessage(error))\n }\n }\n for (const target of args.sessions) {\n const source = {\n source: target.path,\n kind: `sessions:${target.harness ?? 'all'}`,\n read: 0,\n written: 0,\n errors: [] as string[],\n }\n summary.sources.push(source)\n try {\n const refs = await harnessSessionRefs(resolve(target.path), {\n ...(target.harness === undefined ? {} : { harness: target.harness }),\n ...(args.sinceMs === undefined ? {} : { sinceMs: args.sinceMs }),\n })\n let batch: RolloutLine[] = []\n for await (const item of harnessSessionRolloutLines(refs, capturedAt)) {\n if (item.line) batch.push(item.line)\n else source.errors.push(`${item.ref.path}: ${item.error}`)\n if (batch.length >= 100) {\n await write(source, batch)\n batch = []\n }\n }\n await write(source, batch)\n } catch (error) {\n source.errors.push(errorMessage(error))\n }\n }\n for (const path of args.gateReceipts) {\n const source = {\n source: path,\n kind: 'gate-receipts',\n read: 0,\n written: 0,\n errors: [] as string[],\n }\n summary.sources.push(source)\n try {\n const { lines, skipped } = await gateReceiptRolloutLines(path, capturedAt)\n if (skipped > 0) source.errors.push(`${skipped} receipts carried no verdict`)\n await write(source, lines)\n } catch (error) {\n source.errors.push(errorMessage(error))\n }\n }\n io.stdout(`${JSON.stringify(summary, null, 2)}\\n`)\n return summary.sources.some((s) => s.read === 0 && s.errors.length > 0) ? 1 : 0\n}\n","/**\n * `agent-eval supervisor-run report <runDir>` takes one run directory and\n * prints the report the module already renders. The command reads through\n * `analyzeSupervisorRun`, so a Runtime run directory takes the\n * same path and the status comes from the record `terminal-record.ts` names.\n *\n * Exit codes follow the other self-parsing subcommands: 2 for a usage error,\n * 1 when the directory cannot be read (missing, not a directory, or a corrupt\n * journal or terminal record), 0 after the report was written to stdout.\n */\n\nimport { stat } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport { errorMessage } from '../errors'\nimport { analyzeSupervisorRun } from './reader'\nimport { renderSupervisorRunHeadline, renderSupervisorRunMarkdown } from './render'\nimport { ROLLOUTS_USAGE, runRolloutsCommand } from './rollouts-command'\n\nexport type SupervisorRunReportFormat = 'headline' | 'markdown' | 'json'\n\nconst FORMATS: readonly SupervisorRunReportFormat[] = ['headline', 'markdown', 'json']\n\nconst SUPERVISOR_RUN_USAGE = `usage: agent-eval supervisor-run report <runDir> [--format headline|markdown|json]\n ${ROLLOUTS_USAGE.replace('usage: ', '')}`\n\n/** Output sinks, injectable so tests read the exact bytes a terminal would. */\nexport interface SupervisorRunCommandIo {\n readonly stdout: (text: string) => void\n readonly stderr: (text: string) => void\n}\n\nconst PROCESS_IO: SupervisorRunCommandIo = {\n stdout: (text) => {\n process.stdout.write(text)\n },\n stderr: (text) => {\n process.stderr.write(text)\n },\n}\n\ninterface ReportArgs {\n readonly runDir: string\n readonly format: SupervisorRunReportFormat\n}\n\nfunction isFormat(value: string): value is SupervisorRunReportFormat {\n return (FORMATS as readonly string[]).includes(value)\n}\n\nfunction parseReportArgs(argv: readonly string[]): ReportArgs {\n let runDir: string | null = null\n let format: SupervisorRunReportFormat = 'headline'\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i] as string\n if (arg === '--format') {\n const raw = argv[++i]\n if (raw === undefined || !isFormat(raw)) {\n throw new Error(\n `--format expects one of ${FORMATS.join('|')}, got ${JSON.stringify(raw ?? '')}`,\n )\n }\n format = raw\n } else if (arg.startsWith('--format=')) {\n const raw = arg.slice('--format='.length)\n if (!isFormat(raw)) {\n throw new Error(`--format expects one of ${FORMATS.join('|')}, got ${JSON.stringify(raw)}`)\n }\n format = raw\n } else if (arg.startsWith('--')) {\n throw new Error(`unknown flag \"${arg}\"`)\n } else if (runDir === null) {\n runDir = arg\n } else {\n throw new Error(`unexpected argument \"${arg}\"`)\n }\n }\n if (runDir === null) throw new Error(SUPERVISOR_RUN_USAGE)\n return { runDir, format }\n}\n\n/**\n * CLI driver for `agent-eval supervisor-run`. `argv` is everything after the\n * command name, so `['report', runDir, ...flags]`. Returns the process exit code.\n */\nexport async function runSupervisorRunCommand(\n argv: readonly string[],\n io: SupervisorRunCommandIo = PROCESS_IO,\n): Promise<number> {\n const [verb, ...rest] = argv\n if (verb === undefined || verb === '--help' || verb === '-h' || verb === 'help') {\n io.stdout(`${SUPERVISOR_RUN_USAGE}\\n`)\n return verb === undefined ? 2 : 0\n }\n if (verb === 'rollouts') {\n if (rest.includes('--help') || rest.includes('-h')) {\n io.stdout(`${ROLLOUTS_USAGE}\\n`)\n return 0\n }\n return runRolloutsCommand(rest, io)\n }\n if (verb !== 'report') {\n io.stderr(`unknown supervisor-run subcommand \"${verb}\"\\n${SUPERVISOR_RUN_USAGE}\\n`)\n return 2\n }\n if (rest.includes('--help') || rest.includes('-h')) {\n io.stdout(`${SUPERVISOR_RUN_USAGE}\\n`)\n return 0\n }\n\n let args: ReportArgs\n try {\n args = parseReportArgs(rest)\n } catch (error) {\n io.stderr(`${errorMessage(error)}\\n`)\n return 2\n }\n\n const runDir = resolve(args.runDir)\n // A path that is not a directory is a caller error, not a run with every\n // measurement missing: reporting an absent-shaped run for a typo would read\n // as evidence about a run that never existed.\n const entry = await stat(runDir).catch(() => null)\n if (entry === null || !entry.isDirectory()) {\n io.stderr(`[agent-eval] supervisor-run report: ${runDir} is not a directory\\n`)\n return 1\n }\n\n try {\n const report = await analyzeSupervisorRun(runDir)\n switch (args.format) {\n case 'headline':\n io.stdout(`${renderSupervisorRunHeadline(report)}\\n`)\n break\n case 'markdown':\n io.stdout(renderSupervisorRunMarkdown(report))\n break\n case 'json':\n io.stdout(`${JSON.stringify(report, null, 2)}\\n`)\n break\n }\n return 0\n } catch (error) {\n io.stderr(`[agent-eval] supervisor-run report failed for ${runDir}: ${errorMessage(error)}\\n`)\n return 1\n }\n}\n","#!/usr/bin/env node\n/**\n * agent-eval CLI.\n *\n * agent-eval serve [--port 5005] [--host 127.0.0.1]\n * agent-eval rpc <method> # one request from stdin → one response on stdout\n * agent-eval rpc-batch <method> # JSONL stdin → JSONL stdout\n * agent-eval analyst-benchmark ... # benchmark a real-model trace analyst\n * agent-eval supervisor-run report <runDir> [--format headline|markdown|json]\n * agent-eval search ship <search-ledger.jsonl> --run-kind optimization|eval\n * agent-eval search show <search-ledger.jsonl>\n * agent-eval openapi [--out path] # write OpenAPI spec\n * agent-eval version\n *\n * <method> is one of: judge, listRubrics, version. When omitted, the\n * stdin payload must be a full {method, params} envelope.\n */\nimport { writeFileSync } from 'node:fs'\nimport { runAnalystBenchmarkCommand } from './analyst/benchmark-command'\nimport { resolveCliLlmConfig } from './cli-config'\nimport { runRolloutReleaseCli } from './rollout/release/hf-dataset'\nimport { runSearchCommand } from './search-command'\nimport { runSupervisorRunCommand } from './supervisor-run/report-command'\nimport { handleVersion } from './wire/handlers'\nimport { buildOpenApi } from './wire/openapi'\nimport { runRpcBatch, runRpcOnce } from './wire/rpc'\nimport { startServerAsync } from './wire/server'\n\ninterface Args {\n command: string\n positional: string[]\n flags: Record<string, string>\n}\n\nfunction parseArgs(argv: string[]): Args {\n const [command, ...rest] = argv\n const positional: string[] = []\n const flags: Record<string, string> = {}\n for (let i = 0; i < rest.length; i++) {\n const tok = rest[i]!\n if (tok.startsWith('--')) {\n const raw = tok.slice(2)\n const equalsAt = raw.indexOf('=')\n if (equalsAt >= 0) {\n flags[raw.slice(0, equalsAt)] = raw.slice(equalsAt + 1)\n continue\n }\n const key = raw\n if (key === 'help') {\n flags[key] = 'true'\n continue\n }\n const next = rest[i + 1]\n if (next != null && !next.startsWith('--')) {\n flags[key] = next\n i++\n } else {\n flags[key] = 'true'\n }\n } else if (tok === '-h') {\n flags.help = 'true'\n } else {\n positional.push(tok)\n }\n }\n return { command: command ?? 'help', positional, flags }\n}\n\nconst HELP = `agent-eval: evaluation RPC and HTTP server.\n\nCommands:\n serve [--port 5005] [--host 127.0.0.1]\n Start the HTTP server. POST /v1/judge, GET /v1/rubrics, GET /v1/version, GET /openapi.json.\n rpc <method>\n Read one JSON object from stdin (the params for <method>), write one\n JSON object to stdout. Methods: judge, listRubrics, version.\n rpc-batch <method>\n Like 'rpc' but JSONL in / JSONL out.\n openapi [--out openapi.json]\n Write the OpenAPI 3.1 spec.\n rollout-release <ledger.jsonl...> --out <dir> [--formats sft,verifiers,rft,raw] [--include-proposers] [--denylist <terms.txt>] [--push <org/name>]\n Build a HuggingFace-ready dataset dir from tangle.rollout.v1 ledgers:\n validate, fail-closed split and license filters, drop any line with a\n secret or private detail, scrub, export formats + card.\n analyst-benchmark --dataset <agentrx|codetracebench> --labels <path> --trace-dir <path> [--artifact-dir <path>] --out <dir> ...\n Compare an empty baseline with a real-model trace analyst on public labels.\n Run with --help for all required inputs and controls.\n supervisor-run rollouts [<runDir>...] [--sessions [<harness>:]<path>]... [--since <ISO>] [--gate-receipts <file>] [--denylist <file>] --out <ledger.jsonl>\n Import Discovery run dirs, native harness sessions and beelink-gate receipts\n into one rollout ledger; rows with any secret or private detail are dropped.\n supervisor-run report <runDir> [--format headline|markdown|json]\n Report one Runtime or loops supervisor run directory. The status comes\n from Runtime's own result.json / failure.json; every missing measurement\n stays named. Exits 1 when the directory cannot be read.\n search ship <search-ledger.jsonl> --run-kind optimization|eval [--content full|digests]\n Ship a search ledger and its blobs to the hosted store in TANGLE_INGEST_URL,\n starting from the store's head. Run with --help for the environment it reads.\n search show <search-ledger.jsonl>\n Verify a search ledger and print its summary: leading nodes, recently\n discarded nodes and recent proposals, the same text a proposer reads.\n version\n Print server + wire-protocol version JSON.\n\nJudge provider:\n Set AGENT_EVAL_LLM_BASE_URL, AGENT_EVAL_LLM_API_KEY, and AGENT_EVAL_LLM_MODEL.\n OPENAI_* and TANGLE_* equivalents are also accepted. This binary is the only\n place that reads a provider credential; the library never does. Without both\n a base URL and a key, /v1/judge refuses with llm_not_configured.\n\nWithout arguments, prints this help.`\n\nasync function main(): Promise<number> {\n const { command, positional, flags } = parseArgs(process.argv.slice(2))\n assertKnownFlags(command, flags)\n\n if (command === 'analyst-benchmark' && flags.help === 'true') {\n return await runAnalystBenchmarkCommand(process.argv.slice(3))\n }\n if (command === 'search') return await runSearchCommand(process.argv.slice(3))\n if (flags.help === 'true') {\n process.stdout.write(`${HELP}\\n`)\n return 0\n }\n\n switch (command) {\n case 'serve': {\n const port = parsePort(flags.port ?? '5005')\n const host = flags.host ?? '127.0.0.1'\n const llm = resolveCliLlmConfig()\n const { server } = await startServerAsync({\n port,\n host,\n ...(llm.chat ? { chat: llm.chat } : {}),\n ...(llm.model ? { judgeModel: llm.model } : {}),\n })\n // Keep process alive on SIGINT/SIGTERM\n const shutdown = (sig: string) => {\n // eslint-disable-next-line no-console\n console.log(`[agent-eval] received ${sig}, shutting down`)\n server.close(() => process.exit(0))\n // Force exit after 5s if close hangs\n setTimeout(() => process.exit(1), 5000).unref()\n }\n process.on('SIGINT', () => shutdown('SIGINT'))\n process.on('SIGTERM', () => shutdown('SIGTERM'))\n // Block forever\n await new Promise(() => {})\n return 0\n }\n case 'rpc': {\n const [method] = positional\n const llm = resolveCliLlmConfig()\n return await runRpcOnce(method, {\n ...(llm.chat ? { chat: llm.chat } : {}),\n ...(llm.model ? { judgeModel: llm.model } : {}),\n })\n }\n case 'rpc-batch': {\n const [method] = positional\n const llm = resolveCliLlmConfig()\n return await runRpcBatch(method, {\n ...(llm.chat ? { chat: llm.chat } : {}),\n ...(llm.model ? { judgeModel: llm.model } : {}),\n })\n }\n case 'openapi': {\n const out = flags.out ?? 'openapi.json'\n const spec = buildOpenApi(handleVersion().version)\n writeFileSync(out, `${JSON.stringify(spec, null, 2)}\\n`, 'utf-8')\n // eslint-disable-next-line no-console\n console.log(`[agent-eval] wrote OpenAPI 3.1 spec to ${out}`)\n return 0\n }\n case 'rollout-release': {\n // The subcommand owns its own flag grammar (multi-value --formats,\n // boolean --include-proposers) — pass raw argv through untouched.\n return await runRolloutReleaseCli(process.argv.slice(3))\n }\n case 'analyst-benchmark': {\n return await runAnalystBenchmarkCommand(process.argv.slice(3))\n }\n case 'supervisor-run': {\n // The subcommand owns its own flag grammar; pass raw argv through.\n return await runSupervisorRunCommand(process.argv.slice(3))\n }\n case 'version': {\n process.stdout.write(`${JSON.stringify(handleVersion(), null, 2)}\\n`)\n return 0\n }\n case '--version': {\n process.stdout.write(`${handleVersion().version}\\n`)\n return 0\n }\n case 'help':\n case '--help':\n case '-h':\n case '':\n process.stdout.write(`${HELP}\\n`)\n return 0\n default:\n process.stderr.write(`unknown command: ${command}\\n${HELP}\\n`)\n return 1\n }\n}\n\nconst FLAGS_BY_COMMAND: Record<string, ReadonlySet<string>> = {\n serve: new Set(['help', 'host', 'port']),\n rpc: new Set(['help']),\n 'rpc-batch': new Set(['help']),\n openapi: new Set(['help', 'out']),\n version: new Set(['help']),\n help: new Set(),\n '--help': new Set(),\n '-h': new Set(),\n '--version': new Set(),\n '': new Set(),\n}\n\nfunction assertKnownFlags(command: string, flags: Record<string, string>): void {\n // These subcommands parse their own argv.\n if (\n command === 'rollout-release' ||\n command === 'analyst-benchmark' ||\n command === 'supervisor-run' ||\n command === 'search'\n ) {\n return\n }\n const allowed = FLAGS_BY_COMMAND[command]\n if (!allowed) return\n const unknown = Object.keys(flags).filter((flag) => !allowed.has(flag))\n if (unknown.length > 0) {\n throw new Error(`unknown flag for ${command || 'help'}: --${unknown[0]}`)\n }\n}\n\nfunction parsePort(raw: string): number {\n const port = Number(raw)\n if (!Number.isInteger(port) || port < 0 || port > 65_535) {\n throw new Error(`--port must be an integer from 0 to 65535; received ${JSON.stringify(raw)}`)\n }\n return port\n}\n\nmain()\n .then((code) => {\n process.exitCode = code\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error('[agent-eval] cli error:', err)\n process.exitCode = 1\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,wBACP,MAAyB,QAAQ,KACH;CAC9B,MAAM,kBAAkB,SAAS,IAAI,uBAAuB;CAC5D,MAAM,iBAAiB,SAAS,IAAI,sBAAsB;CAC1D,MAAM,eAAe,SAAS,IAAI,cAAc;CAChD,MAAM,eAAe,SAAS,IAAI,cAAc;CAChD,MAAM,UACJ,mBACA,SAAS,IAAI,eAAe,KAC5B,SAAS,IAAI,iBAAiB,MAC7B,eAAe,8BAA8B,KAAA,OAC7C,eAAe,mCAAmC,KAAA;CACrD,MAAM,SAAS,kBAAkB,gBAAgB;CACjD,MAAM,QACJ,SAAS,IA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AO,IAAI,IAAI;EAAC;EAAQ;EAAQ;CAAM,CAAC;CACvC,qBAAK,IAAI,IAAI,CAAC,MAAM,CAAC;CACrB,6BAAa,IAAI,IAAI,CAAC,MAAM,CAAC;CAC7B,yBAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC;CAChC,yBAAS,IAAI,IAAI,CAAC,MAAM,CAAC;CACzB,sBAAM,IAAI,IAAI;CACd,0BAAU,IAAI,IAAI;CAClB,sBAAM,IAAI,IAAI;CACd,6BAAa,IAAI,IAAI;CACrB,oBAAI,IAAI,IAAI;AACd;AAEA,SAAS,iBAAiB,SAAiB,OAAqC;CAE9E,IACE,YAAY,qBACZ,YAAY,uBACZ,YAAY,oBACZ,YAAY,UAEZ;CAEF,MAAM,UAAU,iBAAiB;CACjC,IAAI,CAAC,SAAS;CACd,MAAM,UAAU,OAAO,KAAK,KAAK,CAAC,CAAC,QAAQ,SAAS,CAAC,QAAQ,IAAI,IAAI,CAAC;CACtE,IAAI,QAAQ,SAAS,GACnB,MAAM,IAAI,MAAM,oBAAoB,WAAW,OAAO,MAAM,QAAQ,IAAI;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,MAAM,OAAO,OAAO,GAAG;CACvB,IAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAChD,MAAM,IAAI,MAAM,uDAAuD,KAAK,UAAU,GAAG,GAAG;CAE9F,OAAO;AACT;AAEA,KAAK,CAAC,CACH,MAAM,SAAS;CACd,QAAQ,WAAW;AACrB,CAAC,CAAC,CACD,OAAO,QAAQ;CAEd,QAAQ,MAAM,2BAA2B,GAAG;CAC5C,QAAQ,WAAW;AACrB,CAAC"}
1
+ {"version":3,"file":"cli.js","names":["parseArgs"],"sources":["../src/cli-config.ts","../src/search-command.ts","../src/supervisor-run/rollouts-command.ts","../src/supervisor-run/report-command.ts","../src/cli.ts"],"sourcesContent":["/**\n * Provider configuration for the `agent-eval` binary.\n *\n * The binary reads endpoint and credential values from its environment.\n * TypeScript library callers bind a transport explicitly. The maintained\n * HTTP transport accepts their credential and sends provider requests.\n */\n\nimport { type ChatClient, createChatClient } from './analyst/chat-client'\n\ninterface CliLlmConfig {\n /** Judge transport for the wire handlers. Absent when no provider is configured. */\n chat?: ChatClient\n model?: string\n}\n\n/** The endpoint the binary resolved from its environment. */\ninterface CliProviderRoute {\n baseUrl: string\n apiKey: string\n model?: string\n}\n\n/**\n * Environment precedence for the binary's provider route, with no client built.\n *\n * Both halves are required: a base URL without a key, or a key without an\n * endpoint, is a half-configured server. `/v1/judge` then refuses with\n * `llm_not_configured` instead of calling an unintended endpoint.\n */\nfunction resolveCliProviderRoute(\n env: NodeJS.ProcessEnv = process.env,\n): CliProviderRoute | undefined {\n const explicitBaseUrl = nonEmpty(env.AGENT_EVAL_LLM_BASE_URL)\n const explicitApiKey = nonEmpty(env.AGENT_EVAL_LLM_API_KEY)\n const openAiApiKey = nonEmpty(env.OPENAI_API_KEY)\n const tangleApiKey = nonEmpty(env.TANGLE_API_KEY)\n const baseUrl =\n explicitBaseUrl ??\n nonEmpty(env.OPENAI_BASE_URL) ??\n nonEmpty(env.TANGLE_ROUTER_URL) ??\n (openAiApiKey ? 'https://api.openai.com/v1' : undefined) ??\n (tangleApiKey ? 'https://router.tangle.tools/v1' : undefined)\n const apiKey = explicitApiKey ?? openAiApiKey ?? tangleApiKey\n const model =\n nonEmpty(env.AGENT_EVAL_LLM_MODEL) ?? nonEmpty(env.OPENAI_MODEL) ?? nonEmpty(env.TANGLE_MODEL)\n\n if (!baseUrl || !apiKey) return undefined\n return { baseUrl, apiKey, ...(model ? { model } : {}) }\n}\n\nexport function resolveCliLlmConfig(env: NodeJS.ProcessEnv = process.env): CliLlmConfig {\n const route = resolveCliProviderRoute(env)\n if (!route) return {}\n return {\n chat: cliChatClient({ baseUrl: route.baseUrl, apiKey: route.apiKey }, route.model),\n ...(route.model ? { model: route.model } : {}),\n }\n}\n\n/**\n * The binary's transport IS the published one — `createChatClient({ transport:\n * 'openai-compatible' })` — so the server and a library consumer cannot drift\n * onto two different clients for the same endpoint.\n *\n * The one thing kept local is the error text. A generic \"no model on the\n * request\" tells a server operator nothing; this names the variable to set.\n */\nfunction cliChatClient(\n route: { baseUrl: string; apiKey: string },\n defaultModel: string | undefined,\n): ChatClient {\n const client = createChatClient({\n transport: 'openai-compatible',\n baseUrl: route.baseUrl,\n apiKey: route.apiKey,\n ...(defaultModel ? { defaultModel } : {}),\n })\n return {\n ...client,\n chat: (req, callOpts) => {\n if (!req.model && !defaultModel) {\n throw new Error(\n 'agent-eval: no model on the request and no AGENT_EVAL_LLM_MODEL configured',\n )\n }\n return client.chat(req, callOpts)\n },\n }\n}\n\nfunction nonEmpty(value: string | undefined): string | undefined {\n const trimmed = value?.trim()\n return trimmed ? trimmed : undefined\n}\n","/**\n * `agent-eval search <subcommand>`: work with a search ledger from a terminal.\n *\n * agent-eval search ship <search-ledger.jsonl> --run-kind optimization|eval [--content full|digests]\n * agent-eval search show <search-ledger.jsonl> [--tree] [--operator-yield] [--front] [--task-matrix]\n * [--edit-credit] [--landscape] [--skill-manifold] [--json]\n * agent-eval search show <search-ledger.jsonl> [<search-ledger.jsonl> ...] --meta [--objective <key>] [--json]\n *\n * `ship` sends the ledger to the hosted store named by `TANGLE_INGEST_URL`,\n * `TANGLE_INGEST_API_KEY` and `TANGLE_TENANT_ID`, starting from the store's\n * head, so it finishes or resumes a ship that a loop could not complete.\n *\n * `show` verifies the ledger and prints `renderSearchSummary`: the same\n * compact text a proposer reads, on the search's own ranking split (the\n * selection split when the search declares one, else train). There is no\n * local HTML renderer; the hosted store's page is the visual view (§5 of the\n * search-tree design). A lens flag adds that lens's text form after the\n * summary, so an agent reads what a person sees; `--json` prints the lens\n * results as JSON instead, the shape a view renders.\n *\n * `show --meta` reads every ledger it is given and prints the `metaSearch`\n * lens over them instead of one search's summary: each search as one node\n * scored by its held-out lift per known dollar, the configurations best first,\n * and the searches arranged by derivation and containment.\n */\n\nimport { createHash } from 'node:crypto'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { open, readFile } from 'node:fs/promises'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { replaySearchLedgerText } from './campaign/search-ledger'\nimport type { SearchArtifactRef } from './campaign/search-ledger-types'\nimport type { SearchStateView } from './campaign/search-state'\nimport { renderSearchSummary } from './campaign/search-summary'\nimport { hostedTenantFromEnv } from './hosted/client'\nimport { SEARCH_LEDGER_BATCH_MAX_BYTES, SearchRunKindSchema } from './hosted/search-ledger-wire'\nimport { SearchShipConflictError, shipSearchLedger } from './hosted/search-shipper'\nimport { editCredit, editCreditText } from './search/lenses/edit-credit'\nimport { type FrontData, front } from './search/lenses/front'\nimport { formatLandscape, landscape, surfaceTextEdits } from './search/lenses/landscape'\nimport { metaSearch } from './search/lenses/meta-search'\nimport { renderMetaSearchText } from './search/lenses/meta-search-text'\nimport { type OperatorYieldData, operatorYield } from './search/lenses/operator-yield'\nimport { INSUFFICIENT_FROM } from './search/lenses/shared'\nimport { formatSkillManifold, skillManifold } from './search/lenses/skill-manifold'\nimport { type TaskMatrixData, taskMatrix } from './search/lenses/task-matrix'\nimport { type TreeData, type TreeNode, tree } from './search/lenses/tree'\n\nconst USAGE = `usage: agent-eval search <subcommand> ...\n\n ship <search-ledger.jsonl> --run-kind optimization|eval [--content full|digests]\n Ships the ledger's entries, and the blobs they name, to the hosted store in\n TANGLE_INGEST_URL (or TANGLE_ORCHESTRATOR_URL) as tenant TANGLE_TENANT_ID with\n TANGLE_INGEST_API_KEY (or TANGLE_API_KEY). It starts from the store's head, so\n running it again sends only what the store lacks. Prints the result as JSON.\n Exits 1 when the store holds a different chain for the search.\n\n show <search-ledger.jsonl> [--tree] [--operator-yield] [--front] [--task-matrix]\n [--edit-credit] [--landscape] [--skill-manifold] [--json]\n Verifies the ledger and prints its search summary: the leading nodes\n against the root, the most recently discarded nodes and why, and a log\n of recent proposals. The same text a proposer reads as context, on the\n search's own ranking split. Each lens flag adds that lens's text form\n (search-tree-design §12) below the summary — the same JSON\n Intelligence, discovery lab, VerticalBench and agent-runtime read.\n --tree the tidy tree of nodes and edges.\n --operator-yield outcome counts and yield per known dollar, by edge operator.\n --front the Pareto front over score and known cost per cell.\n --task-matrix nodes × units, clustered, with specialist gain per cluster.\n --edit-credit every edit as a gene followed down the lineage, its\n credit, interacting pairs, and skill candidates. It\n reads node artifacts from the blobs the ledger names,\n verified by digest.\n --landscape nodes placed by line edits between their profile\n surfaces (read from the blobs, verified by digest), the\n kriged score surface, its basins, and the plateau score\n a policy drafts on.\n --skill-manifold the node × unit score matrix factored into skill axes,\n its cross-validated intrinsic dimension, and the unit\n that best separates the leaders.\n --json prints the requested lenses as JSON instead of text.\n\n show <search-ledger.jsonl> [<search-ledger.jsonl> ...] --meta [--objective <key>] [--json]\n Verifies every ledger and prints the meta-search lens over them: each\n search as one node, scored by its claim's held-out lift per known\n dollar (unscored searches say why), configurations best first with\n their interval, method and n, and the searches arranged by derivation\n and containment. --objective names the objective the best\n configuration is chosen within when the searches span several.`\n\nexport async function runSearchCommand(argv: string[]): Promise<number> {\n const [subcommand, ...rest] = argv\n if (subcommand === undefined || subcommand === '--help' || subcommand === '-h') {\n process.stdout.write(`${USAGE}\\n`)\n return 0\n }\n if (subcommand === 'show') return await runShowCommand(rest)\n if (subcommand !== 'ship') {\n process.stderr.write(`unknown search subcommand: ${subcommand}\\n${USAGE}\\n`)\n return 1\n }\n if (rest.some((arg) => arg === undefined || arg === '--help' || arg === '-h')) {\n process.stdout.write(`${USAGE}\\n`)\n return 0\n }\n const { path, flags } = parseShipArgs(rest)\n const runKind = SearchRunKindSchema.safeParse(flags['run-kind'])\n if (!runKind.success) throw new Error(`--run-kind must be optimization or eval\\n${USAGE}`)\n const content = flags.content ?? 'full'\n if (content !== 'full' && content !== 'digests') {\n throw new Error(`--content must be full or digests\\n${USAGE}`)\n }\n const tenant = hostedTenantFromEnv()\n if (!tenant) {\n throw new Error(\n 'set TANGLE_INGEST_URL, TANGLE_INGEST_API_KEY and TANGLE_TENANT_ID to name the store',\n )\n }\n const searchId = await firstLineSearchId(path)\n try {\n const shipped = await shipSearchLedger({\n tenant,\n ledger: { path, searchId },\n runKind: runKind.data,\n content,\n })\n process.stdout.write(`${JSON.stringify(shipped, null, 2)}\\n`)\n return shipped.head.nextSequence === shipped.localLines ? 0 : 1\n } catch (error) {\n if (!(error instanceof SearchShipConflictError)) throw error\n process.stderr.write(`${error.message}\\n`)\n return 1\n }\n}\n\nasync function runShowCommand(argv: string[]): Promise<number> {\n if (argv.includes('--help') || argv.includes('-h')) {\n process.stdout.write(`${USAGE}\\n`)\n return 0\n }\n if (argv.includes('--meta')) return await runShowMetaCommand(argv)\n const positional = argv.filter((arg) => !arg.startsWith('--'))\n const flags = new Set(argv.filter((arg) => arg.startsWith('--')))\n const unknown = [...flags].filter((flag) => !SHOW_FLAGS.has(flag))\n if (positional.length !== 1 || unknown.length > 0) {\n if (unknown.length > 0) process.stderr.write(`unknown flag ${unknown.join(', ')}\\n`)\n process.stdout.write(`${USAGE}\\n`)\n return 1\n }\n const path = positional[0]!\n const searchId = await firstLineSearchId(path)\n const text = await readFile(path, 'utf8')\n const state = replaySearchLedgerText(text, searchId, path)\n const split =\n state.header && state.header.splits.selection.tasks.length > 0 ? 'selection' : 'train'\n const lenses = showLenses(state, path, flags)\n if (flags.has('--json')) {\n if (lenses.length === 0) {\n process.stderr.write('--json needs a lens flag\\n')\n return 1\n }\n const json = Object.fromEntries(lenses.map((lens) => [lens.name, lens.result]))\n process.stdout.write(`${JSON.stringify(json, null, 2)}\\n`)\n return 0\n }\n const sections = [renderSearchSummary(state, { split }), ...lenses.map((lens) => lens.text)]\n process.stdout.write(`${sections.join('\\n\\n')}\\n`)\n return 0\n}\n\nasync function runShowMetaCommand(argv: string[]): Promise<number> {\n const paths: string[] = []\n let objective: string | undefined\n let json = false\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index]!\n if (token === '--meta') continue\n if (token === '--json') {\n json = true\n continue\n }\n if (token === '--objective') {\n objective = argv[++index]\n if (objective === undefined) throw new Error(`--objective needs a value\\n${USAGE}`)\n continue\n }\n if (token.startsWith('--')) throw new Error(`unknown flag ${token}\\n${USAGE}`)\n paths.push(token)\n }\n if (paths.length === 0) throw new Error(`show --meta needs at least one ledger\\n${USAGE}`)\n const states = []\n for (const path of paths) {\n const searchId = await firstLineSearchId(path)\n states.push(replaySearchLedgerText(await readFile(path, 'utf8'), searchId, path))\n }\n const lens = metaSearch(states, objective === undefined ? {} : { objective })\n process.stdout.write(\n json ? `${JSON.stringify({ metaSearch: lens }, null, 2)}\\n` : `${renderMetaSearchText(lens)}\\n`,\n )\n return 0\n}\n\nconst SHOW_FLAGS = new Set([\n '--edit-credit',\n '--json',\n '--tree',\n '--operator-yield',\n '--front',\n '--task-matrix',\n '--landscape',\n '--skill-manifold',\n])\n\nfunction showLenses(\n state: SearchStateView,\n ledgerPath: string,\n flags: ReadonlySet<string>,\n): Array<{ name: string; result: unknown; text: string }> {\n const lenses: Array<{ name: string; result: unknown; text: string }> = []\n if (flags.has('--tree')) {\n const result = tree(state)\n lenses.push({ name: 'tree', result, text: renderTreeText(result.data) })\n }\n if (flags.has('--operator-yield')) {\n const result = operatorYield(state)\n lenses.push({ name: 'operatorYield', result, text: renderOperatorYieldText(result.data) })\n }\n if (flags.has('--front')) {\n const result = front(state)\n lenses.push({ name: 'front', result, text: renderFrontText(result.data) })\n }\n if (flags.has('--task-matrix')) {\n const result = taskMatrix(state)\n lenses.push({ name: 'taskMatrix', result, text: renderTaskMatrixText(result.data) })\n }\n if (flags.has('--edit-credit')) {\n const result = editCredit(state, { readArtifact: ledgerBlobReader(ledgerPath) })\n lenses.push({ name: 'editCredit', result, text: editCreditText(result) })\n }\n if (flags.has('--landscape')) {\n const read = ledgerBlobReader(ledgerPath)\n const result = landscape(\n state,\n surfaceTextEdits((surface) => read(surface.artifact) ?? null),\n )\n lenses.push({ name: 'landscape', result, text: formatLandscape(result) })\n }\n if (flags.has('--skill-manifold')) {\n const result = skillManifold(state)\n lenses.push({ name: 'skillManifold', result, text: formatSkillManifold(result) })\n }\n return lenses\n}\n\n/**\n * Reads a blob a ledger names: at its `file:` URI, else under `blobs/` beside\n * the ledger, where `SearchRecorder` writes them. Bytes that do not hash to the\n * reference's digest and length read as unavailable, never as content.\n */\nfunction ledgerBlobReader(ledgerPath: string): (ref: SearchArtifactRef) => unknown | undefined {\n const cache = new Map<string, unknown>()\n return (ref) => {\n if (cache.has(ref.sha256)) return cache.get(ref.sha256)\n const hex = ref.sha256.slice('sha256:'.length)\n const candidates = [join(dirname(ledgerPath), 'blobs', `${hex}.json`)]\n if (ref.uri.startsWith('file:')) candidates.unshift(fileURLToPath(ref.uri))\n let value: unknown\n for (const candidate of candidates) {\n if (!existsSync(candidate)) continue\n const bytes = readFileSync(candidate)\n const digest = createHash('sha256').update(bytes).digest('hex')\n if (digest !== hex || bytes.byteLength !== ref.byteLength) continue\n try {\n value = JSON.parse(bytes.toString('utf8'))\n } catch {\n // Verified bytes that are not JSON are not content a lens can read.\n }\n break\n }\n cache.set(ref.sha256, value)\n return value\n }\n}\n\nfunction renderTreeText(data: TreeData): string {\n const lines = [\n `tree: ${data.nodeCount} node${data.nodeCount === 1 ? '' : 's'}, ${data.edgeCount} edge${data.edgeCount === 1 ? '' : 's'}`,\n ]\n const walk = (node: TreeNode, prefix: string, isLast: boolean): void => {\n const branch = prefix === '' ? '' : isLast ? '└─ ' : '├─ '\n const op = node.operator ? `${node.operator} → ` : ''\n const rung = node.rung === null ? '' : ` rung ${node.rung}`\n const depth = node.depth === null ? ' depth unknown' : ''\n const cost =\n node.unknownCostCells === 0\n ? `$${node.knownCostUsd.toFixed(2)}`\n : `$${node.knownCostUsd.toFixed(2)} known + at least $${node.floorUsd.toFixed(2)} over ${node.unknownCostCells} unknown-cost cell${node.unknownCostCells === 1 ? '' : 's'}`\n lines.push(\n `${prefix}${branch}${op}${node.nodeId} (${node.status ?? 'undecided'}${rung}${depth}) ${cost}`,\n )\n const childPrefix = prefix + (prefix === '' ? '' : isLast ? ' ' : '│ ')\n node.children.forEach((child, index) => {\n walk(child, childPrefix, index === node.children.length - 1)\n })\n }\n data.roots.forEach((root, index) => {\n walk(root, '', index === data.roots.length - 1)\n })\n return lines.join('\\n')\n}\n\nfunction renderOperatorYieldText(data: OperatorYieldData): string {\n const lines = [`operator yield (${data.split} split, gain per known $ of proposal + screen):`]\n if (data.rows.length === 0) lines.push(' no edges yet')\n for (const row of data.rows) {\n const y = row.yield\n const outcomes = Object.entries(row.outcomes)\n .filter(([, count]) => count > 0)\n .map(([status, count]) => `${status}=${count}`)\n .join(' ')\n const yieldText =\n y.method === 'none'\n ? y.n === 0\n ? 'yield: no measured children'\n : `yield unknown (${y.n} of ${INSUFFICIENT_FROM}, none)`\n : y.method === 'insufficient'\n ? `yield≈${y.mean!.toFixed(4)}/$ (${y.n} of ${INSUFFICIENT_FROM}, insufficient)`\n : `yield≈${y.mean!.toFixed(4)}/$ [${y.interval![0].toFixed(4)}, ${y.interval![1].toFixed(4)}] (${y.method}, ${y.intervalMethod}, n=${y.n})`\n const nodes = Object.values(row.outcomes).reduce((sum, count) => sum + count, 0)\n const reproposals = row.reproposals > 0 ? `, ${row.reproposals} re-proposals` : ''\n lines.push(\n ` ${row.operator}: ${row.proposals} proposals${reproposals} → ${nodes} node${nodes === 1 ? '' : 's'} (${outcomes || 'no decisions yet'}); ${yieldText}; ${row.excluded} excluded`,\n )\n }\n return lines.join('\\n')\n}\n\nfunction renderFrontText(data: FrontData): string {\n const onFront = data.rows.filter((row) => row.onFront)\n const reasons = Object.entries(data.exclusions)\n .filter(([, count]) => count > 0)\n .map(([reason, count]) => `${reason} ${count}`)\n .join(', ')\n const lines = [\n `front (${data.split} split, axes: ${data.axes.join(', ')}): ${data.frontierSize} of ${data.rows.length} node(s) on the frontier, ${data.excludedCount} excluded${reasons ? ` (${reasons})` : ''}`,\n ]\n for (const row of onFront) {\n lines.push(\n ` ${row.nodeId}: score=${row.score!.toFixed(4)} on ${row.units} units (${row.method}) costPerCell=$${row.costPerCellUsd!.toFixed(4)}`,\n )\n }\n return lines.join('\\n')\n}\n\nfunction renderTaskMatrixText(data: TaskMatrixData): string {\n const lines = [\n `task matrix (${data.split} split, ${data.direction}): ${data.nodeIds.length} node(s) × ${data.unitIds.length} unit(s), ${data.nodeClusters.length} node cluster(s), ${data.unitClusters.length} unit cluster(s)`,\n ]\n if (data.sampling) {\n lines.push(\n ` clustered ${data.sampling.nodesClustered} of ${data.sampling.nodesTotal} nodes (cap ${data.sampling.cap}), evenly sampled in registration order; unit clusters and specialist gains use the same nodes`,\n )\n }\n for (const row of data.specialistGain) {\n const gain =\n row.gain === null\n ? `insufficient (${row.insufficient})`\n : `${row.gain.toFixed(4)} (best ${row.bestNodeId}, ${row.nodesContributing} nodes on ${row.unitIds.length} units)`\n lines.push(` cluster ${row.clusterId} [${row.unitIds.join(', ')}]: specialist gain ${gain}`)\n }\n return lines.join('\\n')\n}\n\nfunction parseShipArgs(argv: string[]): { path: string; flags: Record<string, string> } {\n const flags: Record<string, string> = {}\n const positional: string[] = []\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index]!\n if (!token.startsWith('--')) {\n positional.push(token)\n continue\n }\n const [name, inline] = token.slice(2).split('=', 2) as [string, string | undefined]\n if (name !== 'run-kind' && name !== 'content') throw new Error(`unknown flag --${name}`)\n const value = inline ?? argv[++index]\n if (value === undefined) throw new Error(`--${name} needs a value`)\n flags[name] = value\n }\n if (positional.length !== 1) throw new Error(USAGE)\n return { path: positional[0]!, flags }\n}\n\n/** The ledger names its search on every line; read the first. */\nasync function firstLineSearchId(path: string): Promise<string> {\n const handle = await open(path, 'r')\n try {\n // A line longer than one request's limit cannot ship anyway.\n const bytes = Buffer.alloc(SEARCH_LEDGER_BATCH_MAX_BYTES + 1)\n const { bytesRead } = await handle.read(bytes, 0, bytes.byteLength, 0)\n const newline = bytes.subarray(0, bytesRead).indexOf(0x0a)\n if (newline < 0) throw new Error(`${path} holds no complete ledger line`)\n const first = JSON.parse(bytes.toString('utf8', 0, newline)) as { searchId?: unknown }\n if (typeof first.searchId !== 'string') throw new Error(`${path} line 1 names no searchId`)\n return first.searchId\n } finally {\n await handle.close()\n }\n}\n","/**\n * `agent-eval supervisor-run rollouts` writes one rollout ledger from the\n * places the fleet's work is recorded:\n *\n * <runDir...> Discovery / Runtime run directories (`discoveryRunRolloutLines`)\n * --sessions [<harness>:]<path> a HOME, store directory, session file or OpenCode .db;\n * the prefix limits a directory to one harness and names a file's\n * --since <ISO> limit --sessions to stores changed since then\n * --gate-receipts <file> beelink-gate receipts.jsonl, as verifiable labels\n * --denylist <file> literal private terms, one per line\n * --otlp <file> also write each kept run row's session as OTLP spans\n *\n * Every row passes the privacy screen before it is written: a row with any\n * secret or private detail is dropped whole and counted by rule, so the\n * ledger never holds one. Rows are written under the write policy and read\n * back with `readRolloutJournal`; their rewards are unscreened.\n */\n\nimport { appendFile, readFile, rm } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport { errorMessage } from '../errors'\nimport { appendRolloutLines } from '../rollout/ledger'\nimport { gateReceiptRolloutLines } from '../rollout/readers/gate-receipts'\nimport {\n harnessSessionRefs,\n harnessSessionRolloutLines,\n} from '../rollout/readers/harness-session-lines'\nimport { PRIVACY_RULE_NAMES, privacyHit } from '../rollout/release/scrub'\nimport type { RolloutLine } from '../rollout/schema'\nimport { discoveryRunRolloutLines } from './discovery-rollouts'\nimport type { SupervisorRunCommandIo } from './report-command'\n\nexport const ROLLOUTS_USAGE =\n 'usage: agent-eval supervisor-run rollouts [<runDir>...] [--sessions [<harness>:]<path>]... [--since <ISO>] [--gate-receipts <file>]... [--denylist <file>] [--otlp <file>] --out <ledger.jsonl>'\n\ninterface RolloutsArgs {\n runDirs: string[]\n sessions: Array<{ path: string; harness?: string }>\n sinceMs?: number\n gateReceipts: string[]\n denylist: string | null\n otlp: string | null\n out: string\n}\n\nfunction parseArgs(argv: readonly string[]): RolloutsArgs {\n const args: RolloutsArgs = {\n runDirs: [],\n sessions: [],\n gateReceipts: [],\n denylist: null,\n otlp: null,\n out: '',\n }\n const value = (i: number, flag: string): string => {\n const v = argv[i]\n if (v === undefined || v.startsWith('--')) throw new Error(`${flag} expects a value`)\n return v\n }\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i] as string\n if (arg === '--out') args.out = value(++i, arg)\n else if (arg === '--sessions') {\n const raw = value(++i, arg)\n const prefixed = /^([a-z][a-z-]*):(.+)$/u.exec(raw)\n args.sessions.push(prefixed ? { harness: prefixed[1]!, path: prefixed[2]! } : { path: raw })\n } else if (arg === '--since') {\n const ms = Date.parse(value(++i, arg))\n if (Number.isNaN(ms)) throw new Error(`--since expects an ISO time, got ${argv[i]}`)\n args.sinceMs = ms\n } else if (arg === '--gate-receipts') args.gateReceipts.push(value(++i, arg))\n else if (arg === '--denylist') args.denylist = value(++i, arg)\n else if (arg === '--otlp') args.otlp = value(++i, arg)\n else if (arg.startsWith('--')) throw new Error(`unknown flag \"${arg}\"`)\n else args.runDirs.push(arg)\n }\n if (!args.out) throw new Error(ROLLOUTS_USAGE)\n if (args.runDirs.length + args.sessions.length + args.gateReceipts.length === 0) {\n throw new Error(`no sources given\\n${ROLLOUTS_USAGE}`)\n }\n return args\n}\n\nexport interface RolloutsSummary {\n out: string\n written: number\n dropped: Record<string, number>\n sources: Array<{ source: string; kind: string; read: number; written: number; errors: string[] }>\n}\n\nexport async function runRolloutsCommand(\n argv: readonly string[],\n io: SupervisorRunCommandIo,\n): Promise<number> {\n let args: RolloutsArgs\n try {\n args = parseArgs(argv)\n } catch (error) {\n io.stderr(`${errorMessage(error)}\\n`)\n return 2\n }\n const out = resolve(args.out)\n const denylist =\n args.denylist === null\n ? []\n : (await readFile(args.denylist, 'utf8'))\n .split('\\n')\n .map((line) => line.replace(/#.*/u, '').trim())\n .filter(Boolean)\n const capturedAt = new Date().toISOString()\n const summary: RolloutsSummary = {\n out,\n written: 0,\n dropped: Object.fromEntries(PRIVACY_RULE_NAMES.map((name) => [name, 0])),\n sources: [],\n }\n await rm(out, { force: true })\n if (args.otlp !== null) await rm(args.otlp, { force: true })\n\n const write = async (source: RolloutsSummary['sources'][number], lines: RolloutLine[]) => {\n source.read += lines.length\n const kept = lines.filter((line) => {\n const hit = privacyHit(line, denylist)\n if (hit !== null) summary.dropped[hit] = (summary.dropped[hit] ?? 0) + 1\n return hit === null\n })\n await appendRolloutLines(out, kept)\n source.written += kept.length\n summary.written += kept.length\n return kept\n }\n\n for (const runDir of args.runDirs) {\n const source = { source: runDir, kind: 'run-dir', read: 0, written: 0, errors: [] as string[] }\n summary.sources.push(source)\n try {\n const run = await discoveryRunRolloutLines(resolve(runDir), { capturedAt })\n source.errors.push(...run.gaps.map((gap) => `${gap.code}: ${gap.message}`), ...run.notes)\n const kept = await write(source, run.lines)\n const spans = kept.map((line) => run.otlp.get(line.rollout_id) ?? '')\n if (args.otlp !== null) await appendFile(args.otlp, spans.join(''))\n } catch (error) {\n source.errors.push(errorMessage(error))\n }\n }\n for (const target of args.sessions) {\n const source = {\n source: target.path,\n kind: `sessions:${target.harness ?? 'all'}`,\n read: 0,\n written: 0,\n errors: [] as string[],\n }\n summary.sources.push(source)\n try {\n const refs = await harnessSessionRefs(resolve(target.path), {\n ...(target.harness === undefined ? {} : { harness: target.harness }),\n ...(args.sinceMs === undefined ? {} : { sinceMs: args.sinceMs }),\n })\n let batch: RolloutLine[] = []\n for await (const item of harnessSessionRolloutLines(refs, capturedAt)) {\n if (item.line) batch.push(item.line)\n else source.errors.push(`${item.ref.path}: ${item.error}`)\n if (batch.length >= 100) {\n await write(source, batch)\n batch = []\n }\n }\n await write(source, batch)\n } catch (error) {\n source.errors.push(errorMessage(error))\n }\n }\n for (const path of args.gateReceipts) {\n const source = {\n source: path,\n kind: 'gate-receipts',\n read: 0,\n written: 0,\n errors: [] as string[],\n }\n summary.sources.push(source)\n try {\n const { lines, skipped } = await gateReceiptRolloutLines(path, capturedAt)\n if (skipped > 0) source.errors.push(`${skipped} receipts carried no verdict`)\n await write(source, lines)\n } catch (error) {\n source.errors.push(errorMessage(error))\n }\n }\n io.stdout(`${JSON.stringify(summary, null, 2)}\\n`)\n return summary.sources.some((s) => s.read === 0 && s.errors.length > 0) ? 1 : 0\n}\n","/**\n * `agent-eval supervisor-run report <runDir>` takes one run directory and\n * prints the report the module already renders. The command reads through\n * `analyzeSupervisorRun`, so a Runtime run directory takes the\n * same path and the status comes from the record `terminal-record.ts` names.\n *\n * Exit codes follow the other self-parsing subcommands: 2 for a usage error,\n * 1 when the directory cannot be read (missing, not a directory, or a corrupt\n * journal or terminal record), 0 after the report was written to stdout.\n */\n\nimport { stat } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport { errorMessage } from '../errors'\nimport { analyzeSupervisorRun } from './reader'\nimport { renderSupervisorRunHeadline, renderSupervisorRunMarkdown } from './render'\nimport { ROLLOUTS_USAGE, runRolloutsCommand } from './rollouts-command'\n\nexport type SupervisorRunReportFormat = 'headline' | 'markdown' | 'json'\n\nconst FORMATS: readonly SupervisorRunReportFormat[] = ['headline', 'markdown', 'json']\n\nconst SUPERVISOR_RUN_USAGE = `usage: agent-eval supervisor-run report <runDir> [--format headline|markdown|json]\n ${ROLLOUTS_USAGE.replace('usage: ', '')}`\n\n/** Output sinks, injectable so tests read the exact bytes a terminal would. */\nexport interface SupervisorRunCommandIo {\n readonly stdout: (text: string) => void\n readonly stderr: (text: string) => void\n}\n\nconst PROCESS_IO: SupervisorRunCommandIo = {\n stdout: (text) => {\n process.stdout.write(text)\n },\n stderr: (text) => {\n process.stderr.write(text)\n },\n}\n\ninterface ReportArgs {\n readonly runDir: string\n readonly format: SupervisorRunReportFormat\n}\n\nfunction isFormat(value: string): value is SupervisorRunReportFormat {\n return (FORMATS as readonly string[]).includes(value)\n}\n\nfunction parseReportArgs(argv: readonly string[]): ReportArgs {\n let runDir: string | null = null\n let format: SupervisorRunReportFormat = 'headline'\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i] as string\n if (arg === '--format') {\n const raw = argv[++i]\n if (raw === undefined || !isFormat(raw)) {\n throw new Error(\n `--format expects one of ${FORMATS.join('|')}, got ${JSON.stringify(raw ?? '')}`,\n )\n }\n format = raw\n } else if (arg.startsWith('--format=')) {\n const raw = arg.slice('--format='.length)\n if (!isFormat(raw)) {\n throw new Error(`--format expects one of ${FORMATS.join('|')}, got ${JSON.stringify(raw)}`)\n }\n format = raw\n } else if (arg.startsWith('--')) {\n throw new Error(`unknown flag \"${arg}\"`)\n } else if (runDir === null) {\n runDir = arg\n } else {\n throw new Error(`unexpected argument \"${arg}\"`)\n }\n }\n if (runDir === null) throw new Error(SUPERVISOR_RUN_USAGE)\n return { runDir, format }\n}\n\n/**\n * CLI driver for `agent-eval supervisor-run`. `argv` is everything after the\n * command name, so `['report', runDir, ...flags]`. Returns the process exit code.\n */\nexport async function runSupervisorRunCommand(\n argv: readonly string[],\n io: SupervisorRunCommandIo = PROCESS_IO,\n): Promise<number> {\n const [verb, ...rest] = argv\n if (verb === undefined || verb === '--help' || verb === '-h' || verb === 'help') {\n io.stdout(`${SUPERVISOR_RUN_USAGE}\\n`)\n return verb === undefined ? 2 : 0\n }\n if (verb === 'rollouts') {\n if (rest.includes('--help') || rest.includes('-h')) {\n io.stdout(`${ROLLOUTS_USAGE}\\n`)\n return 0\n }\n return runRolloutsCommand(rest, io)\n }\n if (verb !== 'report') {\n io.stderr(`unknown supervisor-run subcommand \"${verb}\"\\n${SUPERVISOR_RUN_USAGE}\\n`)\n return 2\n }\n if (rest.includes('--help') || rest.includes('-h')) {\n io.stdout(`${SUPERVISOR_RUN_USAGE}\\n`)\n return 0\n }\n\n let args: ReportArgs\n try {\n args = parseReportArgs(rest)\n } catch (error) {\n io.stderr(`${errorMessage(error)}\\n`)\n return 2\n }\n\n const runDir = resolve(args.runDir)\n // A path that is not a directory is a caller error, not a run with every\n // measurement missing: reporting an absent-shaped run for a typo would read\n // as evidence about a run that never existed.\n const entry = await stat(runDir).catch(() => null)\n if (entry === null || !entry.isDirectory()) {\n io.stderr(`[agent-eval] supervisor-run report: ${runDir} is not a directory\\n`)\n return 1\n }\n\n try {\n const report = await analyzeSupervisorRun(runDir)\n switch (args.format) {\n case 'headline':\n io.stdout(`${renderSupervisorRunHeadline(report)}\\n`)\n break\n case 'markdown':\n io.stdout(renderSupervisorRunMarkdown(report))\n break\n case 'json':\n io.stdout(`${JSON.stringify(report, null, 2)}\\n`)\n break\n }\n return 0\n } catch (error) {\n io.stderr(`[agent-eval] supervisor-run report failed for ${runDir}: ${errorMessage(error)}\\n`)\n return 1\n }\n}\n","#!/usr/bin/env node\n/**\n * agent-eval CLI.\n *\n * agent-eval serve [--port 5005] [--host 127.0.0.1]\n * agent-eval rpc <method> # one request from stdin → one response on stdout\n * agent-eval rpc-batch <method> # JSONL stdin → JSONL stdout\n * agent-eval analyst-benchmark ... # benchmark a real-model trace analyst\n * agent-eval supervisor-run report <runDir> [--format headline|markdown|json]\n * agent-eval search ship <search-ledger.jsonl> --run-kind optimization|eval\n * agent-eval search show <search-ledger.jsonl>\n * agent-eval openapi [--out path] # write OpenAPI spec\n * agent-eval version\n *\n * <method> is one of: judge, listRubrics, version. When omitted, the\n * stdin payload must be a full {method, params} envelope.\n */\nimport { writeFileSync } from 'node:fs'\nimport { runAnalystBenchmarkCommand } from './analyst/benchmark-command'\nimport { resolveCliLlmConfig } from './cli-config'\nimport { runRolloutReleaseCli } from './rollout/release/hf-dataset'\nimport { runSearchCommand } from './search-command'\nimport { runSupervisorRunCommand } from './supervisor-run/report-command'\nimport { handleVersion } from './wire/handlers'\nimport { buildOpenApi } from './wire/openapi'\nimport { runRpcBatch, runRpcOnce } from './wire/rpc'\nimport { startServerAsync } from './wire/server'\n\ninterface Args {\n command: string\n positional: string[]\n flags: Record<string, string>\n}\n\nfunction parseArgs(argv: string[]): Args {\n const [command, ...rest] = argv\n const positional: string[] = []\n const flags: Record<string, string> = {}\n for (let i = 0; i < rest.length; i++) {\n const tok = rest[i]!\n if (tok.startsWith('--')) {\n const raw = tok.slice(2)\n const equalsAt = raw.indexOf('=')\n if (equalsAt >= 0) {\n flags[raw.slice(0, equalsAt)] = raw.slice(equalsAt + 1)\n continue\n }\n const key = raw\n if (key === 'help') {\n flags[key] = 'true'\n continue\n }\n const next = rest[i + 1]\n if (next != null && !next.startsWith('--')) {\n flags[key] = next\n i++\n } else {\n flags[key] = 'true'\n }\n } else if (tok === '-h') {\n flags.help = 'true'\n } else {\n positional.push(tok)\n }\n }\n return { command: command ?? 'help', positional, flags }\n}\n\nconst HELP = `agent-eval: evaluation RPC and HTTP server.\n\nCommands:\n serve [--port 5005] [--host 127.0.0.1]\n Start the HTTP server. POST /v1/judge, GET /v1/rubrics, GET /v1/version, GET /openapi.json.\n rpc <method>\n Read one JSON object from stdin (the params for <method>), write one\n JSON object to stdout. Methods: judge, listRubrics, version.\n rpc-batch <method>\n Like 'rpc' but JSONL in / JSONL out.\n openapi [--out openapi.json]\n Write the OpenAPI 3.1 spec.\n rollout-release <ledger.jsonl...> --out <dir> [--formats sft,verifiers,rft,raw] [--include-proposers] [--denylist <terms.txt>] [--push <org/name>]\n Build a HuggingFace-ready dataset dir from tangle.rollout.v1 ledgers:\n validate, fail-closed split and license filters, drop any line with a\n secret or private detail, scrub, export formats + card.\n analyst-benchmark --dataset <agentrx|codetracebench> --labels <path> --trace-dir <path> [--artifact-dir <path>] --out <dir> ...\n Compare an empty baseline with a real-model trace analyst on public labels.\n Run with --help for all required inputs and controls.\n supervisor-run rollouts [<runDir>...] [--sessions [<harness>:]<path>]... [--since <ISO>] [--gate-receipts <file>] [--denylist <file>] --out <ledger.jsonl>\n Import Discovery run dirs, native harness sessions and beelink-gate receipts\n into one rollout ledger; rows with any secret or private detail are dropped.\n supervisor-run report <runDir> [--format headline|markdown|json]\n Report one Runtime or loops supervisor run directory. The status comes\n from Runtime's own result.json / failure.json; every missing measurement\n stays named. Exits 1 when the directory cannot be read.\n search ship <search-ledger.jsonl> --run-kind optimization|eval [--content full|digests]\n Ship a search ledger and its blobs to the hosted store in TANGLE_INGEST_URL,\n starting from the store's head. Run with --help for the environment it reads.\n search show <search-ledger.jsonl>\n Verify a search ledger and print its summary: leading nodes, recently\n discarded nodes and recent proposals, the same text a proposer reads.\n version\n Print server + wire-protocol version JSON.\n\nJudge provider:\n Set AGENT_EVAL_LLM_BASE_URL, AGENT_EVAL_LLM_API_KEY, and AGENT_EVAL_LLM_MODEL.\n OPENAI_* and TANGLE_* equivalents are also accepted. This binary is the only\n place that reads a provider credential; the library never does. Without both\n a base URL and a key, /v1/judge refuses with llm_not_configured.\n\nWithout arguments, prints this help.`\n\nasync function main(): Promise<number> {\n const { command, positional, flags } = parseArgs(process.argv.slice(2))\n assertKnownFlags(command, flags)\n\n if (command === 'analyst-benchmark' && flags.help === 'true') {\n return await runAnalystBenchmarkCommand(process.argv.slice(3))\n }\n if (command === 'search') return await runSearchCommand(process.argv.slice(3))\n if (flags.help === 'true') {\n process.stdout.write(`${HELP}\\n`)\n return 0\n }\n\n switch (command) {\n case 'serve': {\n const port = parsePort(flags.port ?? '5005')\n const host = flags.host ?? '127.0.0.1'\n const llm = resolveCliLlmConfig()\n const { server } = await startServerAsync({\n port,\n host,\n ...(llm.chat ? { chat: llm.chat } : {}),\n ...(llm.model ? { judgeModel: llm.model } : {}),\n })\n // Keep process alive on SIGINT/SIGTERM\n const shutdown = (sig: string) => {\n // eslint-disable-next-line no-console\n console.log(`[agent-eval] received ${sig}, shutting down`)\n server.close(() => process.exit(0))\n // Force exit after 5s if close hangs\n setTimeout(() => process.exit(1), 5000).unref()\n }\n process.on('SIGINT', () => shutdown('SIGINT'))\n process.on('SIGTERM', () => shutdown('SIGTERM'))\n // Block forever\n await new Promise(() => {})\n return 0\n }\n case 'rpc': {\n const [method] = positional\n const llm = resolveCliLlmConfig()\n return await runRpcOnce(method, {\n ...(llm.chat ? { chat: llm.chat } : {}),\n ...(llm.model ? { judgeModel: llm.model } : {}),\n })\n }\n case 'rpc-batch': {\n const [method] = positional\n const llm = resolveCliLlmConfig()\n return await runRpcBatch(method, {\n ...(llm.chat ? { chat: llm.chat } : {}),\n ...(llm.model ? { judgeModel: llm.model } : {}),\n })\n }\n case 'openapi': {\n const out = flags.out ?? 'openapi.json'\n const spec = buildOpenApi(handleVersion().version)\n writeFileSync(out, `${JSON.stringify(spec, null, 2)}\\n`, 'utf-8')\n // eslint-disable-next-line no-console\n console.log(`[agent-eval] wrote OpenAPI 3.1 spec to ${out}`)\n return 0\n }\n case 'rollout-release': {\n // The subcommand owns its own flag grammar (multi-value --formats,\n // boolean --include-proposers) — pass raw argv through untouched.\n return await runRolloutReleaseCli(process.argv.slice(3))\n }\n case 'analyst-benchmark': {\n return await runAnalystBenchmarkCommand(process.argv.slice(3))\n }\n case 'supervisor-run': {\n // The subcommand owns its own flag grammar; pass raw argv through.\n return await runSupervisorRunCommand(process.argv.slice(3))\n }\n case 'version': {\n process.stdout.write(`${JSON.stringify(handleVersion(), null, 2)}\\n`)\n return 0\n }\n case '--version': {\n process.stdout.write(`${handleVersion().version}\\n`)\n return 0\n }\n case 'help':\n case '--help':\n case '-h':\n case '':\n process.stdout.write(`${HELP}\\n`)\n return 0\n default:\n process.stderr.write(`unknown command: ${command}\\n${HELP}\\n`)\n return 1\n }\n}\n\nconst FLAGS_BY_COMMAND: Record<string, ReadonlySet<string>> = {\n serve: new Set(['help', 'host', 'port']),\n rpc: new Set(['help']),\n 'rpc-batch': new Set(['help']),\n openapi: new Set(['help', 'out']),\n version: new Set(['help']),\n help: new Set(),\n '--help': new Set(),\n '-h': new Set(),\n '--version': new Set(),\n '': new Set(),\n}\n\nfunction assertKnownFlags(command: string, flags: Record<string, string>): void {\n // These subcommands parse their own argv.\n if (\n command === 'rollout-release' ||\n command === 'analyst-benchmark' ||\n command === 'supervisor-run' ||\n command === 'search'\n ) {\n return\n }\n const allowed = FLAGS_BY_COMMAND[command]\n if (!allowed) return\n const unknown = Object.keys(flags).filter((flag) => !allowed.has(flag))\n if (unknown.length > 0) {\n throw new Error(`unknown flag for ${command || 'help'}: --${unknown[0]}`)\n }\n}\n\nfunction parsePort(raw: string): number {\n const port = Number(raw)\n if (!Number.isInteger(port) || port < 0 || port > 65_535) {\n throw new Error(`--port must be an integer from 0 to 65535; received ${JSON.stringify(raw)}`)\n }\n return port\n}\n\nmain()\n .then((code) => {\n process.exitCode = code\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error('[agent-eval] cli error:', err)\n process.exitCode = 1\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,wBACP,MAAyB,QAAQ,KACH;CAC9B,MAAM,kBAAkB,SAAS,IAAI,uBAAuB;CAC5D,MAAM,iBAAiB,SAAS,IAAI,sBAAsB;CAC1D,MAAM,eAAe,SAAS,IAAI,cAAc;CAChD,MAAM,eAAe,SAAS,IAAI,cAAc;CAChD,MAAM,UACJ,mBACA,SAAS,IAAI,eAAe,KAC5B,SAAS,IAAI,iBAAiB,MAC7B,eAAe,8BAA8B,KAAA,OAC7C,eAAe,mCAAmC,KAAA;CACrD,MAAM,SAAS,kBAAkB,gBAAgB;CACjD,MAAM,QACJ,SAAS,IAAI,oBAAoB,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY;CAE/F,IAAI,CAAC,WAAW,CAAC,QAAQ,OAAO,KAAA;CAChC,OAAO;EAAE;EAAS;EAAQ,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;CAAG;AACxD;AAEA,SAAgB,oBAAoB,MAAyB,QAAQ,KAAmB;CACtF,MAAM,QAAQ,wBAAwB,GAAG;CACzC,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,OAAO;EACL,MAAM,cAAc;GAAE,SAAS,MAAM;GAAS,QAAQ,MAAM;EAAO,GAAG,MAAM,KAAK;EACjF,GAAI,MAAM,QAAQ,EAAE,OAAO,MAAM,MAAM,IAAI,CAAC;CAC9C;AACF;;;;;;;;;AAUA,SAAS,cACP,O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K,CAAC;CAChC,yBAAS,IAAI,IAAI,CAAC,MAAM,CAAC;CACzB,sBAAM,IAAI,IAAI;CACd,0BAAU,IAAI,IAAI;CAClB,sBAAM,IAAI,IAAI;CACd,6BAAa,IAAI,IAAI;CACrB,oBAAI,IAAI,IAAI;AACd;AAEA,SAAS,iBAAiB,SAAiB,OAAqC;CAE9E,IACE,YAAY,qBACZ,YAAY,uBACZ,YAAY,oBACZ,YAAY,UAEZ;CAEF,MAAM,UAAU,iBAAiB;CACjC,IAAI,CAAC,SAAS;CACd,MAAM,UAAU,OAAO,KAAK,KAAK,CAAC,CAAC,QAAQ,SAAS,CAAC,QAAQ,IAAI,IAAI,CAAC;CACtE,IAAI,QAAQ,SAAS,GACnB,MAAM,IAAI,MAAM,oBAAoB,WAAW,OAAO,MAAM,QAAQ,IAAI;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,MAAM,OAAO,OAAO,GAAG;CACvB,IAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAChD,MAAM,IAAI,MAAM,uDAAuD,KAAK,UAAU,GAAG,GAAG;CAE9F,OAAO;AACT;AAEA,KAAK,CAAC,CACH,MAAM,SAAS;CACd,QAAQ,WAAW;AACrB,CAAC,CAAC,CACD,OAAO,QAAQ;CAEd,QAAQ,MAAM,2BAA2B,GAAG;CAC5C,QAAQ,WAAW;AACrB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { s as ValidationError } from "./errors-DeEEV9Vx.js";
2
- import { s as makeRng } from "./mean-DDFhslBt.js";
2
+ import { l as makeRng } from "./mean-D1d6gedE.js";
3
3
  // src/meta-eval/cluster-bootstrap.ts
4
4
  /**
5
5
  * Percentile cluster bootstrap of an observation mean. Whole clusters are resampled with
@@ -62,4 +62,4 @@ function clusterBootstrapMean(observations, options = {}) {
62
62
  }
63
63
  export { clusterBootstrapMean as t };
64
64
 
65
- //# sourceMappingURL=cluster-bootstrap-hNXESoc1.js.map
65
+ //# sourceMappingURL=cluster-bootstrap-BteuR1hg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cluster-bootstrap-hNXESoc1.js","names":[],"sources":["../src/meta-eval/cluster-bootstrap.ts"],"sourcesContent":["import { ValidationError } from '../errors'\nimport { makeRng } from '../statistics/internal'\n\n/** One observation and the source cluster it belongs to. */\nexport interface ClusteredObservation {\n cluster: string\n value: number\n}\n\nexport interface ClusterBootstrapOptions {\n /** Confidence level. Default 0.95. */\n confidence?: number\n /** Bootstrap resample count. Default 2000. */\n resamples?: number\n /** Deterministic seed. If omitted, derived from the values so the interval is reproducible. */\n seed?: number\n}\n\nexport interface ClusterBootstrapResult {\n n: number\n clusters: number\n /** Mean over observations, each observation weighted equally. */\n mean: number\n low: number\n high: number\n confidence: number\n resamples: number\n}\n\n/**\n * Percentile cluster bootstrap of an observation mean. Whole clusters are resampled with\n * replacement and each resample's statistic is Σ values / Σ observations over the drawn\n * clusters, so observations that share a source move together and a large cluster cannot\n * pose as many independent results. For a paired comparison pass the per-observation\n * difference (candidate − baseline) under the observation's cluster.\n *\n * With one cluster the interval collapses to the point estimate: there is no between-cluster\n * spread to measure, which callers must treat as no interval, not as certainty.\n */\nexport function clusterBootstrapMean(\n observations: readonly ClusteredObservation[],\n options: ClusterBootstrapOptions = {},\n): ClusterBootstrapResult {\n const confidence = options.confidence ?? 0.95\n const resamples = options.resamples ?? 2000\n if (!(confidence > 0 && confidence < 1)) {\n throw new ValidationError(\n `clusterBootstrapMean: confidence must be in (0,1), got ${confidence}`,\n )\n }\n if (!Number.isInteger(resamples) || resamples < 1) {\n throw new ValidationError(\n `clusterBootstrapMean: resamples must be a positive integer, got ${resamples}`,\n )\n }\n if (!observations.length) {\n throw new ValidationError('clusterBootstrapMean: requires at least one observation')\n }\n\n const sums = new Map<string, { sum: number; count: number }>()\n const values: number[] = []\n for (const [index, observation] of observations.entries()) {\n if (typeof observation?.cluster !== 'string' || observation.cluster === '') {\n throw new ValidationError(`clusterBootstrapMean: observation ${index} needs a cluster id`)\n }\n if (!Number.isFinite(observation.value)) {\n throw new ValidationError(`clusterBootstrapMean: observation ${index} value must be finite`)\n }\n const cell = sums.get(observation.cluster) ?? { sum: 0, count: 0 }\n cell.sum += observation.value\n cell.count += 1\n sums.set(observation.cluster, cell)\n values.push(observation.value)\n }\n\n const cells = [...sums.values()]\n const total = cells.reduce((acc, cell) => acc + cell.sum, 0)\n const mean = total / observations.length\n const k = cells.length\n const rng = makeRng(options.seed, values)\n const samples = new Array<number>(resamples)\n for (let b = 0; b < resamples; b++) {\n let sum = 0\n let count = 0\n for (let draw = 0; draw < k; draw++) {\n const cell = cells[Math.floor(rng() * k)]!\n sum += cell.sum\n count += cell.count\n }\n samples[b] = sum / count\n }\n samples.sort((a, b) => a - b)\n const alpha = 1 - confidence\n const lowIdx = Math.floor((alpha / 2) * resamples)\n const highIdx = Math.min(resamples - 1, Math.ceil((1 - alpha / 2) * resamples) - 1)\n return {\n n: observations.length,\n clusters: k,\n mean,\n low: samples[lowIdx]!,\n high: samples[Math.max(highIdx, lowIdx)]!,\n confidence,\n resamples,\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,SAAgB,qBACd,cACA,UAAmC,CAAC,GACZ;CACxB,MAAM,aAAa,QAAQ,cAAc;CACzC,MAAM,YAAY,QAAQ,aAAa;CACvC,IAAI,EAAE,aAAa,KAAK,aAAa,IACnC,MAAM,IAAI,gBACR,0DAA0D,YAC5D;CAEF,IAAI,CAAC,OAAO,UAAU,SAAS,KAAK,YAAY,GAC9C,MAAM,IAAI,gBACR,mEAAmE,WACrE;CAEF,IAAI,CAAC,aAAa,QAChB,MAAM,IAAI,gBAAgB,yDAAyD;CAGrF,MAAM,uBAAO,IAAI,IAA4C;CAC7D,MAAM,SAAmB,CAAC;CAC1B,KAAK,MAAM,CAAC,OAAO,gBAAgB,aAAa,QAAQ,GAAG;EACzD,IAAI,OAAO,aAAa,YAAY,YAAY,YAAY,YAAY,IACtE,MAAM,IAAI,gBAAgB,qCAAqC,MA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from '../errors'\nimport { makeRng } from '../statistics/internal'\n\n/** One observation and the source cluster it belongs to. */\nexport interface ClusteredObservation {\n cluster: string\n value: number\n}\n\nexport interface ClusterBootstrapOptions {\n /** Confidence level. Default 0.95. */\n confidence?: number\n /** Bootstrap resample count. Default 2000. */\n resamples?: number\n /** Deterministic seed. If omitted, derived from the values so the interval is reproducible. */\n seed?: number\n}\n\nexport interface ClusterBootstrapResult {\n n: number\n clusters: number\n /** Mean over observations, each observation weighted equally. */\n mean: number\n low: number\n high: number\n confidence: number\n resamples: number\n}\n\n/**\n * Percentile cluster bootstrap of an observation mean. Whole clusters are resampled with\n * replacement and each resample's statistic is Σ values / Σ observations over the drawn\n * clusters, so observations that share a source move together and a large cluster cannot\n * pose as many independent results. For a paired comparison pass the per-observation\n * difference (candidate − baseline) under the observation's cluster.\n *\n * With one cluster the interval collapses to the point estimate: there is no between-cluster\n * spread to measure, which callers must treat as no interval, not as certainty.\n */\nexport function clusterBootstrapMean(\n observations: readonly ClusteredObservation[],\n options: ClusterBootstrapOptions = {},\n): ClusterBootstrapResult {\n const confidence = options.confidence ?? 0.95\n const resamples = options.resamples ?? 2000\n if (!(confidence > 0 && confidence < 1)) {\n throw new ValidationError(\n `clusterBootstrapMean: confidence must be in (0,1), got ${confidence}`,\n )\n }\n if (!Number.isInteger(resamples) || resamples < 1) {\n throw new ValidationError(\n `clusterBootstrapMean: resamples must be a positive integer, got ${resamples}`,\n )\n }\n if (!observations.length) {\n throw new ValidationError('clusterBootstrapMean: requires at least one observation')\n }\n\n const sums = new Map<string, { sum: number; count: number }>()\n const values: number[] = []\n for (const [index, observation] of observations.entries()) {\n if (typeof observation?.cluster !== 'string' || observation.cluster === '') {\n throw new ValidationError(`clusterBootstrapMean: observation ${index} needs a cluster id`)\n }\n if (!Number.isFinite(observation.value)) {\n throw new ValidationError(`clusterBootstrapMean: observation ${index} value must be finite`)\n }\n const cell = sums.get(observation.cluster) ?? { sum: 0, count: 0 }\n cell.sum += observation.value\n cell.count += 1\n sums.set(observation.cluster, cell)\n values.push(observation.value)\n }\n\n const cells = [...sums.values()]\n const total = cells.reduce((acc, cell) => acc + cell.sum, 0)\n const mean = total / observations.length\n const k = cells.length\n const rng = makeRng(options.seed, values)\n const samples = new Array<number>(resamples)\n for (let b = 0; b < resamples; b++) {\n let sum = 0\n let count = 0\n for (let draw = 0; draw < k; draw++) {\n const cell = cells[Math.floor(rng() * k)]!\n sum += cell.sum\n count += cell.count\n }\n samples[b] = sum / count\n }\n samples.sort((a, b) => a - b)\n const alpha = 1 - confidence\n const lowIdx = Math.floor((alpha / 2) * resamples)\n const highIdx = Math.min(resamples - 1, Math.ceil((1 - alpha / 2) * resamples) - 1)\n return {\n n: observations.length,\n clusters: k,\n mean,\n low: samples[lowIdx]!,\n high: samples[Math.max(highIdx, lowIdx)]!,\n confidence,\n resamples,\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,SAAgB,qBACd,cACA,UAAmC,CAAC,GACZ;CACxB,MAAM,aAAa,QAAQ,cAAc;CACzC,MAAM,YAAY,QAAQ,aAAa;CACvC,IAAI,EAAE,aAAa,KAAK,aAAa,IACnC,MAAM,IAAI,gBACR,0DAA0D,YAC5D;CAEF,IAAI,CAAC,OAAO,UAAU,SAAS,KAAK,YAAY,GAC9C,MAAM,IAAI,gBACR,mEAAmE,WACrE;CAEF,IAAI,CAAC,aAAa,QAChB,MAAM,IAAI,gBAAgB,yDAAyD;CAGrF,MAAM,uBAAO,IAAI,IAA4C;CAC7D,MAAM,SAAmB,CAAC;CAC1B,KAAK,MAAM,CAAC,OAAO,gBAAgB,aAAa,QAAQ,GAAG;EACzD,IAAI,OAAO,aAAa,YAAY,YAAY,YAAY,YAAY,IACtE,MAAM,IAAI,gBAAgB,qCAAqC,MAAM,oBAAoB;EAE3F,IAAI,CAAC,OAAO,SAAS,YAAY,KAAK,GACpC,MAAM,IAAI,gBAAgB,qCAAqC,MAAM,sBAAsB;EAE7F,MAAM,OAAO,KAAK,IAAI,YAAY,OAAO,KAAK;GAAE,KAAK;GAAG,OAAO;EAAE;EACjE,KAAK,OAAO,YAAY;EACxB,KAAK,SAAS;EACd,KAAK,IAAI,YAAY,SAAS,IAAI;EAClC,OAAO,KAAK,YAAY,KAAK;CAC/B;CAEA,MAAM,QAAQ,CAAC,GAAG,KAAK,OAAO,CAAC;CAE/B,MAAM,OADQ,MAAM,QAAQ,KAAK,SAAS,MAAM,KAAK,KAAK,CACzC,IAAI,aAAa;CAClC,MAAM,IAAI,MAAM;CAChB,MAAM,MAAM,QAAQ,QAAQ,MAAM,MAAM;CACxC,MAAM,UAAU,IAAI,MAAc,SAAS;CAC3C,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,KAAK;EAClC,IAAI,MAAM;EACV,IAAI,QAAQ;EACZ,KAAK,IAAI,OAAO,GAAG,OAAO,GAAG,QAAQ;GACnC,MAAM,OAAO,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC;GACvC,OAAO,KAAK;GACZ,SAAS,KAAK;EAChB;EACA,QAAQ,KAAK,MAAM;CACrB;CACA,QAAQ,MAAM,GAAG,MAAM,IAAI,CAAC;CAC5B,MAAM,QAAQ,IAAI;CAClB,MAAM,SAAS,KAAK,MAAO,QAAQ,IAAK,SAAS;CACjD,MAAM,UAAU,KAAK,IAAI,YAAY,GAAG,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC;CAClF,OAAO;EACL,GAAG,aAAa;EAChB,UAAU;EACV;EACA,KAAK,QAAQ;EACb,MAAM,QAAQ,KAAK,IAAI,SAAS,MAAM;EACtC;EACA;CACF;AACF"}
@@ -1,14 +1,14 @@
1
1
  import { o as CostLedgerHandle } from "../cost-ledger-Czro9wmo.js";
2
- import { S as makeProposalFinding, i as AnalystFinding, v as ProposalFinding, y as ProposalFindingOrigin } from "../types-DzCO-S1m.js";
2
+ import { S as makeProposalFinding, i as AnalystFinding, v as ProposalFinding, y as ProposalFindingOrigin } from "../types-B9s9Xo5_.js";
3
3
  import { A as createChatClient, T as CreateChatClientOpts, x as ChatClient } from "../types-0KglnQ9o.js";
4
- import { $ as paretoPolicy, G as AxisVerdict, J as ObjectiveSource, K as BuildEvidenceVectorOptions, Q as buildEvidenceVector, W as AxisEvidence, X as PromotionObjective, Y as ParetoSignificanceGateOptions, Z as PromotionPolicy, et as paretoSignificanceGate, q as EvidenceVector } from "../statistical-heldout-bU7FBNjR.js";
5
- import { Ar as externalTextOptimizationMethod, Br as OptimizationMethodProvenance, Ci as RunEvalOptions, Cr as GepaEngineRun, Di as RunCampaignOptions, Dr as gepaOptimizationMethod, Ei as CampaignCellRetryPolicy, Er as GepaRunnerCommand, Fr as ExternalTextEvaluationResponse, Gn as HeldOutGateOptions, Gr as OptimizationTokenUsage, Jn as DefaultProductionGateOptions, Kn as heldOutGate, Lr as OptimizationMethod, Mr as ExternalTextOptimizerContext, Nr as ExternalTextOptimizerResult, Oi as runCampaign, Or as OpenAICompatibleOptimizerModel, Pr as ExternalOptimizationExample, Ri as FinalEvidencePolicy, Sr as GepaEngineOptions, Ti as CampaignCellFailureReceipt, Tr as GepaOptimizationRecipe, Ur as OptimizationPackageSource, Vr as OptimizationMethodResult, Wi as campaignSplitDigest, Wr as ComparisonCost, Xn as defaultProductionGate, Yn as DefaultProductionRewardHackingOptions, _r as OptimizationMethodComparison, ai as ReferenceEquivalenceJudgeResult, br as compareOptimizationMethods, ci as LlmJudgeOptions, dr as composeGate, fi as transientDispatchFailure, fr as SkillOptOptimizationMethodConfig, gr as CompareOptimizationMethodsOptions, hi as runImprovementLoop, hr as skillOptOptimizationMethod, ii as ReferenceEquivalenceJudgeOptions, jr as ExternalTextOptimizationMethodConfig, kr as OptimizerModelBudget, li as llmJudge, mi as RunImprovementLoopResult, mr as SkillOptTrainerConfig, oi as ReferenceEquivalenceScenario, pi as RunImprovementLoopOptions, pr as SkillOptRunnerCommand, qn as DefaultProductionGateCheck, ri as ReferenceEquivalenceJudgeInput, si as LlmJudgeDimension, wi as runEval, wr as GepaOptimizationMethodConfig, xr as GepaAdaptiveEngineRun, zi as FinalEvidenceUse, zr as OptimizationMethodInput } from "../index-BwutH5i7.js";
6
- import { C as JudgeDimension, H as SurfaceProposer, M as OptimizerConfig, R as Scenario, S as JudgeConfig, V as SessionScript, _ as GateDecision, a as CampaignResult, b as GenerationRecord, c as CampaignTraceWriter, d as DispatchContext, f as DispatchFn, g as GateContribution, h as GateContext, i as CampaignCostMeter, j as MutableSurface, l as CodeSurface, m as GateCheckStatus, n as CampaignArtifactWriter, p as Gate, r as CampaignCellResult, t as CampaignAggregates, v as GateResult, w as JudgeScore, y as GenerationCandidate } from "../types-BF-xQGQn.js";
7
- import { Kt as fsCampaignStorage, Wt as CampaignStorage, qt as inMemoryCampaignStorage } from "../search-kernel-BjR2Sr7w.js";
4
+ import { $ as paretoPolicy, G as AxisVerdict, J as ObjectiveSource, K as BuildEvidenceVectorOptions, Q as buildEvidenceVector, W as AxisEvidence, X as PromotionObjective, Y as ParetoSignificanceGateOptions, Z as PromotionPolicy, et as paretoSignificanceGate, q as EvidenceVector } from "../statistical-heldout-_dXihc9T.js";
5
+ import { Ar as externalTextOptimizationMethod, Br as OptimizationMethodProvenance, Ci as RunEvalOptions, Cr as GepaEngineRun, Di as RunCampaignOptions, Dr as gepaOptimizationMethod, Ei as CampaignCellRetryPolicy, Er as GepaRunnerCommand, Fr as ExternalTextEvaluationResponse, Gn as HeldOutGateOptions, Gr as OptimizationTokenUsage, Jn as DefaultProductionGateOptions, Kn as heldOutGate, Lr as OptimizationMethod, Mr as ExternalTextOptimizerContext, Nr as ExternalTextOptimizerResult, Oi as runCampaign, Or as OpenAICompatibleOptimizerModel, Pr as ExternalOptimizationExample, Ri as FinalEvidencePolicy, Sr as GepaEngineOptions, Ti as CampaignCellFailureReceipt, Tr as GepaOptimizationRecipe, Ur as OptimizationPackageSource, Vr as OptimizationMethodResult, Wi as campaignSplitDigest, Wr as ComparisonCost, Xn as defaultProductionGate, Yn as DefaultProductionRewardHackingOptions, _r as OptimizationMethodComparison, ai as ReferenceEquivalenceJudgeResult, br as compareOptimizationMethods, ci as LlmJudgeOptions, dr as composeGate, fi as transientDispatchFailure, fr as SkillOptOptimizationMethodConfig, gr as CompareOptimizationMethodsOptions, hi as runImprovementLoop, hr as skillOptOptimizationMethod, ii as ReferenceEquivalenceJudgeOptions, jr as ExternalTextOptimizationMethodConfig, kr as OptimizerModelBudget, li as llmJudge, mi as RunImprovementLoopResult, mr as SkillOptTrainerConfig, oi as ReferenceEquivalenceScenario, pi as RunImprovementLoopOptions, pr as SkillOptRunnerCommand, qn as DefaultProductionGateCheck, ri as ReferenceEquivalenceJudgeInput, si as LlmJudgeDimension, wi as runEval, wr as GepaOptimizationMethodConfig, xr as GepaAdaptiveEngineRun, zi as FinalEvidenceUse, zr as OptimizationMethodInput } from "../index-BJM4rwP2.js";
6
+ import { C as JudgeDimension, H as SurfaceProposer, M as OptimizerConfig, R as Scenario, S as JudgeConfig, V as SessionScript, _ as GateDecision, a as CampaignResult, b as GenerationRecord, c as CampaignTraceWriter, d as DispatchContext, f as DispatchFn, g as GateContribution, h as GateContext, i as CampaignCostMeter, j as MutableSurface, l as CodeSurface, m as GateCheckStatus, n as CampaignArtifactWriter, p as Gate, r as CampaignCellResult, t as CampaignAggregates, v as GateResult, w as JudgeScore, y as GenerationCandidate } from "../types-CBkDo7ja.js";
7
+ import { Kt as fsCampaignStorage, Wt as CampaignStorage, qt as inMemoryCampaignStorage } from "../search-kernel-kwO-sgCq.js";
8
8
  import { d as FileSystemOutcomeStore, f as FileSystemOutcomeStoreOptions, h as OutcomeStore, p as InMemoryOutcomeStore, u as DeploymentOutcome } from "../rubric-predictive-validity-B3RzbwOx.js";
9
9
  import { n as HostedTenant } from "../client-BIFwUg7I.js";
10
- import { _ as ReleaseSummary, a as summarizeExecution, c as ExecutionInsight, d as InsightReport, f as InterRaterInsight, g as Recommendation, h as OutcomeCorrelationInsight, i as SummarizeExecutionOptions, l as FailureClassTally, m as LiftInsight, n as analyzeRuns, o as CostProvenanceSummary, p as JudgeInsight, r as ExecutionReport, s as ExecutionErrorOutcomeCell, t as AnalyzeRunsOptions, u as FailureClusterInsight, v as ScalarDistribution, y as TokenUsageInsight } from "../analyze-runs-BYyMShsj.js";
11
- import { _ as SelfImproveMethodResult, a as DefinedAgentEval, c as SelfImproveMethodOptions, d as SelfImproveProposerOptions, f as SelfImproveProposerResult, g as SelfImproveMethodProvenance, h as selfImprove, i as DefineAgentEvalOptions, l as SelfImproveOptions, m as SelfImproveRunError, n as AgentEvalEvaluateOptions, o as defineAgentEval, p as SelfImproveResult, r as AgentEvalImproveOptions, s as SelfImproveBudget, t as AgentEvalAgent, u as SelfImproveProgressEvent } from "../define-agent-eval-B9zPWFSK.js";
12
- import { $ as AgentProfileImprovementExperimentExecutionInput, A as CodeAgentSessionActionSurface, B as AgentTraceIndex, C as CodeAgentSessionIntakeOptions, Ct as PairedMeasurementAdapter, D as CodeAgentSessionAction, E as ParsedCodeAgentJsonl, Et as SealCandidateBenchmarkSuiteOptions, F as observeCodeAgentSession, G as parseAgentTrace, H as AgentTraceRecord, I as AgentTraceContributor, J as EvalReportingSuiteOptions, K as partitionRunsByAuthoringModel, L as AgentTraceContributorType, M as CodeAgentSessionObservation, N as CodeAgentSessionSource, O as CodeAgentSessionActionKind, P as CodeAgentSessionTerminalStatus, Q as RunRecordRejection, R as AgentTraceConversation, S as CodeAgentSessionDiagnostic, St as PairedMeasurement, T as CodeAgentSessionMetrics, Tt as RunCandidateExperimentOptions, U as AuthoringProvenance, V as AgentTraceRange, W as PartitionByAuthoringModelResult, X as FromRunRecordDirOptions, Y as EvalReportingSuiteResult, Z as FromRunRecordDirResult, _ as fromPiSession, _t as verifyCandidateExperimentComparison, a as FromFeedbackTableOptions, at as runAgentProfileImprovementExperiment, b as streamCodeAgentJsonlFile, bt as CompareCandidateExperimentOptions, c as CodeAgentStoreObservation, ct as sealAgentProfileImprovementTask, d as CodeAgentStoreScope, dt as measuredComparisonFromCandidateExperiment, et as AgentProfileImprovementExperimentRun, f as CodeAgentStoreSession, ft as runCandidateExperiment, g as fromOpenCodeSession, gt as verifyCandidateExperiment, h as fromKimiCodeSession, ht as sealCandidateExperiment, i as FeedbackTableRow, it as measuredComparisonFromAgentProfileImprovementExperiment, j as CodeAgentSessionExecutionReceipt, k as CodeAgentSessionActionStatus, l as CodeAgentStoreRejection, lt as verifyAgentProfileImprovementExperimentComparison, m as fromCodexSession, mt as sealCandidateBenchmarkTask, n as fromOtelSpans, nt as RunAgentProfileImprovementExperimentOptions, o as FromFeedbackTableResult, ot as sealAgentProfileImprovementExperiment, p as fromClaudeCodeSession, pt as sealCandidateBenchmarkSuite, q as EvalReportingSuiteInput, r as FeedbackTableMeta, rt as SealAgentProfileImprovementSuiteOptions, s as fromFeedbackTable, st as sealAgentProfileImprovementSuite, t as FromOtelSpansOptions, tt as CompareAgentProfileImprovementExperimentOptions, u as CodeAgentStoreRejections, ut as evaluatePairedMeasurements, v as parseCodeAgentJsonl, vt as CandidateExperimentExecutionInput, w as CodeAgentSessionIntakeResult, wt as PairedMeasurementEvaluation, x as CodeAgentJsonlLine, xt as EvaluatePairedMeasurementsOptions, y as parseCodeAgentJsonlFile, yt as CandidateExperimentRun, z as AgentTraceFile } from "../index-ByJ20lyu.js";
13
- import { n as buildDefaultAnalystRegistry, t as DefaultAnalystRegistryOptions } from "../default-registry-DKlKVXMx.js";
10
+ import { _ as ReleaseSummary, a as summarizeExecution, c as ExecutionInsight, d as InsightReport, f as InterRaterInsight, g as Recommendation, h as OutcomeCorrelationInsight, i as SummarizeExecutionOptions, l as FailureClassTally, m as LiftInsight, n as analyzeRuns, o as CostProvenanceSummary, p as JudgeInsight, r as ExecutionReport, s as ExecutionErrorOutcomeCell, t as AnalyzeRunsOptions, u as FailureClusterInsight, v as ScalarDistribution, y as TokenUsageInsight } from "../analyze-runs-pJ4fhnYg.js";
11
+ import { _ as SelfImproveMethodResult, a as DefinedAgentEval, c as SelfImproveMethodOptions, d as SelfImproveProposerOptions, f as SelfImproveProposerResult, g as SelfImproveMethodProvenance, h as selfImprove, i as DefineAgentEvalOptions, l as SelfImproveOptions, m as SelfImproveRunError, n as AgentEvalEvaluateOptions, o as defineAgentEval, p as SelfImproveResult, r as AgentEvalImproveOptions, s as SelfImproveBudget, t as AgentEvalAgent, u as SelfImproveProgressEvent } from "../define-agent-eval-DKVYlm-T.js";
12
+ import { $ as AgentProfileImprovementExperimentExecutionInput, A as CodeAgentSessionActionSurface, B as AgentTraceIndex, C as CodeAgentSessionIntakeOptions, Ct as PairedMeasurementAdapter, D as CodeAgentSessionAction, E as ParsedCodeAgentJsonl, Et as SealCandidateBenchmarkSuiteOptions, F as observeCodeAgentSession, G as parseAgentTrace, H as AgentTraceRecord, I as AgentTraceContributor, J as EvalReportingSuiteOptions, K as partitionRunsByAuthoringModel, L as AgentTraceContributorType, M as CodeAgentSessionObservation, N as CodeAgentSessionSource, O as CodeAgentSessionActionKind, P as CodeAgentSessionTerminalStatus, Q as RunRecordRejection, R as AgentTraceConversation, S as CodeAgentSessionDiagnostic, St as PairedMeasurement, T as CodeAgentSessionMetrics, Tt as RunCandidateExperimentOptions, U as AuthoringProvenance, V as AgentTraceRange, W as PartitionByAuthoringModelResult, X as FromRunRecordDirOptions, Y as EvalReportingSuiteResult, Z as FromRunRecordDirResult, _ as fromPiSession, _t as verifyCandidateExperimentComparison, a as FromFeedbackTableOptions, at as runAgentProfileImprovementExperiment, b as streamCodeAgentJsonlFile, bt as CompareCandidateExperimentOptions, c as CodeAgentStoreObservation, ct as sealAgentProfileImprovementTask, d as CodeAgentStoreScope, dt as measuredComparisonFromCandidateExperiment, et as AgentProfileImprovementExperimentRun, f as CodeAgentStoreSession, ft as runCandidateExperiment, g as fromOpenCodeSession, gt as verifyCandidateExperiment, h as fromKimiCodeSession, ht as sealCandidateExperiment, i as FeedbackTableRow, it as measuredComparisonFromAgentProfileImprovementExperiment, j as CodeAgentSessionExecutionReceipt, k as CodeAgentSessionActionStatus, l as CodeAgentStoreRejection, lt as verifyAgentProfileImprovementExperimentComparison, m as fromCodexSession, mt as sealCandidateBenchmarkTask, n as fromOtelSpans, nt as RunAgentProfileImprovementExperimentOptions, o as FromFeedbackTableResult, ot as sealAgentProfileImprovementExperiment, p as fromClaudeCodeSession, pt as sealCandidateBenchmarkSuite, q as EvalReportingSuiteInput, r as FeedbackTableMeta, rt as SealAgentProfileImprovementSuiteOptions, s as fromFeedbackTable, st as sealAgentProfileImprovementSuite, t as FromOtelSpansOptions, tt as CompareAgentProfileImprovementExperimentOptions, u as CodeAgentStoreRejections, ut as evaluatePairedMeasurements, v as parseCodeAgentJsonl, vt as CandidateExperimentExecutionInput, w as CodeAgentSessionIntakeResult, wt as PairedMeasurementEvaluation, x as CodeAgentJsonlLine, xt as EvaluatePairedMeasurementsOptions, y as parseCodeAgentJsonlFile, yt as CandidateExperimentRun, z as AgentTraceFile } from "../index-chNyKroE.js";
13
+ import { n as buildDefaultAnalystRegistry, t as DefaultAnalystRegistryOptions } from "../default-registry-BNv7eB1C.js";
14
14
  export { type AgentEvalAgent, type AgentEvalEvaluateOptions, type AgentEvalImproveOptions, type AgentProfileImprovementExperimentExecutionInput, type AgentProfileImprovementExperimentRun, type AgentTraceContributor, type AgentTraceContributorType, type AgentTraceConversation, type AgentTraceFile, type AgentTraceIndex, type AgentTraceRange, type AgentTraceRecord, type AnalystFinding, type AnalyzeRunsOptions, type AuthoringProvenance, type AxisEvidence, type AxisVerdict, type BuildEvidenceVectorOptions, type CampaignAggregates, type CampaignArtifactWriter, type CampaignCellFailureReceipt, type CampaignCellResult, type CampaignCellRetryPolicy, type CampaignCostMeter, type CampaignResult, type CampaignStorage, type CampaignTraceWriter, type CandidateExperimentExecutionInput, type CandidateExperimentRun, type ChatClient, type CodeAgentJsonlLine, type CodeAgentSessionAction, type CodeAgentSessionActionKind, type CodeAgentSessionActionStatus, type CodeAgentSessionActionSurface, type CodeAgentSessionDiagnostic, type CodeAgentSessionExecutionReceipt, type CodeAgentSessionIntakeOptions, type CodeAgentSessionIntakeResult, type CodeAgentSessionMetrics, type CodeAgentSessionObservation, type CodeAgentSessionSource, type CodeAgentSessionTerminalStatus, type CodeAgentStoreObservation, type CodeAgentStoreRejection, type CodeAgentStoreRejections, type CodeAgentStoreScope, type CodeAgentStoreSession, type CodeSurface, type CompareAgentProfileImprovementExperimentOptions, type CompareCandidateExperimentOptions, type CompareOptimizationMethodsOptions, type ComparisonCost, type CostLedgerHandle, type CostProvenanceSummary, type CreateChatClientOpts, type DefaultAnalystRegistryOptions, type DefaultProductionGateCheck, type DefaultProductionGateOptions, type DefaultProductionRewardHackingOptions, type DefineAgentEvalOptions, type DefinedAgentEval, type DeploymentOutcome, type DispatchFn as Dispatch, type DispatchContext, type EvalReportingSuiteInput, type EvalReportingSuiteOptions, type EvalReportingSuiteResult, type EvaluatePairedMeasurementsOptions, type EvidenceVector, type ExecutionErrorOutcomeCell, type ExecutionInsight, type ExecutionReport, type ExternalOptimizationExample, type ExternalTextEvaluationResponse, type ExternalTextOptimizationMethodConfig, type ExternalTextOptimizerContext, type ExternalTextOptimizerResult, type FailureClassTally, type FailureClusterInsight, type FeedbackTableMeta, type FeedbackTableRow, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, type FinalEvidencePolicy, type FinalEvidenceUse, type FromFeedbackTableOptions, type FromFeedbackTableResult, type FromOtelSpansOptions, type FromRunRecordDirOptions, type FromRunRecordDirResult, type Gate, type GateCheckStatus, type GateContext, type GateContribution, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaAdaptiveEngineRun, type GepaEngineOptions, type GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaRunnerCommand, type HeldOutGateOptions, type HostedTenant, InMemoryOutcomeStore, type InsightReport, type InterRaterInsight, type JudgeConfig, type JudgeDimension, type JudgeInsight, type JudgeScore, type LiftInsight, type LlmJudgeDimension, type LlmJudgeOptions, type MutableSurface, type ObjectiveSource, type OpenAICompatibleOptimizerModel, type OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodProvenance, type OptimizationMethodResult, type OptimizationPackageSource, type OptimizationTokenUsage, type OptimizerConfig, type OptimizerModelBudget, type OutcomeCorrelationInsight, type OutcomeStore, type PairedMeasurement, type PairedMeasurementAdapter, type PairedMeasurementEvaluation, type ParetoSignificanceGateOptions, type ParsedCodeAgentJsonl, type PartitionByAuthoringModelResult, type PromotionObjective, type PromotionPolicy, type ProposalFinding, type ProposalFindingOrigin, type Recommendation, type ReferenceEquivalenceJudgeInput, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceJudgeResult, type ReferenceEquivalenceScenario, type ReleaseSummary, type RunAgentProfileImprovementExperimentOptions, type RunCampaignOptions, type RunCandidateExperimentOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunRecordRejection, type ScalarDistribution, type Scenario, type SealAgentProfileImprovementSuiteOptions, type SealCandidateBenchmarkSuiteOptions, type SelfImproveBudget, type SelfImproveMethodOptions, type SelfImproveMethodProvenance, type SelfImproveMethodResult, type SelfImproveOptions, type SelfImproveProgressEvent, type SelfImproveProposerOptions, type SelfImproveProposerResult, type SelfImproveResult, SelfImproveRunError, type SessionScript, type SkillOptOptimizationMethodConfig, type SkillOptRunnerCommand, type SkillOptTrainerConfig, type SummarizeExecutionOptions, type SurfaceProposer, type TokenUsageInsight, analyzeRuns, buildDefaultAnalystRegistry, buildEvidenceVector, campaignSplitDigest, compareOptimizationMethods, composeGate, createChatClient, defaultProductionGate, defineAgentEval, evaluatePairedMeasurements, externalTextOptimizationMethod, fromClaudeCodeSession, fromCodexSession, fromFeedbackTable, fromKimiCodeSession, fromOpenCodeSession, fromOtelSpans, fromPiSession, fsCampaignStorage, gepaOptimizationMethod, heldOutGate, inMemoryCampaignStorage, llmJudge, makeProposalFinding, measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, observeCodeAgentSession, paretoPolicy, paretoSignificanceGate, parseAgentTrace, parseCodeAgentJsonl, parseCodeAgentJsonlFile, partitionRunsByAuthoringModel, runAgentProfileImprovementExperiment, runCampaign, runCandidateExperiment, runEval, runImprovementLoop, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateBenchmarkSuite, sealCandidateBenchmarkTask, sealCandidateExperiment, selfImprove, skillOptOptimizationMethod, streamCodeAgentJsonlFile, summarizeExecution, transientDispatchFailure, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison };
@@ -1,25 +1,25 @@
1
1
  import { a as hashCanonical } from "../canonical-CicJlINA.js";
2
- import "../run-record-DEjx43cI.js";
3
- import { t as mean$1 } from "../mean-DDFhslBt.js";
4
- import { r as summarizeExecution, t as analyzeRuns } from "../analyze-runs-dGYmYNtb.js";
5
- import { r as pairedBootstrap } from "../paired-tests-kASEKpc-.js";
6
- import { t as decidePairedPromotion } from "../paired-promotion-decision-5Pl_qJLX.js";
7
- import { a as heldoutSignificance } from "../statistical-heldout-DYF5f10K.js";
2
+ import "../run-record-CpLS4Uid.js";
3
+ import { t as mean$1 } from "../mean-D1d6gedE.js";
4
+ import { r as summarizeExecution, t as analyzeRuns } from "../analyze-runs-C7vWBDhl.js";
5
+ import { r as pairedBootstrap } from "../paired-tests-Buh6feJ4.js";
6
+ import { t as decidePairedPromotion } from "../paired-promotion-decision-CiueaTTj.js";
7
+ import { a as heldoutSignificance } from "../statistical-heldout-NBxC7jGo.js";
8
8
  import { f as mapConcurrentRange } from "../journal-C1uLJi0w.js";
9
- import { X as runEval, Z as runCampaign, a as clamp01, f as runImprovementLoop, r as transientDispatchFailure, t as llmJudge, z as defaultProductionGate } from "../llm-judge-CyDyqb6V.js";
9
+ import { X as runEval, Z as runCampaign, a as clamp01, f as runImprovementLoop, r as transientDispatchFailure, t as llmJudge, z as defaultProductionGate } from "../llm-judge-CHLvjbVR.js";
10
10
  import { i as isModelPriced, n as estimateCost } from "../metrics-DNCAUtuB.js";
11
11
  import { t as CostLedger } from "../cost-ledger-CS8R3IZj.js";
12
- import { A as campaignSplitDigest } from "../campaign-evidence-BICB3a9Z.js";
13
- import { M as fsCampaignStorage, N as inMemoryCampaignStorage } from "../external-optimizer-subprocess-CeHuAaMJ.js";
14
- import { a as makeProposalFinding } from "../types-BK0blWhe.js";
12
+ import { A as campaignSplitDigest } from "../campaign-evidence-CcA7a67m.js";
13
+ import { M as fsCampaignStorage, N as inMemoryCampaignStorage } from "../external-optimizer-subprocess-B44kOfZb.js";
14
+ import { a as makeProposalFinding } from "../types-CL1_N7AZ.js";
15
15
  import { n as isRecord } from "../json-DtvZNAU9.js";
16
- import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-DyzJ0wOo.js";
17
- import { t as buildDefaultAnalystRegistry } from "../default-registry-gmDeN0KT.js";
16
+ import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-CjF2nTA3.js";
17
+ import { t as buildDefaultAnalystRegistry } from "../default-registry-eCkZFfuF.js";
18
18
  import { t as extractUsage } from "../extract-usage-ISFqhfDz.js";
19
19
  import { t as createChatClient } from "../chat-client-D0me8iwq.js";
20
20
  import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "../outcome-store-TarrcfHG.js";
21
- import { c as composeGate, l as externalTextOptimizationMethod, n as compareOptimizationMethods, r as gepaOptimizationMethod, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-O35aMdxU.js";
22
- import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-f79oklG_.js";
21
+ import { c as composeGate, l as externalTextOptimizationMethod, n as compareOptimizationMethods, r as gepaOptimizationMethod, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-D72XZZfR.js";
22
+ import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-DLPcEnCf.js";
23
23
  import { t as fromOtelSpans } from "../otel-spans-BsGzTWIK.js";
24
24
  import { createHash } from "node:crypto";
25
25
  import { agentCandidateBenchmarkSuiteSchema, agentCandidateBenchmarkTaskSchema, agentCandidateBundleSchema, agentCandidateEvaluationPolicySchema, agentCandidateExperimentSchema, agentImprovementMeasuredComparisonSchema, agentProfileImprovementExperimentSchema, agentProfileImprovementMeasuredComparisonSchema, agentProfileImprovementRunCellSchema, agentProfileImprovementRunReceiptSchema, agentProfileImprovementSuiteInputsSchema, agentProfileImprovementSuiteSchema, agentProfileImprovementTaskSchema, candidateExecutionEvidenceSchema, canonicalCandidateDigest, canonicalCandidateJson, numbersApproximatelyEqual, omitTopLevelDigest } from "@tangle-network/agent-interface";
@@ -1,13 +1,13 @@
1
1
  import { a as hashCanonical, o as jsonDocument, r as canonicalString } from "./canonical-CicJlINA.js";
2
- import { c as findingEvidenceRefSchema, s as findingCalibrationSchema } from "./finding-composition-DlvE1Qul.js";
3
- import { l as weightedComposite } from "./descriptive-BTzLL-aj.js";
2
+ import { c as findingEvidenceRefSchema, s as findingCalibrationSchema } from "./finding-composition-Belh_qU3.js";
3
+ import { l as weightedComposite } from "./descriptive-B3Eb7tX0.js";
4
4
  import { n as contentHash } from "./verdict-cache-BVH-fl18.js";
5
5
  import { t as deepFreezeCanonicalJson } from "./deep-freeze-CK8-2W7p.js";
6
- import { i as makeFinding } from "./types-BK0blWhe.js";
7
- import { r as calibrationFromPairs } from "./calibration-DLzckXnn.js";
6
+ import { i as makeFinding } from "./types-CL1_N7AZ.js";
7
+ import { r as calibrationFromPairs } from "./calibration-CbZPApIO.js";
8
8
  import { parseSystemOneQuestions, parseSystemOneRequest, parseSystemOneResult, systemOneUsage } from "./systemone-protocol.js";
9
9
  import { n as asJudge, r as createEvaluator, t as asAnalyst } from "./evaluation-BBI37mRe.js";
10
- import "./systemone-review-S49gsy_y.js";
10
+ import "./systemone-review-BusEIzsg.js";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { z } from "zod";
13
13
  // src/decision-point-records.ts
@@ -546,6 +546,12 @@ const cancelled = () => ({
546
546
  });
547
547
  /** Minimum independent nominal-label agreement required before routing can drive work. */
548
548
  const DECISION_POINT_MIN_KAPPA = .77;
549
+ /** The second, named line beside κ: ROC area, its interval's low end and the gold count a probability reading needs. */
550
+ const DECISION_POINT_AUC_BAR = {
551
+ auc: .8,
552
+ ciLow: .7,
553
+ gold_n: 10
554
+ };
549
555
  function validateDecisionDefinition(config) {
550
556
  parseSystemOneQuestions(config.questions);
551
557
  if ([
@@ -828,6 +834,6 @@ function decisionPoint(options) {
828
834
  reliability: () => decisionPointReliability(ledger, definitionDigest, Object.keys(config.questions).filter((name) => !config.policy[name].recordOnly), Object.keys(config.questions).filter((name) => config.policy[name].recordOnly))
829
835
  };
830
836
  }
831
- export { systemOneAnalyst as a, assessSystemOneDomainMatch as c, decisionAnswerSchema as d, decisionCalibrationSchema as f, normalizedSystemOneScore as i, prepareSystemOneDomainMatch as l, decisionPoint as n, systemOneEvaluator as o, validDecisionIdentity as p, decisionQuestionDigest as r, systemOneJudge as s, DECISION_POINT_MIN_KAPPA as t, systemOneChoiceMargin as u };
837
+ export { normalizedSystemOneScore as a, systemOneJudge as c, systemOneChoiceMargin as d, decisionAnswerSchema as f, decisionQuestionDigest as i, assessSystemOneDomainMatch as l, validDecisionIdentity as m, DECISION_POINT_MIN_KAPPA as n, systemOneAnalyst as o, decisionCalibrationSchema as p, decisionPoint as r, systemOneEvaluator as s, DECISION_POINT_AUC_BAR as t, prepareSystemOneDomainMatch as u };
832
838
 
833
- //# sourceMappingURL=decision-point-CErE7GnP.js.map
839
+ //# sourceMappingURL=decision-point-CNyoKOkz.js.map