reeval 0.2.0 → 0.4.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 (224) hide show
  1. package/THIRD_PARTY_NOTICES.md +9 -9
  2. package/assets/package.json +1 -1
  3. package/assets/pnpm-lock.yaml +84 -33
  4. package/dist/agent-C9dLMCM7.js +334 -0
  5. package/dist/agent-C9dLMCM7.js.map +1 -0
  6. package/dist/{agent-D-6z0Z3F.js → agent-M70OWyfG.js} +5 -5
  7. package/dist/{agent-D-6z0Z3F.js.map → agent-M70OWyfG.js.map} +1 -1
  8. package/dist/analysis-CxSCt1YY.js.map +1 -1
  9. package/dist/{assemble-DtouO0iQ.js → assemble-BmVT26kf.js} +25 -17
  10. package/dist/assemble-BmVT26kf.js.map +1 -0
  11. package/dist/assemble-DZiN1p_E.js +2 -0
  12. package/dist/{attempt-BdRQ9jKX.js → attempt-CGPV3BZY.js} +2 -2
  13. package/dist/{attempt-BdRQ9jKX.js.map → attempt-CGPV3BZY.js.map} +1 -1
  14. package/dist/bridge/index.mjs +1620 -1793
  15. package/dist/bridge/package.json +2 -2
  16. package/dist/bridge/pnpm-lock.yaml +75 -75
  17. package/dist/bridge/pnpm-workspace.yaml +1 -1
  18. package/dist/{cli-CGuUdOPK.js → cli-BdxFLEIc.js} +166 -55
  19. package/dist/cli-BdxFLEIc.js.map +1 -0
  20. package/dist/{cli-spec-DKAu09Gi.js → cli-spec-DUeyuSIQ.js} +11 -4
  21. package/dist/cli-spec-DUeyuSIQ.js.map +1 -0
  22. package/dist/cli.js +2 -2
  23. package/dist/{command-CCuYRGsI.js → command-BtcBitmY.js} +12 -12
  24. package/dist/{command-CCuYRGsI.js.map → command-BtcBitmY.js.map} +1 -1
  25. package/dist/{command-BekzrvZI.js → command-ByqQ-v-j.js} +13 -13
  26. package/dist/{command-BekzrvZI.js.map → command-ByqQ-v-j.js.map} +1 -1
  27. package/dist/{command-CLKuXn6Z.js → command-CIsO5xdR.js} +11 -9
  28. package/dist/command-CIsO5xdR.js.map +1 -0
  29. package/dist/{command-CEm8PZ1N.js → command-CQiFfn-C.js} +169 -280
  30. package/dist/command-CQiFfn-C.js.map +1 -0
  31. package/dist/command-DllipyoK.js +2 -0
  32. package/dist/{commands-CF8mOfiu.js → commands-CPrrZ2mI.js} +29 -13
  33. package/dist/commands-CPrrZ2mI.js.map +1 -0
  34. package/dist/{commands-A4udfyKZ.js → commands-D3Dxgh60.js} +1 -1
  35. package/dist/{config-DqJvSqYo.js → config-B93Csktg.js} +43 -15
  36. package/dist/{config-DqJvSqYo.js.map → config-B93Csktg.js.map} +1 -1
  37. package/dist/db-DIE0bsNO.js +2 -0
  38. package/dist/{db-DxDzMhtB.js → db-SpvY8l1g.js} +4 -4
  39. package/dist/{db-DxDzMhtB.js.map → db-SpvY8l1g.js.map} +1 -1
  40. package/dist/{dist-BZXYHN2X.js → dist-C2k9IvL3.js} +107 -55
  41. package/dist/dist-C2k9IvL3.js.map +1 -0
  42. package/dist/{docker-Buu3a60z.js → docker-Bv1ZC6V7.js} +1 -1
  43. package/dist/{docker-DQDZWXF9.js → docker-C2YwD_dh.js} +3 -3
  44. package/dist/{docker-DQDZWXF9.js.map → docker-C2YwD_dh.js.map} +1 -1
  45. package/dist/{docker-w0CSdQq0.js → docker-uNaAGE2C.js} +5 -5
  46. package/dist/{docker-w0CSdQq0.js.map → docker-uNaAGE2C.js.map} +1 -1
  47. package/dist/{doctor-Bs1_pG9_.js → doctor-COH-levb.js} +88 -20
  48. package/dist/doctor-COH-levb.js.map +1 -0
  49. package/dist/{egress-QJMzVtbw.js → egress-C7Obb71D.js} +35 -19
  50. package/dist/egress-C7Obb71D.js.map +1 -0
  51. package/dist/{environment-9WHSWLxH.js → environment-lDFQY2BF.js} +116 -4
  52. package/dist/environment-lDFQY2BF.js.map +1 -0
  53. package/dist/{files-D2-qn_Dl.js → files-BO9P6msM.js} +114 -14
  54. package/dist/files-BO9P6msM.js.map +1 -0
  55. package/dist/files-BRWmQJ-9.js +2 -0
  56. package/dist/files-Bwr8UW4b.js +2 -0
  57. package/dist/{files-bF2fPuT9.js → files-CMoTBEul.js} +40 -7
  58. package/dist/files-CMoTBEul.js.map +1 -0
  59. package/dist/{git-D6hMeieS.js → git-LJp55bkf.js} +3 -3
  60. package/dist/{git-D6hMeieS.js.map → git-LJp55bkf.js.map} +1 -1
  61. package/dist/{harness-ls5aX1UO.js → harness-BbMShUC-.js} +4 -4
  62. package/dist/{harness-ls5aX1UO.js.map → harness-BbMShUC-.js.map} +1 -1
  63. package/dist/harness.d.ts +2 -2
  64. package/dist/harness.js +1 -1
  65. package/dist/{header-DzFDoMCI.js → header-sPQ9Lq2S.js} +2 -2
  66. package/dist/{header-DzFDoMCI.js.map → header-sPQ9Lq2S.js.map} +1 -1
  67. package/dist/{images-2m2U-UQc.js → images-Pph_XJ68.js} +6 -6
  68. package/dist/{images-2m2U-UQc.js.map → images-Pph_XJ68.js.map} +1 -1
  69. package/dist/index.d.ts +11 -4
  70. package/dist/index.js +173 -65
  71. package/dist/index.js.map +1 -1
  72. package/dist/{init-CH9UY7Bt.js → init-BcYpzHXs.js} +10 -10
  73. package/dist/{init-CH9UY7Bt.js.map → init-BcYpzHXs.js.map} +1 -1
  74. package/dist/init-YS5qBRwV.js +2 -0
  75. package/dist/{invocations-rXktgSAn.js → invocations-DHC946b-.js} +4 -4
  76. package/dist/{invocations-rXktgSAn.js.map → invocations-DHC946b-.js.map} +1 -1
  77. package/dist/{jiti-BOLXpKyG.js → jiti-DWsGEgxD.js} +4 -4
  78. package/dist/{jiti-BOLXpKyG.js.map → jiti-DWsGEgxD.js.map} +1 -1
  79. package/dist/{judge-D8Uf4dA9.js → judge-D6wqgTDp.js} +17 -4
  80. package/dist/judge-D6wqgTDp.js.map +1 -0
  81. package/dist/judge.d.ts +12 -8
  82. package/dist/judge.js +13 -5
  83. package/dist/judge.js.map +1 -1
  84. package/dist/{live-Bs3LReMV.js → live-DZkCtmNP.js} +2 -2
  85. package/dist/{live-Bs3LReMV.js.map → live-DZkCtmNP.js.map} +1 -1
  86. package/dist/{matchers-DyLvm7EG.js → matchers-DbFPZQgA.js} +9 -4
  87. package/dist/{matchers-DyLvm7EG.js.map → matchers-DbFPZQgA.js.map} +1 -1
  88. package/dist/model-CJ6USX6C.js +2 -0
  89. package/dist/model-CNoc8t2Y.js +2 -0
  90. package/dist/model-DUZtNaYR.js +228 -0
  91. package/dist/model-DUZtNaYR.js.map +1 -0
  92. package/dist/{model-CDL98xue.js → model-ORtLm2UB.js} +41 -3
  93. package/dist/{model-CDL98xue.js.map → model-ORtLm2UB.js.map} +1 -1
  94. package/dist/{model-BdO79gWz.js → model-f0wprGPm.js} +3 -3
  95. package/dist/{model-BdO79gWz.js.map → model-f0wprGPm.js.map} +1 -1
  96. package/dist/{node-kG64XxdE.js → node-OXPxBD2N.js} +3 -3
  97. package/dist/{node-kG64XxdE.js.map → node-OXPxBD2N.js.map} +1 -1
  98. package/dist/{opencode-providers-DZuD_oYt.js → opencode-providers-DJVocFOU.js} +31 -3
  99. package/dist/opencode-providers-DJVocFOU.js.map +1 -0
  100. package/dist/{options-k25fjaER.js → options-Ftb2gE01.js} +85 -26
  101. package/dist/options-Ftb2gE01.js.map +1 -0
  102. package/dist/patch-BxqggH-T.js +118 -0
  103. package/dist/patch-BxqggH-T.js.map +1 -0
  104. package/dist/{plan-gwk6dJ8c.js → plan-BkhLKrsN.js} +23 -6
  105. package/dist/plan-BkhLKrsN.js.map +1 -0
  106. package/dist/{preflight-B6hfAXhh.js → preflight-CuvY0o3B.js} +3 -3
  107. package/dist/{preflight-B6hfAXhh.js.map → preflight-CuvY0o3B.js.map} +1 -1
  108. package/dist/{preflight-D2Hce5Jp.js → preflight-D3cJETui.js} +1 -1
  109. package/dist/{prepare-NuWsT11j.js → prepare-BI9j2-H-.js} +5 -5
  110. package/dist/{prepare-NuWsT11j.js.map → prepare-BI9j2-H-.js.map} +1 -1
  111. package/dist/{prepare-C3fefNnV.js → prepare-CVuTk5F9.js} +2 -2
  112. package/dist/{provenance-Dfb8YY5Y.js → provenance-6n49wska.js} +22 -4
  113. package/dist/provenance-6n49wska.js.map +1 -0
  114. package/dist/{providers-Bfx5Mnk9.js → providers-BFapaM2D.js} +3 -3
  115. package/dist/{providers-Bfx5Mnk9.js.map → providers-BFapaM2D.js.map} +1 -1
  116. package/dist/{providers-BMIGzPPG.js → providers-Cay8pI0y.js} +1 -1
  117. package/dist/query-Br77sQYj.js +2 -0
  118. package/dist/{query-CFATHZmV.js → query-CnstTDt8.js} +2 -2
  119. package/dist/{query-CFATHZmV.js.map → query-CnstTDt8.js.map} +1 -1
  120. package/dist/questions-Cm321-Mo.js +325 -0
  121. package/dist/questions-Cm321-Mo.js.map +1 -0
  122. package/dist/{record-DQ8wzyco.js → record-CbuQH4l1.js} +7 -3
  123. package/dist/record-CbuQH4l1.js.map +1 -0
  124. package/dist/{redact-C4fL_bZP.js → redact-DJ9JCShu.js} +99 -28
  125. package/dist/redact-DJ9JCShu.js.map +1 -0
  126. package/dist/{results-BtvBJAp-.js → results-D9GgBYw5.js} +4 -4
  127. package/dist/{results-BtvBJAp-.js.map → results-D9GgBYw5.js.map} +1 -1
  128. package/dist/{root-CFDjpWuc.js → root-Zeokqt3-.js} +2 -2
  129. package/dist/{root-CFDjpWuc.js.map → root-Zeokqt3-.js.map} +1 -1
  130. package/dist/{sandbox-BJPWuQE9.js → sandbox-CO__l-i1.js} +3 -3
  131. package/dist/{sandbox-BJPWuQE9.js.map → sandbox-CO__l-i1.js.map} +1 -1
  132. package/dist/sandbox.d.ts +2 -2
  133. package/dist/sandbox.js +1 -1
  134. package/dist/server-D5Zq3I5N.js +2 -0
  135. package/dist/{server-5DWmKKfV.js → server-DsmIrBzi.js} +12 -10
  136. package/dist/{server-5DWmKKfV.js.map → server-DsmIrBzi.js.map} +1 -1
  137. package/dist/source-BgqURlel.js +2 -0
  138. package/dist/{source-Bsfa3LZH.js → source-DJ1c8jwe.js} +2 -2
  139. package/dist/{source-Bsfa3LZH.js.map → source-DJ1c8jwe.js.map} +1 -1
  140. package/dist/{src-DXx_29pq.js → src-B1OT_Zhf.js} +46 -46
  141. package/dist/{src-DXx_29pq.js.map → src-B1OT_Zhf.js.map} +1 -1
  142. package/dist/{src-BQyMiWri.js → src-BAiYD4eC.js} +48 -7
  143. package/dist/{src-BQyMiWri.js.map → src-BAiYD4eC.js.map} +1 -1
  144. package/dist/{src-N7E_mfcZ.js → src-BC5FFzE8.js} +1 -1
  145. package/dist/src-Bi2Y3EkE.js +3 -0
  146. package/dist/{src-D8KYzxBX.js → src-BmBFlEIe.js} +12 -7
  147. package/dist/{src-D8KYzxBX.js.map → src-BmBFlEIe.js.map} +1 -1
  148. package/dist/src-C8WNyopo.js +3 -0
  149. package/dist/src-CYz-TreZ.js +3 -0
  150. package/dist/src-C_91Ln3Z.js +4 -0
  151. package/dist/{src-Cmp-7YrD.js → src-DWk0e7ix.js} +5 -5
  152. package/dist/{src-Cmp-7YrD.js.map → src-DWk0e7ix.js.map} +1 -1
  153. package/dist/{src-AEwxd1UP.js → src-DfEAlC9s.js} +4 -4
  154. package/dist/{src-AEwxd1UP.js.map → src-DfEAlC9s.js.map} +1 -1
  155. package/dist/{src-DwwiVLqv.js → src-V-iU5X9S.js} +24 -21
  156. package/dist/{src-DwwiVLqv.js.map → src-V-iU5X9S.js.map} +1 -1
  157. package/dist/{src-C-LHyTSV.js → src-gPJFzHcK.js} +1 -1
  158. package/dist/src-gVzsO4_f.js +3 -0
  159. package/dist/{state-DZ7eqb1F.js → state-DFbJrVi3.js} +15 -15
  160. package/dist/{state-DZ7eqb1F.js.map → state-DFbJrVi3.js.map} +1 -1
  161. package/dist/state-Joc2b4qk.js +2 -0
  162. package/dist/studio-app/assets/index-B1Pf3LAT.css +2 -0
  163. package/dist/studio-app/assets/index-BhorHbrj.js +58 -0
  164. package/dist/studio-app/index.html +2 -2
  165. package/dist/{summary-D7Ttky0z.js → summary-CEMYhzXm.js} +33 -5
  166. package/dist/summary-CEMYhzXm.js.map +1 -0
  167. package/dist/summary-WR5qLj_z.js +192 -0
  168. package/dist/summary-WR5qLj_z.js.map +1 -0
  169. package/dist/tools-DN-cJcfi.js +249 -0
  170. package/dist/tools-DN-cJcfi.js.map +1 -0
  171. package/dist/{types-CYJldf5N.d.ts → types-B_CqVrOS.d.ts} +210 -30
  172. package/dist/view/index.d.ts +63 -1
  173. package/dist/view/index.js +5 -5
  174. package/dist/{views-BrHOv6wg.js → views-DNbUdW9d.js} +4 -4
  175. package/dist/{views-BrHOv6wg.js.map → views-DNbUdW9d.js.map} +1 -1
  176. package/dist/views-DnYbVkKg.js +3 -0
  177. package/dist/{worker-entry-DnYkANPG.js → worker-entry-CJmG4hhE.js} +3 -3
  178. package/dist/{worker-entry-DnYkANPG.js.map → worker-entry-CJmG4hhE.js.map} +1 -1
  179. package/dist/{workspace-BVgNhC9h.js → workspace-CmSp2MXO.js} +1 -1
  180. package/dist/{workspace-uPapQj16.js → workspace-QtlJtRut.js} +5 -5
  181. package/dist/{workspace-uPapQj16.js.map → workspace-QtlJtRut.js.map} +1 -1
  182. package/docker/Dockerfile +2 -0
  183. package/docker/reeval-path.sh +21 -0
  184. package/package.json +13 -12
  185. package/dist/assemble-Dm4gD1TU.js +0 -2
  186. package/dist/assemble-DtouO0iQ.js.map +0 -1
  187. package/dist/cli-CGuUdOPK.js.map +0 -1
  188. package/dist/cli-spec-DKAu09Gi.js.map +0 -1
  189. package/dist/command-CEm8PZ1N.js.map +0 -1
  190. package/dist/command-CLKuXn6Z.js.map +0 -1
  191. package/dist/commands-CF8mOfiu.js.map +0 -1
  192. package/dist/db-Cjj2ZsfQ.js +0 -2
  193. package/dist/dist-BZXYHN2X.js.map +0 -1
  194. package/dist/doctor-Bs1_pG9_.js.map +0 -1
  195. package/dist/egress-QJMzVtbw.js.map +0 -1
  196. package/dist/environment-9WHSWLxH.js.map +0 -1
  197. package/dist/files--6CEUXm7.js +0 -2
  198. package/dist/files-Bd25OAQH.js +0 -2
  199. package/dist/files-D2-qn_Dl.js.map +0 -1
  200. package/dist/files-bF2fPuT9.js.map +0 -1
  201. package/dist/init-DJuxvYCW.js +0 -2
  202. package/dist/judge-D8Uf4dA9.js.map +0 -1
  203. package/dist/model-v-0_Ik7S.js +0 -2
  204. package/dist/opencode-providers-DZuD_oYt.js.map +0 -1
  205. package/dist/options-k25fjaER.js.map +0 -1
  206. package/dist/patch-BkKje4cp.js +0 -69
  207. package/dist/patch-BkKje4cp.js.map +0 -1
  208. package/dist/plan-gwk6dJ8c.js.map +0 -1
  209. package/dist/provenance-Dfb8YY5Y.js.map +0 -1
  210. package/dist/query-DR4m6CXf.js +0 -2
  211. package/dist/record-DQ8wzyco.js.map +0 -1
  212. package/dist/redact-C4fL_bZP.js.map +0 -1
  213. package/dist/server-buV3adNS.js +0 -2
  214. package/dist/source-BXzrmof5.js +0 -2
  215. package/dist/src-55j1zNHH.js +0 -3
  216. package/dist/src-BDwSuyIo.js +0 -3
  217. package/dist/src-DEgff9Z7.js +0 -4
  218. package/dist/src-W9g-y5X5.js +0 -3
  219. package/dist/src-daS0wKH2.js +0 -3
  220. package/dist/state-Cyw3QTsN.js +0 -2
  221. package/dist/studio-app/assets/index-Da1XDzx8.js +0 -58
  222. package/dist/studio-app/assets/index-xwzWdcE_.css +0 -2
  223. package/dist/summary-D7Ttky0z.js.map +0 -1
  224. package/dist/views-CwCWLWqo.js +0 -3
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import { n as isTimeout, t as UsageError } from "./errors-CSxfJ4qu.js";
2
- import { b as parseDuration, d as isSecret, f as isSecretTemplate, g as stepCommand, l as isHostFile, m as parseGitRepo, o as defineEnvironment, p as mcpHosts, t as DEFAULT_SKILL_EXCLUDE, v as workspaceLabel, y as workspaceOf } from "./environment-9WHSWLxH.js";
2
+ import { C as workspaceLabel, T as parseDuration, _ as isSecretTemplate, c as defineEnvironment, g as isSecret, m as isHostFile, n as DEFAULT_SKILL_EXCLUDE, t as DEFAULT_DIRECTORY_IGNORES, u as filesOf, v as mcpHosts, w as workspaceOf, x as stepCommand, y as parseGitRepo } from "./environment-lDFQY2BF.js";
3
3
  import { t as inCI } from "./env-BQqj93gu.js";
