reeval 0.17.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/README.md +5 -3
  2. package/THIRD_PARTY_NOTICES.md +5 -5
  3. package/dist/{adapter-DyvDj4ZN.js → adapter-C8xPuXYq.js} +5 -4
  4. package/dist/adapter-C8xPuXYq.js.map +1 -0
  5. package/dist/{agent-v036GEgG.js → agent-CBoLndM7.js} +30 -10
  6. package/dist/{agent-v036GEgG.js.map → agent-CBoLndM7.js.map} +1 -1
  7. package/dist/agents-C6zhkxp3.js +1151 -0
  8. package/dist/agents-C6zhkxp3.js.map +1 -0
  9. package/dist/{analysis-adKPz-UJ.js → analysis-BnG_1x_O.js} +4 -4
  10. package/dist/{analysis-adKPz-UJ.js.map → analysis-BnG_1x_O.js.map} +1 -1
  11. package/dist/{app-files-hpRT5lj_.js → app-files-DT5mJyV4.js} +4 -4
  12. package/dist/app-files-DT5mJyV4.js.map +1 -0
  13. package/dist/assemble-UPCRrtOz.js +1 -0
  14. package/dist/{assemble-Dlh6Xv3U.js → assemble-t6h018An.js} +194 -307
  15. package/dist/assemble-t6h018An.js.map +1 -0
  16. package/dist/{attempt-CtKGvaQR.js → attempt-CAdlwlNu.js} +3 -3
  17. package/dist/{attempt-CtKGvaQR.js.map → attempt-CAdlwlNu.js.map} +1 -1
  18. package/dist/{attempt-host-DErH-DYV.js → attempt-host-CIm1-11m.js} +18 -10
  19. package/dist/{attempt-host-DErH-DYV.js.map → attempt-host-CIm1-11m.js.map} +1 -1
  20. package/dist/boat-BjLqFJIZ.js +108 -0
  21. package/dist/boat-BjLqFJIZ.js.map +1 -0
  22. package/dist/boat-CJCtzfB1.js +322 -0
  23. package/dist/boat-CJCtzfB1.js.map +1 -0
  24. package/dist/bridge/index.mjs +300 -78
  25. package/dist/capture-DoxFUN3J.js +1 -0
  26. package/dist/{capture-Bdcx9Gap.js → capture-iBzFiC0j.js} +406 -625
  27. package/dist/capture-iBzFiC0j.js.map +1 -0
  28. package/dist/cases-Dy0mifal.js +1 -0
  29. package/dist/cases-z9E6DCd5.js +639 -0
  30. package/dist/cases-z9E6DCd5.js.map +1 -0
  31. package/dist/{cli-CGd51thd.js → cli-20Fpvs5H.js} +929 -576
  32. package/dist/cli-20Fpvs5H.js.map +1 -0
  33. package/dist/{cli-spec-ChkleEVm.js → cli-spec-Dsr79Qy1.js} +46 -18
  34. package/dist/cli-spec-Dsr79Qy1.js.map +1 -0
  35. package/dist/cli.js +2 -2
  36. package/dist/{client-CF-DOjOU.js → client-KM4C5r5_.js} +111 -14
  37. package/dist/client-KM4C5r5_.js.map +1 -0
  38. package/dist/{command-CsfcwMyc.js → command-B5OyHpOu.js} +24 -81
  39. package/dist/command-B5OyHpOu.js.map +1 -0
  40. package/dist/{command-CtTdCF3B.js → command-BLNVDiIg.js} +10 -10
  41. package/dist/{command-CtTdCF3B.js.map → command-BLNVDiIg.js.map} +1 -1
  42. package/dist/{command-CyIb9BSC.js → command-CRh-cb6Z.js} +120 -55
  43. package/dist/command-CRh-cb6Z.js.map +1 -0
  44. package/dist/{command-TLmY-rYp.js → command-aUJvENwy.js} +18 -18
  45. package/dist/command-aUJvENwy.js.map +1 -0
  46. package/dist/{commands-C54S45d7.js → commands-CWy-WndG.js} +239 -92
  47. package/dist/commands-CWy-WndG.js.map +1 -0
  48. package/dist/{commands-jO9Jj35r.js → commands-CfdBX-mc.js} +1 -1
  49. package/dist/{config-ImY6AlRE.js → config-B9mB1kF5.js} +924 -1729
  50. package/dist/config-B9mB1kF5.js.map +1 -0
  51. package/dist/{context-BajfiH0S.js → context-Bkv3ndjq.js} +3 -2
  52. package/dist/context-Bkv3ndjq.js.map +1 -0
  53. package/dist/{cost-e4IppZpJ.js → cost-BdRgySQl.js} +4 -4
  54. package/dist/{cost-e4IppZpJ.js.map → cost-BdRgySQl.js.map} +1 -1
  55. package/dist/cost-Cr26Alhq.js +1 -0
  56. package/dist/{cursor-catalog-Bw6-pJjR.js → cursor-catalog-BSn9xjmo.js} +3 -3
  57. package/dist/{cursor-catalog-Bw6-pJjR.js.map → cursor-catalog-BSn9xjmo.js.map} +1 -1
  58. package/dist/db-P2fXw4nx.js +2 -0
  59. package/dist/{db-sHGpaLo9.js → db-zgC1tvKB.js} +178 -74
  60. package/dist/db-zgC1tvKB.js.map +1 -0
  61. package/dist/debug-CF4p4Lp_.js +1 -0
  62. package/dist/{debug-B5jDImcW.js → debug-CIXzB4wK.js} +2 -2
  63. package/dist/{debug-B5jDImcW.js.map → debug-CIXzB4wK.js.map} +1 -1
  64. package/dist/{default-effort-fpdbYVKm.js → default-effort-BAy8ixd1.js} +1 -1
  65. package/dist/{default-effort-BZRa-SQP.js → default-effort-DGhQmu95.js} +8 -5
  66. package/dist/default-effort-DGhQmu95.js.map +1 -0
  67. package/dist/{dist-ByYk_wAs.js → dist-CAFD1yfv.js} +28 -6
  68. package/dist/dist-CAFD1yfv.js.map +1 -0
  69. package/dist/{docker-CWuSRj7a.js → docker-Cqw-CyWz.js} +4 -4
  70. package/dist/{docker-CWuSRj7a.js.map → docker-Cqw-CyWz.js.map} +1 -1
  71. package/dist/{docker--2ytOHcu.js → docker-DAMnm3L9.js} +103 -73
  72. package/dist/docker-DAMnm3L9.js.map +1 -0
  73. package/dist/{docker-CIzHzwlC.js → docker-Dr4XeDc8.js} +1 -1
  74. package/dist/{doctor-eE65YpEv.js → doctor-B2PohneB.js} +86 -29
  75. package/dist/doctor-B2PohneB.js.map +1 -0
  76. package/dist/{env-T86lAqUD.js → env-8x1O8I1M.js} +2 -2
  77. package/dist/{env-T86lAqUD.js.map → env-8x1O8I1M.js.map} +1 -1
  78. package/dist/{environment-Cy3FVLR5.js → environment-DB8o3hGi.js} +80 -40
  79. package/dist/environment-DB8o3hGi.js.map +1 -0
  80. package/dist/{errors-BQV__TzH.js → errors-BZgLSZtV.js} +2 -2
  81. package/dist/{errors-BQV__TzH.js.map → errors-BZgLSZtV.js.map} +1 -1
  82. package/dist/{eval-source-BTsTRiBW.js → eval-source-D3sbAzt-.js} +23 -15
  83. package/dist/eval-source-D3sbAzt-.js.map +1 -0
  84. package/dist/evaluate-COdzf7Hl.d.ts +92 -0
  85. package/dist/{evaluate-CFFdyYZX.js → evaluate-CwKeN_fo.js} +472 -159
  86. package/dist/evaluate-CwKeN_fo.js.map +1 -0
  87. package/dist/files-B4KQUiM7.js +1 -0
  88. package/dist/files-BEwfjD8J.js +64 -0
  89. package/dist/files-BEwfjD8J.js.map +1 -0
  90. package/dist/{files-CQU08uh4.js → files-BRzV7aPh.js} +5 -5
  91. package/dist/{files-CQU08uh4.js.map → files-BRzV7aPh.js.map} +1 -1
  92. package/dist/{files-CIX-pLl4.js → files-BiFU16BW.js} +6 -6
  93. package/dist/{files-CIX-pLl4.js.map → files-BiFU16BW.js.map} +1 -1
  94. package/dist/files-C1Rk9FYA.js +1 -0
  95. package/dist/files-C3mCC8Mn.js +1 -0
  96. package/dist/{files-tnMgu7-X.js → files-Cl7BQ5gE.js} +55 -14
  97. package/dist/{files-tnMgu7-X.js.map → files-Cl7BQ5gE.js.map} +1 -1
  98. package/dist/{files-BGlHnC46.js → files-DgXyaAg6.js} +2 -2
  99. package/dist/{files-BGlHnC46.js.map → files-DgXyaAg6.js.map} +1 -1
  100. package/dist/{files-p-uTdOjA.js → files-DlQshsks.js} +3 -2
  101. package/dist/files-DlQshsks.js.map +1 -0
  102. package/dist/files-DnlA1A7N.js +1 -0
  103. package/dist/gate-CgYdaprG.js +49 -0
  104. package/dist/gate-CgYdaprG.js.map +1 -0
  105. package/dist/gateway.d.ts +1 -1
  106. package/dist/{git-BWVkG4Yl.js → git-fDiJ8UIV.js} +3 -3
  107. package/dist/{git-BWVkG4Yl.js.map → git-fDiJ8UIV.js.map} +1 -1
  108. package/dist/harness-C2berMiM.js +105 -0
  109. package/dist/harness-C2berMiM.js.map +1 -0
  110. package/dist/{harness-Ch2P81sx.js → harness-DXv2gnaT.js} +68 -111
  111. package/dist/harness-DXv2gnaT.js.map +1 -0
  112. package/dist/harness.d.ts +1 -1
  113. package/dist/harness.js +1 -1
  114. package/dist/{ids-DuK6xl4w.js → ids-C_advdJA.js} +3 -8
  115. package/dist/ids-C_advdJA.js.map +1 -0
  116. package/dist/{images-BVZHDf_z.js → images-BNgcR77K.js} +98 -10
  117. package/dist/images-BNgcR77K.js.map +1 -0
  118. package/dist/index.d.ts +23 -3
  119. package/dist/index.js +5 -5
  120. package/dist/init-4RPeD-K-.js +1 -0
  121. package/dist/{init-BWnMbUnc.js → init-DbuZVRrW.js} +8 -7
  122. package/dist/init-DbuZVRrW.js.map +1 -0
  123. package/dist/ink-list-BpfidQ1h.js +274 -0
  124. package/dist/ink-list-BpfidQ1h.js.map +1 -0
  125. package/dist/{invocations-BGRs1r_C.js → invocations-CxGNOlh0.js} +4 -4
  126. package/dist/{invocations-BGRs1r_C.js.map → invocations-CxGNOlh0.js.map} +1 -1
  127. package/dist/judge-COMXT1Hx.js +230 -0
  128. package/dist/judge-COMXT1Hx.js.map +1 -0
  129. package/dist/judge.d.ts +1 -1
  130. package/dist/judge.js +1 -1
  131. package/dist/judgments-CzgpsTqv.js +246 -0
  132. package/dist/judgments-CzgpsTqv.js.map +1 -0
  133. package/dist/kinds-C1oY3qyC.js +697 -0
  134. package/dist/kinds-C1oY3qyC.js.map +1 -0
  135. package/dist/{summary-zP3cCXDN.js → layout-Cm85tQYk.js} +77 -154
  136. package/dist/layout-Cm85tQYk.js.map +1 -0
  137. package/dist/list-DuThsE28.js +1348 -0
  138. package/dist/list-DuThsE28.js.map +1 -0
  139. package/dist/live-CJCK11nh.js +1 -0
  140. package/dist/{live-d_5a5iUv.js → live-CgYbO4Te.js} +24 -4
  141. package/dist/live-CgYbO4Te.js.map +1 -0
  142. package/dist/{live-ColieOai.js → live-CnGrRM6j.js} +8 -8
  143. package/dist/{live-ColieOai.js.map → live-CnGrRM6j.js.map} +1 -1
  144. package/dist/{matchers-B4ZtlJyP.js → matchers-CXLn-1jm.js} +4 -3
  145. package/dist/{matchers-B4ZtlJyP.js.map → matchers-CXLn-1jm.js.map} +1 -1
  146. package/dist/{model-DOXnWH65.js → model-047Dcd-a.js} +1 -1
  147. package/dist/model-Cv4GuTsZ.js +1 -0
  148. package/dist/{model-CFSjV-HJ.js → model-CwwkrCb7.js} +5 -5
  149. package/dist/{model-CFSjV-HJ.js.map → model-CwwkrCb7.js.map} +1 -1
  150. package/dist/{model-DBpdRXtO.js → model-DJjLw-0r.js} +43 -19
  151. package/dist/{model-DBpdRXtO.js.map → model-DJjLw-0r.js.map} +1 -1
  152. package/dist/{model-DOiCiMCD.js → model-V3mMXp6x.js} +213 -559
  153. package/dist/model-V3mMXp6x.js.map +1 -0
  154. package/dist/{node-CwP1G178.js → node-D7pAU--0.js} +34 -25
  155. package/dist/node-D7pAU--0.js.map +1 -0
  156. package/dist/{opencode-providers-yNKyXD49.js → opencode-providers-BGiXt8_B.js} +107 -49
  157. package/dist/opencode-providers-BGiXt8_B.js.map +1 -0
  158. package/dist/{openrouter-models-C8nzPKG2.js → openrouter-models-Cw1z8-sq.js} +2 -2
  159. package/dist/{openrouter-models-C8nzPKG2.js.map → openrouter-models-Cw1z8-sq.js.map} +1 -1
  160. package/dist/options-CHubslQf.js +1 -0
  161. package/dist/{gate-BoDKeuJu.js → pairs-BGb134Vu.js} +3 -49
  162. package/dist/pairs-BGb134Vu.js.map +1 -0
  163. package/dist/{patch-DvLr8wCZ.js → patch-DH4e_Gkd.js} +3 -3
  164. package/dist/{patch-DvLr8wCZ.js.map → patch-DH4e_Gkd.js.map} +1 -1
  165. package/dist/plain-BYUf_fUV.js +267 -0
  166. package/dist/plain-BYUf_fUV.js.map +1 -0
  167. package/dist/{plan-CIfOFhth.js → plan-Cgq9NCEX.js} +117 -45
  168. package/dist/plan-Cgq9NCEX.js.map +1 -0
  169. package/dist/{plugins-BEs2Am3L.js → plugins-BkmPxDiY.js} +11 -268
  170. package/dist/plugins-BkmPxDiY.js.map +1 -0
  171. package/dist/preflight-4gWSy0Pe.js +1 -0
  172. package/dist/{preflight-50Qw5e5K.js → preflight-BElE_q0u.js} +16 -9
  173. package/dist/preflight-BElE_q0u.js.map +1 -0
  174. package/dist/preflight-CtlloeOQ.js +68 -0
  175. package/dist/preflight-CtlloeOQ.js.map +1 -0
  176. package/dist/{preflight-BAIRsTpl.js → preflight-R-InZCQb.js} +1 -1
  177. package/dist/{prepare-8XhzhLHX.js → prepare-C7f5mPl5.js} +9 -9
  178. package/dist/{prepare-8XhzhLHX.js.map → prepare-C7f5mPl5.js.map} +1 -1
  179. package/dist/{prepare-8nvfDFQx.js → prepare-CzkAdbXm.js} +2 -2
  180. package/dist/{prices-C4BRuSe8.js → prices-5m3SzMZ3.js} +3 -3
  181. package/dist/{prices-C4BRuSe8.js.map → prices-5m3SzMZ3.js.map} +1 -1
  182. package/dist/{provenance-Cc8fFE7Z.js → provenance-zsc4--dP.js} +6 -5
  183. package/dist/provenance-zsc4--dP.js.map +1 -0
  184. package/dist/provider-BnUoz4KB.js +1 -0
  185. package/dist/{provider-DZd8t_XW.js → provider-BxzZq3Th.js} +2 -2
  186. package/dist/{provider-DZd8t_XW.js.map → provider-BxzZq3Th.js.map} +1 -1
  187. package/dist/{providers-DZSTlC9R.js → providers-B8xYMeah.js} +152 -9
  188. package/dist/providers-B8xYMeah.js.map +1 -0
  189. package/dist/providers-CVu8e0xS.js +1 -0
  190. package/dist/{query-DXpxaaTH.js → query-Bb3SYICk.js} +3 -3
  191. package/dist/{query-DXpxaaTH.js.map → query-Bb3SYICk.js.map} +1 -1
  192. package/dist/query-DIfkUcPh.js +1 -0
  193. package/dist/{questions-C_Y-oXW6.js → questions-CWlR9ffu.js} +41 -11
  194. package/dist/questions-CWlR9ffu.js.map +1 -0
  195. package/dist/{record-DhzwkSXc.js → record-6IUzwP9K.js} +5 -3
  196. package/dist/record-6IUzwP9K.js.map +1 -0
  197. package/dist/{redact-BEEGc37e.js → redact-BhjtnjrU.js} +11 -7
  198. package/dist/redact-BhjtnjrU.js.map +1 -0
  199. package/dist/remarks-CAvTSq16.js +1 -0
  200. package/dist/{remarks-0EXMh6AD.js → remarks-D9Lcd1fF.js} +3 -2
  201. package/dist/remarks-D9Lcd1fF.js.map +1 -0
  202. package/dist/remarks-DPCONFxZ.js +138 -0
  203. package/dist/remarks-DPCONFxZ.js.map +1 -0
  204. package/dist/{remarks-E4rpi8Ym.js → remarks-vtkPmQb9.js} +327 -41
  205. package/dist/remarks-vtkPmQb9.js.map +1 -0
  206. package/dist/{remote-DZ00A8V_.js → remote-BgYWqogI.js} +6 -6
  207. package/dist/{remote-DZ00A8V_.js.map → remote-BgYWqogI.js.map} +1 -1
  208. package/dist/{resolve-B_JlQ0La.js → resolve-Do0ZaYH6.js} +11 -10
  209. package/dist/resolve-Do0ZaYH6.js.map +1 -0
  210. package/dist/resolve-amw_2Odz.js +1 -0
  211. package/dist/{results-BMJHaQbi.js → results-JyuM64gy.js} +7 -7
  212. package/dist/{results-BMJHaQbi.js.map → results-JyuM64gy.js.map} +1 -1
  213. package/dist/resume-AW5oXzUc.js +691 -0
  214. package/dist/resume-AW5oXzUc.js.map +1 -0
  215. package/dist/retry-ChzISxmy.js +105 -0
  216. package/dist/retry-ChzISxmy.js.map +1 -0
  217. package/dist/{runtime-CSZ1hjlN.js → runtime-BpW1f1Mx.js} +26 -7
  218. package/dist/runtime-BpW1f1Mx.js.map +1 -0
  219. package/dist/sandbox/boat.d.ts +26 -0
  220. package/dist/sandbox/boat.js +37 -0
  221. package/dist/sandbox/boat.js.map +1 -0
  222. package/dist/{sandbox-B5W8lLL1.js → sandbox-kSgr7vo5.js} +31 -3
  223. package/dist/sandbox-kSgr7vo5.js.map +1 -0
  224. package/dist/sandbox.d.ts +20 -2
  225. package/dist/sandbox.js +1 -1
  226. package/dist/server-2_gUnVvf.js +1 -0
  227. package/dist/{server-BfN6q2lH.js → server-Cn8VqO9S.js} +10 -10
  228. package/dist/{server-BfN6q2lH.js.map → server-Cn8VqO9S.js.map} +1 -1
  229. package/dist/{shared-ogqPJ0uo.js → shared-Cfi45Bvy.js} +9 -2
  230. package/dist/shared-Cfi45Bvy.js.map +1 -0
  231. package/dist/slug-IHh3f770.js +136 -0
  232. package/dist/slug-IHh3f770.js.map +1 -0
  233. package/dist/source-CY3etKzw.js +1 -0
  234. package/dist/{source-BD6Bg0Tr.js → source-CYOhR98B.js} +2 -2
  235. package/dist/{source-BD6Bg0Tr.js.map → source-CYOhR98B.js.map} +1 -1
  236. package/dist/src-6Zzyg4Qd.js +2 -0
  237. package/dist/{src-BC2WXULN.js → src-BDhcPtnI.js} +2 -2
  238. package/dist/{src-B-L8O1Ld.js → src-BNQznj4z.js} +2 -2
  239. package/dist/{src-B-L8O1Ld.js.map → src-BNQznj4z.js.map} +1 -1
  240. package/dist/src-BRMsk9nh.js +2 -0
  241. package/dist/{src-Dp-fWOfG.js → src-CV_7DkPa.js} +47 -45
  242. package/dist/{src-Dp-fWOfG.js.map → src-CV_7DkPa.js.map} +1 -1
  243. package/dist/{src-KlDOGD0B.js → src-Cb2MWozp.js} +3 -1
  244. package/dist/{src-KlDOGD0B.js.map → src-Cb2MWozp.js.map} +1 -1
  245. package/dist/{src-Cpy9MNS3.js → src-Ck2r_EMT.js} +617 -74
  246. package/dist/src-Ck2r_EMT.js.map +1 -0
  247. package/dist/{src-HTG2SoNz.js → src-DAzaCTcN.js} +2 -2
  248. package/dist/{src-HTG2SoNz.js.map → src-DAzaCTcN.js.map} +1 -1
  249. package/dist/src-DB7N8TYJ.js +2 -0
  250. package/dist/src-DPDaAYwh.js +2 -0
  251. package/dist/{src-Cx0HJIJ-.js → src-Dbk19BiP.js} +2 -2
  252. package/dist/src-DtodMT59.js +1 -0
  253. package/dist/{src-uluei5nU.js → src-DvGns8cz.js} +2 -2
  254. package/dist/{src-uluei5nU.js.map → src-DvGns8cz.js.map} +1 -1
  255. package/dist/{src-B_igzM1O.js → src-Dw79VLa3.js} +3 -1
  256. package/dist/{src-B_igzM1O.js.map → src-Dw79VLa3.js.map} +1 -1
  257. package/dist/{src-D5t4OiRt.js → src-KxS91P7L.js} +3 -1
  258. package/dist/{src-D5t4OiRt.js.map → src-KxS91P7L.js.map} +1 -1
  259. package/dist/src-T-OeuJLr.js +2 -0
  260. package/dist/{src-BvM0jWuZ.js → src-YvblOrBU.js} +2 -2
  261. package/dist/{src-BvM0jWuZ.js.map → src-YvblOrBU.js.map} +1 -1
  262. package/dist/src-zntEDlnx.js +3 -0
  263. package/dist/{state-CdSjXIfE.js → state-BOLt8pJg.js} +17 -17
  264. package/dist/{state-CdSjXIfE.js.map → state-BOLt8pJg.js.map} +1 -1
  265. package/dist/state-kimtIhBP.js +1 -0
  266. package/dist/{stats-D-Gqwqt0.js → stats-C18W4xPX.js} +63 -8
  267. package/dist/stats-C18W4xPX.js.map +1 -0
  268. package/dist/suite-CKBa6MKt.js +2 -0
  269. package/dist/suite-COglUhPd.js +1272 -0
  270. package/dist/suite-COglUhPd.js.map +1 -0
  271. package/dist/summary-DU5zaibx.js +148 -0
  272. package/dist/summary-DU5zaibx.js.map +1 -0
  273. package/dist/tart-BTVXp8rz.js +373 -0
  274. package/dist/tart-BTVXp8rz.js.map +1 -0
  275. package/dist/tart-cli-BIC9HqPg.js +37 -0
  276. package/dist/tart-cli-BIC9HqPg.js.map +1 -0
  277. package/dist/tart-cli-BMrkmBjI.js +1 -0
  278. package/dist/tart-images-DZ_Mbh-g.js +233 -0
  279. package/dist/tart-images-DZ_Mbh-g.js.map +1 -0
  280. package/dist/tart-ref-7Qv3cm3B.js +1 -0
  281. package/dist/tart-ref-DYZijjrU.js +55 -0
  282. package/dist/tart-ref-DYZijjrU.js.map +1 -0
  283. package/dist/testing.d.ts +47 -37
  284. package/dist/testing.js +4 -4
  285. package/dist/{text-D--Q5KsA.js → text-B8-W3Cvn.js} +2 -4
  286. package/dist/{text-D--Q5KsA.js.map → text-B8-W3Cvn.js.map} +1 -1
  287. package/dist/trace-Dx2NBE1O.js +311 -0
  288. package/dist/trace-Dx2NBE1O.js.map +1 -0
  289. package/dist/traits-DKnYkqeK.js +66 -0
  290. package/dist/traits-DKnYkqeK.js.map +1 -0
  291. package/dist/{transcript-C_IpYMRk.js → transcript-CCf07UmU.js} +3 -3
  292. package/dist/{transcript-C_IpYMRk.js.map → transcript-CCf07UmU.js.map} +1 -1
  293. package/dist/{types-C4OkYhZg.js → types-C2mLpph3.js} +3 -2
  294. package/dist/types-C2mLpph3.js.map +1 -0
  295. package/dist/{types-BHR1lGPh.d.ts → types-DBwFsGem.d.ts} +420 -136
  296. package/dist/{judge-ByEUlzOM.js → vercel-CGlSBv63.js} +3 -229
  297. package/dist/vercel-CGlSBv63.js.map +1 -0
  298. package/dist/{vertex-6uSpZ5L8.js → vertex-Eb2wqahk.js} +5 -2
  299. package/dist/vertex-Eb2wqahk.js.map +1 -0
  300. package/dist/vertex-O88TCwgY.js +1 -0
  301. package/dist/view/index.d.ts +238 -90
  302. package/dist/view/index.js +11 -9
  303. package/dist/{views-CKoN5NAx.js → views-DAIiLiV3.js} +8 -7
  304. package/dist/views-DAIiLiV3.js.map +1 -0
  305. package/dist/views-DtRhj2Tn.js +2 -0
  306. package/dist/{worker-entry-D5dB8cgT.js → worker-entry-BIROTPX1.js} +11 -8
  307. package/dist/{worker-entry-D5dB8cgT.js.map → worker-entry-BIROTPX1.js.map} +1 -1
  308. package/dist/workspace-CcQRT31C.js +1 -0
  309. package/dist/{workspace-Cho30qlM.js → workspace-uuE51x35.js} +7 -7
  310. package/dist/{workspace-Cho30qlM.js.map → workspace-uuE51x35.js.map} +1 -1
  311. package/package.json +26 -11
  312. package/skills/eval-rubric/SKILL.md +31 -4
  313. package/dist/adapter-DyvDj4ZN.js.map +0 -1
  314. package/dist/app-files-hpRT5lj_.js.map +0 -1
  315. package/dist/assemble-DTXwCL3m.js +0 -1
  316. package/dist/assemble-Dlh6Xv3U.js.map +0 -1
  317. package/dist/capture-BT2fAmpZ.js +0 -1
  318. package/dist/capture-Bdcx9Gap.js.map +0 -1
  319. package/dist/cli-CGd51thd.js.map +0 -1
  320. package/dist/cli-spec-ChkleEVm.js.map +0 -1
  321. package/dist/client-CF-DOjOU.js.map +0 -1
  322. package/dist/command-CsfcwMyc.js.map +0 -1
  323. package/dist/command-CyIb9BSC.js.map +0 -1
  324. package/dist/command-TLmY-rYp.js.map +0 -1
  325. package/dist/commands-C54S45d7.js.map +0 -1
  326. package/dist/config-ImY6AlRE.js.map +0 -1
  327. package/dist/context-BajfiH0S.js.map +0 -1
  328. package/dist/contrasts-DtSX8E_V.js +0 -101
  329. package/dist/contrasts-DtSX8E_V.js.map +0 -1
  330. package/dist/cost-CMzY9VXv.js +0 -1
  331. package/dist/db-ZIk6S2CD.js +0 -2
  332. package/dist/db-sHGpaLo9.js.map +0 -1
  333. package/dist/debug-BnXV7JbX.js +0 -1
  334. package/dist/default-effort-BZRa-SQP.js.map +0 -1
  335. package/dist/dist-ByYk_wAs.js.map +0 -1
  336. package/dist/docker--2ytOHcu.js.map +0 -1
  337. package/dist/doctor-eE65YpEv.js.map +0 -1
  338. package/dist/environment-Cy3FVLR5.js.map +0 -1
  339. package/dist/eval-source-BTsTRiBW.js.map +0 -1
  340. package/dist/evaluate-CFFdyYZX.js.map +0 -1
  341. package/dist/evaluate-DnGOaGQc.d.ts +0 -43
  342. package/dist/files-B3d-8Fe0.js +0 -1
  343. package/dist/files-COW5JBJM.js +0 -1
  344. package/dist/files-Do4Rp3yZ.js +0 -1
  345. package/dist/files-p-uTdOjA.js.map +0 -1
  346. package/dist/gate-BoDKeuJu.js.map +0 -1
  347. package/dist/harness-Ch2P81sx.js.map +0 -1
  348. package/dist/ids-DuK6xl4w.js.map +0 -1
  349. package/dist/images-BVZHDf_z.js.map +0 -1
  350. package/dist/init-BWnMbUnc.js.map +0 -1
  351. package/dist/init-s1jN-PCI.js +0 -1
  352. package/dist/judge-ByEUlzOM.js.map +0 -1
  353. package/dist/live-DmJix4c8.js +0 -1
  354. package/dist/live-d_5a5iUv.js.map +0 -1
  355. package/dist/model-8uZBYqV5.js +0 -1
  356. package/dist/model-DOiCiMCD.js.map +0 -1
  357. package/dist/node-CwP1G178.js.map +0 -1
  358. package/dist/opencode-providers-yNKyXD49.js.map +0 -1
  359. package/dist/plan-CIfOFhth.js.map +0 -1
  360. package/dist/plugins-BEs2Am3L.js.map +0 -1
  361. package/dist/preflight-50Qw5e5K.js.map +0 -1
  362. package/dist/provenance-Cc8fFE7Z.js.map +0 -1
  363. package/dist/provider-DCdTHQpk.js +0 -1
  364. package/dist/providers-CP_bBtYm.js +0 -1
  365. package/dist/providers-DZSTlC9R.js.map +0 -1
  366. package/dist/query-kFPuqBv1.js +0 -1
  367. package/dist/questions-C_Y-oXW6.js.map +0 -1
  368. package/dist/record-DhzwkSXc.js.map +0 -1
  369. package/dist/redact-BEEGc37e.js.map +0 -1
  370. package/dist/remarks-0EXMh6AD.js.map +0 -1
  371. package/dist/remarks-BL18Id09.js +0 -1
  372. package/dist/remarks-DeZZT8PK.js +0 -116
  373. package/dist/remarks-DeZZT8PK.js.map +0 -1
  374. package/dist/remarks-E4rpi8Ym.js.map +0 -1
  375. package/dist/resolve-BJSay360.js +0 -1
  376. package/dist/resolve-B_JlQ0La.js.map +0 -1
  377. package/dist/resume-CexsWuGK.js +0 -434
  378. package/dist/resume-CexsWuGK.js.map +0 -1
  379. package/dist/runtime-CSZ1hjlN.js.map +0 -1
  380. package/dist/sandbox-B5W8lLL1.js.map +0 -1
  381. package/dist/server-SBzrf35T.js +0 -1
  382. package/dist/shared-ogqPJ0uo.js.map +0 -1
  383. package/dist/source-Dn1uqPon.js +0 -1
  384. package/dist/src-BKDZO3ra.js +0 -2
  385. package/dist/src-BxrHipV0.js +0 -3
  386. package/dist/src-C9elednc.js +0 -2
  387. package/dist/src-CM7xdJFA.js +0 -2
  388. package/dist/src-CWEGknZo.js +0 -2
  389. package/dist/src-Cpy9MNS3.js.map +0 -1
  390. package/dist/src-DVaAKCsH.js +0 -1
  391. package/dist/src-DurP--_D.js +0 -2
  392. package/dist/state-Cicc9Oa5.js +0 -1
  393. package/dist/stats-D-Gqwqt0.js.map +0 -1
  394. package/dist/suite-BYJ2Q0S-.js +0 -2
  395. package/dist/suite-BtHPBFYL.js +0 -544
  396. package/dist/suite-BtHPBFYL.js.map +0 -1
  397. package/dist/summary-zP3cCXDN.js.map +0 -1
  398. package/dist/types-C4OkYhZg.js.map +0 -1
  399. package/dist/vertex-6uSpZ5L8.js.map +0 -1
  400. package/dist/vertex-BaAz44YN.js +0 -1
  401. package/dist/views-CKoN5NAx.js.map +0 -1
  402. package/dist/views-CmyX255j.js +0 -2
  403. package/dist/workspace-Dw9DEZox.js +0 -1
