reeval 0.3.0 → 0.5.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 (213) hide show
  1. package/THIRD_PARTY_NOTICES.md +5 -5
  2. package/assets/package.json +1 -1
  3. package/assets/pnpm-lock.yaml +36 -36
  4. package/dist/{agent-DcQAvomp.js → agent-BDPZxZo6.js} +5 -5
  5. package/dist/{agent-DcQAvomp.js.map → agent-BDPZxZo6.js.map} +1 -1
  6. package/dist/{agent-BYy0Tc6P.js → agent-Dcnbp_qS.js} +5 -5
  7. package/dist/{agent-BYy0Tc6P.js.map → agent-Dcnbp_qS.js.map} +1 -1
  8. package/dist/{analysis-CxSCt1YY.js → analysis-1fqCRQJ5.js} +4 -4
  9. package/dist/{analysis-CxSCt1YY.js.map → analysis-1fqCRQJ5.js.map} +1 -1
  10. package/dist/{assemble-h8s0hzTQ.js → assemble-Br5xWfoJ.js} +10 -10
  11. package/dist/assemble-Br5xWfoJ.js.map +1 -0
  12. package/dist/assemble-BriNtYfK.js +2 -0
  13. package/dist/{attempt-BdRQ9jKX.js → attempt-CGPV3BZY.js} +2 -2
  14. package/dist/{attempt-BdRQ9jKX.js.map → attempt-CGPV3BZY.js.map} +1 -1
  15. package/dist/bridge/index.mjs +1620 -1793
  16. package/dist/bridge/package.json +2 -2
  17. package/dist/bridge/pnpm-lock.yaml +75 -75
  18. package/dist/bridge/pnpm-workspace.yaml +1 -1
  19. package/dist/{cli-DemDdg8J.js → cli-Ben0kbJt.js} +61 -55
  20. package/dist/cli-Ben0kbJt.js.map +1 -0
  21. package/dist/{cli-spec-BxLPgNN-.js → cli-spec-DUeyuSIQ.js} +4 -3
  22. package/dist/cli-spec-DUeyuSIQ.js.map +1 -0
  23. package/dist/cli.js +2 -2
  24. package/dist/{command-y91-aNhu.js → command-BZXB7JbK.js} +26 -18
  25. package/dist/command-BZXB7JbK.js.map +1 -0
  26. package/dist/{command-pHfluVCF.js → command-CmFpqrTW.js} +8 -8
  27. package/dist/{command-pHfluVCF.js.map → command-CmFpqrTW.js.map} +1 -1
  28. package/dist/{command-CxwnRrTs.js → command-DpR1iz_b.js} +14 -13
  29. package/dist/command-DpR1iz_b.js.map +1 -0
  30. package/dist/command-pIntI3Iq.js +2 -0
  31. package/dist/{command-PEbIzJj3.js → command-zD7IIwQF.js} +14 -14
  32. package/dist/{command-PEbIzJj3.js.map → command-zD7IIwQF.js.map} +1 -1
  33. package/dist/{commands-De-SxIgY.js → commands-8xIhRt-7.js} +1 -1
  34. package/dist/{commands-DhCuEa6z.js → commands-CkfvCaoN.js} +31 -13
  35. package/dist/commands-CkfvCaoN.js.map +1 -0
  36. package/dist/{config-CqSLZkwx.js → config-kbc7kZz3.js} +10 -7
  37. package/dist/{config-CqSLZkwx.js.map → config-kbc7kZz3.js.map} +1 -1
  38. package/dist/db-BgmkqBzz.js +2 -0
  39. package/dist/{db-DA4LBwi_.js → db-DYPkngEs.js} +5 -5
  40. package/dist/db-DYPkngEs.js.map +1 -0
  41. package/dist/{dist-BSoys6pg.js → dist-D6co5uaT.js} +106 -54
  42. package/dist/dist-D6co5uaT.js.map +1 -0
  43. package/dist/{docker-DMRwn7yh.js → docker-BLqzfYMT.js} +3 -3
  44. package/dist/{docker-DMRwn7yh.js.map → docker-BLqzfYMT.js.map} +1 -1
  45. package/dist/{docker-DwG9f76x.js → docker-C4H1eSjN.js} +5 -5
  46. package/dist/{docker-DwG9f76x.js.map → docker-C4H1eSjN.js.map} +1 -1
  47. package/dist/{docker-jf52ARP7.js → docker-CJkJ4-_n.js} +1 -1
  48. package/dist/{doctor-DhvVbNKv.js → doctor-X2ba-e1Y.js} +80 -16
  49. package/dist/doctor-X2ba-e1Y.js.map +1 -0
  50. package/dist/{egress-D9vJCATi.js → egress-CRQ7wCj8.js} +11 -11
  51. package/dist/{egress-D9vJCATi.js.map → egress-CRQ7wCj8.js.map} +1 -1
  52. package/dist/{environment-ByCF9s3n.js → environment-D3sZUybY.js} +154 -17
  53. package/dist/environment-D3sZUybY.js.map +1 -0
  54. package/dist/errors-yDAEwmZo.js +15 -0
  55. package/dist/errors-yDAEwmZo.js.map +1 -0
  56. package/dist/files-BTF2wg0i.js +2 -0
  57. package/dist/{files-CfsIRN7n.js → files-CO4Y4eRS.js} +3 -3
  58. package/dist/{files-CfsIRN7n.js.map → files-CO4Y4eRS.js.map} +1 -1
  59. package/dist/files-CspMl_3t.js +2 -0
  60. package/dist/{files-DHBBIYx_.js → files-DiGDoSSw.js} +196 -12
  61. package/dist/files-DiGDoSSw.js.map +1 -0
  62. package/dist/{git-oX92_Jh-.js → git-BZlPo1Rh.js} +3 -3
  63. package/dist/{git-oX92_Jh-.js.map → git-BZlPo1Rh.js.map} +1 -1
  64. package/dist/{harness-BbMShUC-.js → harness-8-dnGNgT.js} +2 -2
  65. package/dist/{harness-BbMShUC-.js.map → harness-8-dnGNgT.js.map} +1 -1
  66. package/dist/harness.d.ts +1 -1
  67. package/dist/harness.js +1 -1
  68. package/dist/{header-sPQ9Lq2S.js → header-CTTSGpy-.js} +2 -2
  69. package/dist/{header-sPQ9Lq2S.js.map → header-CTTSGpy-.js.map} +1 -1
  70. package/dist/{images-C9Y4ijbG.js → images-CPfNRSuK.js} +6 -6
  71. package/dist/{images-C9Y4ijbG.js.map → images-CPfNRSuK.js.map} +1 -1
  72. package/dist/index.d.ts +15 -4
  73. package/dist/index.js +186 -71
  74. package/dist/index.js.map +1 -1
  75. package/dist/init-C5Kp2CVo.js +2 -0
  76. package/dist/{init-x55uF8a4.js → init-CquBKr3J.js} +6 -8
  77. package/dist/init-CquBKr3J.js.map +1 -0
  78. package/dist/{invocations-DSMfs3Dx.js → invocations-DHC946b-.js} +3 -3
  79. package/dist/{invocations-DSMfs3Dx.js.map → invocations-DHC946b-.js.map} +1 -1
  80. package/dist/{judge-D8Uf4dA9.js → judge-7WjNdU9z.js} +20 -7
  81. package/dist/judge-7WjNdU9z.js.map +1 -0
  82. package/dist/judge.d.ts +7 -4
  83. package/dist/judge.js +5 -2
  84. package/dist/judge.js.map +1 -1
  85. package/dist/{matchers-D51lM8dO.js → matchers-Bp-OH1vj.js} +7 -2
  86. package/dist/{matchers-D51lM8dO.js.map → matchers-Bp-OH1vj.js.map} +1 -1
  87. package/dist/{model-DQQQ3q_n.js → model-BAB6ScG7.js} +1 -1
  88. package/dist/model-Bip8dx2I.js +2 -0
  89. package/dist/{model-BdO79gWz.js → model-Bv8uUZ07.js} +3 -3
  90. package/dist/{model-BdO79gWz.js.map → model-Bv8uUZ07.js.map} +1 -1
  91. package/dist/{model-GFM8iOzM.js → model-CwxodD2e.js} +7 -7
  92. package/dist/model-CwxodD2e.js.map +1 -0
  93. package/dist/{model-ORtLm2UB.js → model-DGafiJdy.js} +118 -6
  94. package/dist/model-DGafiJdy.js.map +1 -0
  95. package/dist/{node-OXPxBD2N.js → node-B72WWfgg.js} +3 -2
  96. package/dist/{node-OXPxBD2N.js.map → node-B72WWfgg.js.map} +1 -1
  97. package/dist/{options-CIutEeuy.js → options-BBLwgaSz.js} +158 -78
  98. package/dist/options-BBLwgaSz.js.map +1 -0
  99. package/dist/patch-CzT5wTZr.js +118 -0
  100. package/dist/patch-CzT5wTZr.js.map +1 -0
  101. package/dist/{plan-DcHTdiJN.js → plan-4AO_VH20.js} +5 -4
  102. package/dist/{plan-DcHTdiJN.js.map → plan-4AO_VH20.js.map} +1 -1
  103. package/dist/{preflight-BQyUr_hW.js → preflight-B8XgaXdX.js} +1 -1
  104. package/dist/{preflight-vISQIiF1.js → preflight-Cl__EL9Y.js} +3 -3
  105. package/dist/{preflight-vISQIiF1.js.map → preflight-Cl__EL9Y.js.map} +1 -1
  106. package/dist/{prepare-Ca0Nxd9b.js → prepare-BgzG6f6h.js} +2 -2
  107. package/dist/{prepare-BTeAiW9Q.js → prepare-jmZNuhe5.js} +5 -5
  108. package/dist/{prepare-BTeAiW9Q.js.map → prepare-jmZNuhe5.js.map} +1 -1
  109. package/dist/{provenance-D4vo7RF6.js → provenance-rP7Unzb4.js} +3 -3
  110. package/dist/{provenance-D4vo7RF6.js.map → provenance-rP7Unzb4.js.map} +1 -1
  111. package/dist/{providers-Bjgky1u8.js → providers-Cs0GAhfO.js} +4 -4
  112. package/dist/{providers-Bjgky1u8.js.map → providers-Cs0GAhfO.js.map} +1 -1
  113. package/dist/{providers-DfVMglqP.js → providers-Dh6hQDI6.js} +1 -1
  114. package/dist/{query-D2KaStTs.js → query-BOtU7Phq.js} +3 -3
  115. package/dist/{query-D2KaStTs.js.map → query-BOtU7Phq.js.map} +1 -1
  116. package/dist/query-BjqPXDPV.js +2 -0
  117. package/dist/{questions-CzXdVVsh.js → questions-nUB6aKz_.js} +5 -5
  118. package/dist/{questions-CzXdVVsh.js.map → questions-nUB6aKz_.js.map} +1 -1
  119. package/dist/{redact-C4fL_bZP.js → redact-DJ9JCShu.js} +99 -28
  120. package/dist/redact-DJ9JCShu.js.map +1 -0
  121. package/dist/{results-BI-zTqQy.js → results-EaWTGQtw.js} +4 -4
  122. package/dist/{results-BI-zTqQy.js.map → results-EaWTGQtw.js.map} +1 -1
  123. package/dist/{sandbox-Dd-4Bx6B.js → sandbox-DsY0Xa_L.js} +3 -3
  124. package/dist/{sandbox-Dd-4Bx6B.js.map → sandbox-DsY0Xa_L.js.map} +1 -1
  125. package/dist/sandbox.d.ts +1 -1
  126. package/dist/sandbox.js +1 -1
  127. package/dist/server-D62mXUew.js +2 -0
  128. package/dist/{server-C7t8WYCR.js → server-DFCcG4kE.js} +8 -8
  129. package/dist/{server-C7t8WYCR.js.map → server-DFCcG4kE.js.map} +1 -1
  130. package/dist/source-Cr87qm1N.js +2 -0
  131. package/dist/{source-fNUCWsCW.js → source-ybqIFzmB.js} +2 -2
  132. package/dist/{source-fNUCWsCW.js.map → source-ybqIFzmB.js.map} +1 -1
  133. package/dist/{src-CEQFcAJH.js → src-B3kHPyvg.js} +1 -1
  134. package/dist/src-Bq2wa7fE.js +3 -0
  135. package/dist/{src-D3eW1e7Y.js → src-CQXA5zkO.js} +17 -18
  136. package/dist/{src-D3eW1e7Y.js.map → src-CQXA5zkO.js.map} +1 -1
  137. package/dist/{src-C91RndLw.js → src-CQzUdIZj.js} +1 -1
  138. package/dist/src-CYBvNARj.js +3 -0
  139. package/dist/{src-DWk0e7ix.js → src-Czhg5ONv.js} +54 -58
  140. package/dist/src-Czhg5ONv.js.map +1 -0
  141. package/dist/src-D2H8Rz6M.js +4 -0
  142. package/dist/{src-B1OT_Zhf.js → src-DABrrexp.js} +50 -67
  143. package/dist/src-DABrrexp.js.map +1 -0
  144. package/dist/{src-BAiYD4eC.js → src-DVWhOfrD.js} +24 -4
  145. package/dist/src-DVWhOfrD.js.map +1 -0
  146. package/dist/{src-DTlmkpJe.js → src-DygwWk6l.js} +1 -1
  147. package/dist/src-OXjUr5ng.js +3 -0
  148. package/dist/{src-DfEAlC9s.js → src-Zqi4rheD.js} +4 -4
  149. package/dist/{src-DfEAlC9s.js.map → src-Zqi4rheD.js.map} +1 -1
  150. package/dist/state-BOeZS-Wa.js +2 -0
  151. package/dist/{state-g6ij_40j.js → state-CWs2X2x8.js} +12 -12
  152. package/dist/{state-g6ij_40j.js.map → state-CWs2X2x8.js.map} +1 -1
  153. package/dist/studio-app/assets/{index-DciOL7BI.js → index-BYZWo5gl.js} +9 -9
  154. package/dist/studio-app/index.html +1 -1
  155. package/dist/{summary-gawvEpNu.js → summary-78yLjokt.js} +5 -3
  156. package/dist/summary-78yLjokt.js.map +1 -0
  157. package/dist/{summary-DjbxgCDi.js → summary-CxHRN1zB.js} +6 -6
  158. package/dist/{summary-DjbxgCDi.js.map → summary-CxHRN1zB.js.map} +1 -1
  159. package/dist/{tools-B7SoW5kU.js → tools-DCuVntbR.js} +3 -3
  160. package/dist/{tools-B7SoW5kU.js.map → tools-DCuVntbR.js.map} +1 -1
  161. package/dist/{types-C5AEPr29.d.ts → types-BUWwRisO.d.ts} +105 -24
  162. package/dist/view/index.d.ts +45 -3
  163. package/dist/view/index.js +4 -4
  164. package/dist/views-BVu2pD9u.js +3 -0
  165. package/dist/{views-CHXQfSWQ.js → views-CZDDDj2F.js} +4 -4
  166. package/dist/{views-CHXQfSWQ.js.map → views-CZDDDj2F.js.map} +1 -1
  167. package/dist/{worker-entry-B6nuDpBX.js → worker-entry-DlriWSAs.js} +5 -5
  168. package/dist/{worker-entry-B6nuDpBX.js.map → worker-entry-DlriWSAs.js.map} +1 -1
  169. package/dist/{workspace-DXV77ZqW.js → workspace-BwKzynEj.js} +1 -1
  170. package/dist/{workspace-DUUfne8b.js → workspace-oBK63kWs.js} +5 -5
  171. package/dist/{workspace-DUUfne8b.js.map → workspace-oBK63kWs.js.map} +1 -1
  172. package/package.json +13 -12
  173. package/dist/assemble-BFsyMhb-.js +0 -2
  174. package/dist/assemble-h8s0hzTQ.js.map +0 -1
  175. package/dist/cli-DemDdg8J.js.map +0 -1
  176. package/dist/cli-spec-BxLPgNN-.js.map +0 -1
  177. package/dist/command-CxwnRrTs.js.map +0 -1
  178. package/dist/command-DhgZPhsY.js +0 -2
  179. package/dist/command-y91-aNhu.js.map +0 -1
  180. package/dist/commands-DhCuEa6z.js.map +0 -1
  181. package/dist/db-DA4LBwi_.js.map +0 -1
  182. package/dist/db-DDfq7Tx_.js +0 -2
  183. package/dist/dist-BSoys6pg.js.map +0 -1
  184. package/dist/doctor-DhvVbNKv.js.map +0 -1
  185. package/dist/environment-ByCF9s3n.js.map +0 -1
  186. package/dist/errors-CSxfJ4qu.js +0 -11
  187. package/dist/errors-CSxfJ4qu.js.map +0 -1
  188. package/dist/files-B16cQ6XX.js +0 -2
  189. package/dist/files-BC5Yqir-.js +0 -2
  190. package/dist/files-DHBBIYx_.js.map +0 -1
  191. package/dist/init-DPJv7OmX.js +0 -2
  192. package/dist/init-x55uF8a4.js.map +0 -1
  193. package/dist/judge-D8Uf4dA9.js.map +0 -1
  194. package/dist/model-CNoc8t2Y.js +0 -2
  195. package/dist/model-GFM8iOzM.js.map +0 -1
  196. package/dist/model-ORtLm2UB.js.map +0 -1
  197. package/dist/options-CIutEeuy.js.map +0 -1
  198. package/dist/patch-BkKje4cp.js +0 -69
  199. package/dist/patch-BkKje4cp.js.map +0 -1
  200. package/dist/query-CWkZnV62.js +0 -2
  201. package/dist/redact-C4fL_bZP.js.map +0 -1
  202. package/dist/server-BjbgFX28.js +0 -2
  203. package/dist/source-CLE8vMNa.js +0 -2
  204. package/dist/src-B1OT_Zhf.js.map +0 -1
  205. package/dist/src-BAiYD4eC.js.map +0 -1
  206. package/dist/src-CNp0srm9.js +0 -3
  207. package/dist/src-DJsBrqo6.js +0 -4
  208. package/dist/src-DWk0e7ix.js.map +0 -1
  209. package/dist/src-DgYURuJ6.js +0 -3
  210. package/dist/src-sSPmuaAc.js +0 -3
  211. package/dist/state-Bx-pH2ON.js +0 -2
  212. package/dist/summary-gawvEpNu.js.map +0 -1
  213. package/dist/views-DDei2LHa.js +0 -3
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
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-ByCF9s3n.js";
1
+ import { n as UsageError, r as isTimeout, t as TimeoutError } from "./errors-yDAEwmZo.js";
2
+ import { C as stepCommand, D as parseDuration, E as workspaceOf, T as workspaceLabel, _ as isSecret, b as parseGitRepo, c as defineEnvironment, d as filesOf, h as isHostFile, n as DEFAULT_SKILL_EXCLUDE, t as DEFAULT_DIRECTORY_IGNORES, v as isSecretTemplate, y as mcpHosts } from "./environment-D3sZUybY.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-D9vJCATi.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-CRQ7wCj8.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-D3eW1e7Y.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-CIutEeuy.js";
11
- import { n as badCharacterAt, o as defineConfig } from "./config-CqSLZkwx.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-D51lM8dO.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-7WjNdU9z.js";
9
+ import { S as placeholder, et as run, tt as shellQuote } from "./src-CQXA5zkO.js";
10
+ import { a as evalPlan, d as sandboxId, f as sandboxSetBy, h as unbrokeredError, i as checkOptions, l as matchesTags, m as unbrokered, n as cascade, o as expand, p as secretVarsIn, s as harnessId, t as brokeredIn } from "./options-BBLwgaSz.js";
11
+ import { n as badCharacterAt, o as defineConfig } from "./config-kbc7kZz3.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-Bp-OH1vj.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-DUUfne8b.js";
19
- import { r as patchForJudge, t as changedFilesForJudge } from "./patch-BkKje4cp.js";
18
+ import { i as preparedWorkspace } from "./workspace-oBK63kWs.js";
19
+ import { n as judgeDiff } from "./patch-CzT5wTZr.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";
@@ -448,7 +448,12 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
448
448
  };