4
- import { a as registerSecret, i as redactSecrets } from "./redact-C4fL_bZP.js";
4
+ import { o as redactSecrets, s as registerSecret } from "./redact-DJ9JCShu.js";
5
5
  import { t as InfraError } from "./types-C5vI3g1C.js";
6
- import { _ as layoutOf, a as unenforceable, h as expectedBlockedFor, n as allowedHosts, o as createFakeSandbox, p as brokeringFor, r as egressLabel, t as DEFAULT_EGRESS_ALLOW, v as refusedMcp } from "./egress-QJMzVtbw.js";
6
+ import { _ as layoutOf, a as unenforceable, h as expectedBlockedFor, n as allowedHosts, o as createFakeSandbox, p as brokeringFor, r as egressLabel, t as DEFAULT_EGRESS_ALLOW, v as refusedMcp } from "./egress-C7Obb71D.js";
7
7
  import { c as relativeFile, i as evalSlug, l as sha256, n as attemptKey, r as evalId, s as recordFileName, t as attemptId } from "./ids-Bp6ut7ZD.js";
8
- import { l as runJudge, s as judgeModelName } from "./judge-D8Uf4dA9.js";
9
- import { S as placeholder, et as run, tt as shellQuote } from "./src-DwwiVLqv.js";
10
- import { a as evalPlan, d as secretVarsIn, f as unbrokered, i as checkOptions, l as matchesTags, n as cascade, o as expand, p as unbrokeredError, s as harnessId, t as brokeredIn, u as sandboxId } from "./options-k25fjaER.js";
11
- import { n as badCharacterAt, o as defineConfig } from "./config-DqJvSqYo.js";
12
- import { a as withLease, c as registerGroup, l as registerTest, o as collectingFile, p as expect, s as getRunContext, t as HarnessCapabilityError } from "./matchers-DyLvm7EG.js";
13
- import { a as withDebug, i as debugTrace, n as attemptDebug, r as debugLog, t as AttemptDebug } from "./attempt-BdRQ9jKX.js";
8
+ import { c as judgeModelName, d as isApiError, i as badJudgeList, u as runJudge } from "./judge-D6wqgTDp.js";
9
+ import { S as placeholder, et as run, tt as shellQuote } from "./src-V-iU5X9S.js";
10
+ import { a as evalPlan, d as sandboxId, f as secretVarsIn, i as checkOptions, l as matchesTags, m as unbrokeredError, n as cascade, o as expand, p as unbrokered, s as harnessId, t as brokeredIn } from "./options-Ftb2gE01.js";
11
+ import { n as badCharacterAt, o as defineConfig } from "./config-B93Csktg.js";
12
+ import { a as withLease, c as registerGroup, l as registerTest, o as collectingFile, p as expect, s as getRunContext, t as HarnessCapabilityError } from "./matchers-DbFPZQgA.js";
13
+ import { a as withDebug, i as debugTrace, n as attemptDebug, r as debugLog, t as AttemptDebug } from "./attempt-CGPV3BZY.js";
14
14
  import { t as attemptDebugDir } from "./files-BLlrhU4-.js";
