@tangle-network/agent-bench 0.3.6 → 0.3.8

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 (265) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/HARNESS.md +43 -0
  3. package/dist/adapters.js +24 -24
  4. package/dist/benchmarks/_harness.d.ts +1 -1
  5. package/dist/benchmarks/_harness.js +1 -1
  6. package/dist/benchmarks/aec-bench.js +2 -2
  7. package/dist/benchmarks/agentbench.js +2 -2
  8. package/dist/benchmarks/appworld.js +2 -2
  9. package/dist/benchmarks/bfcl.js +2 -2
  10. package/dist/benchmarks/commit0.js +2 -2
  11. package/dist/benchmarks/crag.js +2 -2
  12. package/dist/benchmarks/dabstep.js +2 -2
  13. package/dist/benchmarks/enterpriseops-gym.js +2 -2
  14. package/dist/benchmarks/finresearchbench.js +2 -2
  15. package/dist/benchmarks/humaneval.d.ts +10 -1
  16. package/dist/benchmarks/humaneval.js +5 -3
  17. package/dist/benchmarks/nomiracl.js +2 -2
  18. package/dist/benchmarks/open-rag-bench.js +2 -2
  19. package/dist/benchmarks/programbench.js +2 -2
  20. package/dist/benchmarks/ragbench.js +2 -2
  21. package/dist/benchmarks/swe-bench.js +2 -2
  22. package/dist/benchmarks/t2-ragbench.js +2 -2
  23. package/dist/benchmarks/tau-bench-shared.js +2 -2
  24. package/dist/benchmarks/tau2-bench.js +3 -3
  25. package/dist/benchmarks/tau3-banking.js +3 -3
  26. package/dist/benchmarks/terminal-bench.js +2 -2
  27. package/dist/benchmarks/toollm.js +2 -2
  28. package/dist/benchmarks/webarena-verified.js +2 -2
  29. package/dist/{chunk-CKUVRZ2T.js → chunk-3U5TXJZS.js} +2 -2
  30. package/dist/{chunk-PPYSEKFM.js → chunk-5H5XV76F.js} +73 -15
  31. package/dist/chunk-5H5XV76F.js.map +1 -0
  32. package/dist/{chunk-YCGY7UIZ.js → chunk-7GRVHU22.js} +2 -2
  33. package/dist/{chunk-Z7ML6L77.js → chunk-HWST3SED.js} +2 -2
  34. package/dist/{chunk-SYDW647C.js → chunk-IA2FBTWC.js} +2 -2
  35. package/dist/{chunk-R67DFVLO.js → chunk-IFVINJ4B.js} +2 -2
  36. package/dist/{chunk-R36V2VP7.js → chunk-IZ5M6OAC.js} +2 -2
  37. package/dist/{chunk-ODT47UAY.js → chunk-K3BQGZCT.js} +2 -2
  38. package/dist/{chunk-IFAV6KEM.js → chunk-KP5KD6EN.js} +2 -2
  39. package/dist/{chunk-ZEWMTR5M.js → chunk-MQMRLGOG.js} +2 -2
  40. package/dist/{chunk-TSWPNOYM.js → chunk-NQG5XDSB.js} +2 -2
  41. package/dist/{chunk-7WSD27QQ.js → chunk-PB64GYIG.js} +2 -2
  42. package/dist/{chunk-HBSWHQNJ.js → chunk-RCYQEFNX.js} +3 -3
  43. package/dist/{chunk-J3KDJNX2.js → chunk-RH5F53JT.js} +2 -2
  44. package/dist/{chunk-UAIOHCUK.js → chunk-SFLA7OH3.js} +3 -3
  45. package/dist/{chunk-Y6O2OCUO.js → chunk-SHM6MRRF.js} +2 -2
  46. package/dist/{chunk-KDIKRJGB.js → chunk-SHYIRB7I.js} +2 -2
  47. package/dist/{chunk-HHXFIHXC.js → chunk-SVR2LKYI.js} +2 -2
  48. package/dist/{chunk-5SBJCB6W.js → chunk-V7AEBY6U.js} +22 -22
  49. package/dist/{chunk-LRRD7NAG.js → chunk-WSKWVEQB.js} +18 -2
  50. package/dist/chunk-WSKWVEQB.js.map +1 -0
  51. package/dist/{chunk-2PVVP7GN.js → chunk-XKEFIFIC.js} +2 -2
  52. package/dist/{chunk-JRWWGMK7.js → chunk-XYA4XSNU.js} +2 -2
  53. package/dist/{chunk-X5YKXC6V.js → chunk-YSMEKBTD.js} +2 -2
  54. package/dist/{chunk-2XU6OGEN.js → chunk-Z4TZ76N7.js} +2 -2
  55. package/dist/index.js +24 -24
  56. package/package.json +6 -5
  57. package/scripts/run-package-tests.mjs +30 -8
  58. package/scripts/verify-packed-consumer.mjs +1 -1
  59. package/scripts/verify-pier-agent.mts +1 -0
  60. package/src/benchmarks/_harness.ts +20 -2
  61. package/src/benchmarks/humaneval.test.mts +122 -0
  62. package/src/benchmarks/humaneval.ts +100 -27
  63. package/src/david-attribution.mts +78 -0
  64. package/src/david-goliath.mts +149 -0
  65. package/src/hev-improve.mts +25 -6
  66. package/src/humaneval-object-ablation.mts +201 -0
  67. package/src/live-improve-campaign-mbpp.mts +641 -0
  68. package/src/live-improve-campaign.mts +500 -0
  69. package/src/mbpp-structural.mts +12 -7
  70. package/src/quant-arena/README.md +144 -0
  71. package/src/quant-arena/backtest.test.mts +135 -0
  72. package/src/quant-arena/backtest.ts +218 -0
  73. package/src/quant-arena/data.test.mts +44 -0
  74. package/src/quant-arena/data.ts +141 -0
  75. package/src/quant-arena/driver.test.mts +253 -0
  76. package/src/quant-arena/driver.ts +219 -0
  77. package/src/quant-arena/fixtures/data/PROVENANCE.md +26 -0
  78. package/src/quant-arena/fixtures/data/holdout/IDX.csv +523 -0
  79. package/src/quant-arena/fixtures/data/holdout/S01.csv +523 -0
  80. package/src/quant-arena/fixtures/data/holdout/S02.csv +523 -0
  81. package/src/quant-arena/fixtures/data/holdout/S03.csv +523 -0
  82. package/src/quant-arena/fixtures/data/holdout/S04.csv +523 -0
  83. package/src/quant-arena/fixtures/data/holdout/S05.csv +523 -0
  84. package/src/quant-arena/fixtures/data/holdout/S06.csv +523 -0
  85. package/src/quant-arena/fixtures/data/holdout/S07.csv +523 -0
  86. package/src/quant-arena/fixtures/data/holdout/S08.csv +523 -0
  87. package/src/quant-arena/fixtures/data/holdout/S09.csv +523 -0
  88. package/src/quant-arena/fixtures/data/holdout/S10.csv +523 -0
  89. package/src/quant-arena/fixtures/data/insample/IDX.csv +2087 -0
  90. package/src/quant-arena/fixtures/data/insample/S01.csv +2087 -0
  91. package/src/quant-arena/fixtures/data/insample/S02.csv +2087 -0
  92. package/src/quant-arena/fixtures/data/insample/S03.csv +2087 -0
  93. package/src/quant-arena/fixtures/data/insample/S04.csv +2087 -0
  94. package/src/quant-arena/fixtures/data/insample/S05.csv +2087 -0
  95. package/src/quant-arena/fixtures/data/insample/S06.csv +2087 -0
  96. package/src/quant-arena/fixtures/data/insample/S07.csv +2087 -0
  97. package/src/quant-arena/fixtures/data/insample/S08.csv +2087 -0
  98. package/src/quant-arena/fixtures/data/insample/S09.csv +2087 -0
  99. package/src/quant-arena/fixtures/data/insample/S10.csv +2087 -0
  100. package/src/quant-arena/fixtures/demo-campaign/cost-ledger.jsonl +16 -0
  101. package/src/quant-arena/fixtures/demo-campaign/notebook.jsonl +5 -0
  102. package/src/quant-arena/fixtures/demo-campaign/rollout-manifest.json +171 -0
  103. package/src/quant-arena/fixtures/demo-campaign/strategies/cand-001-default-author/strategy.ts +119 -0
  104. package/src/quant-arena/fixtures/demo-campaign/strategies/cand-002-default-author/strategy.ts +119 -0
  105. package/src/quant-arena/fixtures/demo-campaign/strategies/cand-003-quant-researcher/strategy.ts +105 -0
  106. package/src/quant-arena/fixtures/demo-campaign/strategies/cand-004-quant-researcher/strategy.ts +102 -0
  107. package/src/quant-arena/fixtures/demo-campaign-v2/cost-ledger.jsonl +4 -0
  108. package/src/quant-arena/fixtures/demo-campaign-v2/notebook.jsonl +2 -0
  109. package/src/quant-arena/fixtures/demo-campaign-v2/rollout-manifest.json +84 -0
  110. package/src/quant-arena/fixtures/demo-campaign-v2/strategies/cand-001-quant-researcher/strategy.ts +117 -0
  111. package/src/quant-arena/holdout-certify.mts +206 -0
  112. package/src/quant-arena/holdout-certify.test.mts +82 -0
  113. package/src/quant-arena/leak-audit.test.mts +79 -0
  114. package/src/quant-arena/leak-audit.ts +95 -0
  115. package/src/quant-arena/make-fixtures.mts +161 -0
  116. package/src/quant-arena/multiplicity.test.mts +68 -0
  117. package/src/quant-arena/multiplicity.ts +87 -0
  118. package/src/quant-arena/nautilus-certify.ts +31 -0
  119. package/src/quant-arena/oms.ts +90 -0
  120. package/src/quant-arena/profiles/quant-researcher.profile.json +7 -0
  121. package/src/quant-arena/python/pyproject.toml +8 -0
  122. package/src/quant-arena/python/uv.lock +1297 -0
  123. package/src/quant-arena/python/vbt-worker.py +192 -0
  124. package/src/quant-arena/quant-loop.mts +813 -0
  125. package/src/quant-arena/quant-loop.test.mts +75 -0
  126. package/src/quant-arena/strategies/buy-hold-index/strategy.ts +11 -0
  127. package/src/quant-arena/strategies/equal-weight/strategy.ts +20 -0
  128. package/src/quant-arena/strategies/sma-crossover/strategy.ts +42 -0
  129. package/src/quant-arena/types.ts +133 -0
  130. package/src/quant-arena/vbt-client.ts +321 -0
  131. package/src/quant-arena/vbt-parity.test.mts +183 -0
  132. package/src/quant-arena/windows.test.mts +45 -0
  133. package/src/quant-arena/windows.ts +54 -0
  134. package/src/rollout-ledger/backfill-swe-arena.mts +606 -0
  135. package/src/rollout-ledger/backfill-swe-arena.test.mts +338 -0
  136. package/src/rollout-ledger/settle-capture.mts +442 -0
  137. package/src/rollout-ledger/settle-capture.test.mts +270 -0
  138. package/src/stream-observe.py +45 -0
  139. package/src/stream-observe.tpl.html +247 -0
  140. package/src/supervisor-arena.mts +816 -0
  141. package/src/swe-arena/activation.mts +228 -0
  142. package/src/swe-arena/activation.test.mts +303 -0
  143. package/src/swe-arena/analyze.ts +211 -0
  144. package/src/swe-arena/arms.ts +804 -0
  145. package/src/swe-arena/bootstrap-meta.mts +188 -0
  146. package/src/swe-arena/bootstrap-meta.test.mts +51 -0
  147. package/src/swe-arena/briefing.mts +217 -0
  148. package/src/swe-arena/briefing.test.mts +178 -0
  149. package/src/swe-arena/calibrate.ts +217 -0
  150. package/src/swe-arena/capabilities.mts +76 -0
  151. package/src/swe-arena/capabilities.test.mts +57 -0
  152. package/src/swe-arena/capacity.ts +194 -0
  153. package/src/swe-arena/cell-evidence.mts +437 -0
  154. package/src/swe-arena/cell-evidence.test.mts +248 -0
  155. package/src/swe-arena/diagnosis-ensemble.test.mts +210 -0
  156. package/src/swe-arena/diagnosis-ensemble.ts +520 -0
  157. package/src/swe-arena/execution.test.mts +1170 -0
  158. package/src/swe-arena/factory-command-container.ts +284 -0
  159. package/src/swe-arena/factory-judge-child.mts +228 -0
  160. package/src/swe-arena/factory.test.mts +643 -0
  161. package/src/swe-arena/fixtures/analyze.py +80 -0
  162. package/src/swe-arena/fixtures/excludes.txt +8 -0
  163. package/src/swe-arena/fixtures/factory/agent-eval-309/calibration.md +51 -0
  164. package/src/swe-arena/fixtures/factory/agent-eval-309/manifest.json +29 -0
  165. package/src/swe-arena/fixtures/factory/agent-eval-309/spec.md +64 -0
  166. package/src/swe-arena/fixtures/factory/agent-runtime-232/calibration.md +48 -0
  167. package/src/swe-arena/fixtures/factory/agent-runtime-232/manifest.json +29 -0
  168. package/src/swe-arena/fixtures/factory/agent-runtime-232/spec.md +48 -0
  169. package/src/swe-arena/fixtures/factory/loops-28/calibration.md +47 -0
  170. package/src/swe-arena/fixtures/factory/loops-28/manifest.json +30 -0
  171. package/src/swe-arena/fixtures/factory/loops-28/spec.md +50 -0
  172. package/src/swe-arena/fixtures/gen1-salvage/README.md +45 -0
  173. package/src/swe-arena/fixtures/gen1-salvage/cand0-e6d7361.diff +116 -0
  174. package/src/swe-arena/fixtures/gen1-salvage/cand1-76a8590.diff +293 -0
  175. package/src/swe-arena/fixtures/holdout-preregister.log +12 -0
  176. package/src/swe-arena/fixtures/holdout.json +44 -0
  177. package/src/swe-arena/fixtures/instances.json +146 -0
  178. package/src/swe-arena/fixtures/ledger.jsonl +12 -0
  179. package/src/swe-arena/fixtures/patches/pallets__flask-5014.solo.patch +36 -0
  180. package/src/swe-arena/fixtures/patches/pydata__xarray-4687.sup.patch +33 -0
  181. package/src/swe-arena/fixtures/rejudge.jsonl +15 -0
  182. package/src/swe-arena/fixtures/rematch.jsonl +3 -0
  183. package/src/swe-arena/fixtures/rematch2.jsonl +3 -0
  184. package/src/swe-arena/fixtures/rematch3.jsonl +3 -0
  185. package/src/swe-arena/fixtures/run-report/README.md +43 -0
  186. package/src/swe-arena/fixtures/run-report/factory-agent-eval-309-FSUP0.json +173 -0
  187. package/src/swe-arena/fixtures/run-report/factory-agent-eval-309-FSUP0.md +100 -0
  188. package/src/swe-arena/fixtures/run-report/gen3-rollup.json +551 -0
  189. package/src/swe-arena/fixtures/run-report/gen3-rollup.md +64 -0
  190. package/src/swe-arena/fixtures/sup-journal-true.json +19 -0
  191. package/src/swe-arena/fixtures/verify/astropy__astropy-13033.sh +48 -0
  192. package/src/swe-arena/fixtures/verify/django__django-11532.sh +50 -0
  193. package/src/swe-arena/fixtures/verify/matplotlib__matplotlib-20826.sh +76 -0
  194. package/src/swe-arena/fixtures/verify/pydata__xarray-4687.sh +44 -0
  195. package/src/swe-arena/fixtures/verify/pytest-dev__pytest-6197.sh +32 -0
  196. package/src/swe-arena/fixtures/verify/sphinx-doc__sphinx-9658.sh +51 -0
  197. package/src/swe-arena/fixtures/worker-tokens.json +42 -0
  198. package/src/swe-arena/fixtures.ts +237 -0
  199. package/src/swe-arena/gepa-seat.mts +583 -0
  200. package/src/swe-arena/gepa-seat.test.mts +635 -0
  201. package/src/swe-arena/holdout-certify.mts +408 -0
  202. package/src/swe-arena/holdout-certify.test.mts +160 -0
  203. package/src/swe-arena/judge-child.mts +37 -0
  204. package/src/swe-arena/ledger-orphans.mts +77 -0
  205. package/src/swe-arena/ledger-orphans.test.mts +147 -0
  206. package/src/swe-arena/lineage-record.mts +164 -0
  207. package/src/swe-arena/lineage-record.test.mts +115 -0
  208. package/src/swe-arena/manifest.mts +293 -0
  209. package/src/swe-arena/manifest.test.mts +169 -0
  210. package/src/swe-arena/materialize.ts +142 -0
  211. package/src/swe-arena/outer-loop.mts +2795 -0
  212. package/src/swe-arena/outer-loop.test.mts +696 -0
  213. package/src/swe-arena/parity.test.mts +87 -0
  214. package/src/swe-arena/premeasured-from-cells.mts +281 -0
  215. package/src/swe-arena/premeasured-from-cells.test.mts +180 -0
  216. package/src/swe-arena/proc.test.mts +174 -0
  217. package/src/swe-arena/proc.ts +260 -0
  218. package/src/swe-arena/profiles/default-author.profile.json +4 -0
  219. package/src/swe-arena/proposer-fanout.mts +770 -0
  220. package/src/swe-arena/proposer-fanout.test.mts +619 -0
  221. package/src/swe-arena/proposer-provenance.mts +177 -0
  222. package/src/swe-arena/proposer-provenance.test.mts +106 -0
  223. package/src/swe-arena/reconcile.ts +0 -0
  224. package/src/swe-arena/replay.mts +183 -0
  225. package/src/swe-arena/replay.test.mts +300 -0
  226. package/src/swe-arena/run-experiment.mts +727 -0
  227. package/src/swe-arena/run-report.mts +75 -0
  228. package/src/swe-arena/run-supervisor.mjs +297 -0
  229. package/src/swe-arena/run-supervisor.test.mts +500 -0
  230. package/src/swe-arena/score-split.mts +140 -0
  231. package/src/swe-arena/score-split.test.mts +123 -0
  232. package/src/swe-arena/serialized-judge.ts +414 -0
  233. package/src/swe-arena/types.ts +218 -0
  234. package/src/swe-code-improve.mts +328 -0
  235. package/src/swe-emit-patch.mts +104 -0
  236. package/src/swe-improve.mts +232 -0
  237. package/src/swe-jail.ts +2 -2
  238. package/src/swe-local-proof.mts +169 -0
  239. package/src/swe-repro-calibrate.mts +446 -0
  240. package/src/swe-stream.mts +1497 -0
  241. package/src/swe-structural.mts +245 -837
  242. package/dist/chunk-LRRD7NAG.js.map +0 -1
  243. package/dist/chunk-PPYSEKFM.js.map +0 -1
  244. /package/dist/{chunk-CKUVRZ2T.js.map → chunk-3U5TXJZS.js.map} +0 -0
  245. /package/dist/{chunk-YCGY7UIZ.js.map → chunk-7GRVHU22.js.map} +0 -0
  246. /package/dist/{chunk-Z7ML6L77.js.map → chunk-HWST3SED.js.map} +0 -0
  247. /package/dist/{chunk-SYDW647C.js.map → chunk-IA2FBTWC.js.map} +0 -0
  248. /package/dist/{chunk-R67DFVLO.js.map → chunk-IFVINJ4B.js.map} +0 -0
  249. /package/dist/{chunk-R36V2VP7.js.map → chunk-IZ5M6OAC.js.map} +0 -0
  250. /package/dist/{chunk-ODT47UAY.js.map → chunk-K3BQGZCT.js.map} +0 -0
  251. /package/dist/{chunk-IFAV6KEM.js.map → chunk-KP5KD6EN.js.map} +0 -0
  252. /package/dist/{chunk-ZEWMTR5M.js.map → chunk-MQMRLGOG.js.map} +0 -0
  253. /package/dist/{chunk-TSWPNOYM.js.map → chunk-NQG5XDSB.js.map} +0 -0
  254. /package/dist/{chunk-7WSD27QQ.js.map → chunk-PB64GYIG.js.map} +0 -0
  255. /package/dist/{chunk-HBSWHQNJ.js.map → chunk-RCYQEFNX.js.map} +0 -0
  256. /package/dist/{chunk-J3KDJNX2.js.map → chunk-RH5F53JT.js.map} +0 -0
  257. /package/dist/{chunk-UAIOHCUK.js.map → chunk-SFLA7OH3.js.map} +0 -0
  258. /package/dist/{chunk-Y6O2OCUO.js.map → chunk-SHM6MRRF.js.map} +0 -0
  259. /package/dist/{chunk-KDIKRJGB.js.map → chunk-SHYIRB7I.js.map} +0 -0
  260. /package/dist/{chunk-HHXFIHXC.js.map → chunk-SVR2LKYI.js.map} +0 -0
  261. /package/dist/{chunk-5SBJCB6W.js.map → chunk-V7AEBY6U.js.map} +0 -0
  262. /package/dist/{chunk-2PVVP7GN.js.map → chunk-XKEFIFIC.js.map} +0 -0
  263. /package/dist/{chunk-JRWWGMK7.js.map → chunk-XYA4XSNU.js.map} +0 -0
  264. /package/dist/{chunk-X5YKXC6V.js.map → chunk-YSMEKBTD.js.map} +0 -0
  265. /package/dist/{chunk-2XU6OGEN.js.map → chunk-Z4TZ76N7.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.8
4
+
5
+ - Resolve package-owned fixtures and scripts from both source and compiled installs, and prove ToolLLM fixture loading from the packed package.
6
+
7
+ ## 0.3.7
8
+
9
+ - Declare the public executable search path for Pier candidate entrypoints so the exact process contract can replay them against `@tangle-network/agent-runtime@0.102.0`.
10
+ - Align the portable agent contract with `@tangle-network/agent-interface@0.32.0`.
11
+ - Add the trace-driven SWE supervisor improvement loop with measured candidate worktrees and official Docker judging.
12
+ - Settle cancelled worker trees, isolate each cell's state, serialize judges with a kernel lock, and reject unfinished processes before patch extraction or scoring.
13
+
3
14
  ## 0.3.6
4
15
 
5
16
  - Ship compiled ESM and declarations so Node can import the installed package without a TypeScript runtime.
package/HARNESS.md CHANGED
@@ -71,6 +71,48 @@ this codebase. `agent-lab/runs/RUNS.md` is the index mapping artifacts → verdi
71
71
  findings gist. **Set `OUT=runs/<date>/<name>.json` (in agent-lab) on every run — never `/tmp`**
72
72
  (a reboot erases ramdisk; ~20 runs nearly died there once).
73
73
 
74
+ ## Run observability — never hand-grep a journal again
75
+
76
+ Every supervisor cell writes `run-report.json` + `run-report.md` next to its artifacts, and
77
+ appends a headline block to the run log, automatically: `outer-loop.mts` and both
78
+ `run-experiment.mts` paths call `writeRunReportSafe` after each cell and `reportRound` at
79
+ the gate. Source: `swe-arena/run-report.mts` (pure `computeRunReport` + an I/O collector).
80
+
81
+ What it answers, all deterministic, all from artifacts already on disk (`journal.jsonl`,
82
+ `workers/*.ndjson`, `workers/*.inbox.ndjson`, `state.json`, `result.json`, `judge.json`,
83
+ the ledger, `driver.log`, the delivered patch, the opencode session store):
84
+
85
+ - **orchestration** — workers spawned/settled/cancelled, **steer count with a per-worker
86
+ breakdown**, spawn waves + sizes, max concurrency, respawns, repeated labels, delegation
87
+ depth, time-to-first-spawn, supervisor wall, idle wall (zero live workers), worker
88
+ utilization (Σ worker wall ÷ supervisor wall).
89
+ - **decision quality** — settled by status/verdict, accepted vs rejected vs empty-pass,
90
+ evidence→respawn sequences vs blind respawns, review actions, evidence bytes returned.
91
+ - **economics** — tokens + USD by role (brain from journal `metered`; workers from journal
92
+ `settled` spend plus the opencode session join), per-worker rows, cost per accepted patch,
93
+ worker wall distribution.
94
+ - **outcome** — supervisor status/verdict/delivered, judge verdict + score (from `judge.json`
95
+ or the matching ledger row, with provenance), verify gate, patch file/line/test-touch stats.
96
+
97
+ Every metric is UNAVAILABLE-aware: a missing artifact yields `{"unavailable": "<reason>"}`
98
+ and renders as `unavailable — <reason>`, never `0`. A supervisor that steered nobody and a
99
+ supervisor whose worker logs were lost are visually different, because they have driven
100
+ opposite conclusions about the same architecture.
101
+
102
+ Standalone / backfill (use `--report-dir` when the run directory must stay READ-ONLY):
103
+ ```
104
+ tsx src/swe-arena/run-report.mts <cellDir> [--patch p.diff] [--ledger ledger.jsonl] [--log run.log] [--report-dir out/]
105
+ tsx src/swe-arena/run-report.mts --round <outDir> [--report-dir out/]
106
+ ```
107
+
108
+ Relationship to the published `traces` CLI (`npx @tangle-network/traces analyze`): traces
109
+ covers the HARNESS-SESSION layer — per-session model calls, token/cost tables, latency
110
+ distributions, stuck-loop detection, tool-error rates, skill/subagent adoption — reading the
111
+ opencode/claude-code/codex session stores. It has no supervision-tree reader: no journal
112
+ parsing, no steer/wave/concurrency/utilization/delegation-depth metric, no accepted-vs-rejected
113
+ worker accounting. The two are complementary; run-report prints the traces command for the
114
+ same cell rather than re-deriving session-level facts.
115
+
74
116
  ## Data flow (the whole experiment in one line)
75
117
  `rollout (worker → answer) → adapter.judge (valid?) → CORPUS RunRecord (k attempts, output+valid each) → corpus-replay --selector (pick WITHOUT the judge) → corpus-report CI → gate verdict`
76
118
  The expensive part (rollouts) produces a **reusable corpus**; selection + stats are free
@@ -135,6 +177,7 @@ the gate + measurement tools:
135
177
  commit0-env-run.mts the HARD domain through `runBenchmark` (the optimization suite)
136
178
  terminal-compare.ts Terminal-Bench compare (own main)
137
179
  pnpm verify:pier zero-model failure/pass Pier controls through a separate verifier
180
+ swe-arena/run-report.mts deterministic per-cell run report (steers, waves, idle, cost by role) + round rollup
138
181
  unit tests (the only fully-green, cred-free runnable surface besides offline replay):
139
182
  node --test --import tsx src/{selector,refine-loop}.test.mts
140
183
  tsx src/gate.test.mts # offline plumbing test (no creds)
package/dist/adapters.js CHANGED
@@ -1,40 +1,40 @@
1
1
  import {
2
2
  ADAPTERS,
3
3
  resolveAdapter
4
- } from "./chunk-5SBJCB6W.js";
5
- import "./chunk-2PVVP7GN.js";
4
+ } from "./chunk-V7AEBY6U.js";
5
+ import "./chunk-XKEFIFIC.js";
6
6
  import "./chunk-VQRS7VUC.js";