449
449
  let egressSet = false;
450
450
  let workspace;
451
+ let sandboxSet = false;
451
452
  for (const { spec } of environment.layers) {
453
+ if (spec.sandbox !== void 0) {
454
+ if (sandboxSet) overrides.add("sandbox");
455
+ sandboxSet = true;
456
+ }
452
457
  if (spec.workspace !== void 0) {
453
458
  if (workspace) overrides.add("workspace");
454
459
  workspace = spec.workspace;
@@ -552,7 +557,8 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
552
557
  }
553
558
  const fileList = [...files].map(([path, v]) => ({
554
559
  path,
555
- content: isHostFile(v) ? readHostFile(v, envWhere) : v
560
+ content: isHostFile(v) ? readHostFile(v, envWhere) : v,
561
+ ...isHostFile(v) && statSync(v.path).mode & 64 ? { executable: true } : {}
556
562
  }));
557
563
  const rulesContent = rules === void 0 ? void 0 : isHostFile(rules) ? Buffer.from(readHostFile(rules, envWhere)).toString("utf8") : rules;
558
564
  const skillList = [...skills.values()];
@@ -568,6 +574,7 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
568
574
  path: f.path,
569
575
  sha256: sha256(f.content)
570
576
  }));
577
+ const executable = fileList.flatMap((f) => f.executable ? [f.path] : []);
571
578
  const rulesRecord = rulesContent === void 0 ? void 0 : {
572
579
  path: rulesFile,
573
580
  sha256: sha256(rulesContent)
@@ -614,6 +621,7 @@ async function resolveEnvironment(environment, optionsEnv, root, where, rulesFil
614
621
  ]),