15
15
  import { n as clip, r as formatDuration, t as capMiddle } from "./text-gEcKjAyp.js";
16
16
  import { t as contextTaker } from "./context-loi9OCZv.js";
17
17
  import { t as PrepareError } from "./provider-CmAYTQQs.js";
18
- import { i as preparedWorkspace } from "./workspace-uPapQj16.js";
19
- import { r as patchForJudge, t as changedFilesForJudge } from "./patch-BkKje4cp.js";
18
+ import { i as preparedWorkspace } from "./workspace-QtlJtRut.js";
19
+ import { n as judgeDiff } from "./patch-BxqggH-T.js";
20
20
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
21
21
  import { basename, isAbsolute, join, relative, sep } from "node:path";
22
22
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
@@ -26,12 +26,12 @@ import { parse } from "yaml";
26
26
  /** Runs a check or setup step with the checks' brokered secrets swapped in (see brokerPhases). */
27
27
  const asCheck = (a, fn) => a.phases ? a.phases.checks(fn) : fn();
28
28
  function requireSandbox(a) {
29
- if (!a.sandbox) throw new Error("No sandbox yet: call t.send() or await t.sandbox() before t.exec() or t.readFile()");
29
+ if (!a.sandbox) throw new Error("No sandbox yet: call c.send() or await c.sandbox() before c.exec() or c.readFile()");
30
30
  return a.sandbox;
31
31
  }