7
- import "./chunk-Z7ML6L77.js";
8
- import "./chunk-R67DFVLO.js";
7
+ import "./chunk-HWST3SED.js";
8
+ import "./chunk-IFVINJ4B.js";
9
9
  import "./chunk-SEVJPLZC.js";
10
- import "./chunk-CKUVRZ2T.js";
11
- import "./chunk-Y6O2OCUO.js";
12
- import "./chunk-HBSWHQNJ.js";
13
- import "./chunk-UAIOHCUK.js";
14
- import "./chunk-R36V2VP7.js";
15
- import "./chunk-JRWWGMK7.js";
10
+ import "./chunk-3U5TXJZS.js";
11
+ import "./chunk-SHM6MRRF.js";
12
+ import "./chunk-RCYQEFNX.js";
13
+ import "./chunk-SFLA7OH3.js";
14
+ import "./chunk-IZ5M6OAC.js";
15
+ import "./chunk-XYA4XSNU.js";
16
16
  import "./chunk-INNOYXCP.js";
17
17
  import "./chunk-PA2ZKHJC.js";
18
- import "./chunk-PPYSEKFM.js";
18
+ import "./chunk-5H5XV76F.js";
19
19
  import "./chunk-TBKU5XQI.js";
20
- import "./chunk-TSWPNOYM.js";
21
- import "./chunk-KDIKRJGB.js";
22
- import "./chunk-ZEWMTR5M.js";
20
+ import "./chunk-NQG5XDSB.js";
21
+ import "./chunk-SHYIRB7I.js";
22
+ import "./chunk-MQMRLGOG.js";
23
23
  import "./chunk-PUIRNYI7.js";