615
622
  mcp: mcpShape,
616
623
  files: fileRecords,
624
+ ...executable.length ? { executable } : {},
617
625
  rules: rulesRecord?.sha256,
618
626
  vars: literalVars,
619
627
  secrets: secretNames,
@@ -905,7 +913,7 @@ async function callMcpTool(sandbox, servers, name, tool, signal) {
905
913
  //#region src/harness/index.ts
906
914
  async function createHarness(descriptor) {
907
915
  if (descriptor.kind === "fake") return createFakeHarness(descriptor);
908
- const { createAgentHarness } = await import("./agent-DcQAvomp.js");
916
+ const { createAgentHarness } = await import("./agent-BDPZxZo6.js");
909
917
  return createAgentHarness(descriptor);
910
918
  }
911
919
  /** Where each harness's agent looks for repo skills, relative to the workspace. */
@@ -932,8 +940,8 @@ async function prepareEnvironment(a, root, runId, where, signal) {
932
940
  if (debug) traceEnvironment(debug, spec, env);
933
941
  record.image = null;
934
942
  if (spec.sandbox.kind === "docker") {
935
- const { preparedFor } = await import("./preflight-BQyUr_hW.js");
936
- const { dockerProvider } = await import("./providers-DfVMglqP.js");
943
+ const { preparedFor } = await import("./preflight-B8XgaXdX.js");
944
+ const { dockerProvider } = await import("./providers-Dh6hQDI6.js");
937
945
  signal.throwIfAborted();
938
946
  const prepared = preparedFor(root, runId, dockerProvider(), spec.sandbox, spec.harness);
939
947
  if (!prepared) throw new InfraError(`The sandbox image for ${where} wasn't prepared before the run started`);
@@ -944,27 +952,98 @@ async function prepareEnvironment(a, root, runId, where, signal) {
944
952
  } else debugLog("image", `none: the ${spec.sandbox.kind} sandbox runs on the host`);
945
953
  }
946
954
  //#endregion
955
+ //#region src/judge/size.ts
956
+ /** Roughly four characters a token, as `reeval analyze` counts: an estimate, not the model's. */
957
+ const CHARS_PER_TOKEN = 4;
958
+ const tokensOf = (chars) => Math.ceil(chars / CHARS_PER_TOKEN);
959
+ const k = (tokens) => tokens < 1e3 ? String(tokens) : `${Math.round(tokens / 1e3)}k`;
960
+ const diffItems = (patch) => patch.split(/(?=^diff --git )/m).map((part) => ({
961
+ name: /^diff --git a\/.+ b\/(.+)$/m.exec(part)?.[1] ?? "",
962
+ chars: part.length
963
+ })).filter((item) => item.name);
964
+ /** The state's parts by size, each with its biggest files where it has any. */
965
+ function partsOf(state, question) {
966
+ return [...Object.entries(state).map(([name, value]) => {
967
+ const text = typeof value === "string" ? value : JSON.stringify(value);
968
+ const items = name === "diff" && typeof value === "string" ? diffItems(value) : value && typeof value === "object" && !Array.isArray(value) ? Object.entries(value).map(([file, content]) => ({
969
+ name: file,
970
+ chars: typeof content === "string" ? content.length : JSON.stringify(content).length
971
+ })) : [];
972
+ return {
973
+ name,
974
+ chars: text?.length ?? 0,
975
+ items
976
+ };
977
+ }), {
978
+ name: "question",
979
+ chars: question.length,
980
+ items: []
981
+ }].sort((a, b) => b.chars - a.chars);
982
+ }
983
+ /** The estimated size of what the judge reads, in tokens. */
984
+ const inputTokens = (state, question) => tokensOf(JSON.stringify(state).length + question.length);
985
+ /**
986
+ * `diff 306k, of which dist/assets/index-….js is 296k; output 1k; …`: the state's parts by
987
+ * estimated tokens, naming the biggest files in each.
988
+ */
989
+ function describeSize(state, question) {
990
+ const parts = partsOf(state, question);
991
+ const big = parts.filter((p) => tokensOf(p.chars) >= 1e3);
992
+ return (big.length ? big : parts.slice(0, 1)).map((p) => {
993
+ 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))}`);
994
+ return `${p.name} ${k(tokensOf(p.chars))}${top.length ? `, of which ${top.join(", ")}` : ""}`;
995
+ }).join("; ");
996
+ }
997
+ 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.";
998
+ /**
999
+ * A provider's error, as the provider worded it, then what the judge's input held: its estimated
1000
+ * size and biggest parts and files, and how to narrow it.
1001
+ */
1002
+ const withInputSize = (message, state, question) => `${message}\nThe judge's input was ~${k(inputTokens(state, question))} tokens (estimated): ${describeSize(state, question)}. ${HINT}`;
1003
+ //#endregion
947
1004
  //#region src/attempt/judge.ts
948
1005
  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
1006
  const isTurn = (value) => typeof value === "object" && value !== null && "transcript" in value && "diff" in value;
950
- function judgeState(turn, output = turn.text) {
951
- return {
1007
+ const workspacePath = (path) => path.replace(/^\.\//, "");
1008
+ /**
1009
+ * The turn's task and output, its changed files and diff as `judgeDiff` shows them, and the whole
1010
+ * current content of each of `files` (null when there's no such file).
1011
+ */
1012
+ async function judgeState(turn, output, { include, files }, readFile) {
1013
+ const inFull = files?.length ? files : void 0;
1014
+ const shown = judgeDiff(turn.diff, {
1015
+ ...include ? { include } : {},
1016
+ ...inFull ? { inFull: new Set(inFull.map(workspacePath)) } : {}
1017
+ });
1018
+ const state = {
952
1019
  task: turn.prompt,
953
1020
  output,
954
- files: changedFilesForJudge(turn.diff.files),
955
- diff: patchForJudge(turn.diff.patch)
1021
+ files: shown.files,
1022
+ diff: shown.patch
1023
+ };
1024
+ if (inFull) {
1025
+ const contents = {};
1026
+ for (const path of inFull) contents[workspacePath(path)] = await readFile(path);
1027
+ state.contents = contents;
1028
+ }
1029
+ return {
1030
+ state,
1031
+ dropped: shown.dropped
956
1032
  };
957
1033
  }
958
1034
  /**
959
1035
  * Phase 4, the judge: grades a turn (the last by default) or a value against a question, under
960
1036
  * 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.
1037
+ * 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
1038
+ * checks after it still run.
962
1039
  */
963
- function judgeCaller(a) {
1040
+ function judgeCaller(a, readFile) {
964
1041
  return async (question, { on, ...call } = {}) => {
965
1042
  if (typeof question !== "string" || !question.trim()) throw new Error(`c.judge() needs a question: a non-empty string (got ${JSON.stringify(question)})`);
966
1043
  const { threshold } = call;
967
1044
  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)})`);
1045
+ const bad = badJudgeList(call);
1046
+ if (bad) throw new Error(`c.judge() ${bad.key} must be a list of non-empty strings (got ${bad.got})`);
968
1047
  const subject = isTurn(on) ? on : a.turns.at(-1);
969
1048
  if (!subject) throw new Error("c.judge() has no turn to grade: call c.send() first");
970
1049
  const options = {
@@ -976,35 +1055,69 @@ function judgeCaller(a) {
976
1055
  a.judgeErrored = true;
977
1056
  throw new Error(noJudgeModel(getRunContext().config.file));
978
1057
  }
979
- const state = judgeState(subject, on === void 0 || isTurn(on) ? void 0 : on);
1058
+ const { include, files, maxConcurrent, ...judgeOptions } = options;
1059
+ const { state, dropped } = await judgeState(subject, on === void 0 || isTurn(on) ? subject.text : on, {
1060
+ include,
1061
+ files
1062
+ }, readFile);
1063
+ const name = judgeModelName(model);
980
1064
  const input = {
981
1065
  question,
982
- model: judgeModelName(model),
983
- state
1066
+ model: name,
1067
+ state,
1068
+ ...dropped.length ? { dropped } : {}
984
1069
  };
985
1070
  a.record.judgeInputs?.push(input);
986
1071
  const start = performance.now();
987
1072
  const ms = () => Math.round(performance.now() - start);
1073
+ const atLeast = options.threshold ?? .8;
988
1074
  a.report({
989
1075
  kind: "judge-start",
990
1076
  question
991
1077
  });
992
- debugLog("judge", `asking ${input.model}: ${JSON.stringify(clip(question, 160))}`);
1078
+ debugLog("judge", `asking ${name}: ${JSON.stringify(clip(question, 160))}`);
1079
+ if (dropped.length) debugLog("judge", `left out of the judge's input: ${dropped.join(" · ")}`);
993
1080
  debugTrace("judge", "prompt", input, "judge prompt");
994
- const { maxConcurrent, ...judgeOptions } = options;
995
- const provider = judgeModelName(model).split("/")[0];
1081
+ const failed = (message, retries) => {
1082
+ a.judgeErrored = true;
1083
+ a.judgeErrors.push(`c.judge(${JSON.stringify(clip(question, 80))}) failed: ${message}`);
1084
+ input.error = message;
1085
+ if (retries?.length) input.retries = retries;
1086
+ debugLog("judge", `${name} · ${formatDuration(ms())} · error: ${message}`);
1087
+ debugTrace("judge", "error", {
1088
+ error: message,
1089
+ retries
1090
+ }, "judge error");
1091
+ a.report({
1092
+ kind: "judge-end",
1093
+ question,
1094
+ verdict: "error",
1095
+ score: null,
1096
+ threshold: null,
1097
+ ms: ms()
1098
+ });
1099
+ return {
1100
+ verdict: "error",
1101
+ score: null,
1102
+ threshold: atLeast,
1103
+ question,
1104
+ model: name,
1105
+ error: message
1106
+ };
1107
+ };
1108
+ const provider = name.split("/")[0];
996
1109
  try {
997
1110
  const { verdict, retries } = await a.timed("judgeMs", () => withLease(maxConcurrent ? { [`judge:${provider}`]: maxConcurrent } : {}, () => runJudge(question, state, {
998
1111
  ...judgeOptions,
999
1112
  model,
1000
- threshold: options.threshold ?? .8
1113
+ threshold: atLeast
1001
1114
  }, a.signal), a.signal));
1002
1115
  a.record.judgements.push(retries.length ? {
1003
1116
  ...verdict,
1004
1117
  retries
1005
1118
  } : 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`);
1119
+ const { score } = verdict;
1120
+ 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
1121
  debugTrace("judge", "response", {
1009
1122
  verdict,
1010
1123
  retries
@@ -1014,29 +1127,18 @@ function judgeCaller(a) {
1014
1127
  question,
1015
1128
  verdict: verdict.verdict,
1016
1129
  score,
1017
- threshold,
1130
+ threshold: verdict.threshold,
1018
1131
  ms: ms()
1019
1132
  });
1020
1133
  return verdict;
1021
1134
  } catch (error) {
1022
- a.judgeErrored = true;
1135
+ if (a.signal.aborted) {
1136
+ a.judgeErrored = true;
1137
+ throw error;
1138
+ }
1023
1139
  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;
1140
+ const message = error instanceof Error ? error.message : String(error);
1141
+ return failed(isApiError(error) ? withInputSize(message, state, question) : message, retries);
1040
1142
  }
1041
1143
  };
1042
1144
  }
@@ -1047,7 +1149,7 @@ async function createSandbox(descriptor, options) {
1047
1149
  switch (descriptor.kind) {
1048
1150
  case "fake": return await createFakeSandbox(descriptor, options.env);
1049
1151
  case "docker": {
1050
- const { createDockerSandbox } = await import("./docker-jf52ARP7.js");
1152
+ const { createDockerSandbox } = await import("./docker-CJkJ4-_n.js");
1051
1153
  return await createDockerSandbox(descriptor, options);
1052
1154
  }
1053
1155
  }
@@ -1060,16 +1162,13 @@ async function createSandbox(descriptor, options) {
1060
1162
  //#region src/attempt/record.ts
1061
1163
  function classify(error, signal) {
1062
1164
  const message = error instanceof Error ? error.message : String(error);
1063
- if (signal.aborted) {
1064
- const reason = signal.reason instanceof Error ? signal.reason.message : String(signal.reason);
1065
- return isTimeout(reason) ? {
1066
- kind: "timeout",
1067
- message: "The eval timed out"
1068
- } : {
1069
- kind: "aborted",
1070
- message: "The run was cancelled"
1071
- };
1072
- }
1165
+ if (signal.aborted) return isTimeout(signal.reason) ? {
1166
+ kind: "timeout",
1167
+ message: "The eval timed out"
1168
+ } : {
1169
+ kind: "aborted",
1170
+ message: "The run was cancelled"
1171
+ };
1073
1172
  if (error instanceof InfraError) return {
1074
1173
  kind: "infra",
1075
1174
  message
@@ -1258,7 +1357,8 @@ function createAttempt(spec, signal, progress) {
1258
1357
  }
1259
1358
  },
1260
1359
  signal,
1261
- judgeErrored: false
1360
+ judgeErrored: false,
1361
+ judgeErrors: []
1262
1362
  };
1263
1363
  }
1264
1364
  const startTimeoutMs = (harness) => parseDuration(harness.startTimeout ?? "90s");
@@ -1423,7 +1523,13 @@ async function startSession(a, runId, setupStart) {
1423
1523
  for (const f of env.files) {
1424
1524
  await box.writeFile(f.path, f.content);
1425
1525
  const size = typeof f.content === "string" ? Buffer.byteLength(f.content) : f.content.byteLength;
1426
- debugLog("env", `file ${f.path} (${size} bytes)`);
1526
+ debugLog("env", `file ${f.path} (${size} bytes${f.executable ? ", executable" : ""})`);
1527
+ }
1528
+ const executable = env.files.flatMap((f) => f.executable ? [f.path.startsWith("~/") ? `${box.home}/${f.path.slice(2)}` : f.path] : []);
1529
+ if (executable.length) {
1530
+ const paths = executable.map((p) => shellQuote(p.startsWith("-") ? `./${p}` : p));
1531
+ const r = await box.exec(`chmod +x ${paths.join(" ")}`, { signal: a.signal });
1532
+ if (r.exitCode !== 0) throw new InfraError(`Couldn't make ${executable.join(", ")} executable: ${tailOf(r.stderr || r.stdout)}`);
1427
1533
  }
1428
1534
  const skillDir = workspaceSkillDir(spec.harness);
1429
1535
  for (const skill of env.workspaceSkills) {
@@ -1628,7 +1734,7 @@ async function attemptBody(spec, fn, { signal: testSignal, setMeta, progress, un
1628
1734
  exec,
1629
1735
  readFile
1630
1736
  }),
1631
- judge: judgeCaller(a)
1737
+ judge: judgeCaller(a, readFile)
1632
1738
  };
1633
1739
  const timedOut = () => !!timer?.aborted && !testSignal.aborted;
1634
1740
  try {
@@ -1643,9 +1749,11 @@ async function attemptBody(spec, fn, { signal: testSignal, setMeta, progress, un
1643
1749
  a.signal.throwIfAborted();
1644
1750
  const missed = await unawaited();
1645
1751
  if (missed) throw missed;
1752
+ const [only, ...more] = a.judgeErrors;
1753
+ if (only) throw new Error(more.length ? `${more.length + 1} judge calls failed:\n${a.judgeErrors.join("\n")}` : only);
1646
1754
  } catch (error) {
1647
1755
  recordFailure(a, error, timedOut());
1648
- if (timedOut()) throw new Error(`Eval timed out after ${spec.timeoutMs / 1e3}s`);
1756
+ if (timedOut()) throw new TimeoutError(`Eval timed out after ${spec.timeoutMs / 1e3}s`);
1649
1757
  throw error;
1650
1758
  } finally {
1651
1759
  if (!a.signal.aborted) await unawaited().catch(() => {});
@@ -1726,14 +1834,15 @@ function planEval(declaration, ctx) {
1726
1834
  if (mcp) throw new UsageError(`${where} on ${harnessId(planned.harness)}: ${mcp}`);
1727
1835
  }
1728
1836
  const path = ctx.file ? relativeFile(ctx.config.root, ctx.file) : null;
1729
- const setBy = {
1730
- sandbox: resolved.sources?.sandbox ?? ctx.config.file,
1731
- harness: resolved.sources?.harness ?? ctx.config.file
1732
- };
1837
+ const harnessBy = resolved.sources?.harness ?? ctx.config.file;
1733
1838
  const plan = evalPlan(resolvedEval, plannedAttempts, {
1734
1839
  configFile: ctx.config.file,
1735
1840
  file: path
1736
1841
  });
1842
+ const setByOf = (planned) => ({
1843
+ sandbox: sandboxSetBy(planned, resolved, ctx.config.file),
1844
+ harness: harnessBy
1845
+ });
1737
1846
  if (resolvedEval.skip) {
1738
1847
  const [first] = expand(resolved);
1739
1848
  if (!first) return [];
@@ -1746,7 +1855,7 @@ function planEval(declaration, ctx) {
1746
1855
  label: "",
1747
1856
  harness: first.harness,
1748
1857
  sandbox: first.sandbox,
1749
- setBy,
1858
+ setBy: setByOf(first),
1750
1859
  gate: "none",
1751
1860
  brokered: [],
1752
1861
  secretVars: [],
@@ -1763,6 +1872,8 @@ function planEval(declaration, ctx) {
1763
1872
  return plannedAttempts.map((planned) => {
1764
1873
  if (!cells.includes(planned.cell.key)) cells.push(planned.cell.key);
1765
1874
  const workspace = workspaceOf(planned.environment.layers);
1875
+ const files = filesOf(planned.environment.layers);
1876
+ const setBy = setByOf(planned);
1766
1877
  const attempt = {
1767
1878
  name,
1768
1879
  groups,
@@ -1779,6 +1890,7 @@ function planEval(declaration, ctx) {
1779
1890
  secretVars: secretVarsIn(resolved.env, planned),
1780
1891
  egress: planned.egress,
1781
1892
  ...workspace ? { workspace } : {},
1893
+ ...files.length ? { files } : {},
1782
1894
  plan
1783
1895
  };
1784
1896
  const rankFile = relativeFile(ctx.config.root, ctx.file ?? "");
@@ -1804,7 +1916,10 @@ function planEval(declaration, ctx) {
1804
1916
  timeoutMs,
1805
1917
  env: resolved.env,
1806
1918
  judge: resolved.judge,
1807
- sources: resolved.sources ?? {},
1919
+ sources: {
1920
+ ...resolved.sources,
1921
+ sandbox: setBy.sandbox
1922
+ },
1808
1923
  notes: resolvedEval.notes
1809
1924
  }
1810
1925
  };
@@ -1954,6 +2069,6 @@ const evaluate = Object.assign(defineEval("run"), {
1954
2069
  for: evalFor
1955
2070
  });
1956
2071
  //#endregion
1957
- export { DEFAULT_EGRESS_ALLOW, DEFAULT_SKILL_EXCLUDE, HarnessCapabilityError, defineConfig, defineEnvironment, evaluate, expect, group };
2072
+ export { DEFAULT_DIRECTORY_IGNORES, DEFAULT_EGRESS_ALLOW, DEFAULT_SKILL_EXCLUDE, HarnessCapabilityError, defineConfig, defineEnvironment, evaluate, expect, group };
1958
2073
 
1959
2074
  //# sourceMappingURL=index.js.map