32
32
  /**
33
- * Phase 4, checks: `t.exec` runs with the checks' variables and secrets, each run recorded and
34
- * timed; `t.readFile` reads the sandbox as is.
33
+ * Phase 4, checks: `c.exec` runs with the checks' variables and secrets, each run recorded and
34
+ * timed; `c.readFile` reads the sandbox as is.
35
35
  */
36
36
  function createChecks(a) {
37
37
  const checkEnv = () => a.env?.checkVars ?? {};
@@ -552,7 +552,8 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
552
552
  }
553
553
  const fileList = [...files].map(([path, v]) => ({
554
554
  path,
555
- content: isHostFile(v) ? readHostFile(v, envWhere) : v
555
+ content: isHostFile(v) ? readHostFile(v, envWhere) : v,
556
+ ...isHostFile(v) && statSync(v.path).mode & 64 ? { executable: true } : {}
556
557
  }));
557
558
  const rulesContent = rules === void 0 ? void 0 : isHostFile(rules) ? Buffer.from(readHostFile(rules, envWhere)).toString("utf8") : rules;
558
559
  const skillList = [...skills.values()];
@@ -568,6 +569,7 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
568
569
  path: f.path,
569
570
  sha256: sha256(f.content)
570
571
  }));
572
+ const executable = fileList.flatMap((f) => f.executable ? [f.path] : []);
571
573
  const rulesRecord = rulesContent === void 0 ? void 0 : {
572
574
  path: rulesFile,
573
575
  sha256: sha256(rulesContent)
@@ -614,6 +616,7 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
614
616
  ]),