24
24
  import "./chunk-C7T7WEK2.js";
25
25
  import "./chunk-JTHWEDEW.js";
26
- import "./chunk-2XU6OGEN.js";
27
- import "./chunk-HHXFIHXC.js";
26
+ import "./chunk-Z4TZ76N7.js";
27
+ import "./chunk-SVR2LKYI.js";
28
28
  import "./chunk-X3BTXCJ4.js";
29
- import "./chunk-J3KDJNX2.js";
30
- import "./chunk-X5YKXC6V.js";
31
- import "./chunk-YCGY7UIZ.js";
29
+ import "./chunk-RH5F53JT.js";
30
+ import "./chunk-YSMEKBTD.js";
31
+ import "./chunk-7GRVHU22.js";
32
32
  import "./chunk-UPAMRDX4.js";
33
- import "./chunk-ODT47UAY.js";
34
- import "./chunk-7WSD27QQ.js";
35
- import "./chunk-SYDW647C.js";
36
- import "./chunk-IFAV6KEM.js";
37
- import "./chunk-LRRD7NAG.js";
33
+ import "./chunk-K3BQGZCT.js";
34
+ import "./chunk-PB64GYIG.js";
35
+ import "./chunk-IA2FBTWC.js";
36
+ import "./chunk-KP5KD6EN.js";
37
+ import "./chunk-WSKWVEQB.js";
38
38
  import "./chunk-53UPUNBZ.js";