@@ -0,0 +1,691 @@
1
+ import { n as UsageError } from "./errors-ttMTnIYX.js";
2
+ import { t as RUN_ID } from "./paths-Dwmi7L4X.js";
3
+ import { o as recordFileName, s as relativeFile } from "./ids-C_advdJA.js";
4
+ import { c as readableInvocation, l as readableLiveProgress, n as LIVE_FILE, o as liveCounts } from "./live-CgYbO4Te.js";
5
+ import { p as scratchDir } from "./files-Cl7BQ5gE.js";
6
+ import { t as RefError } from "./views-DAIiLiV3.js";
7
+ import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
8
+ import { hostname } from "node:os";
9
+ import { isAbsolute, join, resolve } from "node:path";
10
+ import { readFile, readdir, stat } from "node:fs/promises";
11
+ function finished$1(result) {
12
+ const outcome = result.meta?.outcome;
13
+ if (result.state === "skipped") return outcome === "fail" || outcome === "infra_error" ? outcome : "skipped";
14
+ if (outcome === "infra_error") return "infra_error";
15
+ return result.state === "passed" ? "pass" : "fail";
16
+ }
17
+ /** Sharing-violation codes Windows uses while a reader has `to` open. */
18
+ const BUSY = /* @__PURE__ */ new Set([
19
+ "EPERM",
20
+ "EACCES",
21
+ "EBUSY"
22
+ ]);
23
+ /** How long a busy rename is retried. A studio poll holds the file for a few milliseconds. */
24
+ const BUSY_MS = 1e3;
25
+ function pause(ms) {
26
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
27
+ }
28
+ /**
29
+ * Renames `from` over `to`. Windows refuses while a reader (`reeval studio`) has `to` open, for a
30
+ * moment: try again for up to a second rather than drop the update.
31
+ */
32
+ function replace(from, to, rename = renameSync, hooks = {}) {
33
+ const now = hooks.now ?? Date.now;
34
+ const wait = hooks.wait ?? pause;
35
+ const deadline = now() + (hooks.busyMs ?? BUSY_MS);
36
+ for (let attempt = 1;; attempt++) try {
37
+ rename(from, to);
38
+ return;
39
+ } catch (error) {
40
+ const code = error.code;
41
+ if (!code || !BUSY.has(code) || now() >= deadline) throw error;
42
+ wait(Math.min(attempt, 32));
43
+ }
44
+ }
45
+ /** Writes the file at once, then on every change and heartbeat. Write errors never fail the run. */
46
+ function writeLiveProgress(options) {
47
+ const now = options.now ?? (() => /* @__PURE__ */ new Date());
48
+ const file = join(options.dir, LIVE_FILE);
49
+ const tmp = `${file}.${process.pid}.tmp`;
50
+ const kept = options.kept ?? /* @__PURE__ */ new Map();
51
+ const attempts = new Map(options.planned.map((p) => {
52
+ const was = kept.get(p.key);
53
+ return [p.key, {
54
+ key: p.key,
55
+ evalId: p.id,
56
+ name: p.attempt.name,
57
+ file: p.file,
58
+ cell: p.attempt.cell.key,
59
+ n: p.attempt.n,
60
+ status: was?.outcome ?? (p.attempt.skip || p.attempt.plan.skip ? "skipped" : "queued"),
61
+ startedAt: was?.startedAt ?? null,
62
+ durationMs: was?.durationMs ?? null
63
+ }];
64
+ }));
65
+ for (const l of options.leftOut ?? []) {
66
+ if (attempts.has(l.key)) continue;
67
+ const was = kept.get(l.key);
68
+ attempts.set(l.key, {
69
+ key: l.key,
70
+ evalId: l.evalId,
71
+ name: l.name,
72
+ file: l.file,
73
+ cell: l.cell,
74
+ n: l.n,
75
+ status: l.done && was?.outcome || "skipped",
76
+ startedAt: was?.startedAt ?? null,
77
+ durationMs: was?.durationMs ?? null
78
+ });
79
+ }
80
+ let phase = "running";
81
+ let stopped = false;
82
+ const read = () => {
83
+ const list = [...attempts.values()];
84
+ return {
85
+ schemaVersion: 1,
86
+ runId: options.runId,
87
+ startedAt: options.startedAt.toISOString(),
88
+ pid: process.pid,
89
+ host: hostname(),
90
+ heartbeatAt: now().toISOString(),
91
+ phase,
92
+ planned: list.length,
93
+ counts: liveCounts(list),
94
+ attempts: list,
95
+ ...options.invocation ? { invocation: options.invocation } : {}
96
+ };
97
+ };
98
+ const write = () => {
99
+ if (stopped) return;
100
+ try {
101
+ writeFileSync(tmp, JSON.stringify(read()));
102
+ replace(tmp, file);
103
+ } catch {}
104
+ };
105
+ try {
106
+ mkdirSync(options.dir, { recursive: true });
107
+ } catch {}
108
+ write();
109
+ const heartbeat = setInterval(write, options.heartbeatMs ?? 2e3);
110
+ heartbeat.unref();
111
+ const stop = () => {
112
+ stopped = true;
113
+ clearInterval(heartbeat);
114
+ };
115
+ return {
116
+ start(key, at) {
117
+ const a = attempts.get(key);
118
+ if (!a) return;
119
+ a.status = "running";
120
+ a.startedAt = new Date(at).toISOString();
121
+ write();
122
+ },
123
+ end(result) {
124
+ const a = attempts.get(result.key);
125
+ if (!a || kept.has(result.key) && result.state === "skipped") return;
126
+ a.status = finished$1(result);
127
+ a.durationMs = result.durationMs;
128
+ write();
129
+ },
130
+ phase(next) {
131
+ phase = next;
132
+ write();
133
+ },
134
+ stop,
135
+ remove() {
136
+ stop();
137
+ rmSync(file, { force: true });
138
+ rmSync(tmp, { force: true });
139
+ },
140
+ read
141
+ };
142
+ }
143
+ // src/resume.ts
144
+ /** Other-host / studio: a heartbeat older than this is quiet. A live pid on this host is not. */
145
+ const STALE_MS = 15e3;
146
+ /** Exclusive claim in staging so two CLIs cannot resume the same id through the plan window. */
147
+ const HOLDER_FILE = "holder";
148
+ /** `.reeval/current`: the run id, written when the run starts (after the plan). */
149
+ const currentPath = (root) => join(root, ".reeval", "current");
150
+ const stagingOf = (root, runId) => join(root, ".reeval", "staging", runId);
151
+ function writeCurrent(root, runId) {
152
+ const file = currentPath(root);
153
+ mkdirSync(join(root, ".reeval"), { recursive: true });
154
+ const tmp = `${file}.${process.pid}.tmp`;
155
+ writeFileSync(tmp, `${runId}\n`);
156
+ try {
157
+ replace(tmp, file);
158
+ } catch (error) {
159
+ rmSync(tmp, { force: true });
160
+ throw error;
161
+ }
162
+ }
163
+ const stillRunning = (runId, flag = "--resume") => new UsageError(flag === "--resume" ? `run ${runId} is still running. Wait for it to finish or stop, then reeval run --resume ${runId}.` : `run ${runId} is still running. Wait for it to finish, then reeval run --retry-errors ${runId}; if it stops before then, reeval run --resume ${runId} finishes it and retries its infra errors.`);
164
+ /** Same host only: `kill(pid, 0)`. Another host cannot be probed. */
165
+ function processAlive(pid, host) {
166
+ if (host !== hostname()) return false;
167
+ try {
168
+ process.kill(pid, 0);
169
+ return true;
170
+ } catch (error) {
171
+ return error.code !== "ESRCH";
172
+ }
173
+ }
174
+ function readHolder(dir) {
175
+ try {
176
+ const [pidLine, hostLine] = readFileSync(join(dir, HOLDER_FILE), "utf8").split("\n");
177
+ const pid = Number(pidLine);
178
+ if (!Number.isInteger(pid) || pid <= 0 || !hostLine) return null;
179
+ return {
180
+ pid,
181
+ host: hostLine
182
+ };
183
+ } catch {
184
+ return null;
185
+ }
186
+ }
187
+ const holderLive = (dir) => {
188
+ const holder = readHolder(dir);
189
+ return holder ? processAlive(holder.pid, holder.host) : false;
190
+ };
191
+ /** This process holds the run's staging. */
192
+ const holdsStaging = (staging) => {
193
+ const holder = readHolder(staging);
194
+ return holder?.pid === process.pid && holder.host === hostname();
195
+ };
196
+ function acquireHolder(staging, runId, flag) {
197
+ const file = join(staging, HOLDER_FILE);
198
+ const body = `${process.pid}\n${hostname()}\n`;
199
+ const create = () => writeFileSync(file, body, { flag: "wx" });
200
+ try {
201
+ create();
202
+ return;
203
+ } catch (error) {
204
+ if (error.code !== "EEXIST") throw error;
205
+ }
206
+ if (holderLive(staging)) throw stillRunning(runId, flag);
207
+ try {
208
+ unlinkSync(file);
209
+ } catch {
210
+ throw stillRunning(runId, flag);
211
+ }
212
+ try {
213
+ create();
214
+ } catch (error) {
215
+ if (error.code === "EEXIST") throw stillRunning(runId, flag);
216
+ throw error;
217
+ }
218
+ }
219
+ function readCurrent(root) {
220
+ try {
221
+ const id = readFileSync(currentPath(root), "utf8").trim();
222
+ return RUN_ID.test(id) ? id : null;
223
+ } catch {
224
+ return null;
225
+ }
226
+ }
227
+ /** Finished with a real outcome: not queued, not skipped, not a cancel abort. */
228
+ function isCompletedAttempt(outcome, error) {
229
+ if (outcome === "skipped") return false;
230
+ if (error?.kind === "aborted") return false;
231
+ return outcome === "pass" || outcome === "fail" || outcome === "infra_error";
232
+ }
233
+ /** Completed with a result a resume keeps, a pass or a fail; an infra error runs again. */
234
+ function isKeptAttempt(outcome, error) {
235
+ return outcome !== "infra_error" && isCompletedAttempt(outcome, error);
236
+ }
237
+ const keptFromRecord = (record) => record.evals.flatMap((e) => e.attempts.filter((a) => isKeptAttempt(a.outcome, a.error)).map((a) => a.key));
238
+ function readEvalRecord(path) {
239
+ try {
240
+ return JSON.parse(readFileSync(path, "utf8"));
241
+ } catch {
242
+ return null;
243
+ }
244
+ }
245
+ function stagingRecordComplete(staging, key, done = isCompletedAttempt) {
246
+ const record = readEvalRecord(join(staging, "evals", recordFileName(key)));
247
+ if (!record) return false;
248
+ return done(record.outcome, record.error);
249
+ }
250
+ /**
251
+ * Attempt keys that already passed or failed in `staging` or in the previous record, so a
252
+ * resume skips them and runs the rest, infra errors included.
253
+ */
254
+ function completedKeysFor(planned, staging, previous) {
255
+ const keys = /* @__PURE__ */ new Set();
256
+ const fromPrevious = new Set(previous ? keptFromRecord(previous) : []);
257
+ for (const { key } of planned) if (stagingRecordComplete(staging, key, isKeptAttempt) || fromPrevious.has(key)) keys.add(key);
258
+ return keys;
259
+ }
260
+ /** In staging: each attempt's earlier infra errors, by key, kept as the attempts run again. */
261
+ const RETRIES_FILE = "retries.json";
262
+ function readRetries(staging) {
263
+ try {
264
+ const parsed = JSON.parse(readFileSync(join(staging, RETRIES_FILE), "utf8"));
265
+ return new Map(Object.entries(parsed));
266
+ } catch {
267
+ return /* @__PURE__ */ new Map();
268
+ }
269
+ }
270
+ /**
271
+ * The planned attempts that ended in an infra error, in staging or the previous record, and so
272
+ * run again; and each one's earlier errors, which `retries.json` keeps once `write` is set, so
273
+ * the record still has them after the worker replaces the attempt's staged record.
274
+ */
275
+ function noteRetries(planned, staging, previous, write) {
276
+ const retries = readRetries(staging);
277
+ const errored = /* @__PURE__ */ new Set();
278
+ const add = (key, retry) => {
279
+ const list = retries.get(key) ?? [];
280
+ const same = (r) => r.at === retry.at && r.error.message === retry.error.message;
281
+ if (!list.some(same)) list.push(retry);
282
+ retries.set(key, list);
283
+ };
284
+ for (const { key } of planned) {
285
+ const was = previousAttempt(previous, key);
286
+ if (was?.retries?.length && !retries.has(key)) retries.set(key, [...was.retries]);
287
+ const staged = readEvalRecord(join(staging, "evals", recordFileName(key)));
288
+ const last = staged ?? (was ? {
289
+ outcome: was.outcome,
290
+ error: was.error
291
+ } : null);
292
+ if (last?.outcome !== "infra_error" || !last.error || last.error.kind === "aborted") continue;
293
+ errored.add(key);
294
+ add(key, {
295
+ error: last.error,
296
+ at: staged?.startedAt ?? was?.startedAt ?? null
297
+ });
298
+ }
299
+ if (write && retries.size) {
300
+ mkdirSync(staging, { recursive: true });
301
+ writeFileSync(join(staging, RETRIES_FILE), `${JSON.stringify(Object.fromEntries(retries))}\n`);
302
+ }
303
+ return {
304
+ errored,
305
+ retries
306
+ };
307
+ }
308
+ /**
309
+ * The attempts the run planned, from the previous record and the progress file a quit left,
310
+ * that this resume's plan leaves out. The record keeps them, so the run stays incomplete until
311
+ * a resume runs the ones that aren't done. A todo or a declared skip, in the previous record or
312
+ * `declared` (the ids this resume collected as `.skip` or `.todo`), never runs, so it's done.
313
+ */
314
+ function leftOutAttempts(planned, staging, previous, live, declared = /* @__PURE__ */ new Set()) {
315
+ const now = new Set(planned.map((p) => p.key));
316
+ const found = /* @__PURE__ */ new Map();
317
+ const add = (a, finished) => {
318
+ if (now.has(a.key) || found.has(a.key)) return;
319
+ const done = finished || declared.has(a.evalId) || stagingRecordComplete(staging, a.key);
320
+ found.set(a.key, {
321
+ ...a,
322
+ done
323
+ });
324
+ };
325
+ for (const e of previous?.evals ?? []) for (const a of e.attempts) add({
326
+ key: a.key,
327
+ evalId: e.id,
328
+ name: e.name,
329
+ file: e.file,
330
+ cell: a.cell,
331
+ n: a.n
332
+ }, e.todo || e.skip === true || isCompletedAttempt(a.outcome, a.error));
333
+ for (const a of live) add(a, false);
334
+ return [...found.values()];
335
+ }
336
+ /** The attempts in a stopped run's progress file, or none. */
337
+ async function liveAttempts(staging) {
338
+ const text = await readFile(join(staging, LIVE_FILE), "utf8").catch(() => null);
339
+ try {
340
+ return (text ? readableLiveProgress(JSON.parse(text))?.attempts : null) ?? [];
341
+ } catch {
342
+ return [];
343
+ }
344
+ }
345
+ /**
346
+ * How each completed attempt finished, for the progress file: from the previous assemble when it
347
+ * has the attempt (as the record keeps it), else from its staged record, which has no duration.
348
+ */
349
+ function keptAttempts(completed, staging, previous) {
350
+ const kept = /* @__PURE__ */ new Map();
351
+ for (const key of completed) {
352
+ const was = previousAttempt(previous, key);
353
+ if (was && was.outcome !== "skipped" && isCompletedAttempt(was.outcome, was.error)) {
354
+ kept.set(key, {
355
+ outcome: was.outcome,
356
+ startedAt: was.startedAt,
357
+ durationMs: was.durationMs
358
+ });
359
+ continue;
360
+ }
361
+ const record = readEvalRecord(join(staging, "evals", recordFileName(key)));
362
+ if (!record || !isCompletedAttempt(record.outcome, record.error)) continue;
363
+ kept.set(key, {
364
+ outcome: record.outcome,
365
+ startedAt: record.startedAt ?? null,
366
+ durationMs: null
367
+ });
368
+ }
369
+ return kept;
370
+ }
371
+ function progressLive(progress, now) {
372
+ if (processAlive(progress.pid, progress.host)) return true;
373
+ if (now - Date.parse(progress.heartbeatAt) > STALE_MS) return false;
374
+ return progress.host !== hostname();
375
+ }
376
+ async function readScratch(root, runId) {
377
+ try {
378
+ const text = await readFile(join(scratchDir(root), `${runId}.json`), "utf8");
379
+ const record = JSON.parse(text);
380
+ return record.kind === "reeval-run" && record.runId === runId ? record : null;
381
+ } catch {
382
+ return null;
383
+ }
384
+ }
385
+ async function listCandidates(root, now = Date.now()) {
386
+ const found = /* @__PURE__ */ new Map();
387
+ const stagingRoot = join(root, ".reeval", "staging");
388
+ const names = await readdir(stagingRoot).catch(() => []);
389
+ for (const runId of names.filter((n) => RUN_ID.test(n))) {
390
+ const dir = join(stagingRoot, runId);
391
+ const info = await stat(dir).catch(() => null);
392
+ if (!info?.isDirectory()) continue;
393
+ const text = await readFile(join(dir, LIVE_FILE), "utf8").catch(() => null);
394
+ const progress = text ? readableLiveProgress(JSON.parse(text)) : null;
395
+ const live = (progress ? progressLive(progress, now) : false) || holderLive(dir);
396
+ const startedAt = progress?.startedAt ?? new Date(info.mtimeMs).toISOString();
397
+ found.set(runId, {
398
+ runId,
399
+ startedAt,
400
+ kind: "staging",
401
+ live,
402
+ complete: false,
403
+ previous: null,
404
+ previousArtifacts: null,
405
+ record: null,
406
+ artifacts: null
407
+ });
408
+ }
409
+ const scratch = scratchDir(root);
410
+ const records = (await readdir(scratch).catch(() => [])).filter((n) => n.endsWith(".json") && RUN_ID.test(n.slice(0, -5)));
411
+ for (const name of records) {
412
+ const runId = name.slice(0, -5);
413
+ const record = await readScratch(root, runId);
414
+ if (!record) continue;
415
+ const artifacts = join(scratch, runId);
416
+ const previousArtifacts = existsSync(artifacts) ? artifacts : null;
417
+ const complete = record.status === "complete";
418
+ const existing = found.get(runId);
419
+ if (existing) {
420
+ existing.previous = record;
421
+ existing.previousArtifacts = previousArtifacts;
422
+ existing.complete = complete;
423
+ existing.record = record;
424
+ existing.artifacts = previousArtifacts;
425
+ continue;
426
+ }
427
+ found.set(runId, {
428
+ runId,
429
+ startedAt: record.startedAt,
430
+ kind: "scratch",
431
+ live: false,
432
+ complete,
433
+ previous: complete ? null : record,
434
+ previousArtifacts: complete ? null : previousArtifacts,
435
+ record,
436
+ artifacts: previousArtifacts
437
+ });
438
+ }
439
+ return [...found.values()].sort((a, b) => a.runId < b.runId ? -1 : 1);
440
+ }
441
+ const resumable = (c) => !c.live && !c.complete && (c.kind === "staging" || c.previous?.status === "interrupted" || c.previous?.status === "budget");
442
+ function toTarget(c) {
443
+ return {
444
+ runId: c.runId,
445
+ startedAt: new Date(c.startedAt),
446
+ kind: c.kind,
447
+ previous: c.previous,
448
+ previousArtifacts: c.previousArtifacts
449
+ };
450
+ }
451
+ function matchRef(candidates, ref) {
452
+ const exact = candidates.find((c) => c.runId === ref);
453
+ if (exact) return exact;
454
+ const byId = candidates.filter((c) => c.runId.startsWith(ref));
455
+ if (byId.length === 1) return byId[0];
456
+ if (byId.length > 1) throw new RefError(`"${ref}" matches ${byId.length} runs: use more of the id`);
457
+ }
458
+ /**
459
+ * `--resume` with no ref (or `latest`): the newest Stopped staging directory, or an
460
+ * `interrupted` / `budget` scratch. A pointer at `.reeval/current` wins when it still names
461
+ * one of those. A live pid (or a holder this process did not steal) is still running: omitted
462
+ * `--resume` names that id instead of "No resumable run". `--resume <ref>` is a run id or
463
+ * unique prefix, not today's assembled `latest` and not a git SHA.
464
+ */
465
+ async function resolveResume(root, ref) {
466
+ const candidates = await listCandidates(root);
467
+ const open = candidates.filter(resumable);
468
+ if (ref === void 0 || ref === "" || ref === "latest") {
469
+ const pointer = readCurrent(root);
470
+ const pick = (pointer ? open.find((c) => c.runId === pointer) : void 0) ?? open.at(-1);
471
+ if (!pick) {
472
+ const liveOnes = candidates.filter((c) => c.live);
473
+ const livePick = (pointer ? liveOnes.find((c) => c.runId === pointer) : void 0) ?? liveOnes.at(-1);
474
+ if (livePick) throw stillRunning(livePick.runId);
475
+ throw new UsageError("No resumable run. A stopped staging directory, or an interrupted or budget-stopped scratch record, can be resumed.");
476
+ }
477
+ return toTarget(pick);
478
+ }
479
+ const back = /^latest~(\d+)$/.exec(ref);
480
+ if (back) {
481
+ const entry = open[open.length - 1 - Number(back[1])];
482
+ if (!entry) throw new RefError(`There ${open.length === 1 ? "is only 1 resumable run" : `are only ${open.length} resumable runs`}, so ${ref} names none. reeval run --resume resumes the newest.`);
483
+ return toTarget(entry);
484
+ }
485
+ const found = matchRef(candidates, ref);
486
+ if (!found) throw new RefError(`No run matches "${ref}". Pass a run id or a unique prefix of one, or leave --resume empty for the newest stopped run.`);
487
+ if (found.live) throw stillRunning(found.runId);
488
+ if (found.complete || !resumable(found)) throw new UsageError(`run ${found.runId} is complete and cannot be resumed. reeval run starts a new run.`);
489
+ return toTarget(found);
490
+ }
491
+ const finished = (c) => !c.live && c.complete && c.record !== null;
492
+ /**
493
+ * `--retry-errors` with no ref (or `latest`): the newest finished run, whose scratch record is
494
+ * `complete`; `latest~N` counts back over those. A ref is a run id or unique prefix, as for
495
+ * `--resume`. A run that didn't finish is left to `--resume`, which retries its infra errors too.
496
+ */
497
+ async function resolveRetry(root, ref) {
498
+ const candidates = await listCandidates(root);
499
+ const done = candidates.filter(finished);
500
+ const target = (c) => ({
501
+ runId: c.runId,
502
+ startedAt: new Date(c.startedAt),
503
+ kind: c.kind,
504
+ previous: c.record,
505
+ previousArtifacts: c.artifacts
506
+ });
507
+ if (ref === void 0 || ref === "" || ref === "latest") {
508
+ const pick = done.at(-1);
509
+ const running = candidates.filter((c) => c.live && (!pick || c.runId > pick.runId)).at(-1);
510
+ if (running) throw new UsageError(`run ${running.runId} is still running, so --retry-errors can't tell which run to retry. Wait for it to finish, or pass the run id.`);
511
+ if (!pick) throw new UsageError("No finished run to retry. --retry-errors re-runs the infra errors of a complete run in .reeval/runs; reeval run --resume continues one that stopped.");
512
+ return target(pick);
513
+ }
514
+ const back = /^latest~(\d+)$/.exec(ref);
515
+ if (back) {
516
+ const entry = done[done.length - 1 - Number(back[1])];
517
+ if (!entry) throw new RefError(`There ${done.length === 1 ? "is only 1 finished run" : `are only ${done.length} finished runs`}, so ${ref} names none. reeval run --retry-errors retries the newest.`);
518
+ return target(entry);
519
+ }
520
+ const found = matchRef(candidates, ref);
521
+ if (!found) throw new RefError(`No run matches "${ref}". Pass a run id or a unique prefix of one, or leave --retry-errors empty for the newest finished run.`);
522
+ if (found.live) throw stillRunning(found.runId, "--retry-errors");
523
+ if (!finished(found)) throw new UsageError(`run ${found.runId} didn't finish. reeval run --resume ${found.runId} runs the rest and retries its infra errors.`);
524
+ return target(found);
525
+ }
526
+ /** The attempts of a run that ended in an infra error (not a cancel). */
527
+ const erroredAttempts = (record) => record.evals.flatMap((e) => e.attempts.filter((a) => a.outcome === "infra_error" && a.error?.kind !== "aborted"));
528
+ /**
529
+ * For a scratch resume: move the assembled record aside so the continuation can write the same
530
+ * id. Staging already in place is left alone.
531
+ */
532
+ async function prepareResume(target, root, { held = false } = {}) {
533
+ const staging = stagingOf(root, target.runId);
534
+ mkdirSync(join(staging, "evals"), { recursive: true });
535
+ if (!(held && holdsStaging(staging))) acquireHolder(staging, target.runId);
536
+ if (!target.previous) return;
537
+ const scratch = scratchDir(root);
538
+ const recordPath = join(scratch, `${target.runId}.json`);
539
+ const aside = join(staging, "previous.json");
540
+ if (existsSync(recordPath) && !existsSync(aside)) renameSync(recordPath, aside);
541
+ if (target.previousArtifacts && existsSync(target.previousArtifacts)) {
542
+ const dest = join(staging, "previous-artifacts");
543
+ if (!existsSync(dest)) renameSync(target.previousArtifacts, dest);
544
+ }
545
+ for (const e of target.previous.evals) for (const a of e.attempts) {
546
+ if (!isCompletedAttempt(a.outcome, a.error)) continue;
547
+ const path = join(staging, "evals", recordFileName(a.key));
548
+ if (existsSync(path)) continue;
549
+ const record = {
550
+ outcome: a.outcome === "skipped" ? "fail" : a.outcome,
551
+ error: a.error,
552
+ startedAt: a.startedAt ?? void 0,
553
+ turns: [],
554
+ diff: null,
555
+ checks: [],
556
+ judgements: [],
557
+ timings: {
558
+ setupMs: 0,
559
+ agentMs: 0,
560
+ diffMs: 0,
561
+ checksMs: 0,
562
+ judgeMs: 0
563
+ }
564
+ };
565
+ writeFileSync(path, `${JSON.stringify(record, null, 2)}\n`);
566
+ }
567
+ }
568
+ /**
569
+ * Holds a retry's run before it collects, so a second retry or resume of it stops as still
570
+ * running rather than racing this one to {@link prepareResume}.
571
+ */
572
+ function holdRetry(target, root) {
573
+ const staging = stagingOf(root, target.runId);
574
+ mkdirSync(join(staging, "evals"), { recursive: true });
575
+ acquireHolder(staging, target.runId, "--retry-errors");
576
+ }
577
+ /**
578
+ * A run a `--retry-errors` stopped during, which a `--resume` finishes as that retry. Its
579
+ * interrupted record lists the retry in `retriedAt`, or a kill stopped the retry before it
580
+ * assembled one: then staging still has the finished record the retry moved aside (only a retry
581
+ * moves a `complete` one), and `began` is when the retry planned, from its `retries.json` (else
582
+ * now), which that record has no entry for. Null for any other run.
583
+ */
584
+ async function stoppedRetry(root, target) {
585
+ if (target.previous?.retriedAt?.length) return { began: null };
586
+ const staging = stagingOf(root, target.runId);
587
+ const { record } = await loadPrevious(staging);
588
+ if (record?.status === "complete") return { began: (await stat(join(staging, "retries.json")).catch(() => null))?.mtime ?? /* @__PURE__ */ new Date() };
589
+ return record?.retriedAt?.length ? { began: null } : null;
590
+ }
591
+ /**
592
+ * Undoes a retry's {@link prepareResume} when it stops before the engine runs: the finished
593
+ * record and its artifacts go back to `.reeval/runs`, and its staging is removed.
594
+ */
595
+ async function restoreRetry(root, runId) {
596
+ const staging = stagingOf(root, runId);
597
+ if (!holdsStaging(staging)) return;
598
+ const scratch = scratchDir(root);
599
+ const aside = join(staging, "previous.json");
600
+ const recordPath = join(scratch, `${runId}.json`);
601
+ if (existsSync(aside) && !existsSync(recordPath)) renameSync(aside, recordPath);
602
+ const artifacts = join(staging, "previous-artifacts");
603
+ if (existsSync(artifacts) && !existsSync(join(scratch, runId))) renameSync(artifacts, join(scratch, runId));
604
+ if (existsSync(recordPath)) rmSync(staging, {
605
+ recursive: true,
606
+ force: true
607
+ });
608
+ }
609
+ async function loadPrevious(staging) {
610
+ const file = join(staging, "previous.json");
611
+ const artifacts = join(staging, "previous-artifacts");
612
+ try {
613
+ const record = JSON.parse(await readFile(file, "utf8"));
614
+ return {
615
+ record: record.kind === "reeval-run" ? record : null,
616
+ artifacts: existsSync(artifacts) ? artifacts : null
617
+ };
618
+ } catch {
619
+ return {
620
+ record: null,
621
+ artifacts: existsSync(artifacts) ? artifacts : null
622
+ };
623
+ }
624
+ }
625
+ /**
626
+ * How the run was first started: from the progress file a quit left, else the record a resume
627
+ * moved aside, else the interrupted or budget-stopped record. Null for a run an older reeval
628
+ * started.
629
+ */
630
+ async function savedInvocation(root, target) {
631
+ const staging = stagingOf(root, target.runId);
632
+ const text = await readFile(join(staging, LIVE_FILE), "utf8").catch(() => null);
633
+ try {
634
+ const live = text ? readableLiveProgress(JSON.parse(text)) : null;
635
+ if (live?.invocation) return live.invocation;
636
+ } catch {}
637
+ const { record } = await loadPrevious(staging);
638
+ return readableInvocation((record ?? target.previous)?.invocation) ?? null;
639
+ }
640
+ /**
641
+ * Filters as a run saves them: a part naming a path on disk (from `cwd`, as the engine reads it),
642
+ * or any absolute part, becomes that path relative to `root` in posix form, `.` for the root
643
+ * itself and `../…` outside it, so no host path is written and a resume resolves it from the
644
+ * root. An absolute part matches files by the start of their path, which the relative form
645
+ * keeps. Other parts are names.
646
+ */
647
+ function savedFilters(root, filters, cwd = process.cwd()) {
648
+ return filters.map((f) => {
649
+ const path = resolve(cwd, f);
650
+ if (!isAbsolute(f) && !existsSync(path)) return f;
651
+ const slash = /[\\/]$/.test(f) ? "/" : "";
652
+ return (relativeFile(root, path) || ".") + slash;
653
+ });
654
+ }
655
+ /**
656
+ * The settings a resume plans with: each one left out is the run's saved one. `--runs` or a
657
+ * profile other than the run's is refused, since it plans other attempts than the ones kept;
658
+ * filters, `--tag` and `--trait` replace the run's for this resume, and `--concurrency` wins with a note.
659
+ * A `--runs` that isn't a count is left for the usual check to refuse. Saved path filters are
660
+ * resolved from `root`, so the resume picks the same files from any directory.
661
+ */
662
+ function resumeSettings(runId, saved, given, { root, env = process.env, flag: continued = "--resume" }) {
663
+ const refuse = (started, flag) => new UsageError(`run ${runId} was started ${started}, and ${continued} finishes the attempts it planned. Leave ${flag} out, or start a new run without ${continued}.`);
664
+ const runs = Number(given.runs);
665
+ const count = Number.isInteger(runs) && runs >= 1;
666
+ if (given.runs !== void 0 && count && runs !== saved.runs) throw refuse(saved.runs === void 0 ? "without --runs" : `with --runs ${saved.runs}`, "--runs");
667
+ const profile = given.profile ?? (env.REEVAL_PROFILE || void 0);
668
+ if (profile !== void 0 && profile !== saved.profile) throw refuse(saved.profile === void 0 ? "without a profile" : `with profile ${saved.profile}`, "--profile and REEVAL_PROFILE");
669
+ const notes = [];
670
+ const concurrency = given.concurrency ?? (env.REEVAL_CONCURRENCY || void 0);
671
+ if (concurrency !== void 0 && saved.concurrency !== void 0) {
672
+ if (Number(concurrency) !== saved.concurrency) notes.push(`concurrency ${concurrency} replaces the ${saved.concurrency} run ${runId} was started with`);
673
+ }
674
+ const settings = {
675
+ ...given,
676
+ filters: given.filters.length ? given.filters : saved.filters.map((f) => existsSync(resolve(root, f)) ? resolve(root, f) : f)
677
+ };
678
+ if (given.runs === void 0 && saved.runs !== void 0) settings.runs = String(saved.runs);
679
+ if (profile === void 0 && saved.profile !== void 0) settings.profile = saved.profile;
680
+ if (concurrency === void 0 && saved.concurrency !== void 0) settings.concurrency = String(saved.concurrency);
681
+ if (!given.tag?.length && saved.tags.length) settings.tag = saved.tags;
682
+ if (!given.trait?.length && saved.traits?.length) settings.trait = saved.traits;
683
+ return {
684
+ settings,
685
+ notes
686
+ };
687
+ }
688
+ const previousAttempt = (previous, key) => previous?.evals.flatMap((e) => e.attempts).find((a) => a.key === key);
689
+ export { writeLiveProgress as S, resumeSettings as _, isKeptAttempt as a, stoppedRetry as b, liveAttempts as c, prepareResume as d, previousAttempt as f, restoreRetry as g, resolveRetry as h, isCompletedAttempt as i, loadPrevious as l, resolveResume as m, erroredAttempts as n, keptAttempts as o, readRetries as p, holdRetry as r, leftOutAttempts as s, completedKeysFor as t, noteRetries as u, savedFilters as v, writeCurrent as x, savedInvocation as y };
690
+
691
+ //# sourceMappingURL=resume-AW5oXzUc.js.map