615
617
  mcp: mcpShape,
616
618
  files: fileRecords,
619
+ ...executable.length ? { executable } : {},
617
620
  rules: rulesRecord?.sha256,
618
621
  vars: literalVars,
619
622
  secrets: secretNames,
@@ -905,7 +908,7 @@ async function callMcpTool(sandbox, servers, name, tool, signal) {
905
908
  //#region src/harness/index.ts
906
909
  async function createHarness(descriptor) {
907
910
  if (descriptor.kind === "fake") return createFakeHarness(descriptor);
908
- const { createAgentHarness } = await import("./agent-D-6z0Z3F.js");
911
+ const { createAgentHarness } = await import("./agent-M70OWyfG.js");
909
912
  return createAgentHarness(descriptor);
910
913
  }
911
914
  /** Where each harness's agent looks for repo skills, relative to the workspace. */
@@ -932,8 +935,8 @@ async function prepareEnvironment(a, root, runId, where, signal) {
932
935
  if (debug) traceEnvironment(debug, spec, env);
933
936
  record.image = null;
934
937
  if (spec.sandbox.kind === "docker") {
935
- const { preparedFor } = await import("./preflight-D2Hce5Jp.js");
936
- const { dockerProvider } = await import("./providers-BMIGzPPG.js");
938
+ const { preparedFor } = await import("./preflight-D3cJETui.js");
939
+ const { dockerProvider } = await import("./providers-Cay8pI0y.js");
937
940
  signal.throwIfAborted();
938
941
  const prepared = preparedFor(root, runId, dockerProvider(), spec.sandbox, spec.harness);
939
942
  if (!prepared) throw new InfraError(`The sandbox image for ${where} wasn't prepared before the run started`);
@@ -944,29 +947,100 @@ async function prepareEnvironment(a, root, runId, where, signal) {
944
947
  } else debugLog("image", `none: the ${spec.sandbox.kind} sandbox runs on the host`);
945
948
  }
946
949
  //#endregion
950
+ //#region src/judge/size.ts
951
+ /** Roughly four characters a token, as `reeval analyze` counts: an estimate, not the model's. */
952
+ const CHARS_PER_TOKEN = 4;
953
+ const tokensOf = (chars) => Math.ceil(chars / CHARS_PER_TOKEN);
954
+ const k = (tokens) => tokens < 1e3 ? String(tokens) : `${Math.round(tokens / 1e3)}k`;
955
+ const diffItems = (patch) => patch.split(/(?=^diff --git )/m).map((part) => ({
956
+ name: /^diff --git a\/.+ b\/(.+)$/m.exec(part)?.[1] ?? "",
957
+ chars: part.length
958
+ })).filter((item) => item.name);
959
+ /** The state's parts by size, each with its biggest files where it has any. */
960
+ function partsOf(state, question) {
961
+ return [...Object.entries(state).map(([name, value]) => {
962
+ const text = typeof value === "string" ? value : JSON.stringify(value);
963
+ const items = name === "diff" && typeof value === "string" ? diffItems(value) : value && typeof value === "object" && !Array.isArray(value) ? Object.entries(value).map(([file, content]) => ({
964
+ name: file,
965
+ chars: typeof content === "string" ? content.length : JSON.stringify(content).length
966
+ })) : [];
967
+ return {
968
+ name,
969
+ chars: text?.length ?? 0,
970
+ items
971
+ };
972
+ }), {
973
+ name: "question",
974
+ chars: question.length,
975
+ items: []
976
+ }].sort((a, b) => b.chars - a.chars);
977
+ }
978
+ /** The estimated size of what the judge reads, in tokens. */
979
+ const inputTokens = (state, question) => tokensOf(JSON.stringify(state).length + question.length);
980
+ /**
981
+ * `diff 306k, of which dist/assets/index-….js is 296k; output 1k; …`: the state's parts by
982
+ * estimated tokens, naming the biggest files in each.
983
+ */
984
+ function describeSize(state, question) {
985
+ const parts = partsOf(state, question);
986
+ const big = parts.filter((p) => tokensOf(p.chars) >= 1e3);
987
+ return (big.length ? big : parts.slice(0, 1)).map((p) => {
988
+ const top = p.items.sort((a, b) => b.chars - a.chars).slice(0, 3).filter((item) => tokensOf(item.chars) >= 1e3).map((item) => `${item.name} is ${k(tokensOf(item.chars))}`);
989
+ return `${p.name} ${k(tokensOf(p.chars))}${top.length ? `, of which ${top.join(", ")}` : ""}`;
990
+ }).join("; ");
991
+ }
992
+ const HINT = "Narrow what the judge sees with include, e.g. c.judge(question, { include: ['src/'] }), or set judge: { include } in the config; files shows chosen files in full.";
993
+ /**
994
+ * A provider's error, as the provider worded it, then what the judge's input held: its estimated
995
+ * size and biggest parts and files, and how to narrow it.
996
+ */
997
+ const withInputSize = (message, state, question) => `${message}\nThe judge's input was ~${k(inputTokens(state, question))} tokens (estimated): ${describeSize(state, question)}. ${HINT}`;
998
+ //#endregion
947
999
  //#region src/attempt/judge.ts
948
- const noJudgeModel = (configFile) => `t.judge() has no model. Set judge: { model: 'typesafe-ai/jev-1.13.0' } in ${configFile}, on the group or eval, or pass { model } to this call.`;
1000
+ const noJudgeModel = (configFile) => `c.judge() has no model. Set judge: { model: 'typesafe-ai/jev-1.13.0' } in ${configFile}, on the group or eval, or pass { model } to this call.`;
949
1001
  const isTurn = (value) => typeof value === "object" && value !== null && "transcript" in value && "diff" in value;
950
- function judgeState(turn, output = turn.text) {
951
- return {
1002
+ const workspacePath = (path) => path.replace(/^\.\//, "");
1003
+ /**
1004
+ * The turn's task and output, its changed files and diff as `judgeDiff` shows them, and the whole
1005
+ * current content of each of `files` (null when there's no such file).
1006
+ */
1007
+ async function judgeState(turn, output, { include, files }, readFile) {
1008
+ const inFull = files?.length ? files : void 0;
1009
+ const shown = judgeDiff(turn.diff, {
1010
+ ...include ? { include } : {},
1011
+ ...inFull ? { inFull: new Set(inFull.map(workspacePath)) } : {}
1012
+ });
1013
+ const state = {
952
1014
  task: turn.prompt,
953
1015
  output,
954
- files: changedFilesForJudge(turn.diff.files),
955
- diff: patchForJudge(turn.diff.patch)
1016
+ files: shown.files,
1017
+ diff: shown.patch
1018
+ };
1019
+ if (inFull) {
1020
+ const contents = {};
1021
+ for (const path of inFull) contents[workspacePath(path)] = await readFile(path);
1022
+ state.contents = contents;
1023
+ }
1024
+ return {
1025
+ state,
1026
+ dropped: shown.dropped
956
1027
  };
957
1028
  }
958
1029
  /**
959
1030
  * Phase 4, the judge: grades a turn (the last by default) or a value against a question, under
960
1031
  * the judge provider's concurrency lease. Every call's input is recorded, including calls that
961
- * fail, and a failure marks the attempt's assertion errors as the judge's.
1032
+ * fail. A call that fails returns a `JudgeFailure` and fails the attempt as a judge error after the eval's body, so the judges and
1033
+ * checks after it still run.
962
1034
  */
963
- function judgeCaller(a) {
1035
+ function judgeCaller(a, readFile) {
964
1036
  return async (question, { on, ...call } = {}) => {
965
- if (typeof question !== "string" || !question.trim()) throw new Error(`t.judge() needs a question: a non-empty string (got ${JSON.stringify(question)})`);
1037
+ if (typeof question !== "string" || !question.trim()) throw new Error(`c.judge() needs a question: a non-empty string (got ${JSON.stringify(question)})`);
966
1038
  const { threshold } = call;
967
- if (threshold !== void 0 && !(typeof threshold === "number" && threshold >= 0 && threshold <= 1)) throw new Error(`t.judge() threshold must be between 0 and 1 (got ${String(threshold)})`);
1039
+ if (threshold !== void 0 && !(typeof threshold === "number" && threshold >= 0 && threshold <= 1)) throw new Error(`c.judge() threshold must be between 0 and 1 (got ${String(threshold)})`);
1040
+ const bad = badJudgeList(call);
1041
+ if (bad) throw new Error(`c.judge() ${bad.key} must be a list of non-empty strings (got ${bad.got})`);
968
1042
  const subject = isTurn(on) ? on : a.turns.at(-1);
969
- if (!subject) throw new Error("t.judge() has no turn to grade: call t.send() first");
1043
+ if (!subject) throw new Error("c.judge() has no turn to grade: call c.send() first");
970
1044
  const options = {
971
1045
  ...a.spec.judge,
972
1046
  ...call
@@ -976,35 +1050,69 @@ function judgeCaller(a) {
976
1050
  a.judgeErrored = true;
977
1051
  throw new Error(noJudgeModel(getRunContext().config.file));
978
1052
  }
979
- const state = judgeState(subject, on === void 0 || isTurn(on) ? void 0 : on);
1053
+ const { include, files, maxConcurrent, ...judgeOptions } = options;
1054
+ const { state, dropped } = await judgeState(subject, on === void 0 || isTurn(on) ? subject.text : on, {
1055
+ include,
1056
+ files
1057
+ }, readFile);
1058
+ const name = judgeModelName(model);
980
1059
  const input = {
981
1060
  question,
982
- model: judgeModelName(model),
983
- state
1061
+ model: name,
1062
+ state,
1063
+ ...dropped.length ? { dropped } : {}
984
1064
  };
985
1065
  a.record.judgeInputs?.push(input);
986
1066
  const start = performance.now();
987
1067
  const ms = () => Math.round(performance.now() - start);
1068
+ const atLeast = options.threshold ?? .8;
988
1069
  a.report({
989
1070
  kind: "judge-start",
990
1071
  question
991
1072
  });
992
- debugLog("judge", `asking ${input.model}: ${JSON.stringify(clip(question, 160))}`);
1073
+ debugLog("judge", `asking ${name}: ${JSON.stringify(clip(question, 160))}`);
1074
+ if (dropped.length) debugLog("judge", `left out of the judge's input: ${dropped.join(" · ")}`);
993
1075
  debugTrace("judge", "prompt", input, "judge prompt");
994
- const { maxConcurrent, ...judgeOptions } = options;
995
- const provider = judgeModelName(model).split("/")[0];
1076
+ const failed = (message, retries) => {
1077
+ a.judgeErrored = true;
1078
+ a.judgeErrors.push(`c.judge(${JSON.stringify(clip(question, 80))}) failed: ${message}`);
1079
+ input.error = message;
1080
+ if (retries?.length) input.retries = retries;
1081
+ debugLog("judge", `${name} · ${formatDuration(ms())} · error: ${message}`);
1082
+ debugTrace("judge", "error", {
1083
+ error: message,
1084
+ retries
1085
+ }, "judge error");
1086
+ a.report({
1087
+ kind: "judge-end",
1088
+ question,
1089
+ verdict: "error",
1090
+ score: null,
1091
+ threshold: null,
1092
+ ms: ms()
1093
+ });
1094
+ return {
1095
+ verdict: "error",
1096
+ score: null,
1097
+ threshold: atLeast,
1098
+ question,
1099
+ model: name,
1100
+ error: message
1101
+ };
1102
+ };
1103
+ const provider = name.split("/")[0];
996
1104
  try {
997
1105
  const { verdict, retries } = await a.timed("judgeMs", () => withLease(maxConcurrent ? { [`judge:${provider}`]: maxConcurrent } : {}, () => runJudge(question, state, {
998
1106
  ...judgeOptions,
999
1107
  model,
1000
- threshold: options.threshold ?? .8
1108
+ threshold: atLeast
1001
1109
  }, a.signal), a.signal));
1002
1110
  a.record.judgements.push(retries.length ? {
1003
1111
  ...verdict,
1004
1112
  retries
1005
1113
  } : verdict);
1006
- const { score, threshold } = verdict;
1007
- debugLog("judge", `${verdict.resolvedModel ?? verdict.model} · ${formatDuration(ms())} · score ${score.toFixed(2)} ${score >= threshold ? "≥" : "<"} ${threshold} · ${verdict.verdict}${retries.length ? ` · ${retries.length} retries` : ""} · reason: P(yes) ${score.toFixed(2)} is ${score >= threshold ? "at or above" : "below"} the ${threshold} threshold`);
1114
+ const { score } = verdict;
1115
+ debugLog("judge", `${verdict.resolvedModel ?? verdict.model} · ${formatDuration(ms())} · score ${score.toFixed(2)} ${score >= verdict.threshold ? "≥" : "<"} ${verdict.threshold} · ${verdict.verdict}${retries.length ? ` · ${retries.length} retries` : ""} · reason: P(yes) ${score.toFixed(2)} is ${score >= verdict.threshold ? "at or above" : "below"} the ${verdict.threshold} threshold`);
1008
1116
  debugTrace("judge", "response", {
1009
1117
  verdict,
1010
1118
  retries
@@ -1014,29 +1122,18 @@ function judgeCaller(a) {
1014
1122
  question,
1015
1123
  verdict: verdict.verdict,
1016
1124
  score,
1017
- threshold,
1125
+ threshold: verdict.threshold,
1018
1126
  ms: ms()
1019
1127
  });
1020
1128
  return verdict;
1021
1129
  } catch (error) {
1022
- a.judgeErrored = true;
1130
+ if (a.signal.aborted) {
1131
+ a.judgeErrored = true;
1132
+ throw error;
1133
+ }
1023
1134
  const { retries } = error;
1024
- input.error = error instanceof Error ? error.message : String(error);
1025
- if (retries?.length) input.retries = retries;
1026
- debugLog("judge", `${input.model} · ${formatDuration(ms())} · error: ${input.error}`);
1027
- debugTrace("judge", "error", {
1028
- error: input.error,
1029
- retries
1030
- }, "judge error");
1031
- a.report({
1032
- kind: "judge-end",
1033
- question,
1034
- verdict: "error",
1035
- score: null,
1036
- threshold: null,
1037
- ms: ms()
1038
- });
1039
- throw error;
1135
+ const message = error instanceof Error ? error.message : String(error);
1136
+ return failed(isApiError(error) ? withInputSize(message, state, question) : message, retries);
1040
1137
  }
1041
1138
  };
1042
1139
  }
@@ -1047,7 +1144,7 @@ async function createSandbox(descriptor, options) {
1047
1144
  switch (descriptor.kind) {
1048
1145
  case "fake": return await createFakeSandbox(descriptor, options.env);
1049
1146
  case "docker": {
1050
- const { createDockerSandbox } = await import("./docker-Buu3a60z.js");
1147
+ const { createDockerSandbox } = await import("./docker-Bv1ZC6V7.js");
1051
1148
  return await createDockerSandbox(descriptor, options);
1052
1149
  }
1053
1150
  }
@@ -1258,7 +1355,8 @@ function createAttempt(spec, signal, progress) {
1258
1355
  }
1259
1356
  },
1260
1357
  signal,
1261
- judgeErrored: false
1358
+ judgeErrored: false,
1359
+ judgeErrors: []
1262
1360
  };
1263
1361
  }
1264
1362
  const startTimeoutMs = (harness) => parseDuration(harness.startTimeout ?? "90s");
@@ -1423,7 +1521,13 @@ async function startSession(a, runId, setupStart) {
1423
1521
  for (const f of env.files) {
1424
1522
  await box.writeFile(f.path, f.content);
1425
1523
  const size = typeof f.content === "string" ? Buffer.byteLength(f.content) : f.content.byteLength;
1426
- debugLog("env", `file ${f.path} (${size} bytes)`);
1524
+ debugLog("env", `file ${f.path} (${size} bytes${f.executable ? ", executable" : ""})`);
1525
+ }
1526
+ const executable = env.files.flatMap((f) => f.executable ? [f.path.startsWith("~/") ? `${box.home}/${f.path.slice(2)}` : f.path] : []);
1527
+ if (executable.length) {
1528
+ const paths = executable.map((p) => shellQuote(p.startsWith("-") ? `./${p}` : p));
1529
+ const r = await box.exec(`chmod +x ${paths.join(" ")}`, { signal: a.signal });
1530
+ if (r.exitCode !== 0) throw new InfraError(`Couldn't make ${executable.join(", ")} executable: ${tailOf(r.stderr || r.stdout)}`);
1427
1531
  }
1428
1532
  const skillDir = workspaceSkillDir(spec.harness);
1429
1533
  for (const skill of env.workspaceSkills) {
@@ -1605,7 +1709,7 @@ async function attemptBody(spec, fn, { signal: testSignal, setMeta, progress, un
1605
1709
  };
1606
1710
  const takeContext = contextTaker(a);
1607
1711
  const { exec, readFile } = createChecks(a);
1608
- const t = {
1712
+ const c = {
1609
1713
  get signal() {
1610
1714
  return a.signal;
1611
1715
  },
@@ -1628,7 +1732,7 @@ async function attemptBody(spec, fn, { signal: testSignal, setMeta, progress, un
1628
1732
  exec,
1629
1733
  readFile
1630
1734
  }),
1631
- judge: judgeCaller(a)
1735
+ judge: judgeCaller(a, readFile)
1632
1736
  };
1633
1737
  const timedOut = () => !!timer?.aborted && !testSignal.aborted;
1634
1738
  try {
@@ -1639,10 +1743,12 @@ async function attemptBody(spec, fn, { signal: testSignal, setMeta, progress, un
1639
1743
  timer = clock.signal;
1640
1744
  a.signal = AbortSignal.any([testSignal, timer]);
1641
1745
  timer.addEventListener("abort", destroy, { once: true });
1642
- await fn(t);
1746
+ await fn(c);
1643
1747
  a.signal.throwIfAborted();
1644
1748
  const missed = await unawaited();
1645
1749
  if (missed) throw missed;
1750
+ const [only, ...more] = a.judgeErrors;
1751
+ if (only) throw new Error(more.length ? `${more.length + 1} judge calls failed:\n${a.judgeErrors.join("\n")}` : only);
1646
1752
  } catch (error) {
1647
1753
  recordFailure(a, error, timedOut());
1648
1754
  if (timedOut()) throw new Error(`Eval timed out after ${spec.timeoutMs / 1e3}s`);
@@ -1763,6 +1869,7 @@ function planEval(declaration, ctx) {
1763
1869
  return plannedAttempts.map((planned) => {
1764
1870
  if (!cells.includes(planned.cell.key)) cells.push(planned.cell.key);
1765
1871
  const workspace = workspaceOf(planned.environment.layers);
1872
+ const files = filesOf(planned.environment.layers);
1766
1873
  const attempt = {
1767
1874
  name,
1768
1875
  groups,
@@ -1779,6 +1886,7 @@ function planEval(declaration, ctx) {
1779
1886
  secretVars: secretVarsIn(resolved.env, planned),
1780
1887
  egress: planned.egress,
1781
1888
  ...workspace ? { workspace } : {},
1889
+ ...files.length ? { files } : {},
1782
1890
  plan
1783
1891
  };
1784
1892
  const rankFile = relativeFile(ctx.config.root, ctx.file ?? "");
@@ -1839,7 +1947,7 @@ function splitArgs(what, name, a, b) {
1839
1947
  if (typeof a === "function" && typeof b === "function") throw new UsageError(`${what}("${name}") got two functions. Options must be a plain object; helpers such as secret are only available in defineConfig and defineEnvironment callbacks. Put the secret in an environment (environment: …) or in the config's env.`);
1840
1948
  if (typeof a === "function") return [b ?? {}, a];
1841
1949
  if (typeof b === "function") return [a ?? {}, b];
1842
- throw new UsageError(what === "group" ? `group("${name}") has no function. Pass the group's body, e.g. group("${name}", () => { … }).` : `${what}("${name}") has no function. Pass the eval's body, e.g. ${what}("${name}", async (t) => { … }).`);
1950
+ throw new UsageError(what === "group" ? `group("${name}") has no function. Pass the group's body, e.g. group("${name}", () => { … }).` : `${what}("${name}") has no function. Pass the eval's body, e.g. ${what}("${name}", async (c) => { … }).`);
1843
1951
  }
1844
1952
  /** `evaluate.only` and `group.only` are refused in CI, where they'd silently skip the rest. */
1845
1953
  function checkOnly(mode, what) {
@@ -1939,12 +2047,12 @@ const defineEval = (mode) => (name, a, b) => {
1939
2047
  function formatName(template, item, index) {
1940
2048
  return template.replace(/%#/g, String(index)).replace(/%s/g, typeof item === "string" ? item : JSON.stringify(item)).replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g, (whole, key) => typeof item === "object" && item !== null && key in item ? String(item[key]) : whole);
1941
2049
  }
1942
- /** One eval per case: `evaluate.for(cases)('adds $a and $b', async (t, c) => …)`. */
2050
+ /** One eval per case: `evaluate.for(cases)('adds $a and $b', async (c, { a, b }) => …)`. */
1943
2051
  const evalFor = (cases) => (name, a, b) => {
1944
2052
  const [own, fn] = splitArgs("evaluate.for", name, a, b);
1945
2053
  const hint = ` For evaluate.for, put $key, %s or %# in the name ("${name}") so each case's name differs.`;
1946
2054
  cases.forEach((item, i) => {
1947
- register("run", formatName(name, item, i), own, (t) => fn(t, item), hint);
2055
+ register("run", formatName(name, item, i), own, (c) => fn(c, item), hint);
1948
2056
  });
1949
2057
  };
1950
2058
  const evaluate = Object.assign(defineEval("run"), {
@@ -1954,6 +2062,6 @@ const evaluate = Object.assign(defineEval("run"), {
1954
2062
  for: evalFor
1955
2063
  });
1956
2064
  //#endregion
1957
- export { DEFAULT_EGRESS_ALLOW, DEFAULT_SKILL_EXCLUDE, HarnessCapabilityError, defineConfig, defineEnvironment, evaluate, expect, group };
2065
+ export { DEFAULT_DIRECTORY_IGNORES, DEFAULT_EGRESS_ALLOW, DEFAULT_SKILL_EXCLUDE, HarnessCapabilityError, defineConfig, defineEnvironment, evaluate, expect, group };
1958
2066
 
1959
2067
  //# sourceMappingURL=index.js.map