39
39
  export {
40
40
  ADAPTERS,
@@ -19,7 +19,7 @@ import '@tangle-network/agent-runtime/loops';
19
19
  * nonzero throws with the captured stderr — never a fabricated score.
20
20
  */
21
21
 
22
- /** Repo root for the bench package (…/bench), so `.venv` and `fixtures` resolve. */
22
+ /** Package root for agent-bench, so `.venv`, scripts, and fixtures resolve. */
23
23
  declare const benchRoot: string;
24
24
  /** Resolve the shared interpreter without requiring an installed package to contain a venv. */
25
25
  declare function resolveBenchPython(env?: Readonly<{
@@ -13,7 +13,7 @@ import {
13
13
  venvBin,
14
14
  venvPython,
15
15
  venvPythonAt
16
- } from "../chunk-LRRD7NAG.js";
16
+ } from "../chunk-WSKWVEQB.js";
17
17
  export {
18
18
  StagedJudgeError,
19
19
  benchRoot,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAecBenchAdapter
3
- } from "../chunk-ODT47UAY.js";
4
- import "../chunk-LRRD7NAG.js";
3
+ } from "../chunk-K3BQGZCT.js";
4
+ import "../chunk-WSKWVEQB.js";
5
5
  export {
6
6
  createAecBenchAdapter
7
7
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  agentbenchAnswerOutput,
3
3
  createAgentBenchAdapter
4
- } from "../chunk-7WSD27QQ.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-PB64GYIG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  agentbenchAnswerOutput,
8
8
  createAgentBenchAdapter
@@ -3,8 +3,8 @@ import {
3
3
  appworldToolLoopClient,
4
4
  createAppWorldAdapter,
5
5
  createAppWorldReactAdapter
6
- } from "../chunk-SYDW647C.js";
7
- import "../chunk-LRRD7NAG.js";
6
+ } from "../chunk-IA2FBTWC.js";
7
+ import "../chunk-WSKWVEQB.js";
8
8
  export {
9
9
  appworldSolutionOutput,
10
10
  appworldToolLoopClient,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  bfclOutput,
3
3
  createBfclAdapter
4
- } from "../chunk-IFAV6KEM.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-KP5KD6EN.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  bfclOutput,
8
8
  createBfclAdapter
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  commit0DiffOutput,
3
3
  createCommit0Adapter
4
- } from "../chunk-2XU6OGEN.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-Z4TZ76N7.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  commit0DiffOutput,
8
8
  createCommit0Adapter
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createCragAdapter
3
- } from "../chunk-HHXFIHXC.js";
3
+ } from "../chunk-SVR2LKYI.js";
4
4
  import "../chunk-X3BTXCJ4.js";
5
- import "../chunk-LRRD7NAG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createCragAdapter
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createDabstepAdapter,
3
3
  dabstepAnswerOutput
4
- } from "../chunk-J3KDJNX2.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-RH5F53JT.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createDabstepAdapter,
8
8
  dabstepAnswerOutput
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createEnterpriseOpsGymAdapter,
3
3
  enterpriseOpsTranscriptOutput
4
- } from "../chunk-X5YKXC6V.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-YSMEKBTD.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createEnterpriseOpsGymAdapter,
8
8
  enterpriseOpsTranscriptOutput
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createFinResearchBenchAdapter
3
- } from "../chunk-YCGY7UIZ.js";
4
- import "../chunk-LRRD7NAG.js";
3
+ } from "../chunk-7GRVHU22.js";
4
+ import "../chunk-WSKWVEQB.js";
5
5
  export {
6
6
  createFinResearchBenchAdapter
7
7
  };
@@ -45,9 +45,18 @@ interface CheckResult {
45
45
  * execution-grounded feedback a self-repair loop steers on; ignored by selection. */
46
46
  detail?: string;
47
47
  }
48
+ interface PythonProgramResult {
49
+ exitCode: number;
50
+ stdout: string;
51
+ stderr: string;
52
+ }
53
+ /** Run arbitrary Python in the same isolated container used by the HumanEval
54
+ * checker. This is also the execution-tool primitive for experiments that let
55
+ * a model test its own snippets; model-written code must never run on the host. */
56
+ declare function runPythonProgram(program: string, timeoutMs?: number): Promise<PythonProgramResult>;
48
57
  declare function runChecker(task: HumanEvalTask, candidate: string): Promise<CheckResult>;
49
58
  /** The HumanEval `BenchmarkAdapter`. OFFSET (env) selects the correctable middle
50
59
  * band; loadTasks honors `limit`/`ids`. The judge is the Docker deployable checker. */
51
60
  declare function createHumanEvalAdapter(): BenchmarkAdapter;
52
61
 
53
- export { type CheckResult, type HumanEvalTask, basePrompt, createHumanEvalAdapter, extractCode, loadHumanEval, runChecker };
62
+ export { type CheckResult, type HumanEvalTask, type PythonProgramResult, basePrompt, createHumanEvalAdapter, extractCode, loadHumanEval, runChecker, runPythonProgram };
@@ -3,13 +3,15 @@ import {
3
3
  createHumanEvalAdapter,
4
4
  extractCode,
5
5
  loadHumanEval,
6
- runChecker
7
- } from "../chunk-PPYSEKFM.js";
6
+ runChecker,
7
+ runPythonProgram
8
+ } from "../chunk-5H5XV76F.js";
8
9
  export {
9
10
  basePrompt,
10
11
  createHumanEvalAdapter,
11
12
  extractCode,
12
13
  loadHumanEval,
13
- runChecker
14
+ runChecker,
15
+ runPythonProgram
14
16
  };
15
17
  //# sourceMappingURL=humaneval.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createNoMiraclAdapter
3
- } from "../chunk-TSWPNOYM.js";
3
+ } from "../chunk-NQG5XDSB.js";
4
4
  import "../chunk-X3BTXCJ4.js";
5
- import "../chunk-LRRD7NAG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createNoMiraclAdapter
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createOpenRagBenchAdapter
3
- } from "../chunk-KDIKRJGB.js";
3
+ } from "../chunk-SHYIRB7I.js";
4
4
  import "../chunk-X3BTXCJ4.js";
5
- import "../chunk-LRRD7NAG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createOpenRagBenchAdapter
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createProgrambenchAdapter,
3
3
  programbenchSubmissionOutput
4
- } from "../chunk-ZEWMTR5M.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-MQMRLGOG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createProgrambenchAdapter,
8
8
  programbenchSubmissionOutput
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createRagBenchAdapter
3
- } from "../chunk-R67DFVLO.js";
3
+ } from "../chunk-IFVINJ4B.js";
4
4
  import "../chunk-X3BTXCJ4.js";
5
- import "../chunk-LRRD7NAG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createRagBenchAdapter
8
8
  };
@@ -3,8 +3,8 @@ import {
3
3
  scoreSweReport,
4
4
  sweEvaluationArgv,
5
5
  swePatchOutput
6
- } from "../chunk-CKUVRZ2T.js";
7
- import "../chunk-LRRD7NAG.js";
6
+ } from "../chunk-3U5TXJZS.js";
7
+ import "../chunk-WSKWVEQB.js";
8
8
  export {
9
9
  createSweBenchAdapter,
10
10
  scoreSweReport,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createT2RagBenchAdapter
3
- } from "../chunk-Y6O2OCUO.js";
3
+ } from "../chunk-SHM6MRRF.js";
4
4
  import "../chunk-X3BTXCJ4.js";
5
- import "../chunk-LRRD7NAG.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createT2RagBenchAdapter
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createTauBenchAdapter,
3
3
  tauResultsOutput
4
- } from "../chunk-R36V2VP7.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-IZ5M6OAC.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createTauBenchAdapter,
8
8
  tauResultsOutput
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createTau2BenchAdapter,
3
3
  tau2ResultsOutput
4
- } from "../chunk-HBSWHQNJ.js";
5
- import "../chunk-R36V2VP7.js";
6
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-RCYQEFNX.js";
5
+ import "../chunk-IZ5M6OAC.js";
6
+ import "../chunk-WSKWVEQB.js";
7
7
  export {
8
8
  createTau2BenchAdapter,
9
9
  tau2ResultsOutput
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createTau3BankingAdapter
3
- } from "../chunk-UAIOHCUK.js";
4
- import "../chunk-R36V2VP7.js";
5
- import "../chunk-LRRD7NAG.js";
3
+ } from "../chunk-SFLA7OH3.js";
4
+ import "../chunk-IZ5M6OAC.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createTau3BankingAdapter
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createTerminalBenchAdapter
3
- } from "../chunk-JRWWGMK7.js";
4
- import "../chunk-LRRD7NAG.js";
3
+ } from "../chunk-XYA4XSNU.js";
4
+ import "../chunk-WSKWVEQB.js";
5
5
  export {
6
6
  createTerminalBenchAdapter
7
7
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createToolLlmAdapter,
3
3
  toollmOutput
4
- } from "../chunk-2PVVP7GN.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-XKEFIFIC.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createToolLlmAdapter,
8
8
  toollmOutput
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createWebArenaVerifiedAdapter,
3
3
  webarenaOutputDirOutput
4
- } from "../chunk-Z7ML6L77.js";
5
- import "../chunk-LRRD7NAG.js";
4
+ } from "../chunk-HWST3SED.js";
5
+ import "../chunk-WSKWVEQB.js";
6
6
  export {
7
7
  createWebArenaVerifiedAdapter,
8
8
  webarenaOutputDirOutput
@@ -5,7 +5,7 @@ import {
5
5
  runVenvPython,
6
6
  safeRunId,
7
7
  stageFile
8
- } from "./chunk-LRRD7NAG.js";
8
+ } from "./chunk-WSKWVEQB.js";
9
9
 
10
10
  // src/benchmarks/swe-bench.ts
11
11
  import { join } from "path";
@@ -248,4 +248,4 @@ export {
248
248
  sweEvaluationArgv,
249
249
  createSweBenchAdapter
250
250
  };
251
- //# sourceMappingURL=chunk-CKUVRZ2T.js.map
251
+ //# sourceMappingURL=chunk-3U5TXJZS.js.map
@@ -1,6 +1,6 @@
1
1
  // src/benchmarks/humaneval.ts
2
2
  import { execFile } from "child_process";
3
- import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "fs";
3
+ import { chmodSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "fs";
4
4
  import { tmpdir } from "os";
5
5
  import { join } from "path";
6
6
  import { gunzipSync } from "zlib";
@@ -59,10 +59,12 @@ check(${task.entryPoint})
59
59
  `;
60
60
  }
61
61
  var dockerRunSeq = 0;
62
- function runChecker(task, candidate) {
62
+ function runPythonProgram(program, timeoutMs = dockerTimeoutMs) {
63
63
  const dir = mkdtempSync(join(tmpdir(), "hev-"));
64
- writeFileSync(join(dir, "p.py"), buildProgram(task, candidate));
64
+ chmodSync(dir, 493);
65
+ writeFileSync(join(dir, "p.py"), program, { mode: 420 });
65
66
  const name = `hev-${process.pid}-${dockerRunSeq++}`;
67
+ const startMarker = `__AGENT_RUNTIME_CANDIDATE_STARTED_${name}__`;
66
68
  return new Promise((resolvePromise, reject) => {
67
69
  let settled = false;
68
70
  const cleanup = () => {
@@ -84,49 +86,98 @@ function runChecker(task, candidate) {
84
86
  cleanup();
85
87
  reject(e);
86
88
  };
87
- const backstop = setTimeout(() => finish({ pass: 0 }), dockerTimeoutMs + 3e3);
89
+ const outerTimeoutMs = timeoutMs + 3e3;
90
+ const backstop = setTimeout(
91
+ () => fail(new Error(`docker checker did not return within ${outerTimeoutMs + 3e3}ms`)),
92
+ outerTimeoutMs + 3e3
93
+ );
94
+ const inContainerSeconds = Math.max(1, Math.ceil(timeoutMs / 1e3));
88
95
  execFile(
89
96
  "docker",
90
97
  [
91
98
  "run",
92
99
  "--rm",
100
+ "--pull=never",
93
101
  "--name",
94
102
  name,
95
103
  "--network=none",
96
104
  "--cpus=1",
97
105
  "--memory=512m",
106
+ "--pids-limit=64",
107
+ "--cap-drop=ALL",
108
+ "--security-opt=no-new-privileges",
109
+ "--read-only",
110
+ "--tmpfs",
111
+ "/tmp:rw,nosuid,nodev,noexec,size=64m,mode=1777",
112
+ "--user",
113
+ "65534:65534",
98
114
  "-v",
99
115
  `${dir}:/w:ro`,
100
116
  "-w",
101
117
  "/w",
102
118
  dockerImage,
103
- "python",
104
- "/w/p.py"
119
+ "sh",
120
+ "-c",
121
+ 'command -v timeout >/dev/null 2>&1 && command -v python >/dev/null 2>&1 && [ -r /w/p.py ] || exit 126; printf "%s\\n" "$1"; exec timeout -s KILL "$2" python /w/p.py',
122
+ "agent-runtime-checker",
123
+ startMarker,
124
+ `${inContainerSeconds}s`
105
125
  ],
106
- { timeout: dockerTimeoutMs, killSignal: "SIGKILL", maxBuffer: 4 * 1024 * 1024 },
107
- (err, _stdout, stderr) => {
126
+ { timeout: outerTimeoutMs, killSignal: "SIGKILL", maxBuffer: 4 * 1024 * 1024 },
127
+ (err, stdout, stderr) => {
128
+ const markerLine = `${startMarker}
129
+ `;
130
+ const candidateStarted = stdout?.startsWith(markerLine) === true;
131
+ const candidateStdout = candidateStarted ? stdout.slice(markerLine.length) : stdout ?? "";
108
132
  if (err) {
109
133
  const e = err;
110
134
  if (e.code === "ENOENT") {
111
135
  fail(new Error("docker binary not found on PATH \u2014 cannot run the deployable checker"));
112
136
  return;
113
137
  }
114
- if (/cannot connect to the docker daemon|is the docker daemon running|permission denied while trying to connect/i.test(stderr)) {
115
- fail(new Error(`docker daemon unreachable: ${stderr.slice(0, 200)}`));
138
+ if (e.killed) {
139
+ fail(new Error(`docker checker exceeded its ${outerTimeoutMs}ms outer timeout`));
116
140
  return;
117
141
  }
118
- if (/(unable to find image|pull access denied|manifest unknown|error response from daemon).*(pull|repository|registry)/i.test(stderr)) {
119
- fail(new Error(`docker image ${dockerImage} unavailable: ${stderr.slice(0, 200)}`));
142
+ if (!candidateStarted) {
143
+ if (/cannot connect to the docker daemon|is the docker daemon running|permission denied while trying to connect/i.test(
144
+ stderr
145
+ )) {
146
+ fail(new Error(`docker daemon unreachable: ${stderr.slice(0, 200)}`));
147
+ return;
148
+ }
149
+ if (/unable to find image|no such image|pull access denied|manifest unknown/i.test(stderr)) {
150
+ fail(new Error(`docker image ${dockerImage} unavailable: ${stderr.slice(0, 200)}`));
151
+ return;
152
+ }
153
+ fail(
154
+ new Error(
155
+ `docker checker did not start the candidate: ${stderr.slice(0, 200) || e.message}`
156
+ )
157
+ );
120
158
  return;
121
159
  }
122
- finish({ pass: 0, detail: (stderr || "").slice(-600) || "timed out (no output)" });
160
+ const exitCode = typeof e.code === "number" ? e.code : 1;
161
+ finish({
162
+ exitCode,
163
+ stdout: candidateStdout,
164
+ stderr: stderr ?? ""
165
+ });
123
166
  return;
124
167
  }
125
- finish({ pass: 1 });
168
+ if (!candidateStarted) {
169
+ fail(new Error("docker checker exited without starting the candidate"));
170
+ return;
171
+ }
172
+ finish({ exitCode: 0, stdout: candidateStdout, stderr: stderr ?? "" });
126
173
  }
127
174
  );
128
175
  });
129
176
  }
177
+ async function runChecker(task, candidate) {
178
+ const result = await runPythonProgram(buildProgram(task, candidate));
179
+ return result.exitCode === 0 ? { pass: 1 } : { pass: 0, detail: result.stderr.slice(-600) || "timed out (no output)" };
180
+ }
130
181
  function toBenchTask(t) {
131
182
  const metadata = {
132
183
  promptHeader: t.prompt,
@@ -153,6 +204,12 @@ function createHumanEvalAdapter() {
153
204
  else resolve();
154
205
  });
155
206
  });
207
+ await new Promise((resolve, reject) => {
208
+ execFile("docker", ["image", "inspect", dockerImage], (err) => {
209
+ if (err) reject(new Error(`HumanEval judge needs the cached Docker image ${dockerImage}`));
210
+ else resolve();
211
+ });
212
+ });
156
213
  },
157
214
  async loadTasks(opts) {
158
215
  const offset = Number(process.env.OFFSET ?? 0);
@@ -176,7 +233,8 @@ export {
176
233
  loadHumanEval,
177
234
  basePrompt,
178
235
  extractCode,
236
+ runPythonProgram,
179
237
  runChecker,
180
238
  createHumanEvalAdapter
181
239
  };
182
- //# sourceMappingURL=chunk-PPYSEKFM.js.map
240
+ //# sourceMappingURL=chunk-5H5XV76F.js.map