niceeval 0.12.1 → 0.12.2-canary.31

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 (3266) hide show
  1. package/INDEX.md +33 -27
  2. package/bin/niceeval.js +8 -6
  3. package/dist/agents/ai-sdk-otel.cjs +54 -0
  4. package/dist/agents/ai-sdk-otel.cjs.map +1 -0
  5. package/dist/agents/ai-sdk-otel.d.cts +27 -0
  6. package/dist/agents/ai-sdk-otel.d.mts +27 -0
  7. package/dist/agents/ai-sdk-otel.d.ts +27 -0
  8. package/dist/agents/ai-sdk-otel.js +6 -0
  9. package/dist/agents/ai-sdk-otel.js.map +1 -0
  10. package/dist/agents/ai-sdk-otel.mjs +6 -0
  11. package/dist/agents/ai-sdk-otel.mjs.map +1 -0
  12. package/dist/agents/ai-sdk.cjs +412 -0
  13. package/dist/agents/ai-sdk.cjs.map +1 -0
  14. package/dist/agents/ai-sdk.d.cts +214 -0
  15. package/dist/agents/ai-sdk.d.mts +214 -0
  16. package/dist/agents/ai-sdk.d.ts +214 -0
  17. package/dist/agents/ai-sdk.js +8 -0
  18. package/dist/agents/ai-sdk.js.map +1 -0
  19. package/dist/agents/bub-install-spec.cjs +42 -0
  20. package/dist/agents/bub-install-spec.cjs.map +1 -0
  21. package/dist/agents/bub-install-spec.d.cts +22 -0
  22. package/dist/agents/bub-install-spec.d.mts +22 -0
  23. package/dist/agents/bub-install-spec.d.ts +22 -0
  24. package/dist/agents/bub-install-spec.js +20 -0
  25. package/dist/agents/bub-install-spec.js.map +1 -0
  26. package/dist/agents/bub.cjs +204 -0
  27. package/dist/agents/bub.cjs.map +1 -0
  28. package/dist/agents/bub.d.cts +57 -0
  29. package/dist/agents/bub.d.mts +57 -0
  30. package/dist/agents/bub.d.ts +57 -0
  31. package/dist/agents/bub.js +7 -0
  32. package/dist/agents/bub.js.map +1 -0
  33. package/dist/agents/builtin.cjs +21 -0
  34. package/dist/agents/builtin.cjs.map +1 -0
  35. package/dist/agents/builtin.d.cts +2 -0
  36. package/dist/agents/builtin.d.mts +2 -0
  37. package/dist/agents/builtin.d.ts +2 -0
  38. package/dist/agents/builtin.js +6 -0
  39. package/dist/agents/builtin.js.map +1 -0
  40. package/dist/agents/cache-marker.cjs +6 -0
  41. package/dist/agents/cache-marker.cjs.map +1 -0
  42. package/dist/agents/cache-marker.d.cts +5 -0
  43. package/dist/agents/cache-marker.d.mts +5 -0
  44. package/dist/agents/cache-marker.js +6 -2
  45. package/dist/agents/cache-marker.js.map +1 -0
  46. package/dist/agents/claude-code.cjs +372 -0
  47. package/dist/agents/claude-code.cjs.map +1 -0
  48. package/dist/agents/claude-code.d.cts +91 -0
  49. package/dist/agents/claude-code.d.mts +91 -0
  50. package/dist/agents/claude-code.d.ts +91 -0
  51. package/dist/agents/claude-code.js +9 -0
  52. package/dist/agents/claude-code.js.map +1 -0
  53. package/dist/agents/codex.cjs +658 -0
  54. package/dist/agents/codex.cjs.map +1 -0
  55. package/dist/agents/codex.d.cts +96 -0
  56. package/dist/agents/codex.d.mts +96 -0
  57. package/dist/agents/codex.d.ts +96 -0
  58. package/dist/agents/codex.js +9 -0
  59. package/dist/agents/codex.js.map +1 -0
  60. package/dist/agents/coding-cli-versions.cjs +71 -0
  61. package/dist/agents/coding-cli-versions.cjs.map +1 -0
  62. package/dist/agents/coding-cli-versions.d.cts +40 -0
  63. package/dist/agents/coding-cli-versions.d.mts +40 -0
  64. package/dist/agents/coding-cli-versions.d.ts +40 -0
  65. package/dist/agents/coding-cli-versions.js +22 -0
  66. package/dist/agents/coding-cli-versions.js.map +1 -0
  67. package/dist/agents/hermes.cjs +237 -0
  68. package/dist/agents/hermes.cjs.map +1 -0
  69. package/dist/agents/hermes.d.cts +17 -0
  70. package/dist/agents/hermes.d.mts +17 -0
  71. package/dist/agents/hermes.d.ts +17 -0
  72. package/dist/agents/hermes.js +7 -0
  73. package/dist/agents/hermes.js.map +1 -0
  74. package/dist/agents/index.cjs +92 -0
  75. package/dist/agents/index.cjs.map +1 -0
  76. package/dist/agents/index.d.cts +44 -0
  77. package/dist/agents/index.d.mts +44 -0
  78. package/dist/agents/index.d.ts +44 -0
  79. package/dist/agents/index.js +86 -0
  80. package/dist/agents/index.js.map +1 -0
  81. package/dist/agents/index.mjs +86 -0
  82. package/dist/agents/index.mjs.map +1 -0
  83. package/dist/agents/langgraph.cjs +426 -0
  84. package/dist/agents/langgraph.cjs.map +1 -0
  85. package/dist/agents/langgraph.d.cts +43 -0
  86. package/dist/agents/langgraph.d.mts +43 -0
  87. package/dist/agents/langgraph.d.ts +43 -0
  88. package/dist/agents/langgraph.js +6 -0
  89. package/dist/agents/langgraph.js.map +1 -0
  90. package/dist/agents/marketplace.cjs +81 -0
  91. package/dist/agents/marketplace.cjs.map +1 -0
  92. package/dist/agents/marketplace.d.cts +27 -0
  93. package/dist/agents/marketplace.d.mts +27 -0
  94. package/dist/agents/marketplace.d.ts +27 -0
  95. package/dist/agents/marketplace.js +8 -0
  96. package/dist/agents/marketplace.js.map +1 -0
  97. package/dist/agents/mcp.cjs +28 -0
  98. package/dist/agents/mcp.cjs.map +1 -0
  99. package/dist/agents/mcp.d.cts +7 -0
  100. package/dist/agents/mcp.d.mts +7 -0
  101. package/dist/agents/mcp.d.ts +7 -0
  102. package/dist/agents/mcp.js +10 -0
  103. package/dist/agents/mcp.js.map +1 -0
  104. package/dist/agents/native-config.cjs +288 -0
  105. package/dist/agents/native-config.cjs.map +1 -0
  106. package/dist/agents/native-config.d.cts +71 -0
  107. package/dist/agents/native-config.d.mts +71 -0
  108. package/dist/agents/native-config.d.ts +71 -0
  109. package/dist/agents/native-config.js +18 -0
  110. package/dist/agents/native-config.js.map +1 -0
  111. package/dist/agents/npm-staged.cjs +378 -0
  112. package/dist/agents/npm-staged.cjs.map +1 -0
  113. package/dist/agents/npm-staged.d.cts +52 -0
  114. package/dist/agents/npm-staged.d.mts +52 -0
  115. package/dist/agents/npm-staged.d.ts +52 -0
  116. package/dist/agents/npm-staged.js +12 -0
  117. package/dist/agents/npm-staged.js.map +1 -0
  118. package/dist/agents/openai-compat.cjs +158 -0
  119. package/dist/agents/openai-compat.cjs.map +1 -0
  120. package/dist/agents/openai-compat.d.cts +88 -0
  121. package/dist/agents/openai-compat.d.mts +88 -0
  122. package/dist/agents/openai-compat.d.ts +88 -0
  123. package/dist/agents/openai-compat.js +12 -0
  124. package/dist/agents/openai-compat.js.map +1 -0
  125. package/dist/agents/openclaw.cjs +236 -0
  126. package/dist/agents/openclaw.cjs.map +1 -0
  127. package/dist/agents/openclaw.d.cts +26 -0
  128. package/dist/agents/openclaw.d.mts +26 -0
  129. package/dist/agents/openclaw.d.ts +26 -0
  130. package/dist/agents/openclaw.js +7 -0
  131. package/dist/agents/openclaw.js.map +1 -0
  132. package/dist/agents/opencode.cjs +228 -0
  133. package/dist/agents/opencode.cjs.map +1 -0
  134. package/dist/agents/opencode.d.cts +17 -0
  135. package/dist/agents/opencode.d.mts +17 -0
  136. package/dist/agents/opencode.d.ts +17 -0
  137. package/dist/agents/opencode.js +7 -0
  138. package/dist/agents/opencode.js.map +1 -0
  139. package/dist/agents/post-setup.cjs +119 -0
  140. package/dist/agents/post-setup.cjs.map +1 -0
  141. package/dist/agents/post-setup.d.cts +20 -0
  142. package/dist/agents/post-setup.d.mts +20 -0
  143. package/dist/agents/post-setup.d.ts +20 -0
  144. package/dist/agents/post-setup.js +12 -0
  145. package/dist/agents/post-setup.js.map +1 -0
  146. package/dist/agents/provisioner.cjs +446 -0
  147. package/dist/agents/provisioner.cjs.map +1 -0
  148. package/dist/agents/provisioner.d.cts +116 -0
  149. package/dist/agents/provisioner.d.mts +116 -0
  150. package/dist/agents/provisioner.d.ts +8 -6
  151. package/dist/agents/provisioner.js +32 -0
  152. package/dist/agents/provisioner.js.map +1 -0
  153. package/dist/agents/sdk-streams.cjs +447 -0
  154. package/dist/agents/sdk-streams.cjs.map +1 -0
  155. package/dist/agents/sdk-streams.d.cts +135 -0
  156. package/dist/agents/sdk-streams.d.mts +135 -0
  157. package/dist/agents/sdk-streams.d.ts +135 -0
  158. package/dist/agents/sdk-streams.js +12 -0
  159. package/dist/agents/sdk-streams.js.map +1 -0
  160. package/dist/agents/session-slot.cjs +8 -0
  161. package/dist/agents/session-slot.cjs.map +1 -0
  162. package/dist/agents/session-slot.d.cts +12 -0
  163. package/dist/agents/session-slot.d.mts +12 -0
  164. package/dist/agents/session-slot.js +6 -0
  165. package/dist/agents/session-slot.js.map +1 -0
  166. package/dist/agents/shared.cjs +202 -0
  167. package/dist/agents/shared.cjs.map +1 -0
  168. package/dist/agents/shared.d.cts +95 -0
  169. package/dist/agents/shared.d.mts +95 -0
  170. package/dist/agents/shared.d.ts +95 -0
  171. package/dist/agents/shared.js +6 -0
  172. package/dist/agents/shared.js.map +1 -0
  173. package/dist/agents/skills.cjs +262 -0
  174. package/dist/agents/skills.cjs.map +1 -0
  175. package/dist/agents/skills.d.cts +60 -0
  176. package/dist/agents/skills.d.mts +60 -0
  177. package/dist/agents/skills.d.ts +60 -0
  178. package/dist/agents/skills.js +22 -0
  179. package/dist/agents/skills.js.map +1 -0
  180. package/dist/agents/streaming.cjs +142 -0
  181. package/dist/agents/streaming.cjs.map +1 -0
  182. package/dist/agents/streaming.d.cts +82 -0
  183. package/dist/agents/streaming.d.mts +82 -0
  184. package/dist/agents/streaming.d.ts +82 -0
  185. package/dist/agents/streaming.js +8 -0
  186. package/dist/agents/streaming.js.map +1 -0
  187. package/dist/agents/types.cjs +5 -0
  188. package/dist/agents/types.cjs.map +1 -0
  189. package/dist/agents/types.d.cts +592 -0
  190. package/dist/agents/types.d.mts +592 -0
  191. package/dist/agents/types.d.ts +26 -20
  192. package/dist/agents/types.js +4 -2
  193. package/dist/agents/types.js.map +1 -0
  194. package/dist/agents/ui-message-stream.cjs +426 -0
  195. package/dist/agents/ui-message-stream.cjs.map +1 -0
  196. package/dist/agents/ui-message-stream.d.cts +68 -0
  197. package/dist/agents/ui-message-stream.d.mts +68 -0
  198. package/dist/agents/ui-message-stream.d.ts +68 -0
  199. package/dist/agents/ui-message-stream.js +6 -0
  200. package/dist/agents/ui-message-stream.js.map +1 -0
  201. package/dist/analysis/index.cjs +11 -0
  202. package/dist/analysis/index.cjs.map +1 -0
  203. package/dist/analysis/index.d.cts +2 -0
  204. package/dist/analysis/index.d.mts +2 -0
  205. package/dist/analysis/index.d.ts +2 -0
  206. package/dist/analysis/index.js +12 -0
  207. package/dist/analysis/index.js.map +1 -0
  208. package/dist/analysis/index.mjs +12 -0
  209. package/dist/analysis/index.mjs.map +1 -0
  210. package/dist/assertions/api.cjs +26 -0
  211. package/dist/assertions/api.cjs.map +1 -0
  212. package/dist/assertions/api.d.cts +395 -0
  213. package/dist/assertions/api.d.mts +395 -0
  214. package/dist/assertions/api.d.ts +395 -0
  215. package/dist/assertions/api.js +8 -0
  216. package/dist/assertions/api.js.map +1 -0
  217. package/dist/assertions/coverage.cjs +97 -0
  218. package/dist/assertions/coverage.cjs.map +1 -0
  219. package/dist/assertions/coverage.d.cts +23 -0
  220. package/dist/assertions/coverage.d.mts +23 -0
  221. package/dist/assertions/coverage.d.ts +1 -1
  222. package/dist/assertions/coverage.js +14 -94
  223. package/dist/assertions/coverage.js.map +1 -0
  224. package/dist/assertions/diff.cjs +249 -0
  225. package/dist/assertions/diff.cjs.map +1 -0
  226. package/dist/assertions/diff.d.cts +88 -0
  227. package/dist/assertions/diff.d.mts +88 -0
  228. package/dist/assertions/diff.d.ts +70 -2
  229. package/dist/assertions/diff.js +36 -116
  230. package/dist/assertions/diff.js.map +1 -0
  231. package/dist/assertions/display.cjs +79 -0
  232. package/dist/assertions/display.cjs.map +1 -0
  233. package/dist/assertions/display.d.cts +36 -0
  234. package/dist/assertions/display.d.mts +36 -0
  235. package/dist/assertions/display.d.ts +32 -32
  236. package/dist/assertions/display.js +14 -200
  237. package/dist/assertions/display.js.map +1 -0
  238. package/dist/assertions/identity.cjs +6 -0
  239. package/dist/assertions/identity.cjs.map +1 -0
  240. package/dist/assertions/identity.d.cts +4 -0
  241. package/dist/assertions/identity.d.mts +4 -0
  242. package/dist/assertions/identity.d.ts +4 -0
  243. package/dist/assertions/identity.js +6 -0
  244. package/dist/assertions/identity.js.map +1 -0
  245. package/dist/assertions/judge.cjs +342 -0
  246. package/dist/assertions/judge.cjs.map +1 -0
  247. package/dist/assertions/judge.d.cts +22 -0
  248. package/dist/assertions/judge.d.mts +22 -0
  249. package/dist/assertions/judge.d.ts +22 -0
  250. package/dist/assertions/judge.js +12 -0
  251. package/dist/assertions/judge.js.map +1 -0
  252. package/dist/assertions/limits.cjs +14 -0
  253. package/dist/assertions/limits.cjs.map +1 -0
  254. package/dist/assertions/limits.d.cts +10 -0
  255. package/dist/assertions/limits.d.mts +10 -0
  256. package/dist/assertions/limits.d.ts +10 -0
  257. package/dist/assertions/limits.js +6 -0
  258. package/dist/assertions/limits.js.map +1 -0
  259. package/dist/assertions/match.cjs +1314 -0
  260. package/dist/assertions/match.cjs.map +1 -0
  261. package/dist/assertions/match.d.cts +276 -0
  262. package/dist/assertions/match.d.mts +276 -0
  263. package/dist/assertions/match.d.ts +276 -0
  264. package/dist/assertions/match.js +82 -0
  265. package/dist/assertions/match.js.map +1 -0
  266. package/dist/assertions/record/attachment.cjs +448 -0
  267. package/dist/assertions/record/attachment.cjs.map +1 -0
  268. package/dist/assertions/record/attachment.d.cts +220 -0
  269. package/dist/assertions/record/attachment.d.mts +220 -0
  270. package/dist/assertions/record/attachment.d.ts +220 -0
  271. package/dist/assertions/record/attachment.js +20 -0
  272. package/dist/assertions/record/attachment.js.map +1 -0
  273. package/dist/assertions/record/codec.cjs +541 -0
  274. package/dist/assertions/record/codec.cjs.map +1 -0
  275. package/dist/assertions/record/codec.d.cts +146 -0
  276. package/dist/assertions/record/codec.d.mts +146 -0
  277. package/dist/assertions/record/codec.d.ts +146 -0
  278. package/dist/assertions/record/codec.js +42 -0
  279. package/dist/assertions/record/codec.js.map +1 -0
  280. package/dist/assertions/record/diff-model.cjs +120 -0
  281. package/dist/assertions/record/diff-model.cjs.map +1 -0
  282. package/dist/assertions/record/diff-model.d.cts +47 -0
  283. package/dist/assertions/record/diff-model.d.mts +47 -0
  284. package/dist/assertions/record/diff-model.d.ts +47 -0
  285. package/dist/assertions/record/diff-model.js +12 -0
  286. package/dist/assertions/record/diff-model.js.map +1 -0
  287. package/dist/assertions/record/diff.cjs +149 -0
  288. package/dist/assertions/record/diff.cjs.map +1 -0
  289. package/dist/assertions/record/diff.d.cts +27 -0
  290. package/dist/assertions/record/diff.d.mts +27 -0
  291. package/dist/assertions/record/diff.d.ts +27 -0
  292. package/dist/assertions/record/diff.js +18 -0
  293. package/dist/assertions/record/diff.js.map +1 -0
  294. package/dist/assertions/record/index.cjs +22 -0
  295. package/dist/assertions/record/index.cjs.map +1 -0
  296. package/dist/assertions/record/index.d.cts +5 -0
  297. package/dist/assertions/record/index.d.mts +5 -0
  298. package/dist/assertions/record/index.d.ts +5 -0
  299. package/dist/assertions/record/index.js +76 -0
  300. package/dist/assertions/record/index.js.map +1 -0
  301. package/dist/assertions/record/model.cjs +10 -0
  302. package/dist/assertions/record/model.cjs.map +1 -0
  303. package/dist/assertions/record/model.d.cts +257 -0
  304. package/dist/assertions/record/model.d.mts +257 -0
  305. package/dist/assertions/record/model.d.ts +257 -0
  306. package/dist/assertions/record/model.js +6 -0
  307. package/dist/assertions/record/model.js.map +1 -0
  308. package/dist/assertions/record/producer.cjs +55 -0
  309. package/dist/assertions/record/producer.cjs.map +1 -0
  310. package/dist/assertions/record/producer.d.cts +45 -0
  311. package/dist/assertions/record/producer.d.mts +45 -0
  312. package/dist/assertions/record/producer.d.ts +45 -0
  313. package/dist/assertions/record/producer.js +6 -0
  314. package/dist/assertions/record/producer.js.map +1 -0
  315. package/dist/assertions/runtime.cjs +1163 -0
  316. package/dist/assertions/runtime.cjs.map +1 -0
  317. package/dist/assertions/runtime.d.cts +45 -0
  318. package/dist/assertions/runtime.d.mts +45 -0
  319. package/dist/assertions/runtime.d.ts +45 -0
  320. package/dist/assertions/runtime.js +16 -0
  321. package/dist/assertions/runtime.js.map +1 -0
  322. package/dist/assertions/types.cjs +3 -0
  323. package/dist/assertions/types.cjs.map +1 -0
  324. package/dist/assertions/types.d.cts +238 -0
  325. package/dist/assertions/types.d.mts +238 -0
  326. package/dist/assertions/types.d.ts +166 -186
  327. package/dist/assertions/types.js +4 -2
  328. package/dist/assertions/types.js.map +1 -0
  329. package/dist/assertions/workspace-diff.cjs +237 -0
  330. package/dist/assertions/workspace-diff.cjs.map +1 -0
  331. package/dist/assertions/workspace-diff.d.cts +77 -0
  332. package/dist/assertions/workspace-diff.d.mts +77 -0
  333. package/dist/assertions/workspace-diff.d.ts +77 -0
  334. package/dist/assertions/workspace-diff.js +16 -0
  335. package/dist/assertions/workspace-diff.js.map +1 -0
  336. package/dist/attempt-locator-resolution.cjs +51 -0
  337. package/dist/attempt-locator-resolution.cjs.map +1 -0
  338. package/dist/attempt-locator-resolution.d.cts +18 -0
  339. package/dist/attempt-locator-resolution.d.mts +18 -0
  340. package/dist/attempt-locator-resolution.d.ts +18 -0
  341. package/dist/attempt-locator-resolution.js +6 -0
  342. package/dist/attempt-locator-resolution.js.map +1 -0
  343. package/dist/attempt-locator.cjs +122 -0
  344. package/dist/attempt-locator.cjs.map +1 -0
  345. package/dist/attempt-locator.d.cts +25 -0
  346. package/dist/attempt-locator.d.mts +25 -0
  347. package/dist/attempt-locator.d.ts +25 -0
  348. package/dist/attempt-locator.js +10 -0
  349. package/dist/attempt-locator.js.map +1 -0
  350. package/dist/cli/bootstrap.cjs +87 -0
  351. package/dist/cli/bootstrap.cjs.map +1 -0
  352. package/dist/cli/bootstrap.d.mts +1 -0
  353. package/dist/cli/bootstrap.d.ts +1 -0
  354. package/dist/cli/bootstrap.js +4 -0
  355. package/dist/cli/bootstrap.js.map +1 -0
  356. package/dist/cli/record.cjs +198 -0
  357. package/dist/cli/record.cjs.map +1 -0
  358. package/dist/cli/record.d.cts +28 -0
  359. package/dist/cli/record.d.mts +28 -0
  360. package/dist/cli/record.d.ts +28 -0
  361. package/dist/cli/record.js +12 -0
  362. package/dist/cli/record.js.map +1 -0
  363. package/dist/cli.cjs +2405 -0
  364. package/dist/cli.cjs.map +1 -0
  365. package/dist/cli.d.cts +139 -0
  366. package/dist/cli.d.mts +139 -0
  367. package/dist/cli.d.ts +139 -0
  368. package/dist/cli.js +34 -0
  369. package/dist/cli.js.map +1 -0
  370. package/dist/context/assert-first.cjs +1766 -0
  371. package/dist/context/assert-first.cjs.map +1 -0
  372. package/dist/context/assert-first.d.cts +204 -0
  373. package/dist/context/assert-first.d.mts +204 -0
  374. package/dist/context/assert-first.d.ts +204 -0
  375. package/dist/context/assert-first.js +6 -0
  376. package/dist/context/assert-first.js.map +1 -0
  377. package/dist/context/control-flow.cjs +15 -0
  378. package/dist/context/control-flow.cjs.map +1 -0
  379. package/dist/context/control-flow.d.cts +5 -0
  380. package/dist/context/control-flow.d.mts +5 -0
  381. package/dist/context/control-flow.d.ts +5 -0
  382. package/dist/context/control-flow.js +6 -0
  383. package/dist/context/control-flow.js.map +1 -0
  384. package/dist/context/send-failures.cjs +119 -0
  385. package/dist/context/send-failures.cjs.map +1 -0
  386. package/dist/context/send-failures.d.cts +45 -0
  387. package/dist/context/send-failures.d.mts +45 -0
  388. package/dist/context/send-failures.d.ts +3 -3
  389. package/dist/context/send-failures.js +18 -0
  390. package/dist/context/send-failures.js.map +1 -0
  391. package/dist/context/send-retry.cjs +105 -0
  392. package/dist/context/send-retry.cjs.map +1 -0
  393. package/dist/context/send-retry.d.cts +41 -0
  394. package/dist/context/send-retry.d.mts +41 -0
  395. package/dist/context/send-retry.d.ts +41 -0
  396. package/dist/context/send-retry.js +12 -0
  397. package/dist/context/send-retry.js.map +1 -0
  398. package/dist/context/session.cjs +503 -0
  399. package/dist/context/session.cjs.map +1 -0
  400. package/dist/context/session.d.cts +179 -0
  401. package/dist/context/session.d.mts +179 -0
  402. package/dist/context/session.d.ts +179 -0
  403. package/dist/context/session.js +12 -0
  404. package/dist/context/session.js.map +1 -0
  405. package/dist/context/types.cjs +3 -0
  406. package/dist/context/types.cjs.map +1 -0
  407. package/dist/context/types.d.cts +37 -0
  408. package/dist/context/types.d.mts +37 -0
  409. package/dist/context/types.d.ts +30 -387
  410. package/dist/context/types.js +4 -3
  411. package/dist/context/types.js.map +1 -0
  412. package/dist/define.cjs +246 -0
  413. package/dist/define.cjs.map +1 -0
  414. package/dist/define.d.cts +26 -0
  415. package/dist/define.d.mts +26 -0
  416. package/dist/define.d.ts +26 -0
  417. package/dist/define.js +22 -0
  418. package/dist/define.js.map +1 -0
  419. package/dist/eval/experiment-id.cjs +18 -0
  420. package/dist/eval/experiment-id.cjs.map +1 -0
  421. package/dist/eval/experiment-id.d.cts +10 -0
  422. package/dist/eval/experiment-id.d.mts +10 -0
  423. package/dist/eval/experiment-id.d.ts +10 -0
  424. package/dist/eval/experiment-id.js +10 -0
  425. package/dist/eval/experiment-id.js.map +1 -0
  426. package/dist/eval/record/attachment.cjs +60 -0
  427. package/dist/eval/record/attachment.cjs.map +1 -0
  428. package/dist/eval/record/attachment.d.cts +30 -0
  429. package/dist/eval/record/attachment.d.mts +30 -0
  430. package/dist/eval/record/attachment.d.ts +30 -0
  431. package/dist/eval/record/attachment.js +16 -0
  432. package/dist/eval/record/attachment.js.map +1 -0
  433. package/dist/eval/record/coherence.cjs +118 -0
  434. package/dist/eval/record/coherence.cjs.map +1 -0
  435. package/dist/eval/record/coherence.d.cts +61 -0
  436. package/dist/eval/record/coherence.d.mts +61 -0
  437. package/dist/eval/record/coherence.d.ts +61 -0
  438. package/dist/eval/record/coherence.js +6 -0
  439. package/dist/eval/record/coherence.js.map +1 -0
  440. package/dist/eval/record/eligibility.cjs +157 -0
  441. package/dist/eval/record/eligibility.cjs.map +1 -0
  442. package/dist/eval/record/eligibility.d.cts +151 -0
  443. package/dist/eval/record/eligibility.d.mts +151 -0
  444. package/dist/eval/record/eligibility.d.ts +151 -0
  445. package/dist/eval/record/eligibility.js +42 -0
  446. package/dist/eval/record/eligibility.js.map +1 -0
  447. package/dist/eval/record/evaluation-plan.cjs +26 -0
  448. package/dist/eval/record/evaluation-plan.cjs.map +1 -0
  449. package/dist/eval/record/evaluation-plan.d.cts +16 -0
  450. package/dist/eval/record/evaluation-plan.d.mts +16 -0
  451. package/dist/eval/record/evaluation-plan.d.ts +16 -0
  452. package/dist/eval/record/evaluation-plan.js +6 -0
  453. package/dist/eval/record/evaluation-plan.js.map +1 -0
  454. package/dist/eval/record/evaluation-record.cjs +540 -0
  455. package/dist/eval/record/evaluation-record.cjs.map +1 -0
  456. package/dist/eval/record/evaluation-record.d.cts +168 -0
  457. package/dist/eval/record/evaluation-record.d.mts +168 -0
  458. package/dist/eval/record/evaluation-record.d.ts +168 -0
  459. package/dist/eval/record/evaluation-record.js +22 -0
  460. package/dist/eval/record/evaluation-record.js.map +1 -0
  461. package/dist/eval/record/evaluation.cjs +220 -0
  462. package/dist/eval/record/evaluation.cjs.map +1 -0
  463. package/dist/eval/record/evaluation.d.cts +175 -0
  464. package/dist/eval/record/evaluation.d.mts +175 -0
  465. package/dist/eval/record/evaluation.d.ts +175 -0
  466. package/dist/eval/record/evaluation.js +36 -0
  467. package/dist/eval/record/evaluation.js.map +1 -0
  468. package/dist/eval/record/index.cjs +26 -0
  469. package/dist/eval/record/index.cjs.map +1 -0
  470. package/dist/eval/record/index.d.cts +9 -0
  471. package/dist/eval/record/index.d.mts +9 -0
  472. package/dist/eval/record/index.d.ts +9 -0
  473. package/dist/eval/record/index.js +242 -0
  474. package/dist/eval/record/index.js.map +1 -0
  475. package/dist/eval/record/membership-provenance.cjs +213 -0
  476. package/dist/eval/record/membership-provenance.cjs.map +1 -0
  477. package/dist/eval/record/membership-provenance.d.cts +855 -0
  478. package/dist/eval/record/membership-provenance.d.mts +855 -0
  479. package/dist/eval/record/membership-provenance.d.ts +855 -0
  480. package/dist/eval/record/membership-provenance.js +58 -0
  481. package/dist/eval/record/membership-provenance.js.map +1 -0
  482. package/dist/eval/record/score.cjs +248 -0
  483. package/dist/eval/record/score.cjs.map +1 -0
  484. package/dist/eval/record/score.d.cts +165 -0
  485. package/dist/eval/record/score.d.mts +165 -0
  486. package/dist/eval/record/score.d.ts +165 -0
  487. package/dist/eval/record/score.js +44 -0
  488. package/dist/eval/record/score.js.map +1 -0
  489. package/dist/eval/record/sealed-assertion.cjs +31 -0
  490. package/dist/eval/record/sealed-assertion.cjs.map +1 -0
  491. package/dist/eval/record/sealed-assertion.d.cts +32 -0
  492. package/dist/eval/record/sealed-assertion.d.mts +32 -0
  493. package/dist/eval/record/sealed-assertion.d.ts +32 -0
  494. package/dist/eval/record/sealed-assertion.js +14 -0
  495. package/dist/eval/record/sealed-assertion.js.map +1 -0
  496. package/dist/eval/record/verdict.cjs +89 -0
  497. package/dist/eval/record/verdict.cjs.map +1 -0
  498. package/dist/eval/record/verdict.d.cts +60 -0
  499. package/dist/eval/record/verdict.d.mts +60 -0
  500. package/dist/eval/record/verdict.d.ts +60 -0
  501. package/dist/eval/record/verdict.js +36 -0
  502. package/dist/eval/record/verdict.js.map +1 -0
  503. package/dist/expect/index.cjs +29 -0
  504. package/dist/expect/index.cjs.map +1 -0
  505. package/dist/expect/index.d.cts +2 -0
  506. package/dist/expect/index.d.mts +2 -0
  507. package/dist/expect/index.d.ts +2 -0
  508. package/dist/expect/index.js +50 -0
  509. package/dist/expect/index.js.map +1 -0
  510. package/dist/expect/index.mjs +50 -0
  511. package/dist/expect/index.mjs.map +1 -0
  512. package/dist/fresh-import.cjs +288 -0
  513. package/dist/fresh-import.cjs.map +1 -0
  514. package/dist/fresh-import.d.cts +20 -0
  515. package/dist/fresh-import.d.mts +20 -0
  516. package/dist/fresh-import.d.ts +20 -0
  517. package/dist/fresh-import.js +8 -0
  518. package/dist/fresh-import.js.map +1 -0
  519. package/dist/i18n/core.cjs +21 -0
  520. package/dist/i18n/core.cjs.map +1 -0
  521. package/dist/i18n/core.d.cts +11 -0
  522. package/dist/i18n/core.d.mts +11 -0
  523. package/dist/i18n/core.js +8 -19
  524. package/dist/i18n/core.js.map +1 -0
  525. package/dist/i18n/en.cjs +474 -0
  526. package/dist/i18n/en.cjs.map +1 -0
  527. package/dist/i18n/en.d.cts +391 -0
  528. package/dist/i18n/en.d.mts +391 -0
  529. package/dist/i18n/en.d.ts +389 -363
  530. package/dist/i18n/en.js +6 -455
  531. package/dist/i18n/en.js.map +1 -0
  532. package/dist/i18n/index.cjs +12 -0
  533. package/dist/i18n/index.cjs.map +1 -0
  534. package/dist/i18n/index.d.cts +5 -0
  535. package/dist/i18n/index.d.mts +5 -0
  536. package/dist/i18n/index.d.ts +4 -9
  537. package/dist/i18n/index.js +6 -30
  538. package/dist/i18n/index.js.map +1 -0
  539. package/dist/index.cjs +25 -0
  540. package/dist/index.cjs.map +1 -0
  541. package/dist/index.d.cts +10 -0
  542. package/dist/index.d.mts +10 -0
  543. package/dist/index.d.ts +10 -0
  544. package/dist/index.js +28 -0
  545. package/dist/index.js.map +1 -0
  546. package/dist/index.mjs +28 -0
  547. package/dist/index.mjs.map +1 -0
  548. package/dist/load-config.cjs +52 -0
  549. package/dist/load-config.cjs.map +1 -0
  550. package/dist/load-config.d.cts +4 -0
  551. package/dist/load-config.d.mts +4 -0
  552. package/dist/load-config.d.ts +4 -0
  553. package/dist/load-config.js +6 -0
  554. package/dist/load-config.js.map +1 -0
  555. package/dist/loaders/glob.cjs +150 -0
  556. package/dist/loaders/glob.cjs.map +1 -0
  557. package/dist/loaders/glob.d.cts +28 -0
  558. package/dist/loaders/glob.d.mts +28 -0
  559. package/dist/loaders/glob.d.ts +28 -0
  560. package/dist/loaders/glob.js +12 -0
  561. package/dist/loaders/glob.js.map +1 -0
  562. package/dist/loaders/index.cjs +281 -0
  563. package/dist/loaders/index.cjs.map +1 -0
  564. package/dist/loaders/index.d.cts +95 -0
  565. package/dist/loaders/index.d.mts +95 -0
  566. package/dist/loaders/index.d.ts +95 -0
  567. package/dist/loaders/index.js +16 -0
  568. package/dist/loaders/index.js.map +1 -0
  569. package/dist/loaders/index.mjs +16 -0
  570. package/dist/loaders/index.mjs.map +1 -0
  571. package/dist/o11y/command-projection.cjs +127 -0
  572. package/dist/o11y/command-projection.cjs.map +1 -0
  573. package/dist/o11y/command-projection.d.cts +29 -0
  574. package/dist/o11y/command-projection.d.mts +29 -0
  575. package/dist/o11y/command-projection.d.ts +29 -0
  576. package/dist/o11y/command-projection.js +18 -0
  577. package/dist/o11y/command-projection.js.map +1 -0
  578. package/dist/o11y/cost.cjs +76 -0
  579. package/dist/o11y/cost.cjs.map +1 -0
  580. package/dist/o11y/cost.d.cts +8 -0
  581. package/dist/o11y/cost.d.mts +8 -0
  582. package/dist/o11y/cost.d.ts +8 -0
  583. package/dist/o11y/cost.js +6 -0
  584. package/dist/o11y/cost.js.map +1 -0
  585. package/dist/o11y/derive.cjs +572 -0
  586. package/dist/o11y/derive.cjs.map +1 -0
  587. package/dist/o11y/derive.d.cts +24 -0
  588. package/dist/o11y/derive.d.mts +24 -0
  589. package/dist/o11y/derive.d.ts +16 -1
  590. package/dist/o11y/derive.js +14 -281
  591. package/dist/o11y/derive.js.map +1 -0
  592. package/dist/o11y/execution-tree.cjs +213 -0
  593. package/dist/o11y/execution-tree.cjs.map +1 -0
  594. package/dist/o11y/execution-tree.d.cts +113 -0
  595. package/dist/o11y/execution-tree.d.mts +113 -0
  596. package/dist/o11y/execution-tree.d.ts +1 -1
  597. package/dist/o11y/execution-tree.js +6 -254
  598. package/dist/o11y/execution-tree.js.map +1 -0
  599. package/dist/o11y/otlp/canonical.cjs +94 -0
  600. package/dist/o11y/otlp/canonical.cjs.map +1 -0
  601. package/dist/o11y/otlp/canonical.d.cts +34 -0
  602. package/dist/o11y/otlp/canonical.d.mts +34 -0
  603. package/dist/o11y/otlp/canonical.d.ts +34 -0
  604. package/dist/o11y/otlp/canonical.js +26 -0
  605. package/dist/o11y/otlp/canonical.js.map +1 -0
  606. package/dist/o11y/otlp/mappers/bub.cjs +24 -0
  607. package/dist/o11y/otlp/mappers/bub.cjs.map +1 -0
  608. package/dist/o11y/otlp/mappers/bub.d.cts +2 -0
  609. package/dist/o11y/otlp/mappers/bub.d.mts +2 -0
  610. package/dist/o11y/otlp/mappers/bub.d.ts +2 -0
  611. package/dist/o11y/otlp/mappers/bub.js +6 -0
  612. package/dist/o11y/otlp/mappers/bub.js.map +1 -0
  613. package/dist/o11y/otlp/mappers/claude-code.cjs +16 -0
  614. package/dist/o11y/otlp/mappers/claude-code.cjs.map +1 -0
  615. package/dist/o11y/otlp/mappers/claude-code.d.cts +2 -0
  616. package/dist/o11y/otlp/mappers/claude-code.d.mts +2 -0
  617. package/dist/o11y/otlp/mappers/claude-code.d.ts +2 -0
  618. package/dist/o11y/otlp/mappers/claude-code.js +6 -0
  619. package/dist/o11y/otlp/mappers/claude-code.js.map +1 -0
  620. package/dist/o11y/otlp/mappers/codex.cjs +31 -0
  621. package/dist/o11y/otlp/mappers/codex.cjs.map +1 -0
  622. package/dist/o11y/otlp/mappers/codex.d.cts +2 -0
  623. package/dist/o11y/otlp/mappers/codex.d.mts +2 -0
  624. package/dist/o11y/otlp/mappers/codex.d.ts +2 -0
  625. package/dist/o11y/otlp/mappers/codex.js +6 -0
  626. package/dist/o11y/otlp/mappers/codex.js.map +1 -0
  627. package/dist/o11y/otlp/mappers/index.cjs +21 -0
  628. package/dist/o11y/otlp/mappers/index.cjs.map +1 -0
  629. package/dist/o11y/otlp/mappers/index.d.cts +4 -0
  630. package/dist/o11y/otlp/mappers/index.d.mts +4 -0
  631. package/dist/o11y/otlp/mappers/index.d.ts +4 -0
  632. package/dist/o11y/otlp/mappers/index.js +12 -0
  633. package/dist/o11y/otlp/mappers/index.js.map +1 -0
  634. package/dist/o11y/otlp/parse.cjs +369 -0
  635. package/dist/o11y/otlp/parse.cjs.map +1 -0
  636. package/dist/o11y/otlp/parse.d.cts +3 -0
  637. package/dist/o11y/otlp/parse.d.mts +3 -0
  638. package/dist/o11y/otlp/parse.d.ts +1 -1
  639. package/dist/o11y/otlp/parse.js +6 -0
  640. package/dist/o11y/otlp/parse.js.map +1 -0
  641. package/dist/o11y/otlp/receiver.cjs +326 -0
  642. package/dist/o11y/otlp/receiver.cjs.map +1 -0
  643. package/dist/o11y/otlp/receiver.d.cts +27 -0
  644. package/dist/o11y/otlp/receiver.d.mts +27 -0
  645. package/dist/o11y/otlp/receiver.d.ts +16 -10
  646. package/dist/o11y/otlp/receiver.js +10 -0
  647. package/dist/o11y/otlp/receiver.js.map +1 -0
  648. package/dist/o11y/otlp/sandbox-receiver.cjs +226 -0
  649. package/dist/o11y/otlp/sandbox-receiver.cjs.map +1 -0
  650. package/dist/o11y/otlp/sandbox-receiver.d.cts +4 -0
  651. package/dist/o11y/otlp/sandbox-receiver.d.mts +4 -0
  652. package/dist/o11y/otlp/sandbox-receiver.d.ts +4 -0
  653. package/dist/o11y/otlp/sandbox-receiver.js +6 -0
  654. package/dist/o11y/otlp/sandbox-receiver.js.map +1 -0
  655. package/dist/o11y/otlp/select.cjs +82 -0
  656. package/dist/o11y/otlp/select.cjs.map +1 -0
  657. package/dist/o11y/otlp/select.d.cts +22 -0
  658. package/dist/o11y/otlp/select.d.mts +22 -0
  659. package/dist/o11y/otlp/select.d.ts +1 -1
  660. package/dist/o11y/otlp/select.js +12 -86
  661. package/dist/o11y/otlp/select.js.map +1 -0
  662. package/dist/o11y/otlp/turn-otel.cjs +180 -0
  663. package/dist/o11y/otlp/turn-otel.cjs.map +1 -0
  664. package/dist/o11y/otlp/turn-otel.d.cts +59 -0
  665. package/dist/o11y/otlp/turn-otel.d.mts +59 -0
  666. package/dist/o11y/otlp/turn-otel.d.ts +26 -10
  667. package/dist/o11y/otlp/turn-otel.js +8 -0
  668. package/dist/o11y/otlp/turn-otel.js.map +1 -0
  669. package/dist/o11y/parsers/bub.cjs +277 -0
  670. package/dist/o11y/parsers/bub.cjs.map +1 -0
  671. package/dist/o11y/parsers/bub.d.cts +7 -0
  672. package/dist/o11y/parsers/bub.d.mts +7 -0
  673. package/dist/o11y/parsers/bub.d.ts +7 -0
  674. package/dist/o11y/parsers/bub.js +10 -0
  675. package/dist/o11y/parsers/bub.js.map +1 -0
  676. package/dist/o11y/parsers/claude-code.cjs +309 -0
  677. package/dist/o11y/parsers/claude-code.cjs.map +1 -0
  678. package/dist/o11y/parsers/claude-code.d.cts +11 -0
  679. package/dist/o11y/parsers/claude-code.d.mts +11 -0
  680. package/dist/o11y/parsers/claude-code.d.ts +11 -0
  681. package/dist/o11y/parsers/claude-code.js +10 -0
  682. package/dist/o11y/parsers/claude-code.js.map +1 -0
  683. package/dist/o11y/parsers/codex.cjs +439 -0
  684. package/dist/o11y/parsers/codex.cjs.map +1 -0
  685. package/dist/o11y/parsers/codex.d.cts +7 -0
  686. package/dist/o11y/parsers/codex.d.mts +7 -0
  687. package/dist/o11y/parsers/codex.d.ts +7 -0
  688. package/dist/o11y/parsers/codex.js +10 -0
  689. package/dist/o11y/parsers/codex.js.map +1 -0
  690. package/dist/o11y/parsers/hermes.cjs +234 -0
  691. package/dist/o11y/parsers/hermes.cjs.map +1 -0
  692. package/dist/o11y/parsers/hermes.d.cts +9 -0
  693. package/dist/o11y/parsers/hermes.d.mts +9 -0
  694. package/dist/o11y/parsers/hermes.d.ts +9 -0
  695. package/dist/o11y/parsers/hermes.js +10 -0
  696. package/dist/o11y/parsers/hermes.js.map +1 -0
  697. package/dist/o11y/parsers/index.cjs +13 -0
  698. package/dist/o11y/parsers/index.cjs.map +1 -0
  699. package/dist/o11y/parsers/index.d.cts +12 -0
  700. package/dist/o11y/parsers/index.d.mts +12 -0
  701. package/dist/o11y/parsers/index.d.ts +12 -0
  702. package/dist/o11y/parsers/index.js +16 -0
  703. package/dist/o11y/parsers/index.js.map +1 -0
  704. package/dist/o11y/parsers/openclaw.cjs +320 -0
  705. package/dist/o11y/parsers/openclaw.cjs.map +1 -0
  706. package/dist/o11y/parsers/openclaw.d.cts +39 -0
  707. package/dist/o11y/parsers/openclaw.d.mts +39 -0
  708. package/dist/o11y/parsers/openclaw.d.ts +39 -0
  709. package/dist/o11y/parsers/openclaw.js +12 -0
  710. package/dist/o11y/parsers/openclaw.js.map +1 -0
  711. package/dist/o11y/parsers/opencode.cjs +337 -0
  712. package/dist/o11y/parsers/opencode.cjs.map +1 -0
  713. package/dist/o11y/parsers/opencode.d.cts +14 -0
  714. package/dist/o11y/parsers/opencode.d.mts +14 -0
  715. package/dist/o11y/parsers/opencode.d.ts +14 -0
  716. package/dist/o11y/parsers/opencode.js +12 -0
  717. package/dist/o11y/parsers/opencode.js.map +1 -0
  718. package/dist/o11y/prices.json +11649 -0
  719. package/dist/o11y/record/capture.cjs +232 -0
  720. package/dist/o11y/record/capture.cjs.map +1 -0
  721. package/dist/o11y/record/capture.d.cts +81 -0
  722. package/dist/o11y/record/capture.d.mts +81 -0
  723. package/dist/o11y/record/capture.d.ts +81 -0
  724. package/dist/o11y/record/capture.js +30 -0
  725. package/dist/o11y/record/capture.js.map +1 -0
  726. package/dist/o11y/record/codec.cjs +222 -0
  727. package/dist/o11y/record/codec.cjs.map +1 -0
  728. package/dist/o11y/record/codec.d.cts +661 -0
  729. package/dist/o11y/record/codec.d.mts +661 -0
  730. package/dist/o11y/record/codec.d.ts +661 -0
  731. package/dist/o11y/record/codec.js +66 -0
  732. package/dist/o11y/record/codec.js.map +1 -0
  733. package/dist/o11y/record/errors.cjs +71 -0
  734. package/dist/o11y/record/errors.cjs.map +1 -0
  735. package/dist/o11y/record/errors.d.cts +53 -0
  736. package/dist/o11y/record/errors.d.mts +53 -0
  737. package/dist/o11y/record/errors.d.ts +53 -0
  738. package/dist/o11y/record/errors.js +24 -0
  739. package/dist/o11y/record/errors.js.map +1 -0
  740. package/dist/o11y/record/families.cjs +699 -0
  741. package/dist/o11y/record/families.cjs.map +1 -0
  742. package/dist/o11y/record/families.d.cts +4298 -0
  743. package/dist/o11y/record/families.d.mts +4298 -0
  744. package/dist/o11y/record/families.d.ts +4298 -0
  745. package/dist/o11y/record/families.js +68 -0
  746. package/dist/o11y/record/families.js.map +1 -0
  747. package/dist/o11y/record/family-projectors.cjs +83 -0
  748. package/dist/o11y/record/family-projectors.cjs.map +1 -0
  749. package/dist/o11y/record/family-projectors.d.cts +46 -0
  750. package/dist/o11y/record/family-projectors.d.mts +46 -0
  751. package/dist/o11y/record/family-projectors.d.ts +46 -0
  752. package/dist/o11y/record/family-projectors.js +18 -0
  753. package/dist/o11y/record/family-projectors.js.map +1 -0
  754. package/dist/o11y/record/family-writers.cjs +371 -0
  755. package/dist/o11y/record/family-writers.cjs.map +1 -0
  756. package/dist/o11y/record/family-writers.d.cts +5293 -0
  757. package/dist/o11y/record/family-writers.d.mts +5293 -0
  758. package/dist/o11y/record/family-writers.d.ts +5293 -0
  759. package/dist/o11y/record/family-writers.js +60 -0
  760. package/dist/o11y/record/family-writers.js.map +1 -0
  761. package/dist/o11y/record/index.cjs +31 -0
  762. package/dist/o11y/record/index.cjs.map +1 -0
  763. package/dist/o11y/record/index.d.cts +14 -0
  764. package/dist/o11y/record/index.d.mts +14 -0
  765. package/dist/o11y/record/index.d.ts +14 -0
  766. package/dist/o11y/record/index.js +488 -0
  767. package/dist/o11y/record/index.js.map +1 -0
  768. package/dist/o11y/record/limits.cjs +69 -0
  769. package/dist/o11y/record/limits.cjs.map +1 -0
  770. package/dist/o11y/record/limits.d.cts +65 -0
  771. package/dist/o11y/record/limits.d.mts +65 -0
  772. package/dist/o11y/record/limits.d.ts +65 -0
  773. package/dist/o11y/record/limits.js +68 -0
  774. package/dist/o11y/record/limits.js.map +1 -0
  775. package/dist/o11y/record/model.cjs +590 -0
  776. package/dist/o11y/record/model.cjs.map +1 -0
  777. package/dist/o11y/record/model.d.cts +275 -0
  778. package/dist/o11y/record/model.d.mts +275 -0
  779. package/dist/o11y/record/model.d.ts +275 -0
  780. package/dist/o11y/record/model.js +158 -0
  781. package/dist/o11y/record/model.js.map +1 -0
  782. package/dist/o11y/record/runner-producer.cjs +1575 -0
  783. package/dist/o11y/record/runner-producer.cjs.map +1 -0
  784. package/dist/o11y/record/runner-producer.d.cts +103 -0
  785. package/dist/o11y/record/runner-producer.d.mts +103 -0
  786. package/dist/o11y/record/runner-producer.d.ts +103 -0
  787. package/dist/o11y/record/runner-producer.js +26 -0
  788. package/dist/o11y/record/runner-producer.js.map +1 -0
  789. package/dist/o11y/record/validation.cjs +323 -0
  790. package/dist/o11y/record/validation.cjs.map +1 -0
  791. package/dist/o11y/record/validation.d.cts +62 -0
  792. package/dist/o11y/record/validation.d.mts +62 -0
  793. package/dist/o11y/record/validation.d.ts +62 -0
  794. package/dist/o11y/record/validation.js +28 -0
  795. package/dist/o11y/record/validation.js.map +1 -0
  796. package/dist/o11y/tool-names.cjs +68 -0
  797. package/dist/o11y/tool-names.cjs.map +1 -0
  798. package/dist/o11y/tool-names.d.cts +11 -0
  799. package/dist/o11y/tool-names.d.mts +11 -0
  800. package/dist/o11y/tool-names.d.ts +11 -0
  801. package/dist/o11y/tool-names.js +8 -0
  802. package/dist/o11y/tool-names.js.map +1 -0
  803. package/dist/o11y/types.cjs +3 -0
  804. package/dist/o11y/types.cjs.map +1 -0
  805. package/dist/o11y/types.d.cts +387 -0
  806. package/dist/o11y/types.d.mts +387 -0
  807. package/dist/o11y/types.d.ts +142 -1
  808. package/dist/o11y/types.js +4 -3
  809. package/dist/o11y/types.js.map +1 -0
  810. package/dist/plugin/contracts.cjs +187 -0
  811. package/dist/plugin/contracts.cjs.map +1 -0
  812. package/dist/plugin/contracts.d.cts +109 -0
  813. package/dist/plugin/contracts.d.mts +109 -0
  814. package/dist/plugin/contracts.d.ts +109 -0
  815. package/dist/plugin/contracts.js +18 -0
  816. package/dist/plugin/contracts.js.map +1 -0
  817. package/dist/plugin/index.cjs +7 -0
  818. package/dist/plugin/index.cjs.map +1 -0
  819. package/dist/plugin/index.d.cts +2 -0
  820. package/dist/plugin/index.d.mts +2 -0
  821. package/dist/plugin/index.d.ts +2 -0
  822. package/dist/plugin/index.js +6 -0
  823. package/dist/plugin/index.js.map +1 -0
  824. package/dist/plugin/index.mjs +6 -0
  825. package/dist/plugin/index.mjs.map +1 -0
  826. package/dist/plugin/link.cjs +204 -0
  827. package/dist/plugin/link.cjs.map +1 -0
  828. package/dist/plugin/link.d.cts +68 -0
  829. package/dist/plugin/link.d.mts +68 -0
  830. package/dist/plugin/link.d.ts +68 -0
  831. package/dist/plugin/link.js +14 -0
  832. package/dist/plugin/link.js.map +1 -0
  833. package/dist/plugins/record/attachment.cjs +62 -0
  834. package/dist/plugins/record/attachment.cjs.map +1 -0
  835. package/dist/plugins/record/attachment.d.cts +14 -0
  836. package/dist/plugins/record/attachment.d.mts +14 -0
  837. package/dist/plugins/record/attachment.d.ts +14 -0
  838. package/dist/plugins/record/attachment.js +20 -0
  839. package/dist/plugins/record/attachment.js.map +1 -0
  840. package/dist/plugins/record/capability.cjs +258 -0
  841. package/dist/plugins/record/capability.cjs.map +1 -0
  842. package/dist/plugins/record/capability.d.cts +94 -0
  843. package/dist/plugins/record/capability.d.mts +94 -0
  844. package/dist/plugins/record/capability.d.ts +94 -0
  845. package/dist/plugins/record/capability.js +26 -0
  846. package/dist/plugins/record/capability.js.map +1 -0
  847. package/dist/plugins/record/codec.cjs +244 -0
  848. package/dist/plugins/record/codec.cjs.map +1 -0
  849. package/dist/plugins/record/codec.d.cts +28 -0
  850. package/dist/plugins/record/codec.d.mts +28 -0
  851. package/dist/plugins/record/codec.d.ts +28 -0
  852. package/dist/plugins/record/codec.js +48 -0
  853. package/dist/plugins/record/codec.js.map +1 -0
  854. package/dist/plugins/record/index.cjs +54 -0
  855. package/dist/plugins/record/index.cjs.map +1 -0
  856. package/dist/plugins/record/index.d.cts +9 -0
  857. package/dist/plugins/record/index.d.mts +9 -0
  858. package/dist/plugins/record/index.d.ts +9 -0
  859. package/dist/plugins/record/index.js +94 -0
  860. package/dist/plugins/record/index.js.map +1 -0
  861. package/dist/plugins/record/migration.cjs +33 -0
  862. package/dist/plugins/record/migration.cjs.map +1 -0
  863. package/dist/plugins/record/migration.d.cts +22 -0
  864. package/dist/plugins/record/migration.d.mts +22 -0
  865. package/dist/plugins/record/migration.d.ts +22 -0
  866. package/dist/plugins/record/migration.js +6 -0
  867. package/dist/plugins/record/migration.js.map +1 -0
  868. package/dist/plugins/record/model.cjs +3 -0
  869. package/dist/plugins/record/model.cjs.map +1 -0
  870. package/dist/plugins/record/model.d.cts +93 -0
  871. package/dist/plugins/record/model.d.mts +93 -0
  872. package/dist/plugins/record/model.d.ts +93 -0
  873. package/dist/plugins/record/model.js +4 -0
  874. package/dist/plugins/record/model.js.map +1 -0
  875. package/dist/plugins/record/provenance.cjs +319 -0
  876. package/dist/plugins/record/provenance.cjs.map +1 -0
  877. package/dist/plugins/record/provenance.d.cts +79 -0
  878. package/dist/plugins/record/provenance.d.mts +79 -0
  879. package/dist/plugins/record/provenance.d.ts +79 -0
  880. package/dist/plugins/record/provenance.js +24 -0
  881. package/dist/plugins/record/provenance.js.map +1 -0
  882. package/dist/projection/attachment-result.cjs +50 -0
  883. package/dist/projection/attachment-result.cjs.map +1 -0
  884. package/dist/projection/attachment-result.d.cts +38 -0
  885. package/dist/projection/attachment-result.d.mts +38 -0
  886. package/dist/projection/attachment-result.d.ts +38 -0
  887. package/dist/projection/attachment-result.js +6 -0
  888. package/dist/projection/attachment-result.js.map +1 -0
  889. package/dist/projection/attempt-selection.cjs +87 -0
  890. package/dist/projection/attempt-selection.cjs.map +1 -0
  891. package/dist/projection/attempt-selection.d.cts +40 -0
  892. package/dist/projection/attempt-selection.d.mts +40 -0
  893. package/dist/projection/attempt-selection.d.ts +40 -0
  894. package/dist/projection/attempt-selection.js +8 -0
  895. package/dist/projection/attempt-selection.js.map +1 -0
  896. package/dist/projection/coverage.cjs +106 -0
  897. package/dist/projection/coverage.cjs.map +1 -0
  898. package/dist/projection/coverage.d.cts +43 -0
  899. package/dist/projection/coverage.d.mts +43 -0
  900. package/dist/projection/coverage.d.ts +43 -0
  901. package/dist/projection/coverage.js +6 -0
  902. package/dist/projection/coverage.js.map +1 -0
  903. package/dist/projection/index.cjs +36 -0
  904. package/dist/projection/index.cjs.map +1 -0
  905. package/dist/projection/index.d.cts +25 -0
  906. package/dist/projection/index.d.mts +25 -0
  907. package/dist/projection/index.d.ts +25 -0
  908. package/dist/projection/index.js +46 -0
  909. package/dist/projection/index.js.map +1 -0
  910. package/dist/projection/index.mjs +46 -0
  911. package/dist/projection/index.mjs.map +1 -0
  912. package/dist/projection/model.cjs +3 -0
  913. package/dist/projection/model.cjs.map +1 -0
  914. package/dist/projection/model.d.cts +49 -0
  915. package/dist/projection/model.d.mts +49 -0
  916. package/dist/projection/model.d.ts +49 -0
  917. package/dist/projection/model.js +4 -0
  918. package/dist/projection/model.js.map +1 -0
  919. package/dist/projection/projector.cjs +111 -0
  920. package/dist/projection/projector.cjs.map +1 -0
  921. package/dist/projection/projector.d.cts +51 -0
  922. package/dist/projection/projector.d.mts +51 -0
  923. package/dist/projection/projector.d.ts +51 -0
  924. package/dist/projection/projector.js +16 -0
  925. package/dist/projection/projector.js.map +1 -0
  926. package/dist/projection/runtime.cjs +246 -0
  927. package/dist/projection/runtime.cjs.map +1 -0
  928. package/dist/projection/runtime.d.cts +14 -0
  929. package/dist/projection/runtime.d.mts +14 -0
  930. package/dist/projection/runtime.d.ts +14 -0
  931. package/dist/projection/runtime.js +6 -0
  932. package/dist/projection/runtime.js.map +1 -0
  933. package/dist/record/attachment/errors.cjs +71 -0
  934. package/dist/record/attachment/errors.cjs.map +1 -0
  935. package/dist/record/attachment/errors.d.cts +57 -0
  936. package/dist/record/attachment/errors.d.mts +57 -0
  937. package/dist/record/attachment/errors.d.ts +57 -0
  938. package/dist/record/attachment/errors.js +22 -0
  939. package/dist/record/attachment/errors.js.map +1 -0
  940. package/dist/record/attachment/index.cjs +14 -0
  941. package/dist/record/attachment/index.cjs.map +1 -0
  942. package/dist/record/attachment/index.d.cts +3 -0
  943. package/dist/record/attachment/index.d.mts +3 -0
  944. package/dist/record/attachment/index.d.ts +3 -0
  945. package/dist/record/attachment/index.js +22 -0
  946. package/dist/record/attachment/index.js.map +1 -0
  947. package/dist/record/attachment/internal.cjs +24 -0
  948. package/dist/record/attachment/internal.cjs.map +1 -0
  949. package/dist/record/attachment/internal.d.cts +6 -0
  950. package/dist/record/attachment/internal.d.mts +6 -0
  951. package/dist/record/attachment/internal.d.ts +6 -0
  952. package/dist/record/attachment/internal.js +34 -0
  953. package/dist/record/attachment/internal.js.map +1 -0
  954. package/dist/record/attachment/runtime.cjs +1017 -0
  955. package/dist/record/attachment/runtime.cjs.map +1 -0
  956. package/dist/record/attachment/runtime.d.cts +86 -0
  957. package/dist/record/attachment/runtime.d.mts +86 -0
  958. package/dist/record/attachment/runtime.d.ts +86 -0
  959. package/dist/record/attachment/runtime.js +52 -0
  960. package/dist/record/attachment/runtime.js.map +1 -0
  961. package/dist/record/attachment/types.cjs +47 -0
  962. package/dist/record/attachment/types.cjs.map +1 -0
  963. package/dist/record/attachment/types.d.cts +194 -0
  964. package/dist/record/attachment/types.d.mts +194 -0
  965. package/dist/record/attachment/types.d.ts +194 -0
  966. package/dist/record/attachment/types.js +28 -0
  967. package/dist/record/attachment/types.js.map +1 -0
  968. package/dist/record/codec/core.cjs +134 -0
  969. package/dist/record/codec/core.cjs.map +1 -0
  970. package/dist/record/codec/core.d.cts +63 -0
  971. package/dist/record/codec/core.d.mts +63 -0
  972. package/dist/record/codec/core.d.ts +63 -0
  973. package/dist/record/codec/core.js +46 -0
  974. package/dist/record/codec/core.js.map +1 -0
  975. package/dist/record/codec/identifiers.cjs +31 -0
  976. package/dist/record/codec/identifiers.cjs.map +1 -0
  977. package/dist/record/codec/identifiers.d.cts +11 -0
  978. package/dist/record/codec/identifiers.d.mts +11 -0
  979. package/dist/record/codec/identifiers.d.ts +11 -0
  980. package/dist/record/codec/identifiers.js +22 -0
  981. package/dist/record/codec/identifiers.js.map +1 -0
  982. package/dist/record/codec/index.cjs +19 -0
  983. package/dist/record/codec/index.cjs.map +1 -0
  984. package/dist/record/codec/index.d.cts +2 -0
  985. package/dist/record/codec/index.d.mts +2 -0
  986. package/dist/record/codec/index.d.ts +2 -0
  987. package/dist/record/codec/index.js +64 -0
  988. package/dist/record/codec/index.js.map +1 -0
  989. package/dist/record/errors/index.cjs +18 -0
  990. package/dist/record/errors/index.cjs.map +1 -0
  991. package/dist/record/errors/index.d.cts +1 -0
  992. package/dist/record/errors/index.d.mts +1 -0
  993. package/dist/record/errors/index.d.ts +1 -0
  994. package/dist/record/errors/index.js +28 -0
  995. package/dist/record/errors/index.js.map +1 -0
  996. package/dist/record/errors/record-errors.cjs +58 -0
  997. package/dist/record/errors/record-errors.cjs.map +1 -0
  998. package/dist/record/errors/record-errors.d.cts +64 -0
  999. package/dist/record/errors/record-errors.d.mts +64 -0
  1000. package/dist/record/errors/record-errors.d.ts +64 -0
  1001. package/dist/record/errors/record-errors.js +28 -0
  1002. package/dist/record/errors/record-errors.js.map +1 -0
  1003. package/dist/record/fact-record.cjs +199 -0
  1004. package/dist/record/fact-record.cjs.map +1 -0
  1005. package/dist/record/fact-record.d.cts +22 -0
  1006. package/dist/record/fact-record.d.mts +22 -0
  1007. package/dist/record/fact-record.d.ts +22 -0
  1008. package/dist/record/fact-record.js +18 -0
  1009. package/dist/record/fact-record.js.map +1 -0
  1010. package/dist/record/index.cjs +55 -0
  1011. package/dist/record/index.cjs.map +1 -0
  1012. package/dist/record/index.d.cts +11 -0
  1013. package/dist/record/index.d.mts +11 -0
  1014. package/dist/record/index.d.ts +11 -0
  1015. package/dist/record/index.js +314 -0
  1016. package/dist/record/index.js.map +1 -0
  1017. package/dist/record/locator.cjs +146 -0
  1018. package/dist/record/locator.cjs.map +1 -0
  1019. package/dist/record/locator.d.cts +71 -0
  1020. package/dist/record/locator.d.mts +71 -0
  1021. package/dist/record/locator.js +20 -136
  1022. package/dist/record/locator.js.map +1 -0
  1023. package/dist/record/maintenance/index.cjs +19 -0
  1024. package/dist/record/maintenance/index.cjs.map +1 -0
  1025. package/dist/record/maintenance/index.d.cts +2 -0
  1026. package/dist/record/maintenance/index.d.mts +2 -0
  1027. package/dist/record/maintenance/index.d.ts +2 -0
  1028. package/dist/record/maintenance/index.js +14 -0
  1029. package/dist/record/maintenance/index.js.map +1 -0
  1030. package/dist/record/maintenance/runtime.cjs +98 -0
  1031. package/dist/record/maintenance/runtime.cjs.map +1 -0
  1032. package/dist/record/maintenance/runtime.d.cts +24 -0
  1033. package/dist/record/maintenance/runtime.d.mts +24 -0
  1034. package/dist/record/maintenance/runtime.d.ts +24 -0
  1035. package/dist/record/maintenance/runtime.js +12 -0
  1036. package/dist/record/maintenance/runtime.js.map +1 -0
  1037. package/dist/record/maintenance/types.cjs +9 -0
  1038. package/dist/record/maintenance/types.cjs.map +1 -0
  1039. package/dist/record/maintenance/types.d.cts +34 -0
  1040. package/dist/record/maintenance/types.d.mts +34 -0
  1041. package/dist/record/maintenance/types.d.ts +34 -0
  1042. package/dist/record/maintenance/types.js +6 -0
  1043. package/dist/record/maintenance/types.js.map +1 -0
  1044. package/dist/record/manifest.cjs +44 -0
  1045. package/dist/record/manifest.cjs.map +1 -0
  1046. package/dist/record/manifest.d.cts +39 -0
  1047. package/dist/record/manifest.d.mts +39 -0
  1048. package/dist/record/manifest.d.ts +5 -3
  1049. package/dist/record/manifest.js +14 -0
  1050. package/dist/record/manifest.js.map +1 -0
  1051. package/dist/record/migration/errors.cjs +68 -0
  1052. package/dist/record/migration/errors.cjs.map +1 -0
  1053. package/dist/record/migration/errors.d.cts +73 -0
  1054. package/dist/record/migration/errors.d.mts +73 -0
  1055. package/dist/record/migration/errors.d.ts +73 -0
  1056. package/dist/record/migration/errors.js +22 -0
  1057. package/dist/record/migration/errors.js.map +1 -0
  1058. package/dist/record/migration/identity.cjs +27 -0
  1059. package/dist/record/migration/identity.cjs.map +1 -0
  1060. package/dist/record/migration/identity.d.cts +5 -0
  1061. package/dist/record/migration/identity.d.mts +5 -0
  1062. package/dist/record/migration/identity.d.ts +5 -0
  1063. package/dist/record/migration/identity.js +8 -0
  1064. package/dist/record/migration/identity.js.map +1 -0
  1065. package/dist/record/migration/index.cjs +28 -0
  1066. package/dist/record/migration/index.cjs.map +1 -0
  1067. package/dist/record/migration/index.d.cts +8 -0
  1068. package/dist/record/migration/index.d.mts +8 -0
  1069. package/dist/record/migration/index.d.ts +8 -0
  1070. package/dist/record/migration/index.js +48 -0
  1071. package/dist/record/migration/index.js.map +1 -0
  1072. package/dist/record/migration/internal.cjs +3 -0
  1073. package/dist/record/migration/internal.cjs.map +1 -0
  1074. package/dist/record/migration/internal.d.cts +111 -0
  1075. package/dist/record/migration/internal.d.mts +111 -0
  1076. package/dist/record/migration/internal.d.ts +111 -0
  1077. package/dist/record/migration/internal.js +4 -0
  1078. package/dist/record/migration/internal.js.map +1 -0
  1079. package/dist/record/migration/orchestrate.cjs +368 -0
  1080. package/dist/record/migration/orchestrate.cjs.map +1 -0
  1081. package/dist/record/migration/orchestrate.d.cts +113 -0
  1082. package/dist/record/migration/orchestrate.d.mts +113 -0
  1083. package/dist/record/migration/orchestrate.d.ts +113 -0
  1084. package/dist/record/migration/orchestrate.js +16 -0
  1085. package/dist/record/migration/orchestrate.js.map +1 -0
  1086. package/dist/record/migration/plan.cjs +63 -0
  1087. package/dist/record/migration/plan.cjs.map +1 -0
  1088. package/dist/record/migration/plan.d.cts +32 -0
  1089. package/dist/record/migration/plan.d.mts +32 -0
  1090. package/dist/record/migration/plan.d.ts +32 -0
  1091. package/dist/record/migration/plan.js +10 -0
  1092. package/dist/record/migration/plan.js.map +1 -0
  1093. package/dist/record/migration/registry.cjs +150 -0
  1094. package/dist/record/migration/registry.cjs.map +1 -0
  1095. package/dist/record/migration/registry.d.cts +61 -0
  1096. package/dist/record/migration/registry.d.mts +61 -0
  1097. package/dist/record/migration/registry.d.ts +61 -0
  1098. package/dist/record/migration/registry.js +14 -0
  1099. package/dist/record/migration/registry.js.map +1 -0
  1100. package/dist/record/migration/storage.cjs +382 -0
  1101. package/dist/record/migration/storage.cjs.map +1 -0
  1102. package/dist/record/migration/storage.d.cts +18 -0
  1103. package/dist/record/migration/storage.d.mts +18 -0
  1104. package/dist/record/migration/storage.d.ts +18 -0
  1105. package/dist/record/migration/storage.js +6 -0
  1106. package/dist/record/migration/storage.js.map +1 -0
  1107. package/dist/record/migration/types.cjs +3 -0
  1108. package/dist/record/migration/types.cjs.map +1 -0
  1109. package/dist/record/migration/types.d.cts +16 -0
  1110. package/dist/record/migration/types.d.mts +16 -0
  1111. package/dist/record/migration/types.d.ts +16 -0
  1112. package/dist/record/migration/types.js +4 -0
  1113. package/dist/record/migration/types.js.map +1 -0
  1114. package/dist/record/model/core.cjs +11 -0
  1115. package/dist/record/model/core.cjs.map +1 -0
  1116. package/dist/record/model/core.d.cts +53 -0
  1117. package/dist/record/model/core.d.mts +53 -0
  1118. package/dist/record/model/core.d.ts +53 -0
  1119. package/dist/record/model/core.js +6 -0
  1120. package/dist/record/model/core.js.map +1 -0
  1121. package/dist/record/model/identifiers.cjs +78 -0
  1122. package/dist/record/model/identifiers.cjs.map +1 -0
  1123. package/dist/record/model/identifiers.d.cts +44 -0
  1124. package/dist/record/model/identifiers.d.mts +44 -0
  1125. package/dist/record/model/identifiers.d.ts +44 -0
  1126. package/dist/record/model/identifiers.js +40 -0
  1127. package/dist/record/model/identifiers.js.map +1 -0
  1128. package/dist/record/model/index.cjs +21 -0
  1129. package/dist/record/model/index.cjs.map +1 -0
  1130. package/dist/record/model/index.d.cts +4 -0
  1131. package/dist/record/model/index.d.mts +4 -0
  1132. package/dist/record/model/index.d.ts +4 -0
  1133. package/dist/record/model/index.js +52 -0
  1134. package/dist/record/model/index.js.map +1 -0
  1135. package/dist/record/model/read-state.cjs +3 -0
  1136. package/dist/record/model/read-state.cjs.map +1 -0
  1137. package/dist/record/model/read-state.d.cts +45 -0
  1138. package/dist/record/model/read-state.d.mts +45 -0
  1139. package/dist/record/model/read-state.d.ts +45 -0
  1140. package/dist/record/model/read-state.js +4 -0
  1141. package/dist/record/model/read-state.js.map +1 -0
  1142. package/dist/record/model/validation.cjs +143 -0
  1143. package/dist/record/model/validation.cjs.map +1 -0
  1144. package/dist/record/model/validation.d.cts +16 -0
  1145. package/dist/record/model/validation.d.mts +16 -0
  1146. package/dist/record/model/validation.d.ts +16 -0
  1147. package/dist/record/model/validation.js +14 -0
  1148. package/dist/record/model/validation.js.map +1 -0
  1149. package/dist/record/platform/errors.cjs +101 -0
  1150. package/dist/record/platform/errors.cjs.map +1 -0
  1151. package/dist/record/platform/errors.d.cts +123 -0
  1152. package/dist/record/platform/errors.d.mts +123 -0
  1153. package/dist/record/platform/errors.d.ts +123 -0
  1154. package/dist/record/platform/errors.js +32 -0
  1155. package/dist/record/platform/errors.js.map +1 -0
  1156. package/dist/record/platform/index.cjs +21 -0
  1157. package/dist/record/platform/index.cjs.map +1 -0
  1158. package/dist/record/platform/index.d.cts +4 -0
  1159. package/dist/record/platform/index.d.mts +4 -0
  1160. package/dist/record/platform/index.d.ts +4 -0
  1161. package/dist/record/platform/index.js +60 -0
  1162. package/dist/record/platform/index.js.map +1 -0
  1163. package/dist/record/platform/node.cjs +715 -0
  1164. package/dist/record/platform/node.cjs.map +1 -0
  1165. package/dist/record/platform/node.d.cts +12 -0
  1166. package/dist/record/platform/node.d.mts +12 -0
  1167. package/dist/record/platform/node.d.ts +12 -0
  1168. package/dist/record/platform/node.js +16 -0
  1169. package/dist/record/platform/node.js.map +1 -0
  1170. package/dist/record/platform/root.cjs +79 -0
  1171. package/dist/record/platform/root.cjs.map +1 -0
  1172. package/dist/record/platform/root.d.cts +35 -0
  1173. package/dist/record/platform/root.d.mts +35 -0
  1174. package/dist/record/platform/root.d.ts +35 -0
  1175. package/dist/record/platform/root.js +8 -0
  1176. package/dist/record/platform/root.js.map +1 -0
  1177. package/dist/record/platform/services.cjs +24 -0
  1178. package/dist/record/platform/services.cjs.map +1 -0
  1179. package/dist/record/platform/services.d.cts +139 -0
  1180. package/dist/record/platform/services.d.mts +139 -0
  1181. package/dist/record/platform/services.d.ts +139 -0
  1182. package/dist/record/platform/services.js +16 -0
  1183. package/dist/record/platform/services.js.map +1 -0
  1184. package/dist/record/reader/errors.cjs +46 -0
  1185. package/dist/record/reader/errors.cjs.map +1 -0
  1186. package/dist/record/reader/errors.d.cts +58 -0
  1187. package/dist/record/reader/errors.d.mts +58 -0
  1188. package/dist/record/reader/errors.d.ts +58 -0
  1189. package/dist/record/reader/errors.js +16 -0
  1190. package/dist/record/reader/errors.js.map +1 -0
  1191. package/dist/record/reader/format.cjs +95 -0
  1192. package/dist/record/reader/format.cjs.map +1 -0
  1193. package/dist/record/reader/format.d.cts +17 -0
  1194. package/dist/record/reader/format.d.mts +17 -0
  1195. package/dist/record/reader/format.d.ts +17 -0
  1196. package/dist/record/reader/format.js +8 -0
  1197. package/dist/record/reader/format.js.map +1 -0
  1198. package/dist/record/reader/identity.cjs +47 -0
  1199. package/dist/record/reader/identity.cjs.map +1 -0
  1200. package/dist/record/reader/identity.d.cts +31 -0
  1201. package/dist/record/reader/identity.d.mts +31 -0
  1202. package/dist/record/reader/identity.d.ts +31 -0
  1203. package/dist/record/reader/identity.js +8 -0
  1204. package/dist/record/reader/identity.js.map +1 -0
  1205. package/dist/record/reader/index.cjs +21 -0
  1206. package/dist/record/reader/index.cjs.map +1 -0
  1207. package/dist/record/reader/index.d.cts +4 -0
  1208. package/dist/record/reader/index.d.mts +4 -0
  1209. package/dist/record/reader/index.d.ts +4 -0
  1210. package/dist/record/reader/index.js +42 -0
  1211. package/dist/record/reader/index.js.map +1 -0
  1212. package/dist/record/reader/internal.cjs +17 -0
  1213. package/dist/record/reader/internal.cjs.map +1 -0
  1214. package/dist/record/reader/internal.d.cts +26 -0
  1215. package/dist/record/reader/internal.d.mts +26 -0
  1216. package/dist/record/reader/internal.d.ts +26 -0
  1217. package/dist/record/reader/internal.js +8 -0
  1218. package/dist/record/reader/internal.js.map +1 -0
  1219. package/dist/record/reader/runtime.cjs +728 -0
  1220. package/dist/record/reader/runtime.cjs.map +1 -0
  1221. package/dist/record/reader/runtime.d.cts +22 -0
  1222. package/dist/record/reader/runtime.d.mts +22 -0
  1223. package/dist/record/reader/runtime.d.ts +22 -0
  1224. package/dist/record/reader/runtime.js +20 -0
  1225. package/dist/record/reader/runtime.js.map +1 -0
  1226. package/dist/record/reader/types.cjs +12 -0
  1227. package/dist/record/reader/types.cjs.map +1 -0
  1228. package/dist/record/reader/types.d.cts +50 -0
  1229. package/dist/record/reader/types.d.mts +50 -0
  1230. package/dist/record/reader/types.d.ts +50 -0
  1231. package/dist/record/reader/types.js +10 -0
  1232. package/dist/record/reader/types.js.map +1 -0
  1233. package/dist/record/source-hash.cjs +30 -0
  1234. package/dist/record/source-hash.cjs.map +1 -0
  1235. package/dist/record/source-hash.d.cts +9 -0
  1236. package/dist/record/source-hash.d.mts +9 -0
  1237. package/dist/record/source-hash.js +8 -25
  1238. package/dist/record/source-hash.js.map +1 -0
  1239. package/dist/record/writer/attachment-payload.cjs +81 -0
  1240. package/dist/record/writer/attachment-payload.cjs.map +1 -0
  1241. package/dist/record/writer/attachment-payload.d.cts +19 -0
  1242. package/dist/record/writer/attachment-payload.d.mts +19 -0
  1243. package/dist/record/writer/attachment-payload.d.ts +19 -0
  1244. package/dist/record/writer/attachment-payload.js +10 -0
  1245. package/dist/record/writer/attachment-payload.js.map +1 -0
  1246. package/dist/record/writer/errors.cjs +35 -0
  1247. package/dist/record/writer/errors.cjs.map +1 -0
  1248. package/dist/record/writer/errors.d.cts +35 -0
  1249. package/dist/record/writer/errors.d.mts +35 -0
  1250. package/dist/record/writer/errors.d.ts +35 -0
  1251. package/dist/record/writer/errors.js +14 -0
  1252. package/dist/record/writer/errors.js.map +1 -0
  1253. package/dist/record/writer/index.cjs +20 -0
  1254. package/dist/record/writer/index.cjs.map +1 -0
  1255. package/dist/record/writer/index.d.cts +3 -0
  1256. package/dist/record/writer/index.d.mts +3 -0
  1257. package/dist/record/writer/index.d.ts +3 -0
  1258. package/dist/record/writer/index.js +22 -0
  1259. package/dist/record/writer/index.js.map +1 -0
  1260. package/dist/record/writer/limits.cjs +16 -0
  1261. package/dist/record/writer/limits.cjs.map +1 -0
  1262. package/dist/record/writer/limits.d.cts +4 -0
  1263. package/dist/record/writer/limits.d.mts +4 -0
  1264. package/dist/record/writer/limits.d.ts +4 -0
  1265. package/dist/record/writer/limits.js +8 -0
  1266. package/dist/record/writer/limits.js.map +1 -0
  1267. package/dist/record/writer/runtime.cjs +656 -0
  1268. package/dist/record/writer/runtime.cjs.map +1 -0
  1269. package/dist/record/writer/runtime.d.cts +7 -0
  1270. package/dist/record/writer/runtime.d.mts +7 -0
  1271. package/dist/record/writer/runtime.d.ts +7 -0
  1272. package/dist/record/writer/runtime.js +6 -0
  1273. package/dist/record/writer/runtime.js.map +1 -0
  1274. package/dist/record/writer/types.cjs +7 -0
  1275. package/dist/record/writer/types.cjs.map +1 -0
  1276. package/dist/record/writer/types.d.cts +56 -0
  1277. package/dist/record/writer/types.d.mts +56 -0
  1278. package/dist/record/writer/types.d.ts +56 -0
  1279. package/dist/record/writer/types.js +10 -0
  1280. package/dist/record/writer/types.js.map +1 -0
  1281. package/dist/report/author/identity.cjs +268 -0
  1282. package/dist/report/author/identity.cjs.map +1 -0
  1283. package/dist/report/author/identity.d.cts +75 -0
  1284. package/dist/report/author/identity.d.mts +75 -0
  1285. package/dist/report/author/identity.d.ts +75 -0
  1286. package/dist/report/author/identity.js +34 -0
  1287. package/dist/report/author/identity.js.map +1 -0
  1288. package/dist/report/author/index.cjs +19 -0
  1289. package/dist/report/author/index.cjs.map +1 -0
  1290. package/dist/report/author/index.d.cts +4 -0
  1291. package/dist/report/author/index.d.mts +4 -0
  1292. package/dist/report/author/index.d.ts +4 -0
  1293. package/dist/report/author/index.js +30 -0
  1294. package/dist/report/author/index.js.map +1 -0
  1295. package/dist/report/author/internal.cjs +98 -0
  1296. package/dist/report/author/internal.cjs.map +1 -0
  1297. package/dist/report/author/internal.d.cts +91 -0
  1298. package/dist/report/author/internal.d.mts +91 -0
  1299. package/dist/report/author/internal.d.ts +91 -0
  1300. package/dist/report/author/internal.js +18 -0
  1301. package/dist/report/author/internal.js.map +1 -0
  1302. package/dist/report/author/model.cjs +467 -0
  1303. package/dist/report/author/model.cjs.map +1 -0
  1304. package/dist/report/author/model.d.cts +241 -0
  1305. package/dist/report/author/model.d.mts +241 -0
  1306. package/dist/report/author/model.d.ts +241 -0
  1307. package/dist/report/author/model.js +32 -0
  1308. package/dist/report/author/model.js.map +1 -0
  1309. package/dist/report/built-in/attempt-overview.cjs +395 -0
  1310. package/dist/report/built-in/attempt-overview.cjs.map +1 -0
  1311. package/dist/report/built-in/attempt-overview.d.cts +10 -0
  1312. package/dist/report/built-in/attempt-overview.d.mts +10 -0
  1313. package/dist/report/built-in/attempt-overview.d.ts +10 -0
  1314. package/dist/report/built-in/attempt-overview.js +9 -0
  1315. package/dist/report/built-in/attempt-overview.js.map +1 -0
  1316. package/dist/report/built-in/execution.cjs +766 -0
  1317. package/dist/report/built-in/execution.cjs.map +1 -0
  1318. package/dist/report/built-in/execution.d.cts +25 -0
  1319. package/dist/report/built-in/execution.d.mts +25 -0
  1320. package/dist/report/built-in/execution.d.ts +25 -0
  1321. package/dist/report/built-in/execution.js +12 -0
  1322. package/dist/report/built-in/execution.js.map +1 -0
  1323. package/dist/report/built-in/index.cjs +31 -0
  1324. package/dist/report/built-in/index.cjs.map +1 -0
  1325. package/dist/report/built-in/index.d.cts +6 -0
  1326. package/dist/report/built-in/index.d.mts +6 -0
  1327. package/dist/report/built-in/index.d.ts +6 -8
  1328. package/dist/report/built-in/index.js +35 -13
  1329. package/dist/report/built-in/index.js.map +1 -0
  1330. package/dist/report/built-in/index.mjs +35 -0
  1331. package/dist/report/built-in/index.mjs.map +1 -0
  1332. package/dist/report/built-in/overview.cjs +206 -0
  1333. package/dist/report/built-in/overview.cjs.map +1 -0
  1334. package/dist/report/built-in/overview.d.cts +6 -0
  1335. package/dist/report/built-in/overview.d.mts +6 -0
  1336. package/dist/report/built-in/overview.d.ts +6 -0
  1337. package/dist/report/built-in/overview.js +11 -0
  1338. package/dist/report/built-in/overview.js.map +1 -0
  1339. package/dist/report/built-in/run-membership-overview.cjs +194 -0
  1340. package/dist/report/built-in/run-membership-overview.cjs.map +1 -0
  1341. package/dist/report/built-in/run-membership-overview.d.cts +6 -0
  1342. package/dist/report/built-in/run-membership-overview.d.mts +6 -0
  1343. package/dist/report/built-in/run-membership-overview.d.ts +6 -0
  1344. package/dist/report/built-in/run-membership-overview.js +9 -0
  1345. package/dist/report/built-in/run-membership-overview.js.map +1 -0
  1346. package/dist/report/built-in/sandbox-history.cjs +384 -0
  1347. package/dist/report/built-in/sandbox-history.cjs.map +1 -0
  1348. package/dist/report/built-in/sandbox-history.d.cts +9 -0
  1349. package/dist/report/built-in/sandbox-history.d.mts +9 -0
  1350. package/dist/report/built-in/sandbox-history.d.ts +9 -0
  1351. package/dist/report/built-in/sandbox-history.js +9 -0
  1352. package/dist/report/built-in/sandbox-history.js.map +1 -0
  1353. package/dist/report/built-in/source.cjs +162 -0
  1354. package/dist/report/built-in/source.cjs.map +1 -0
  1355. package/dist/report/built-in/source.d.cts +11 -0
  1356. package/dist/report/built-in/source.d.mts +11 -0
  1357. package/dist/report/built-in/source.d.ts +11 -0
  1358. package/dist/report/built-in/source.js +8 -0
  1359. package/dist/report/built-in/source.js.map +1 -0
  1360. package/dist/report/execution/index.cjs +20 -0
  1361. package/dist/report/execution/index.cjs.map +1 -0
  1362. package/dist/report/execution/index.d.cts +3 -0
  1363. package/dist/report/execution/index.d.mts +3 -0
  1364. package/dist/report/execution/index.d.ts +3 -0
  1365. package/dist/report/execution/index.js +30 -0
  1366. package/dist/report/execution/index.js.map +1 -0
  1367. package/dist/report/execution/model.cjs +483 -0
  1368. package/dist/report/execution/model.cjs.map +1 -0
  1369. package/dist/report/execution/model.d.cts +50 -0
  1370. package/dist/report/execution/model.d.mts +50 -0
  1371. package/dist/report/execution/model.d.ts +50 -0
  1372. package/dist/report/execution/model.js +16 -0
  1373. package/dist/report/execution/model.js.map +1 -0
  1374. package/dist/report/execution/problems.cjs +210 -0
  1375. package/dist/report/execution/problems.cjs.map +1 -0
  1376. package/dist/report/execution/problems.d.cts +54 -0
  1377. package/dist/report/execution/problems.d.mts +54 -0
  1378. package/dist/report/execution/problems.d.ts +54 -0
  1379. package/dist/report/execution/problems.js +14 -0
  1380. package/dist/report/execution/problems.js.map +1 -0
  1381. package/dist/report/execution/results.cjs +26 -0
  1382. package/dist/report/execution/results.cjs.map +1 -0
  1383. package/dist/report/execution/results.d.cts +102 -0
  1384. package/dist/report/execution/results.d.mts +102 -0
  1385. package/dist/report/execution/results.d.ts +102 -0
  1386. package/dist/report/execution/results.js +8 -0
  1387. package/dist/report/execution/results.js.map +1 -0
  1388. package/dist/report/host/execute.cjs +1287 -0
  1389. package/dist/report/host/execute.cjs.map +1 -0
  1390. package/dist/report/host/execute.d.cts +23 -0
  1391. package/dist/report/host/execute.d.mts +23 -0
  1392. package/dist/report/host/execute.d.ts +23 -0
  1393. package/dist/report/host/execute.js +6 -0
  1394. package/dist/report/host/execute.js.map +1 -0
  1395. package/dist/report/host/from-record.cjs +47 -0
  1396. package/dist/report/host/from-record.cjs.map +1 -0
  1397. package/dist/report/host/from-record.d.cts +36 -0
  1398. package/dist/report/host/from-record.d.mts +36 -0
  1399. package/dist/report/host/from-record.d.ts +36 -0
  1400. package/dist/report/host/from-record.js +8 -0
  1401. package/dist/report/host/from-record.js.map +1 -0
  1402. package/dist/report/host/html.cjs +424 -0
  1403. package/dist/report/host/html.cjs.map +1 -0
  1404. package/dist/report/host/html.d.cts +28 -0
  1405. package/dist/report/host/html.d.mts +28 -0
  1406. package/dist/report/host/html.d.ts +28 -0
  1407. package/dist/report/host/html.js +6 -0
  1408. package/dist/report/host/html.js.map +1 -0
  1409. package/dist/report/host/index.cjs +21 -0
  1410. package/dist/report/host/index.cjs.map +1 -0
  1411. package/dist/report/host/index.d.cts +11 -0
  1412. package/dist/report/host/index.d.mts +11 -0
  1413. package/dist/report/host/index.d.ts +11 -0
  1414. package/dist/report/host/index.js +24 -0
  1415. package/dist/report/host/index.js.map +1 -0
  1416. package/dist/report/host/node/loader.cjs +210 -0
  1417. package/dist/report/host/node/loader.cjs.map +1 -0
  1418. package/dist/report/host/node/loader.d.cts +45 -0
  1419. package/dist/report/host/node/loader.d.mts +45 -0
  1420. package/dist/report/host/node/loader.d.ts +45 -0
  1421. package/dist/report/host/node/loader.js +14 -0
  1422. package/dist/report/host/node/loader.js.map +1 -0
  1423. package/dist/report/host/node/theme.cjs +21 -0
  1424. package/dist/report/host/node/theme.cjs.map +1 -0
  1425. package/dist/report/host/node/theme.d.cts +1 -0
  1426. package/dist/report/host/node/theme.d.mts +1 -0
  1427. package/dist/report/host/node/theme.d.ts +1 -0
  1428. package/dist/report/host/node/theme.js +14 -0
  1429. package/dist/report/host/node/theme.js.map +1 -0
  1430. package/dist/report/host/node.cjs +147 -0
  1431. package/dist/report/host/node.cjs.map +1 -0
  1432. package/dist/report/host/node.d.cts +36 -0
  1433. package/dist/report/host/node.d.mts +36 -0
  1434. package/dist/report/host/node.d.ts +36 -0
  1435. package/dist/report/host/node.js +36 -0
  1436. package/dist/report/host/node.js.map +1 -0
  1437. package/dist/report/host/presentation.cjs +423 -0
  1438. package/dist/report/host/presentation.cjs.map +1 -0
  1439. package/dist/report/host/presentation.d.cts +42 -0
  1440. package/dist/report/host/presentation.d.mts +42 -0
  1441. package/dist/report/host/presentation.d.ts +42 -0
  1442. package/dist/report/host/presentation.js +16 -0
  1443. package/dist/report/host/presentation.js.map +1 -0
  1444. package/dist/report/host/static.cjs +126 -0
  1445. package/dist/report/host/static.cjs.map +1 -0
  1446. package/dist/report/host/static.d.cts +55 -0
  1447. package/dist/report/host/static.d.mts +55 -0
  1448. package/dist/report/host/static.d.ts +55 -0
  1449. package/dist/report/host/static.js +8 -0
  1450. package/dist/report/host/static.js.map +1 -0
  1451. package/dist/report/host/theme.cjs +223 -0
  1452. package/dist/report/host/theme.cjs.map +1 -0
  1453. package/dist/report/host/theme.d.cts +64 -0
  1454. package/dist/report/host/theme.d.mts +64 -0
  1455. package/dist/report/host/theme.d.ts +64 -0
  1456. package/dist/report/host/theme.js +14 -0
  1457. package/dist/report/host/theme.js.map +1 -0
  1458. package/dist/report/host/view-session.cjs +82 -0
  1459. package/dist/report/host/view-session.cjs.map +1 -0
  1460. package/dist/report/host/view-session.d.cts +82 -0
  1461. package/dist/report/host/view-session.d.mts +82 -0
  1462. package/dist/report/host/view-session.d.ts +82 -0
  1463. package/dist/report/host/view-session.js +6 -0
  1464. package/dist/report/host/view-session.js.map +1 -0
  1465. package/dist/report/index.cjs +58 -0
  1466. package/dist/report/index.cjs.map +1 -0
  1467. package/dist/report/index.d.cts +11 -0
  1468. package/dist/report/index.d.mts +11 -0
  1469. package/dist/report/index.d.ts +11 -43
  1470. package/dist/report/index.js +120 -44
  1471. package/dist/report/index.js.map +1 -0
  1472. package/dist/report/index.mjs +120 -0
  1473. package/dist/report/index.mjs.map +1 -0
  1474. package/dist/report/model/panel.cjs +271 -0
  1475. package/dist/report/model/panel.cjs.map +1 -0
  1476. package/dist/report/model/panel.d.cts +109 -0
  1477. package/dist/report/model/panel.d.mts +109 -0
  1478. package/dist/report/model/panel.d.ts +2 -2
  1479. package/dist/report/model/panel.js +22 -260
  1480. package/dist/report/model/panel.js.map +1 -0
  1481. package/dist/report/model/text-layout.cjs +185 -0
  1482. package/dist/report/model/text-layout.cjs.map +1 -0
  1483. package/dist/report/model/text-layout.d.cts +75 -0
  1484. package/dist/report/model/text-layout.d.mts +75 -0
  1485. package/dist/report/model/text-layout.js +22 -173
  1486. package/dist/report/model/text-layout.js.map +1 -0
  1487. package/dist/report/semantic/document.cjs +593 -0
  1488. package/dist/report/semantic/document.cjs.map +1 -0
  1489. package/dist/report/semantic/document.d.cts +162 -0
  1490. package/dist/report/semantic/document.d.mts +162 -0
  1491. package/dist/report/semantic/document.d.ts +162 -0
  1492. package/dist/report/semantic/document.js +38 -0
  1493. package/dist/report/semantic/document.js.map +1 -0
  1494. package/dist/report/semantic/index.cjs +18 -0
  1495. package/dist/report/semantic/index.cjs.map +1 -0
  1496. package/dist/report/semantic/index.d.cts +1 -0
  1497. package/dist/report/semantic/index.d.mts +1 -0
  1498. package/dist/report/semantic/index.d.ts +1 -0
  1499. package/dist/report/semantic/index.js +38 -0
  1500. package/dist/report/semantic/index.js.map +1 -0
  1501. package/dist/runner/accept-prompt.cjs +50 -0
  1502. package/dist/runner/accept-prompt.cjs.map +1 -0
  1503. package/dist/runner/accept-prompt.d.cts +27 -0
  1504. package/dist/runner/accept-prompt.d.mts +27 -0
  1505. package/dist/runner/accept-prompt.d.ts +27 -0
  1506. package/dist/runner/accept-prompt.js +10 -0
  1507. package/dist/runner/accept-prompt.js.map +1 -0
  1508. package/dist/runner/accept.cjs +280 -0
  1509. package/dist/runner/accept.cjs.map +1 -0
  1510. package/dist/runner/accept.d.cts +75 -0
  1511. package/dist/runner/accept.d.mts +75 -0
  1512. package/dist/runner/accept.d.ts +75 -0
  1513. package/dist/runner/accept.js +16 -0
  1514. package/dist/runner/accept.js.map +1 -0
  1515. package/dist/runner/adoption.cjs +859 -0
  1516. package/dist/runner/adoption.cjs.map +1 -0
  1517. package/dist/runner/adoption.d.cts +214 -0
  1518. package/dist/runner/adoption.d.mts +214 -0
  1519. package/dist/runner/adoption.d.ts +214 -0
  1520. package/dist/runner/adoption.js +50 -0
  1521. package/dist/runner/adoption.js.map +1 -0
  1522. package/dist/runner/assert-first-bridge.cjs +203 -0
  1523. package/dist/runner/assert-first-bridge.cjs.map +1 -0
  1524. package/dist/runner/assert-first-bridge.d.cts +51 -0
  1525. package/dist/runner/assert-first-bridge.d.mts +51 -0
  1526. package/dist/runner/assert-first-bridge.d.ts +51 -0
  1527. package/dist/runner/assert-first-bridge.js +6 -0
  1528. package/dist/runner/assert-first-bridge.js.map +1 -0
  1529. package/dist/runner/assertions.cjs +77 -0
  1530. package/dist/runner/assertions.cjs.map +1 -0
  1531. package/dist/runner/assertions.d.cts +8 -0
  1532. package/dist/runner/assertions.d.mts +8 -0
  1533. package/dist/runner/assertions.d.ts +8 -0
  1534. package/dist/runner/assertions.js +6 -0
  1535. package/dist/runner/assertions.js.map +1 -0
  1536. package/dist/runner/attempt.cjs +2057 -0
  1537. package/dist/runner/attempt.cjs.map +1 -0
  1538. package/dist/runner/attempt.d.cts +90 -0
  1539. package/dist/runner/attempt.d.mts +90 -0
  1540. package/dist/runner/attempt.d.ts +90 -0
  1541. package/dist/runner/attempt.js +14 -0
  1542. package/dist/runner/attempt.js.map +1 -0
  1543. package/dist/runner/build-preparation.cjs +87 -0
  1544. package/dist/runner/build-preparation.cjs.map +1 -0
  1545. package/dist/runner/build-preparation.d.cts +23 -0
  1546. package/dist/runner/build-preparation.d.mts +23 -0
  1547. package/dist/runner/build-preparation.d.ts +23 -0
  1548. package/dist/runner/build-preparation.js +8 -0
  1549. package/dist/runner/build-preparation.js.map +1 -0
  1550. package/dist/runner/cleanup-timeout.cjs +40 -0
  1551. package/dist/runner/cleanup-timeout.cjs.map +1 -0
  1552. package/dist/runner/cleanup-timeout.d.cts +21 -0
  1553. package/dist/runner/cleanup-timeout.d.mts +21 -0
  1554. package/dist/runner/cleanup-timeout.d.ts +19 -1
  1555. package/dist/runner/cleanup-timeout.js +12 -0
  1556. package/dist/runner/cleanup-timeout.js.map +1 -0
  1557. package/dist/runner/command-plan.cjs +475 -0
  1558. package/dist/runner/command-plan.cjs.map +1 -0
  1559. package/dist/runner/command-plan.d.cts +106 -0
  1560. package/dist/runner/command-plan.d.mts +106 -0
  1561. package/dist/runner/command-plan.d.ts +106 -0
  1562. package/dist/runner/command-plan.js +6 -0
  1563. package/dist/runner/command-plan.js.map +1 -0
  1564. package/dist/runner/config-identity.cjs +259 -0
  1565. package/dist/runner/config-identity.cjs.map +1 -0
  1566. package/dist/runner/config-identity.d.cts +88 -0
  1567. package/dist/runner/config-identity.d.mts +88 -0
  1568. package/dist/runner/config-identity.d.ts +7 -5
  1569. package/dist/runner/config-identity.js +22 -0
  1570. package/dist/runner/config-identity.js.map +1 -0
  1571. package/dist/runner/direct-agent-sandbox.cjs +64 -0
  1572. package/dist/runner/direct-agent-sandbox.cjs.map +1 -0
  1573. package/dist/runner/direct-agent-sandbox.d.cts +5 -0
  1574. package/dist/runner/direct-agent-sandbox.d.mts +5 -0
  1575. package/dist/runner/direct-agent-sandbox.d.ts +5 -0
  1576. package/dist/runner/direct-agent-sandbox.js +8 -0
  1577. package/dist/runner/direct-agent-sandbox.js.map +1 -0
  1578. package/dist/runner/discover.cjs +628 -0
  1579. package/dist/runner/discover.cjs.map +1 -0
  1580. package/dist/runner/discover.d.cts +29 -0
  1581. package/dist/runner/discover.d.mts +29 -0
  1582. package/dist/runner/discover.d.ts +29 -0
  1583. package/dist/runner/discover.js +12 -0
  1584. package/dist/runner/discover.js.map +1 -0
  1585. package/dist/runner/eval-selection.cjs +95 -0
  1586. package/dist/runner/eval-selection.cjs.map +1 -0
  1587. package/dist/runner/eval-selection.d.cts +37 -0
  1588. package/dist/runner/eval-selection.d.mts +37 -0
  1589. package/dist/runner/eval-selection.d.ts +2 -7
  1590. package/dist/runner/eval-selection.js +12 -0
  1591. package/dist/runner/eval-selection.js.map +1 -0
  1592. package/dist/runner/eval-source.cjs +64 -0
  1593. package/dist/runner/eval-source.cjs.map +1 -0
  1594. package/dist/runner/eval-source.d.cts +28 -0
  1595. package/dist/runner/eval-source.d.mts +28 -0
  1596. package/dist/runner/eval-source.d.ts +1 -1
  1597. package/dist/runner/eval-source.js +26 -0
  1598. package/dist/runner/eval-source.js.map +1 -0
  1599. package/dist/runner/experiment-cleanup-registry.cjs +70 -0
  1600. package/dist/runner/experiment-cleanup-registry.cjs.map +1 -0
  1601. package/dist/runner/experiment-cleanup-registry.d.cts +19 -0
  1602. package/dist/runner/experiment-cleanup-registry.d.mts +19 -0
  1603. package/dist/runner/experiment-cleanup-registry.d.ts +19 -0
  1604. package/dist/runner/experiment-cleanup-registry.js +14 -0
  1605. package/dist/runner/experiment-cleanup-registry.js.map +1 -0
  1606. package/dist/runner/feedback/coordinator.cjs +404 -0
  1607. package/dist/runner/feedback/coordinator.cjs.map +1 -0
  1608. package/dist/runner/feedback/coordinator.d.cts +61 -0
  1609. package/dist/runner/feedback/coordinator.d.mts +61 -0
  1610. package/dist/runner/feedback/coordinator.d.ts +61 -0
  1611. package/dist/runner/feedback/coordinator.js +6 -0
  1612. package/dist/runner/feedback/coordinator.js.map +1 -0
  1613. package/dist/runner/feedback/eval-conclusions.cjs +75 -0
  1614. package/dist/runner/feedback/eval-conclusions.cjs.map +1 -0
  1615. package/dist/runner/feedback/eval-conclusions.d.cts +30 -0
  1616. package/dist/runner/feedback/eval-conclusions.d.mts +30 -0
  1617. package/dist/runner/feedback/eval-conclusions.d.ts +30 -0
  1618. package/dist/runner/feedback/eval-conclusions.js +8 -0
  1619. package/dist/runner/feedback/eval-conclusions.js.map +1 -0
  1620. package/dist/runner/feedback/failure.cjs +194 -0
  1621. package/dist/runner/feedback/failure.cjs.map +1 -0
  1622. package/dist/runner/feedback/failure.d.cts +13 -0
  1623. package/dist/runner/feedback/failure.d.mts +13 -0
  1624. package/dist/runner/feedback/failure.d.ts +13 -0
  1625. package/dist/runner/feedback/failure.js +8 -0
  1626. package/dist/runner/feedback/failure.js.map +1 -0
  1627. package/dist/runner/feedback/human.cjs +1469 -0
  1628. package/dist/runner/feedback/human.cjs.map +1 -0
  1629. package/dist/runner/feedback/human.d.cts +139 -0
  1630. package/dist/runner/feedback/human.d.mts +139 -0
  1631. package/dist/runner/feedback/human.d.ts +139 -0
  1632. package/dist/runner/feedback/human.js +18 -0
  1633. package/dist/runner/feedback/human.js.map +1 -0
  1634. package/dist/runner/feedback/index.cjs +51 -0
  1635. package/dist/runner/feedback/index.cjs.map +1 -0
  1636. package/dist/runner/feedback/index.d.cts +10 -0
  1637. package/dist/runner/feedback/index.d.mts +10 -0
  1638. package/dist/runner/feedback/index.d.ts +10 -0
  1639. package/dist/runner/feedback/index.js +58 -0
  1640. package/dist/runner/feedback/index.js.map +1 -0
  1641. package/dist/runner/feedback/input-guard.cjs +106 -0
  1642. package/dist/runner/feedback/input-guard.cjs.map +1 -0
  1643. package/dist/runner/feedback/input-guard.d.cts +43 -0
  1644. package/dist/runner/feedback/input-guard.d.mts +43 -0
  1645. package/dist/runner/feedback/input-guard.d.ts +43 -0
  1646. package/dist/runner/feedback/input-guard.js +8 -0
  1647. package/dist/runner/feedback/input-guard.js.map +1 -0
  1648. package/dist/runner/feedback/io.cjs +43 -0
  1649. package/dist/runner/feedback/io.cjs.map +1 -0
  1650. package/dist/runner/feedback/io.d.cts +38 -0
  1651. package/dist/runner/feedback/io.d.mts +38 -0
  1652. package/dist/runner/feedback/io.d.ts +38 -0
  1653. package/dist/runner/feedback/io.js +6 -0
  1654. package/dist/runner/feedback/io.js.map +1 -0
  1655. package/dist/runner/feedback/json.cjs +371 -0
  1656. package/dist/runner/feedback/json.cjs.map +1 -0
  1657. package/dist/runner/feedback/json.d.cts +242 -0
  1658. package/dist/runner/feedback/json.d.mts +242 -0
  1659. package/dist/runner/feedback/json.d.ts +242 -0
  1660. package/dist/runner/feedback/json.js +10 -0
  1661. package/dist/runner/feedback/json.js.map +1 -0
  1662. package/dist/runner/feedback/profile.cjs +8 -0
  1663. package/dist/runner/feedback/profile.cjs.map +1 -0
  1664. package/dist/runner/feedback/profile.d.cts +14 -0
  1665. package/dist/runner/feedback/profile.d.mts +14 -0
  1666. package/dist/runner/feedback/profile.d.ts +14 -0
  1667. package/dist/runner/feedback/profile.js +6 -0
  1668. package/dist/runner/feedback/profile.js.map +1 -0
  1669. package/dist/runner/feedback/reducer.cjs +372 -0
  1670. package/dist/runner/feedback/reducer.cjs.map +1 -0
  1671. package/dist/runner/feedback/reducer.d.cts +4 -0
  1672. package/dist/runner/feedback/reducer.d.mts +4 -0
  1673. package/dist/runner/feedback/reducer.d.ts +4 -0
  1674. package/dist/runner/feedback/reducer.js +8 -0
  1675. package/dist/runner/feedback/reducer.js.map +1 -0
  1676. package/dist/runner/feedback/renderer.cjs +3 -0
  1677. package/dist/runner/feedback/renderer.cjs.map +1 -0
  1678. package/dist/runner/feedback/renderer.d.cts +63 -0
  1679. package/dist/runner/feedback/renderer.d.mts +63 -0
  1680. package/dist/runner/feedback/renderer.d.ts +63 -0
  1681. package/dist/runner/feedback/renderer.js +4 -0
  1682. package/dist/runner/feedback/renderer.js.map +1 -0
  1683. package/dist/runner/feedback/sink.cjs +194 -0
  1684. package/dist/runner/feedback/sink.cjs.map +1 -0
  1685. package/dist/runner/feedback/sink.d.cts +187 -0
  1686. package/dist/runner/feedback/sink.d.mts +187 -0
  1687. package/dist/runner/feedback/sink.d.ts +7 -7
  1688. package/dist/runner/feedback/sink.js +34 -0
  1689. package/dist/runner/feedback/sink.js.map +1 -0
  1690. package/dist/runner/feedback/testing.cjs +69 -0
  1691. package/dist/runner/feedback/testing.cjs.map +1 -0
  1692. package/dist/runner/feedback/testing.d.cts +26 -0
  1693. package/dist/runner/feedback/testing.d.mts +26 -0
  1694. package/dist/runner/feedback/testing.d.ts +26 -0
  1695. package/dist/runner/feedback/testing.js +6 -0
  1696. package/dist/runner/feedback/testing.js.map +1 -0
  1697. package/dist/runner/fingerprint.cjs +379 -0
  1698. package/dist/runner/fingerprint.cjs.map +1 -0
  1699. package/dist/runner/fingerprint.d.cts +71 -0
  1700. package/dist/runner/fingerprint.d.mts +71 -0
  1701. package/dist/runner/fingerprint.d.ts +49 -167
  1702. package/dist/runner/fingerprint.js +22 -0
  1703. package/dist/runner/fingerprint.js.map +1 -0
  1704. package/dist/runner/gate-lease.cjs +271 -0
  1705. package/dist/runner/gate-lease.cjs.map +1 -0
  1706. package/dist/runner/gate-lease.d.cts +62 -0
  1707. package/dist/runner/gate-lease.d.mts +62 -0
  1708. package/dist/runner/gate-lease.d.ts +62 -0
  1709. package/dist/runner/gate-lease.js +22 -0
  1710. package/dist/runner/gate-lease.js.map +1 -0
  1711. package/dist/runner/judge-config.cjs +26 -0
  1712. package/dist/runner/judge-config.cjs.map +1 -0
  1713. package/dist/runner/judge-config.d.cts +8 -0
  1714. package/dist/runner/judge-config.d.mts +8 -0
  1715. package/dist/runner/judge-config.d.ts +6 -4
  1716. package/dist/runner/judge-config.js +6 -0
  1717. package/dist/runner/judge-config.js.map +1 -0
  1718. package/dist/runner/leak-gate.cjs +381 -0
  1719. package/dist/runner/leak-gate.cjs.map +1 -0
  1720. package/dist/runner/leak-gate.d.cts +124 -0
  1721. package/dist/runner/leak-gate.d.mts +124 -0
  1722. package/dist/runner/leak-gate.d.ts +36 -8
  1723. package/dist/runner/leak-gate.js +32 -0
  1724. package/dist/runner/leak-gate.js.map +1 -0
  1725. package/dist/runner/ledger.cjs +470 -0
  1726. package/dist/runner/ledger.cjs.map +1 -0
  1727. package/dist/runner/ledger.d.cts +35 -0
  1728. package/dist/runner/ledger.d.mts +35 -0
  1729. package/dist/runner/ledger.d.ts +35 -0
  1730. package/dist/runner/ledger.js +8 -0
  1731. package/dist/runner/ledger.js.map +1 -0
  1732. package/dist/runner/lock.cjs +236 -0
  1733. package/dist/runner/lock.cjs.map +1 -0
  1734. package/dist/runner/lock.d.cts +56 -0
  1735. package/dist/runner/lock.d.mts +56 -0
  1736. package/dist/runner/lock.d.ts +56 -0
  1737. package/dist/runner/lock.js +22 -0
  1738. package/dist/runner/lock.js.map +1 -0
  1739. package/dist/runner/manifest.cjs +179 -0
  1740. package/dist/runner/manifest.cjs.map +1 -0
  1741. package/dist/runner/manifest.d.cts +61 -0
  1742. package/dist/runner/manifest.d.mts +61 -0
  1743. package/dist/runner/manifest.d.ts +4 -4
  1744. package/dist/runner/manifest.js +22 -0
  1745. package/dist/runner/manifest.js.map +1 -0
  1746. package/dist/runner/project-current.cjs +117 -0
  1747. package/dist/runner/project-current.cjs.map +1 -0
  1748. package/dist/runner/project-current.d.cts +29 -0
  1749. package/dist/runner/project-current.d.mts +29 -0
  1750. package/dist/runner/project-current.d.ts +29 -0
  1751. package/dist/runner/project-current.js +8 -0
  1752. package/dist/runner/project-current.js.map +1 -0
  1753. package/dist/runner/project-target.cjs +3 -0
  1754. package/dist/runner/project-target.cjs.map +1 -0
  1755. package/dist/runner/project-target.d.cts +30 -0
  1756. package/dist/runner/project-target.d.mts +30 -0
  1757. package/dist/runner/project-target.d.ts +30 -0
  1758. package/dist/runner/project-target.js +4 -0
  1759. package/dist/runner/project-target.js.map +1 -0
  1760. package/dist/runner/record.cjs +883 -0
  1761. package/dist/runner/record.cjs.map +1 -0
  1762. package/dist/runner/record.d.cts +151 -0
  1763. package/dist/runner/record.d.mts +151 -0
  1764. package/dist/runner/record.d.ts +151 -0
  1765. package/dist/runner/record.js +10 -0
  1766. package/dist/runner/record.js.map +1 -0
  1767. package/dist/runner/rename-experiment.cjs +273 -0
  1768. package/dist/runner/rename-experiment.cjs.map +1 -0
  1769. package/dist/runner/rename-experiment.d.cts +123 -0
  1770. package/dist/runner/rename-experiment.d.mts +123 -0
  1771. package/dist/runner/rename-experiment.d.ts +123 -0
  1772. package/dist/runner/rename-experiment.js +14 -0
  1773. package/dist/runner/rename-experiment.js.map +1 -0
  1774. package/dist/runner/report.cjs +123 -0
  1775. package/dist/runner/report.cjs.map +1 -0
  1776. package/dist/runner/report.d.cts +27 -0
  1777. package/dist/runner/report.d.mts +27 -0
  1778. package/dist/runner/report.d.ts +27 -0
  1779. package/dist/runner/report.js +14 -0
  1780. package/dist/runner/report.js.map +1 -0
  1781. package/dist/runner/reporters/braintrust.cjs +302 -0
  1782. package/dist/runner/reporters/braintrust.cjs.map +1 -0
  1783. package/dist/runner/reporters/braintrust.d.cts +59 -0
  1784. package/dist/runner/reporters/braintrust.d.mts +59 -0
  1785. package/dist/runner/reporters/braintrust.d.ts +59 -0
  1786. package/dist/runner/reporters/braintrust.js +8 -0
  1787. package/dist/runner/reporters/braintrust.js.map +1 -0
  1788. package/dist/runner/reporters/index.cjs +12 -0
  1789. package/dist/runner/reporters/index.cjs.map +1 -0
  1790. package/dist/runner/reporters/index.d.cts +2 -0
  1791. package/dist/runner/reporters/index.d.mts +2 -0
  1792. package/dist/runner/reporters/index.d.ts +2 -0
  1793. package/dist/runner/reporters/index.js +10 -0
  1794. package/dist/runner/reporters/index.js.map +1 -0
  1795. package/dist/runner/reporters/index.mjs +10 -0
  1796. package/dist/runner/reporters/index.mjs.map +1 -0
  1797. package/dist/runner/reporters/json.cjs +116 -0
  1798. package/dist/runner/reporters/json.cjs.map +1 -0
  1799. package/dist/runner/reporters/json.d.cts +3 -0
  1800. package/dist/runner/reporters/json.d.mts +3 -0
  1801. package/dist/runner/reporters/json.d.ts +3 -0
  1802. package/dist/runner/reporters/json.js +8 -0
  1803. package/dist/runner/reporters/json.js.map +1 -0
  1804. package/dist/runner/reporters/shared.cjs +14 -0
  1805. package/dist/runner/reporters/shared.cjs.map +1 -0
  1806. package/dist/runner/reporters/shared.d.cts +3 -0
  1807. package/dist/runner/reporters/shared.d.mts +3 -0
  1808. package/dist/runner/reporters/shared.d.ts +3 -0
  1809. package/dist/runner/reporters/shared.js +8 -0
  1810. package/dist/runner/reporters/shared.js.map +1 -0
  1811. package/dist/runner/reuse-diagnostics.cjs +71 -0
  1812. package/dist/runner/reuse-diagnostics.cjs.map +1 -0
  1813. package/dist/runner/reuse-diagnostics.d.cts +21 -0
  1814. package/dist/runner/reuse-diagnostics.d.mts +21 -0
  1815. package/dist/runner/reuse-diagnostics.d.ts +21 -0
  1816. package/dist/runner/reuse-diagnostics.js +8 -0
  1817. package/dist/runner/reuse-diagnostics.js.map +1 -0
  1818. package/dist/runner/reuse-plan.cjs +739 -0
  1819. package/dist/runner/reuse-plan.cjs.map +1 -0
  1820. package/dist/runner/reuse-plan.d.cts +185 -0
  1821. package/dist/runner/reuse-plan.d.mts +185 -0
  1822. package/dist/runner/reuse-plan.d.ts +185 -0
  1823. package/dist/runner/reuse-plan.js +26 -0
  1824. package/dist/runner/reuse-plan.js.map +1 -0
  1825. package/dist/runner/reuse-readback.cjs +275 -0
  1826. package/dist/runner/reuse-readback.cjs.map +1 -0
  1827. package/dist/runner/reuse-readback.d.cts +169 -0
  1828. package/dist/runner/reuse-readback.d.mts +169 -0
  1829. package/dist/runner/reuse-readback.d.ts +169 -0
  1830. package/dist/runner/reuse-readback.js +20 -0
  1831. package/dist/runner/reuse-readback.js.map +1 -0
  1832. package/dist/runner/run.cjs +2362 -0
  1833. package/dist/runner/run.cjs.map +1 -0
  1834. package/dist/runner/run.d.cts +44 -0
  1835. package/dist/runner/run.d.mts +44 -0
  1836. package/dist/runner/run.d.ts +44 -0
  1837. package/dist/runner/run.js +12 -0
  1838. package/dist/runner/run.js.map +1 -0
  1839. package/dist/runner/sandbox-pool.cjs +312 -0
  1840. package/dist/runner/sandbox-pool.cjs.map +1 -0
  1841. package/dist/runner/sandbox-pool.d.cts +70 -0
  1842. package/dist/runner/sandbox-pool.d.mts +70 -0
  1843. package/dist/runner/sandbox-pool.d.ts +70 -0
  1844. package/dist/runner/sandbox-pool.js +6 -0
  1845. package/dist/runner/sandbox-pool.js.map +1 -0
  1846. package/dist/runner/sandbox-prep.cjs +57 -0
  1847. package/dist/runner/sandbox-prep.cjs.map +1 -0
  1848. package/dist/runner/sandbox-prep.d.cts +8 -0
  1849. package/dist/runner/sandbox-prep.d.mts +8 -0
  1850. package/dist/runner/sandbox-prep.d.ts +8 -0
  1851. package/dist/runner/sandbox-prep.js +8 -0
  1852. package/dist/runner/sandbox-prep.js.map +1 -0
  1853. package/dist/runner/sandbox-record-producer.cjs +142 -0
  1854. package/dist/runner/sandbox-record-producer.cjs.map +1 -0
  1855. package/dist/runner/sandbox-record-producer.d.cts +30 -0
  1856. package/dist/runner/sandbox-record-producer.d.mts +30 -0
  1857. package/dist/runner/sandbox-record-producer.d.ts +30 -0
  1858. package/dist/runner/sandbox-record-producer.js +6 -0
  1859. package/dist/runner/sandbox-record-producer.js.map +1 -0
  1860. package/dist/runner/sandbox-reuse.cjs +57 -0
  1861. package/dist/runner/sandbox-reuse.cjs.map +1 -0
  1862. package/dist/runner/sandbox-reuse.d.cts +43 -0
  1863. package/dist/runner/sandbox-reuse.d.mts +43 -0
  1864. package/dist/runner/sandbox-reuse.d.ts +43 -0
  1865. package/dist/runner/sandbox-reuse.js +8 -0
  1866. package/dist/runner/sandbox-reuse.js.map +1 -0
  1867. package/dist/runner/sandbox-selection.cjs +362 -0
  1868. package/dist/runner/sandbox-selection.cjs.map +1 -0
  1869. package/dist/runner/sandbox-selection.d.cts +87 -0
  1870. package/dist/runner/sandbox-selection.d.mts +87 -0
  1871. package/dist/runner/sandbox-selection.d.ts +17 -6
  1872. package/dist/runner/sandbox-selection.js +22 -0
  1873. package/dist/runner/sandbox-selection.js.map +1 -0
  1874. package/dist/runner/session.cjs +535 -0
  1875. package/dist/runner/session.cjs.map +1 -0
  1876. package/dist/runner/session.d.cts +116 -0
  1877. package/dist/runner/session.d.mts +116 -0
  1878. package/dist/runner/session.d.ts +44 -24
  1879. package/dist/runner/session.js +28 -0
  1880. package/dist/runner/session.js.map +1 -0
  1881. package/dist/runner/source-closure.cjs +51 -0
  1882. package/dist/runner/source-closure.cjs.map +1 -0
  1883. package/dist/runner/source-closure.d.cts +6 -0
  1884. package/dist/runner/source-closure.d.mts +6 -0
  1885. package/dist/runner/source-closure.d.ts +6 -0
  1886. package/dist/runner/source-closure.js +6 -0
  1887. package/dist/runner/source-closure.js.map +1 -0
  1888. package/dist/runner/source-producer.cjs +417 -0
  1889. package/dist/runner/source-producer.cjs.map +1 -0
  1890. package/dist/runner/source-producer.d.cts +70 -0
  1891. package/dist/runner/source-producer.d.mts +70 -0
  1892. package/dist/runner/source-producer.d.ts +70 -0
  1893. package/dist/runner/source-producer.js +10 -0
  1894. package/dist/runner/source-producer.js.map +1 -0
  1895. package/dist/runner/teardown-registry.cjs +112 -0
  1896. package/dist/runner/teardown-registry.cjs.map +1 -0
  1897. package/dist/runner/teardown-registry.d.cts +35 -0
  1898. package/dist/runner/teardown-registry.d.mts +35 -0
  1899. package/dist/runner/teardown-registry.d.ts +35 -0
  1900. package/dist/runner/teardown-registry.js +20 -0
  1901. package/dist/runner/teardown-registry.js.map +1 -0
  1902. package/dist/runner/timeout.cjs +31 -0
  1903. package/dist/runner/timeout.cjs.map +1 -0
  1904. package/dist/runner/timeout.d.cts +30 -0
  1905. package/dist/runner/timeout.d.mts +30 -0
  1906. package/dist/runner/timeout.d.ts +30 -0
  1907. package/dist/runner/timeout.js +8 -0
  1908. package/dist/runner/timeout.js.map +1 -0
  1909. package/dist/runner/timing.cjs +279 -0
  1910. package/dist/runner/timing.cjs.map +1 -0
  1911. package/dist/runner/timing.d.cts +97 -0
  1912. package/dist/runner/timing.d.mts +97 -0
  1913. package/dist/runner/timing.d.ts +2 -2
  1914. package/dist/runner/timing.js +26 -0
  1915. package/dist/runner/timing.js.map +1 -0
  1916. package/dist/runner/types.cjs +135 -0
  1917. package/dist/runner/types.cjs.map +1 -0
  1918. package/dist/runner/types.d.cts +1703 -0
  1919. package/dist/runner/types.d.mts +1703 -0
  1920. package/dist/runner/types.d.ts +214 -166
  1921. package/dist/runner/types.js +32 -109
  1922. package/dist/runner/types.js.map +1 -0
  1923. package/dist/sample/analysis.cjs +1068 -0
  1924. package/dist/sample/analysis.cjs.map +1 -0
  1925. package/dist/sample/analysis.d.cts +153 -0
  1926. package/dist/sample/analysis.d.mts +153 -0
  1927. package/dist/sample/analysis.d.ts +153 -0
  1928. package/dist/sample/analysis.js +30 -0
  1929. package/dist/sample/analysis.js.map +1 -0
  1930. package/dist/sample/index.cjs +16 -0
  1931. package/dist/sample/index.cjs.map +1 -0
  1932. package/dist/sample/index.d.cts +2 -0
  1933. package/dist/sample/index.d.mts +2 -0
  1934. package/dist/sample/index.d.ts +2 -102
  1935. package/dist/sample/index.js +28 -386
  1936. package/dist/sample/index.js.map +1 -0
  1937. package/dist/sandbox/backend.cjs +116 -0
  1938. package/dist/sandbox/backend.cjs.map +1 -0
  1939. package/dist/sandbox/backend.d.cts +58 -0
  1940. package/dist/sandbox/backend.d.mts +58 -0
  1941. package/dist/sandbox/backend.d.ts +9 -3
  1942. package/dist/sandbox/backend.js +26 -0
  1943. package/dist/sandbox/backend.js.map +1 -0
  1944. package/dist/sandbox/build-coordinator.cjs +309 -0
  1945. package/dist/sandbox/build-coordinator.cjs.map +1 -0
  1946. package/dist/sandbox/build-coordinator.d.cts +111 -0
  1947. package/dist/sandbox/build-coordinator.d.mts +111 -0
  1948. package/dist/sandbox/build-coordinator.d.ts +4 -4
  1949. package/dist/sandbox/build-coordinator.js +12 -0
  1950. package/dist/sandbox/build-coordinator.js.map +1 -0
  1951. package/dist/sandbox/case-types.cjs +3 -0
  1952. package/dist/sandbox/case-types.cjs.map +1 -0
  1953. package/dist/sandbox/case-types.d.cts +55 -0
  1954. package/dist/sandbox/case-types.d.mts +55 -0
  1955. package/dist/sandbox/case-types.d.ts +3 -3
  1956. package/dist/sandbox/case-types.js +4 -0
  1957. package/dist/sandbox/case-types.js.map +1 -0
  1958. package/dist/sandbox/checkpoint.cjs +65 -0
  1959. package/dist/sandbox/checkpoint.cjs.map +1 -0
  1960. package/dist/sandbox/checkpoint.d.cts +7 -0
  1961. package/dist/sandbox/checkpoint.d.mts +7 -0
  1962. package/dist/sandbox/checkpoint.d.ts +7 -0
  1963. package/dist/sandbox/checkpoint.js +8 -0
  1964. package/dist/sandbox/checkpoint.js.map +1 -0
  1965. package/dist/sandbox/cli-commands.cjs +535 -0
  1966. package/dist/sandbox/cli-commands.cjs.map +1 -0
  1967. package/dist/sandbox/cli-commands.d.cts +41 -0
  1968. package/dist/sandbox/cli-commands.d.mts +41 -0
  1969. package/dist/sandbox/cli-commands.d.ts +41 -0
  1970. package/dist/sandbox/cli-commands.js +14 -0
  1971. package/dist/sandbox/cli-commands.js.map +1 -0
  1972. package/dist/sandbox/commands.cjs +281 -0
  1973. package/dist/sandbox/commands.cjs.map +1 -0
  1974. package/dist/sandbox/commands.d.cts +141 -0
  1975. package/dist/sandbox/commands.d.mts +141 -0
  1976. package/dist/sandbox/commands.d.ts +64 -3
  1977. package/dist/sandbox/commands.js +20 -0
  1978. package/dist/sandbox/commands.js.map +1 -0
  1979. package/dist/sandbox/compose.cjs +1293 -0
  1980. package/dist/sandbox/compose.cjs.map +1 -0
  1981. package/dist/sandbox/compose.d.cts +215 -0
  1982. package/dist/sandbox/compose.d.mts +215 -0
  1983. package/dist/sandbox/compose.d.ts +32 -16
  1984. package/dist/sandbox/compose.js +38 -0
  1985. package/dist/sandbox/compose.js.map +1 -0
  1986. package/dist/sandbox/content.cjs +153 -0
  1987. package/dist/sandbox/content.cjs.map +1 -0
  1988. package/dist/sandbox/content.d.cts +35 -0
  1989. package/dist/sandbox/content.d.mts +35 -0
  1990. package/dist/sandbox/content.js +10 -0
  1991. package/dist/sandbox/content.js.map +1 -0
  1992. package/dist/sandbox/deadline.cjs +44 -0
  1993. package/dist/sandbox/deadline.cjs.map +1 -0
  1994. package/dist/sandbox/deadline.d.cts +45 -0
  1995. package/dist/sandbox/deadline.d.mts +45 -0
  1996. package/dist/sandbox/deadline.d.ts +2 -2
  1997. package/dist/sandbox/deadline.js +10 -0
  1998. package/dist/sandbox/deadline.js.map +1 -0
  1999. package/dist/sandbox/dind-supervisor.cjs +124 -0
  2000. package/dist/sandbox/dind-supervisor.cjs.map +1 -0
  2001. package/dist/sandbox/dind-supervisor.d.cts +12 -0
  2002. package/dist/sandbox/dind-supervisor.d.mts +12 -0
  2003. package/dist/sandbox/dind-supervisor.d.ts +12 -0
  2004. package/dist/sandbox/dind-supervisor.js +14 -0
  2005. package/dist/sandbox/dind-supervisor.js.map +1 -0
  2006. package/dist/sandbox/docker-agent-image.cjs +36 -0
  2007. package/dist/sandbox/docker-agent-image.cjs.map +1 -0
  2008. package/dist/sandbox/docker-agent-image.d.cts +22 -0
  2009. package/dist/sandbox/docker-agent-image.d.mts +22 -0
  2010. package/dist/sandbox/docker-agent-image.d.ts +22 -0
  2011. package/dist/sandbox/docker-agent-image.js +20 -0
  2012. package/dist/sandbox/docker-agent-image.js.map +1 -0
  2013. package/dist/sandbox/docker-profile/cli.cjs +193 -0
  2014. package/dist/sandbox/docker-profile/cli.cjs.map +1 -0
  2015. package/dist/sandbox/docker-profile/cli.d.cts +12 -0
  2016. package/dist/sandbox/docker-profile/cli.d.mts +12 -0
  2017. package/dist/sandbox/docker-profile/cli.d.ts +12 -0
  2018. package/dist/sandbox/docker-profile/cli.js +12 -0
  2019. package/dist/sandbox/docker-profile/cli.js.map +1 -0
  2020. package/dist/sandbox/docker-profile/errors.cjs +16 -0
  2021. package/dist/sandbox/docker-profile/errors.cjs.map +1 -0
  2022. package/dist/sandbox/docker-profile/errors.d.cts +25 -0
  2023. package/dist/sandbox/docker-profile/errors.d.mts +25 -0
  2024. package/dist/sandbox/docker-profile/errors.d.ts +25 -0
  2025. package/dist/sandbox/docker-profile/errors.js +8 -0
  2026. package/dist/sandbox/docker-profile/errors.js.map +1 -0
  2027. package/dist/sandbox/docker-profile/registry.cjs +377 -0
  2028. package/dist/sandbox/docker-profile/registry.cjs.map +1 -0
  2029. package/dist/sandbox/docker-profile/registry.d.cts +43 -0
  2030. package/dist/sandbox/docker-profile/registry.d.mts +43 -0
  2031. package/dist/sandbox/docker-profile/registry.d.ts +43 -0
  2032. package/dist/sandbox/docker-profile/registry.js +18 -0
  2033. package/dist/sandbox/docker-profile/registry.js.map +1 -0
  2034. package/dist/sandbox/docker-profile/runtime.cjs +198 -0
  2035. package/dist/sandbox/docker-profile/runtime.cjs.map +1 -0
  2036. package/dist/sandbox/docker-profile/runtime.d.cts +36 -0
  2037. package/dist/sandbox/docker-profile/runtime.d.mts +36 -0
  2038. package/dist/sandbox/docker-profile/runtime.d.ts +36 -0
  2039. package/dist/sandbox/docker-profile/runtime.js +20 -0
  2040. package/dist/sandbox/docker-profile/runtime.js.map +1 -0
  2041. package/dist/sandbox/docker-profile/schema.cjs +650 -0
  2042. package/dist/sandbox/docker-profile/schema.cjs.map +1 -0
  2043. package/dist/sandbox/docker-profile/schema.d.cts +129 -0
  2044. package/dist/sandbox/docker-profile/schema.d.mts +129 -0
  2045. package/dist/sandbox/docker-profile/schema.d.ts +129 -0
  2046. package/dist/sandbox/docker-profile/schema.js +38 -0
  2047. package/dist/sandbox/docker-profile/schema.js.map +1 -0
  2048. package/dist/sandbox/docker-stream.cjs +153 -0
  2049. package/dist/sandbox/docker-stream.cjs.map +1 -0
  2050. package/dist/sandbox/docker-stream.d.cts +33 -0
  2051. package/dist/sandbox/docker-stream.d.mts +33 -0
  2052. package/dist/sandbox/docker-stream.js +14 -0
  2053. package/dist/sandbox/docker-stream.js.map +1 -0
  2054. package/dist/sandbox/docker.cjs +1161 -0
  2055. package/dist/sandbox/docker.cjs.map +1 -0
  2056. package/dist/sandbox/docker.d.cts +288 -0
  2057. package/dist/sandbox/docker.d.mts +288 -0
  2058. package/dist/sandbox/docker.d.ts +84 -12
  2059. package/dist/sandbox/docker.js +20 -0
  2060. package/dist/sandbox/docker.js.map +1 -0
  2061. package/dist/sandbox/dockerfile-agent-cache.cjs +104 -0
  2062. package/dist/sandbox/dockerfile-agent-cache.cjs.map +1 -0
  2063. package/dist/sandbox/dockerfile-agent-cache.d.cts +45 -0
  2064. package/dist/sandbox/dockerfile-agent-cache.d.mts +45 -0
  2065. package/dist/sandbox/dockerfile-agent-cache.d.ts +8 -7
  2066. package/dist/sandbox/dockerfile-agent-cache.js +14 -0
  2067. package/dist/sandbox/dockerfile-agent-cache.js.map +1 -0
  2068. package/dist/sandbox/dockerfile-build.cjs +256 -0
  2069. package/dist/sandbox/dockerfile-build.cjs.map +1 -0
  2070. package/dist/sandbox/dockerfile-build.d.cts +59 -0
  2071. package/dist/sandbox/dockerfile-build.d.mts +59 -0
  2072. package/dist/sandbox/dockerfile-build.d.ts +21 -8
  2073. package/dist/sandbox/dockerfile-build.js +16 -0
  2074. package/dist/sandbox/dockerfile-build.js.map +1 -0
  2075. package/dist/sandbox/dockerfile-identity.cjs +124 -0
  2076. package/dist/sandbox/dockerfile-identity.cjs.map +1 -0
  2077. package/dist/sandbox/dockerfile-identity.d.cts +37 -0
  2078. package/dist/sandbox/dockerfile-identity.d.mts +37 -0
  2079. package/dist/sandbox/dockerfile-identity.d.ts +13 -3
  2080. package/dist/sandbox/dockerfile-identity.js +12 -0
  2081. package/dist/sandbox/dockerfile-identity.js.map +1 -0
  2082. package/dist/sandbox/download-directory.cjs +26 -0
  2083. package/dist/sandbox/download-directory.cjs.map +1 -0
  2084. package/dist/sandbox/download-directory.d.cts +9 -0
  2085. package/dist/sandbox/download-directory.d.mts +9 -0
  2086. package/dist/sandbox/download-directory.d.ts +1 -1
  2087. package/dist/sandbox/download-directory.js +6 -0
  2088. package/dist/sandbox/download-directory.js.map +1 -0
  2089. package/dist/sandbox/e2b-agent-template.cjs +140 -0
  2090. package/dist/sandbox/e2b-agent-template.cjs.map +1 -0
  2091. package/dist/sandbox/e2b-agent-template.d.cts +65 -0
  2092. package/dist/sandbox/e2b-agent-template.d.mts +65 -0
  2093. package/dist/sandbox/e2b-agent-template.d.ts +65 -0
  2094. package/dist/sandbox/e2b-agent-template.js +24 -0
  2095. package/dist/sandbox/e2b-agent-template.js.map +1 -0
  2096. package/dist/sandbox/e2b-agent-template.mjs +24 -0
  2097. package/dist/sandbox/e2b-agent-template.mjs.map +1 -0
  2098. package/dist/sandbox/e2b.cjs +664 -0
  2099. package/dist/sandbox/e2b.cjs.map +1 -0
  2100. package/dist/sandbox/e2b.d.cts +124 -0
  2101. package/dist/sandbox/e2b.d.mts +124 -0
  2102. package/dist/sandbox/e2b.d.ts +9 -9
  2103. package/dist/sandbox/e2b.js +10 -0
  2104. package/dist/sandbox/e2b.js.map +1 -0
  2105. package/dist/sandbox/errors.cjs +191 -0
  2106. package/dist/sandbox/errors.cjs.map +1 -0
  2107. package/dist/sandbox/errors.d.cts +60 -0
  2108. package/dist/sandbox/errors.d.mts +60 -0
  2109. package/dist/sandbox/errors.d.ts +1 -1
  2110. package/dist/sandbox/errors.js +20 -0
  2111. package/dist/sandbox/errors.js.map +1 -0
  2112. package/dist/sandbox/identity.cjs +140 -0
  2113. package/dist/sandbox/identity.cjs.map +1 -0
  2114. package/dist/sandbox/identity.d.cts +97 -0
  2115. package/dist/sandbox/identity.d.mts +97 -0
  2116. package/dist/sandbox/identity.d.ts +1 -1
  2117. package/dist/sandbox/identity.js +26 -0
  2118. package/dist/sandbox/identity.js.map +1 -0
  2119. package/dist/sandbox/index.cjs +93 -0
  2120. package/dist/sandbox/index.cjs.map +1 -0
  2121. package/dist/sandbox/index.d.cts +28 -0
  2122. package/dist/sandbox/index.d.mts +28 -0
  2123. package/dist/sandbox/index.d.ts +28 -0
  2124. package/dist/sandbox/index.js +144 -0
  2125. package/dist/sandbox/index.js.map +1 -0
  2126. package/dist/sandbox/index.mjs +144 -0
  2127. package/dist/sandbox/index.mjs.map +1 -0
  2128. package/dist/sandbox/io-retry.cjs +29 -0
  2129. package/dist/sandbox/io-retry.cjs.map +1 -0
  2130. package/dist/sandbox/io-retry.d.cts +17 -0
  2131. package/dist/sandbox/io-retry.d.mts +17 -0
  2132. package/dist/sandbox/io-retry.d.ts +1 -1
  2133. package/dist/sandbox/io-retry.js +6 -0
  2134. package/dist/sandbox/io-retry.js.map +1 -0
  2135. package/dist/sandbox/keep-registry.cjs +269 -0
  2136. package/dist/sandbox/keep-registry.cjs.map +1 -0
  2137. package/dist/sandbox/keep-registry.d.cts +78 -0
  2138. package/dist/sandbox/keep-registry.d.mts +78 -0
  2139. package/dist/sandbox/keep-registry.d.ts +78 -0
  2140. package/dist/sandbox/keep-registry.js +26 -0
  2141. package/dist/sandbox/keep-registry.js.map +1 -0
  2142. package/dist/sandbox/keep.cjs +448 -0
  2143. package/dist/sandbox/keep.cjs.map +1 -0
  2144. package/dist/sandbox/keep.d.cts +64 -0
  2145. package/dist/sandbox/keep.d.mts +64 -0
  2146. package/dist/sandbox/keep.d.ts +64 -0
  2147. package/dist/sandbox/keep.js +28 -0
  2148. package/dist/sandbox/keep.js.map +1 -0
  2149. package/dist/sandbox/layer.cjs +1639 -0
  2150. package/dist/sandbox/layer.cjs.map +1 -0
  2151. package/dist/sandbox/layer.d.cts +565 -0
  2152. package/dist/sandbox/layer.d.mts +565 -0
  2153. package/dist/sandbox/layer.d.ts +179 -32
  2154. package/dist/sandbox/layer.js +42 -0
  2155. package/dist/sandbox/layer.js.map +1 -0
  2156. package/dist/sandbox/ledger-paths.cjs +22 -0
  2157. package/dist/sandbox/ledger-paths.cjs.map +1 -0
  2158. package/dist/sandbox/ledger-paths.d.cts +14 -0
  2159. package/dist/sandbox/ledger-paths.d.mts +14 -0
  2160. package/dist/sandbox/ledger-paths.js +12 -0
  2161. package/dist/sandbox/ledger-paths.js.map +1 -0
  2162. package/dist/sandbox/link.cjs +395 -0
  2163. package/dist/sandbox/link.cjs.map +1 -0
  2164. package/dist/sandbox/link.d.cts +160 -0
  2165. package/dist/sandbox/link.d.mts +160 -0
  2166. package/dist/sandbox/link.d.ts +25 -8
  2167. package/dist/sandbox/link.js +18 -0
  2168. package/dist/sandbox/link.js.map +1 -0
  2169. package/dist/sandbox/local-files.cjs +31 -0
  2170. package/dist/sandbox/local-files.cjs.map +1 -0
  2171. package/dist/sandbox/local-files.d.cts +6 -0
  2172. package/dist/sandbox/local-files.d.mts +6 -0
  2173. package/dist/sandbox/local-files.js +6 -0
  2174. package/dist/sandbox/local-files.js.map +1 -0
  2175. package/dist/sandbox/local.cjs +297 -0
  2176. package/dist/sandbox/local.cjs.map +1 -0
  2177. package/dist/sandbox/local.d.cts +78 -0
  2178. package/dist/sandbox/local.d.mts +78 -0
  2179. package/dist/sandbox/local.d.ts +7 -7
  2180. package/dist/sandbox/local.js +6 -0
  2181. package/dist/sandbox/local.js.map +1 -0
  2182. package/dist/sandbox/operations.cjs +160 -0
  2183. package/dist/sandbox/operations.cjs.map +1 -0
  2184. package/dist/sandbox/operations.d.cts +10 -0
  2185. package/dist/sandbox/operations.d.mts +10 -0
  2186. package/dist/sandbox/operations.d.ts +2 -2
  2187. package/dist/sandbox/operations.js +10 -0
  2188. package/dist/sandbox/operations.js.map +1 -0
  2189. package/dist/sandbox/orphans.cjs +199 -0
  2190. package/dist/sandbox/orphans.cjs.map +1 -0
  2191. package/dist/sandbox/orphans.d.cts +45 -0
  2192. package/dist/sandbox/orphans.d.mts +45 -0
  2193. package/dist/sandbox/orphans.d.ts +45 -0
  2194. package/dist/sandbox/orphans.js +10 -0
  2195. package/dist/sandbox/orphans.js.map +1 -0
  2196. package/dist/sandbox/paths.cjs +102 -0
  2197. package/dist/sandbox/paths.cjs.map +1 -0
  2198. package/dist/sandbox/paths.d.cts +11 -0
  2199. package/dist/sandbox/paths.d.mts +11 -0
  2200. package/dist/sandbox/paths.d.ts +2 -2
  2201. package/dist/sandbox/paths.js +12 -0
  2202. package/dist/sandbox/paths.js.map +1 -0
  2203. package/dist/sandbox/plan.cjs +223 -0
  2204. package/dist/sandbox/plan.cjs.map +1 -0
  2205. package/dist/sandbox/plan.d.cts +88 -0
  2206. package/dist/sandbox/plan.d.mts +88 -0
  2207. package/dist/sandbox/plan.d.ts +4 -3
  2208. package/dist/sandbox/plan.js +20 -0
  2209. package/dist/sandbox/plan.js.map +1 -0
  2210. package/dist/sandbox/prepare-commands.cjs +280 -0
  2211. package/dist/sandbox/prepare-commands.cjs.map +1 -0
  2212. package/dist/sandbox/prepare-commands.d.cts +29 -0
  2213. package/dist/sandbox/prepare-commands.d.mts +29 -0
  2214. package/dist/sandbox/prepare-commands.d.ts +29 -0
  2215. package/dist/sandbox/prepare-commands.js +8 -0
  2216. package/dist/sandbox/prepare-commands.js.map +1 -0
  2217. package/dist/sandbox/record/attachment.cjs +72 -0
  2218. package/dist/sandbox/record/attachment.cjs.map +1 -0
  2219. package/dist/sandbox/record/attachment.d.cts +30 -0
  2220. package/dist/sandbox/record/attachment.d.mts +30 -0
  2221. package/dist/sandbox/record/attachment.d.ts +30 -0
  2222. package/dist/sandbox/record/attachment.js +10 -0
  2223. package/dist/sandbox/record/attachment.js.map +1 -0
  2224. package/dist/sandbox/record/codec.cjs +36 -0
  2225. package/dist/sandbox/record/codec.cjs.map +1 -0
  2226. package/dist/sandbox/record/codec.d.cts +30 -0
  2227. package/dist/sandbox/record/codec.d.mts +30 -0
  2228. package/dist/sandbox/record/codec.d.ts +30 -0
  2229. package/dist/sandbox/record/codec.js +10 -0
  2230. package/dist/sandbox/record/codec.js.map +1 -0
  2231. package/dist/sandbox/record/model.cjs +20 -0
  2232. package/dist/sandbox/record/model.cjs.map +1 -0
  2233. package/dist/sandbox/record/model.d.cts +33 -0
  2234. package/dist/sandbox/record/model.d.mts +33 -0
  2235. package/dist/sandbox/record/model.d.ts +33 -0
  2236. package/dist/sandbox/record/model.js +10 -0
  2237. package/dist/sandbox/record/model.js.map +1 -0
  2238. package/dist/sandbox/record/projector.cjs +29 -0
  2239. package/dist/sandbox/record/projector.cjs.map +1 -0
  2240. package/dist/sandbox/record/projector.d.cts +18 -0
  2241. package/dist/sandbox/record/projector.d.mts +18 -0
  2242. package/dist/sandbox/record/projector.d.ts +18 -0
  2243. package/dist/sandbox/record/projector.js +6 -0
  2244. package/dist/sandbox/record/projector.js.map +1 -0
  2245. package/dist/sandbox/redaction.cjs +59 -0
  2246. package/dist/sandbox/redaction.cjs.map +1 -0
  2247. package/dist/sandbox/redaction.d.cts +19 -0
  2248. package/dist/sandbox/redaction.d.mts +19 -0
  2249. package/dist/sandbox/redaction.js +14 -0
  2250. package/dist/sandbox/redaction.js.map +1 -0
  2251. package/dist/sandbox/registry.cjs +76 -0
  2252. package/dist/sandbox/registry.cjs.map +1 -0
  2253. package/dist/sandbox/registry.d.cts +16 -0
  2254. package/dist/sandbox/registry.d.mts +16 -0
  2255. package/dist/sandbox/registry.d.ts +4 -3
  2256. package/dist/sandbox/registry.js +14 -0
  2257. package/dist/sandbox/registry.js.map +1 -0
  2258. package/dist/sandbox/retry.cjs +82 -0
  2259. package/dist/sandbox/retry.cjs.map +1 -0
  2260. package/dist/sandbox/retry.d.cts +20 -0
  2261. package/dist/sandbox/retry.d.mts +20 -0
  2262. package/dist/sandbox/retry.d.ts +2 -2
  2263. package/dist/sandbox/retry.js +6 -0
  2264. package/dist/sandbox/retry.js.map +1 -0
  2265. package/dist/sandbox/run-identity.cjs +109 -0
  2266. package/dist/sandbox/run-identity.cjs.map +1 -0
  2267. package/dist/sandbox/run-identity.d.cts +38 -0
  2268. package/dist/sandbox/run-identity.d.mts +38 -0
  2269. package/dist/sandbox/run-identity.js +36 -0
  2270. package/dist/sandbox/run-identity.js.map +1 -0
  2271. package/dist/sandbox/runtime.cjs +873 -0
  2272. package/dist/sandbox/runtime.cjs.map +1 -0
  2273. package/dist/sandbox/runtime.d.cts +116 -0
  2274. package/dist/sandbox/runtime.d.mts +116 -0
  2275. package/dist/sandbox/runtime.d.ts +16 -16
  2276. package/dist/sandbox/runtime.js +40 -0
  2277. package/dist/sandbox/runtime.js.map +1 -0
  2278. package/dist/sandbox/shell.cjs +22 -0
  2279. package/dist/sandbox/shell.cjs.map +1 -0
  2280. package/dist/sandbox/shell.d.cts +11 -0
  2281. package/dist/sandbox/shell.d.mts +11 -0
  2282. package/dist/sandbox/shell.js +8 -0
  2283. package/dist/sandbox/shell.js.map +1 -0
  2284. package/dist/sandbox/transfer-errors.cjs +116 -0
  2285. package/dist/sandbox/transfer-errors.cjs.map +1 -0
  2286. package/dist/sandbox/transfer-errors.d.cts +25 -0
  2287. package/dist/sandbox/transfer-errors.d.mts +25 -0
  2288. package/dist/sandbox/transfer-errors.js +14 -0
  2289. package/dist/sandbox/transfer-errors.js.map +1 -0
  2290. package/dist/sandbox/types.cjs +3 -0
  2291. package/dist/sandbox/types.cjs.map +1 -0
  2292. package/dist/sandbox/types.d.cts +177 -0
  2293. package/dist/sandbox/types.d.mts +177 -0
  2294. package/dist/sandbox/types.d.ts +15 -10
  2295. package/dist/sandbox/types.js +4 -3
  2296. package/dist/sandbox/types.js.map +1 -0
  2297. package/dist/sandbox/vercel.cjs +335 -0
  2298. package/dist/sandbox/vercel.cjs.map +1 -0
  2299. package/dist/sandbox/vercel.d.cts +97 -0
  2300. package/dist/sandbox/vercel.d.mts +97 -0
  2301. package/dist/sandbox/vercel.d.ts +9 -9
  2302. package/dist/sandbox/vercel.js +8 -0
  2303. package/dist/sandbox/vercel.js.map +1 -0
  2304. package/dist/shared/aggregate.cjs +97 -0
  2305. package/dist/shared/aggregate.cjs.map +1 -0
  2306. package/dist/shared/aggregate.d.cts +45 -0
  2307. package/dist/shared/aggregate.d.mts +45 -0
  2308. package/dist/shared/aggregate.d.ts +4 -4
  2309. package/dist/shared/aggregate.js +24 -87
  2310. package/dist/shared/aggregate.js.map +1 -0
  2311. package/dist/shared/entry-file-store.cjs +126 -0
  2312. package/dist/shared/entry-file-store.cjs.map +1 -0
  2313. package/dist/shared/entry-file-store.d.cts +46 -0
  2314. package/dist/shared/entry-file-store.d.mts +46 -0
  2315. package/dist/shared/entry-file-store.d.ts +9 -6
  2316. package/dist/shared/entry-file-store.js +18 -0
  2317. package/dist/shared/entry-file-store.js.map +1 -0
  2318. package/dist/shared/external-cause.cjs +278 -0
  2319. package/dist/shared/external-cause.cjs.map +1 -0
  2320. package/dist/shared/external-cause.d.cts +51 -0
  2321. package/dist/shared/external-cause.d.mts +51 -0
  2322. package/dist/shared/external-cause.d.ts +1 -1
  2323. package/dist/shared/external-cause.js +12 -0
  2324. package/dist/shared/external-cause.js.map +1 -0
  2325. package/dist/shared/facts.cjs +24 -0
  2326. package/dist/shared/facts.cjs.map +1 -0
  2327. package/dist/shared/facts.d.cts +7 -0
  2328. package/dist/shared/facts.d.mts +7 -0
  2329. package/dist/shared/facts.d.ts +7 -0
  2330. package/dist/shared/facts.js +6 -0
  2331. package/dist/shared/facts.js.map +1 -0
  2332. package/dist/shared/failure-class.cjs +166 -0
  2333. package/dist/shared/failure-class.cjs.map +1 -0
  2334. package/dist/shared/failure-class.d.cts +92 -0
  2335. package/dist/shared/failure-class.d.mts +92 -0
  2336. package/dist/shared/failure-class.d.ts +2 -2
  2337. package/dist/shared/failure-class.js +20 -0
  2338. package/dist/shared/failure-class.js.map +1 -0
  2339. package/dist/shared/format.cjs +36 -0
  2340. package/dist/shared/format.cjs.map +1 -0
  2341. package/dist/shared/format.d.cts +3 -0
  2342. package/dist/shared/format.d.mts +3 -0
  2343. package/dist/shared/format.d.ts +3 -0
  2344. package/dist/shared/format.js +10 -0
  2345. package/dist/shared/format.js.map +1 -0
  2346. package/dist/shared/json-match.cjs +44 -0
  2347. package/dist/shared/json-match.cjs.map +1 -0
  2348. package/dist/shared/json-match.d.cts +3 -0
  2349. package/dist/shared/json-match.d.mts +3 -0
  2350. package/dist/shared/json-match.d.ts +3 -0
  2351. package/dist/shared/json-match.js +6 -0
  2352. package/dist/shared/json-match.js.map +1 -0
  2353. package/dist/shared/json-value.cjs +45 -0
  2354. package/dist/shared/json-value.cjs.map +1 -0
  2355. package/dist/shared/json-value.d.cts +11 -0
  2356. package/dist/shared/json-value.d.mts +11 -0
  2357. package/dist/shared/json-value.d.ts +11 -0
  2358. package/dist/shared/json-value.js +8 -0
  2359. package/dist/shared/json-value.js.map +1 -0
  2360. package/dist/shared/turn-label.cjs +19 -0
  2361. package/dist/shared/turn-label.cjs.map +1 -0
  2362. package/dist/shared/turn-label.d.cts +9 -0
  2363. package/dist/shared/turn-label.d.mts +9 -0
  2364. package/dist/shared/turn-label.js +8 -14
  2365. package/dist/shared/turn-label.js.map +1 -0
  2366. package/dist/shared/types.cjs +3 -0
  2367. package/dist/shared/types.cjs.map +1 -0
  2368. package/dist/shared/types.d.cts +80 -0
  2369. package/dist/shared/types.d.mts +80 -0
  2370. package/dist/shared/types.d.ts +0 -2
  2371. package/dist/shared/types.js +4 -4
  2372. package/dist/shared/types.js.map +1 -0
  2373. package/dist/shared/verdict.cjs +70 -0
  2374. package/dist/shared/verdict.cjs.map +1 -0
  2375. package/dist/shared/verdict.d.cts +36 -0
  2376. package/dist/shared/verdict.d.mts +36 -0
  2377. package/dist/shared/verdict.d.ts +21 -32
  2378. package/dist/shared/verdict.js +14 -53
  2379. package/dist/shared/verdict.js.map +1 -0
  2380. package/dist/show/command.cjs +20 -0
  2381. package/dist/show/command.cjs.map +1 -0
  2382. package/dist/show/command.d.cts +13 -0
  2383. package/dist/show/command.d.mts +13 -0
  2384. package/dist/show/command.d.ts +13 -0
  2385. package/dist/show/command.js +6 -0
  2386. package/dist/show/command.js.map +1 -0
  2387. package/dist/show/json.cjs +8 -0
  2388. package/dist/show/json.cjs.map +1 -0
  2389. package/dist/show/json.d.cts +2 -0
  2390. package/dist/show/json.d.mts +2 -0
  2391. package/dist/show/json.d.ts +2 -0
  2392. package/dist/show/json.js +8 -0
  2393. package/dist/show/json.js.map +1 -0
  2394. package/dist/show/render.cjs +7 -0
  2395. package/dist/show/render.cjs.map +1 -0
  2396. package/dist/show/render.d.cts +2 -0
  2397. package/dist/show/render.d.mts +2 -0
  2398. package/dist/show/render.d.ts +2 -0
  2399. package/dist/show/render.js +6 -0
  2400. package/dist/show/render.js.map +1 -0
  2401. package/dist/source-loc.cjs +137 -0
  2402. package/dist/source-loc.cjs.map +1 -0
  2403. package/dist/source-loc.d.cts +22 -0
  2404. package/dist/source-loc.d.mts +22 -0
  2405. package/dist/source-loc.d.ts +22 -0
  2406. package/dist/source-loc.js +10 -0
  2407. package/dist/source-loc.js.map +1 -0
  2408. package/dist/sources/assemble.cjs +634 -0
  2409. package/dist/sources/assemble.cjs.map +1 -0
  2410. package/dist/sources/assemble.d.cts +6 -0
  2411. package/dist/sources/assemble.d.mts +6 -0
  2412. package/dist/sources/assemble.d.ts +6 -0
  2413. package/dist/sources/assemble.js +6 -0
  2414. package/dist/sources/assemble.js.map +1 -0
  2415. package/dist/sources/attachment.cjs +272 -0
  2416. package/dist/sources/attachment.cjs.map +1 -0
  2417. package/dist/sources/attachment.d.cts +331 -0
  2418. package/dist/sources/attachment.d.mts +331 -0
  2419. package/dist/sources/attachment.d.ts +331 -0
  2420. package/dist/sources/attachment.js +22 -0
  2421. package/dist/sources/attachment.js.map +1 -0
  2422. package/dist/sources/codec.cjs +220 -0
  2423. package/dist/sources/codec.cjs.map +1 -0
  2424. package/dist/sources/codec.d.cts +408 -0
  2425. package/dist/sources/codec.d.mts +408 -0
  2426. package/dist/sources/codec.d.ts +408 -0
  2427. package/dist/sources/codec.js +56 -0
  2428. package/dist/sources/codec.js.map +1 -0
  2429. package/dist/sources/identity.cjs +10 -0
  2430. package/dist/sources/identity.cjs.map +1 -0
  2431. package/dist/sources/identity.d.cts +10 -0
  2432. package/dist/sources/identity.d.mts +10 -0
  2433. package/dist/sources/identity.d.ts +10 -0
  2434. package/dist/sources/identity.js +10 -0
  2435. package/dist/sources/identity.js.map +1 -0
  2436. package/dist/sources/index.cjs +24 -0
  2437. package/dist/sources/index.cjs.map +1 -0
  2438. package/dist/sources/index.d.cts +7 -0
  2439. package/dist/sources/index.d.mts +7 -0
  2440. package/dist/sources/index.d.ts +7 -0
  2441. package/dist/sources/index.js +90 -0
  2442. package/dist/sources/index.js.map +1 -0
  2443. package/dist/sources/model.cjs +6 -0
  2444. package/dist/sources/model.cjs.map +1 -0
  2445. package/dist/sources/model.d.cts +92 -0
  2446. package/dist/sources/model.d.mts +92 -0
  2447. package/dist/sources/model.d.ts +92 -0
  2448. package/dist/sources/model.js +6 -0
  2449. package/dist/sources/model.js.map +1 -0
  2450. package/dist/sources/projection-model.cjs +3 -0
  2451. package/dist/sources/projection-model.cjs.map +1 -0
  2452. package/dist/sources/projection-model.d.cts +327 -0
  2453. package/dist/sources/projection-model.d.mts +327 -0
  2454. package/dist/sources/projection-model.d.ts +327 -0
  2455. package/dist/sources/projection-model.js +4 -0
  2456. package/dist/sources/projection-model.js.map +1 -0
  2457. package/dist/sources/projector.cjs +282 -0
  2458. package/dist/sources/projector.cjs.map +1 -0
  2459. package/dist/sources/projector.d.cts +8 -0
  2460. package/dist/sources/projector.d.mts +8 -0
  2461. package/dist/sources/projector.d.ts +8 -0
  2462. package/dist/sources/projector.js +10 -0
  2463. package/dist/sources/projector.js.map +1 -0
  2464. package/dist/tty-line.cjs +17 -0
  2465. package/dist/tty-line.cjs.map +1 -0
  2466. package/dist/tty-line.d.cts +2 -0
  2467. package/dist/tty-line.d.mts +2 -0
  2468. package/dist/tty-line.js +6 -0
  2469. package/dist/tty-line.js.map +1 -0
  2470. package/dist/types.cjs +38 -0
  2471. package/dist/types.cjs.map +1 -0
  2472. package/dist/types.d.cts +9 -0
  2473. package/dist/types.d.mts +9 -0
  2474. package/dist/types.d.ts +9 -9
  2475. package/dist/types.js +32 -21
  2476. package/dist/types.js.map +1 -0
  2477. package/dist/util.cjs +193 -0
  2478. package/dist/util.cjs.map +1 -0
  2479. package/dist/util.d.cts +46 -0
  2480. package/dist/util.d.mts +46 -0
  2481. package/dist/util.js +22 -132
  2482. package/dist/util.js.map +1 -0
  2483. package/dist/vendor/remark/remark-gfm.cjs +3484 -0
  2484. package/dist/vendor/remark/remark-gfm.cjs.map +7 -0
  2485. package/dist/vendor/remark/remark-parse.cjs +6975 -0
  2486. package/dist/vendor/remark/remark-parse.cjs.map +7 -0
  2487. package/dist/vendor/remark/remark.cjs +10151 -0
  2488. package/dist/vendor/remark/remark.cjs.map +7 -0
  2489. package/dist/view/data.cjs +3 -0
  2490. package/dist/view/data.cjs.map +1 -0
  2491. package/dist/view/data.d.cts +8 -0
  2492. package/dist/view/data.d.mts +8 -0
  2493. package/dist/view/data.d.ts +8 -0
  2494. package/dist/view/data.js +4 -0
  2495. package/dist/view/data.js.map +1 -0
  2496. package/dist/view/index.cjs +25 -0
  2497. package/dist/view/index.cjs.map +1 -0
  2498. package/dist/view/index.d.cts +9 -0
  2499. package/dist/view/index.d.mts +9 -0
  2500. package/dist/view/index.d.ts +9 -0
  2501. package/dist/view/index.js +30 -0
  2502. package/dist/view/index.js.map +1 -0
  2503. package/dist/view/server.cjs +658 -0
  2504. package/dist/view/server.cjs.map +1 -0
  2505. package/dist/view/server.d.cts +49 -0
  2506. package/dist/view/server.d.mts +49 -0
  2507. package/dist/view/server.d.ts +49 -0
  2508. package/dist/view/server.js +6 -0
  2509. package/dist/view/server.js.map +1 -0
  2510. package/dist/view/shared/types.cjs +3 -0
  2511. package/dist/view/shared/types.cjs.map +1 -0
  2512. package/dist/view/shared/types.d.cts +51 -0
  2513. package/dist/view/shared/types.d.mts +51 -0
  2514. package/dist/view/shared/types.d.ts +51 -0
  2515. package/dist/view/shared/types.js +4 -0
  2516. package/dist/view/shared/types.js.map +1 -0
  2517. package/dist/view/site.cjs +40 -0
  2518. package/dist/view/site.cjs.map +1 -0
  2519. package/dist/view/site.d.cts +26 -0
  2520. package/dist/view/site.d.mts +26 -0
  2521. package/dist/view/site.d.ts +26 -0
  2522. package/dist/view/site.js +10 -0
  2523. package/dist/view/site.js.map +1 -0
  2524. package/dist/view/styles.css +170 -0
  2525. package/docs-site/zh/README.md +6 -6
  2526. package/docs-site/zh/examples/ai-agent-application.mdx +3 -3
  2527. package/docs-site/zh/examples/coding-agent-extensions.mdx +3 -3
  2528. package/docs-site/zh/examples/index.mdx +10 -3
  2529. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +10 -9
  2530. package/docs-site/zh/examples/integrations/claude-sdk.mdx +11 -9
  2531. package/docs-site/zh/examples/integrations/codex-sdk.mdx +14 -13
  2532. package/docs-site/zh/examples/integrations/langgraph.mdx +13 -11
  2533. package/docs-site/zh/examples/integrations/pi-sdk.mdx +11 -9
  2534. package/docs-site/zh/explanation/adapter.mdx +27 -27
  2535. package/docs-site/zh/explanation/assert.mdx +51 -198
  2536. package/docs-site/zh/explanation/drive.mdx +14 -12
  2537. package/docs-site/zh/explanation/evals.mdx +16 -12
  2538. package/docs-site/zh/explanation/experiment.mdx +7 -3
  2539. package/docs-site/zh/explanation/hitl.mdx +7 -7
  2540. package/docs-site/zh/explanation/judge.mdx +67 -96
  2541. package/docs-site/zh/explanation/overview.mdx +59 -100
  2542. package/docs-site/zh/explanation/record.mdx +60 -0
  2543. package/docs-site/zh/explanation/runner.mdx +47 -123
  2544. package/docs-site/zh/explanation/tier.mdx +2 -2
  2545. package/docs-site/zh/index.mdx +15 -13
  2546. package/docs-site/zh/introduction.mdx +15 -13
  2547. package/docs-site/zh/reference/builtin-agents.mdx +60 -37
  2548. package/docs-site/zh/reference/capabilities.mdx +7 -7
  2549. package/docs-site/zh/reference/cli.mdx +146 -80
  2550. package/docs-site/zh/reference/define-agent.mdx +29 -20
  2551. package/docs-site/zh/reference/define-config.mdx +6 -15
  2552. package/docs-site/zh/reference/define-eval.mdx +78 -326
  2553. package/docs-site/zh/reference/events.mdx +70 -21
  2554. package/docs-site/zh/reference/expect.mdx +148 -117
  2555. package/docs-site/zh/reference/official-adapters.mdx +33 -22
  2556. package/docs-site/zh/reference/report-components.mdx +78 -362
  2557. package/docs-site/zh/reference/results-data.mdx +53 -270
  2558. package/docs-site/zh/troubleshooting/debug-sandbox.mdx +8 -6
  2559. package/docs-site/zh/troubleshooting/debugging.mdx +48 -218
  2560. package/docs-site/zh/troubleshooting/recover-after-kill.mdx +3 -3
  2561. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +48 -290
  2562. package/docs-site/zh/tutorials/agent-onboarding.mdx +22 -20
  2563. package/docs-site/zh/tutorials/authoring.mdx +9 -9
  2564. package/docs-site/zh/tutorials/ci-integration.mdx +40 -117
  2565. package/docs-site/zh/tutorials/concurrency.mdx +44 -56
  2566. package/docs-site/zh/tutorials/configuration.mdx +10 -14
  2567. package/docs-site/zh/tutorials/connect-otel.mdx +21 -21
  2568. package/docs-site/zh/tutorials/connect-your-agent.mdx +29 -24
  2569. package/docs-site/zh/tutorials/criteria-files.mdx +2 -2
  2570. package/docs-site/zh/tutorials/custom-reports.mdx +69 -343
  2571. package/docs-site/zh/tutorials/dataset-fanout.mdx +1 -1
  2572. package/docs-site/zh/tutorials/deploy-report-site.mdx +34 -136
  2573. package/docs-site/zh/tutorials/docker-in-docker.mdx +295 -0
  2574. package/docs-site/zh/tutorials/eval-groups.mdx +207 -0
  2575. package/docs-site/zh/tutorials/evaluation-kinds.mdx +67 -103
  2576. package/docs-site/zh/tutorials/experiments.mdx +4 -4
  2577. package/docs-site/zh/tutorials/fixtures.mdx +3 -3
  2578. package/docs-site/zh/tutorials/handle-execution-failures.mdx +114 -0
  2579. package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +102 -0
  2580. package/docs-site/zh/tutorials/plugins.mdx +110 -0
  2581. package/docs-site/zh/tutorials/publish-report.mdx +40 -121
  2582. package/docs-site/zh/tutorials/quickstart.mdx +15 -9
  2583. package/docs-site/zh/tutorials/reporters.mdx +40 -90
  2584. package/docs-site/zh/tutorials/rerun-and-cache.mdx +44 -225
  2585. package/docs-site/zh/tutorials/sandbox-agent.mdx +47 -40
  2586. package/docs-site/zh/tutorials/sandbox-providers.mdx +49 -39
  2587. package/docs-site/zh/tutorials/sandbox-reuse.mdx +37 -15
  2588. package/docs-site/zh/tutorials/theming.mdx +21 -156
  2589. package/docs-site/zh/tutorials/viewing-results.mdx +73 -666
  2590. package/docs-site/zh/tutorials/write-experiment.mdx +22 -21
  2591. package/docs-site/zh/tutorials/write-send.mdx +38 -35
  2592. package/package.json +127 -65
  2593. package/dist/context/deferred-file-content.d.ts +0 -15
  2594. package/dist/i18n/zh-CN.d.ts +0 -367
  2595. package/dist/i18n/zh-CN.js +0 -458
  2596. package/dist/record/annotated-source.d.ts +0 -126
  2597. package/dist/record/annotated-source.js +0 -511
  2598. package/dist/record/attempt-evidence.d.ts +0 -84
  2599. package/dist/record/attempt-evidence.js +0 -108
  2600. package/dist/record/attempt-source.d.ts +0 -4
  2601. package/dist/record/attempt-source.js +0 -28
  2602. package/dist/record/format.d.ts +0 -39
  2603. package/dist/record/format.js +0 -75
  2604. package/dist/record/open.d.ts +0 -62
  2605. package/dist/record/open.js +0 -683
  2606. package/dist/record/types.d.ts +0 -297
  2607. package/dist/record/types.js +0 -9
  2608. package/dist/report/assets/colors.d.ts +0 -22
  2609. package/dist/report/assets/colors.js +0 -61
  2610. package/dist/report/assets/series-encoding.d.ts +0 -36
  2611. package/dist/report/assets/series-encoding.js +0 -104
  2612. package/dist/report/built-in/failures.d.ts +0 -1
  2613. package/dist/report/built-in/failures.js +0 -18
  2614. package/dist/report/built-in/result-components.d.ts +0 -10
  2615. package/dist/report/built-in/result-components.js +0 -199
  2616. package/dist/report/built-in/stability.d.ts +0 -1
  2617. package/dist/report/built-in/stability.js +0 -20
  2618. package/dist/report/built-in/standard.d.ts +0 -50
  2619. package/dist/report/built-in/standard.js +0 -93
  2620. package/dist/report/components/attempt-detail/compute.d.ts +0 -51
  2621. package/dist/report/components/attempt-detail/compute.js +0 -512
  2622. package/dist/report/components/attempt-detail/content.d.ts +0 -28
  2623. package/dist/report/components/attempt-detail/content.js +0 -575
  2624. package/dist/report/components/attempt-detail/index.d.ts +0 -15
  2625. package/dist/report/components/attempt-detail/index.js +0 -154
  2626. package/dist/report/components/attempt-detail/validate.d.ts +0 -11
  2627. package/dist/report/components/attempt-detail/validate.js +0 -417
  2628. package/dist/report/components/cell.d.ts +0 -12
  2629. package/dist/report/components/cell.js +0 -10
  2630. package/dist/report/components/entity-lists/compute.d.ts +0 -35
  2631. package/dist/report/components/entity-lists/compute.js +0 -333
  2632. package/dist/report/components/entity-lists/content.d.ts +0 -7
  2633. package/dist/report/components/entity-lists/content.js +0 -483
  2634. package/dist/report/components/entity-lists/index.d.ts +0 -48
  2635. package/dist/report/components/entity-lists/index.js +0 -81
  2636. package/dist/report/components/entity-lists/validate.d.ts +0 -4
  2637. package/dist/report/components/entity-lists/validate.js +0 -155
  2638. package/dist/report/components/experiment-detail/compute.d.ts +0 -7
  2639. package/dist/report/components/experiment-detail/compute.js +0 -32
  2640. package/dist/report/components/experiment-detail/index.d.ts +0 -9
  2641. package/dist/report/components/experiment-detail/index.js +0 -41
  2642. package/dist/report/components/fixtures.d.ts +0 -10
  2643. package/dist/report/components/fixtures.js +0 -341
  2644. package/dist/report/components/shared-compute.d.ts +0 -23
  2645. package/dist/report/components/shared-compute.js +0 -48
  2646. package/dist/report/components/shared-faces.d.ts +0 -8
  2647. package/dist/report/components/shared-faces.js +0 -21
  2648. package/dist/report/components/shared.d.ts +0 -52
  2649. package/dist/report/components/shared.js +0 -95
  2650. package/dist/report/components/site-components/HeroCard.d.ts +0 -14
  2651. package/dist/report/components/site-components/HeroCard.js +0 -35
  2652. package/dist/report/components/site-components/PoweredBy.d.ts +0 -5
  2653. package/dist/report/components/site-components/PoweredBy.js +0 -7
  2654. package/dist/report/components/site-components/compute.d.ts +0 -34
  2655. package/dist/report/components/site-components/compute.js +0 -144
  2656. package/dist/report/components/site-components/content.d.ts +0 -1
  2657. package/dist/report/components/site-components/content.js +0 -2
  2658. package/dist/report/components/site-components/faces.d.ts +0 -9
  2659. package/dist/report/components/site-components/faces.js +0 -34
  2660. package/dist/report/components/site-components/hero-types.d.ts +0 -17
  2661. package/dist/report/components/site-components/index.d.ts +0 -34
  2662. package/dist/report/components/site-components/index.js +0 -55
  2663. package/dist/report/components/site-components/projections.d.ts +0 -12
  2664. package/dist/report/components/site-components/projections.js +0 -67
  2665. package/dist/report/components/site-components/scope-warnings.d.ts +0 -44
  2666. package/dist/report/components/site-components/scope-warnings.js +0 -115
  2667. package/dist/report/components/site-components/snapshot-diagnostics.d.ts +0 -18
  2668. package/dist/report/components/site-components/snapshot-diagnostics.js +0 -42
  2669. package/dist/report/components/site-components/validators.d.ts +0 -6
  2670. package/dist/report/components/site-components/validators.js +0 -115
  2671. package/dist/report/components/summaries/compute.d.ts +0 -7
  2672. package/dist/report/components/summaries/compute.js +0 -60
  2673. package/dist/report/components/summaries/index.d.ts +0 -29
  2674. package/dist/report/components/summaries/index.js +0 -122
  2675. package/dist/report/components/summaries/stability-overview.d.ts +0 -13
  2676. package/dist/report/components/summaries/stability-overview.js +0 -73
  2677. package/dist/report/components/summaries/validate.d.ts +0 -2
  2678. package/dist/report/components/summaries/validate.js +0 -29
  2679. package/dist/report/definition/cell.d.ts +0 -118
  2680. package/dist/report/definition/cell.js +0 -96
  2681. package/dist/report/definition/grid-layout.d.ts +0 -77
  2682. package/dist/report/definition/grid-layout.js +0 -147
  2683. package/dist/report/definition/primitives/callouts-logic.d.ts +0 -26
  2684. package/dist/report/definition/primitives/callouts-logic.js +0 -102
  2685. package/dist/report/definition/primitives/callouts.d.ts +0 -9
  2686. package/dist/report/definition/primitives/callouts.js +0 -101
  2687. package/dist/report/definition/primitives/chart-map.d.ts +0 -74
  2688. package/dist/report/definition/primitives/chart-map.js +0 -124
  2689. package/dist/report/definition/primitives/chart.d.ts +0 -43
  2690. package/dist/report/definition/primitives/chart.js +0 -619
  2691. package/dist/report/definition/primitives/conversation.d.ts +0 -55
  2692. package/dist/report/definition/primitives/conversation.js +0 -216
  2693. package/dist/report/definition/primitives/copy-block.d.ts +0 -19
  2694. package/dist/report/definition/primitives/copy-block.js +0 -51
  2695. package/dist/report/definition/primitives/diff-lines.d.ts +0 -68
  2696. package/dist/report/definition/primitives/diff-lines.js +0 -149
  2697. package/dist/report/definition/primitives/diff-view.d.ts +0 -14
  2698. package/dist/report/definition/primitives/diff-view.js +0 -156
  2699. package/dist/report/definition/primitives/markdown.d.ts +0 -29
  2700. package/dist/report/definition/primitives/markdown.js +0 -278
  2701. package/dist/report/definition/primitives/marks.d.ts +0 -124
  2702. package/dist/report/definition/primitives/marks.js +0 -91
  2703. package/dist/report/definition/primitives/points-dataset.d.ts +0 -17
  2704. package/dist/report/definition/primitives/points-dataset.js +0 -121
  2705. package/dist/report/definition/primitives/source-view.d.ts +0 -43
  2706. package/dist/report/definition/primitives/source-view.js +0 -179
  2707. package/dist/report/definition/primitives/waterfall.d.ts +0 -34
  2708. package/dist/report/definition/primitives/waterfall.js +0 -201
  2709. package/dist/report/definition/primitives.d.ts +0 -154
  2710. package/dist/report/definition/primitives.js +0 -691
  2711. package/dist/report/definition/report.d.ts +0 -200
  2712. package/dist/report/definition/report.js +0 -275
  2713. package/dist/report/definition/table-text.d.ts +0 -14
  2714. package/dist/report/definition/table-text.js +0 -187
  2715. package/dist/report/definition/tree.d.ts +0 -233
  2716. package/dist/report/definition/tree.js +0 -566
  2717. package/dist/report/extension/assets.d.ts +0 -16
  2718. package/dist/report/extension/assets.js +0 -124
  2719. package/dist/report/extension/define.d.ts +0 -9
  2720. package/dist/report/extension/define.js +0 -137
  2721. package/dist/report/extension/index.d.ts +0 -6
  2722. package/dist/report/extension/index.js +0 -5
  2723. package/dist/report/extension/meta.d.ts +0 -9
  2724. package/dist/report/extension/meta.js +0 -11
  2725. package/dist/report/extension/types.d.ts +0 -52
  2726. package/dist/report/extension/types.js +0 -3
  2727. package/dist/report/model/aggregate.d.ts +0 -111
  2728. package/dist/report/model/aggregate.js +0 -396
  2729. package/dist/report/model/calculation.d.ts +0 -139
  2730. package/dist/report/model/calculation.js +0 -447
  2731. package/dist/report/model/chart/math.d.ts +0 -73
  2732. package/dist/report/model/chart/math.js +0 -198
  2733. package/dist/report/model/chart/plot.d.ts +0 -52
  2734. package/dist/report/model/chart/plot.js +0 -89
  2735. package/dist/report/model/conversions.d.ts +0 -40
  2736. package/dist/report/model/conversions.js +0 -88
  2737. package/dist/report/model/dataset.d.ts +0 -18
  2738. package/dist/report/model/dataset.js +0 -74
  2739. package/dist/report/model/evaluation-kind.d.ts +0 -19
  2740. package/dist/report/model/evaluation-kind.js +0 -32
  2741. package/dist/report/model/flag.d.ts +0 -52
  2742. package/dist/report/model/flag.js +0 -157
  2743. package/dist/report/model/format.d.ts +0 -96
  2744. package/dist/report/model/format.js +0 -339
  2745. package/dist/report/model/locale.d.ts +0 -219
  2746. package/dist/report/model/locale.js +0 -426
  2747. package/dist/report/model/metrics.d.ts +0 -44
  2748. package/dist/report/model/metrics.js +0 -255
  2749. package/dist/report/model/types.d.ts +0 -784
  2750. package/dist/report/model/types.js +0 -5
  2751. package/dist/report/presentation.d.ts +0 -114
  2752. package/dist/report/presentation.js +0 -210
  2753. package/dist/report/react/index.d.ts +0 -13
  2754. package/dist/report/react/index.js +0 -18
  2755. package/dist/report/runtime/load.d.ts +0 -17
  2756. package/dist/report/runtime/load.js +0 -146
  2757. package/dist/report/runtime/page-render.d.ts +0 -47
  2758. package/dist/report/runtime/page-render.js +0 -95
  2759. package/dist/report/runtime/resolved-page.d.ts +0 -35
  2760. package/dist/report/runtime/resolved-page.js +0 -122
  2761. package/dist/report/runtime/target.d.ts +0 -19
  2762. package/dist/report/runtime/target.js +0 -42
  2763. package/dist/report/runtime/text.d.ts +0 -76
  2764. package/dist/report/runtime/text.js +0 -78
  2765. package/dist/report/runtime/web.d.ts +0 -37
  2766. package/dist/report/runtime/web.js +0 -34
  2767. package/dist/report/slices/compute.d.ts +0 -83
  2768. package/dist/report/slices/compute.js +0 -808
  2769. package/dist/report/slices/content.d.ts +0 -17
  2770. package/dist/report/slices/content.js +0 -132
  2771. package/dist/report/slices/validate.d.ts +0 -6
  2772. package/dist/report/slices/validate.js +0 -296
  2773. package/dist/report/tasks.d.ts +0 -144
  2774. package/dist/report/tasks.js +0 -313
  2775. package/dist/report/theme.d.ts +0 -51
  2776. package/dist/report/theme.js +0 -112
  2777. package/src/agents/ai-sdk-otel.ts +0 -62
  2778. package/src/agents/ai-sdk.test.ts +0 -35
  2779. package/src/agents/ai-sdk.ts +0 -603
  2780. package/src/agents/bub-install-spec.ts +0 -50
  2781. package/src/agents/bub.ts +0 -293
  2782. package/src/agents/builtin.ts +0 -16
  2783. package/src/agents/cache-marker.ts +0 -6
  2784. package/src/agents/claude-code.ts +0 -439
  2785. package/src/agents/codex-env.test.ts +0 -153
  2786. package/src/agents/codex.ts +0 -727
  2787. package/src/agents/coding-cli-versions.ts +0 -87
  2788. package/src/agents/command-redaction.test.ts +0 -96
  2789. package/src/agents/hermes.ts +0 -269
  2790. package/src/agents/index.ts +0 -149
  2791. package/src/agents/langgraph.test.ts +0 -30
  2792. package/src/agents/langgraph.ts +0 -508
  2793. package/src/agents/marketplace.ts +0 -96
  2794. package/src/agents/mcp.test.ts +0 -41
  2795. package/src/agents/mcp.ts +0 -31
  2796. package/src/agents/native-config.ts +0 -267
  2797. package/src/agents/npm-staged.ts +0 -370
  2798. package/src/agents/openai-compat.test.ts +0 -69
  2799. package/src/agents/openai-compat.ts +0 -205
  2800. package/src/agents/openclaw.ts +0 -275
  2801. package/src/agents/opencode.ts +0 -198
  2802. package/src/agents/post-setup.test.ts +0 -118
  2803. package/src/agents/post-setup.ts +0 -116
  2804. package/src/agents/provisioner.test.ts +0 -291
  2805. package/src/agents/provisioner.ts +0 -593
  2806. package/src/agents/sdk-streams.test.ts +0 -66
  2807. package/src/agents/sdk-streams.ts +0 -542
  2808. package/src/agents/session-slot.ts +0 -15
  2809. package/src/agents/shared.ts +0 -250
  2810. package/src/agents/skills.ts +0 -309
  2811. package/src/agents/streaming.ts +0 -203
  2812. package/src/agents/types.ts +0 -612
  2813. package/src/agents/ui-message-stream.ts +0 -398
  2814. package/src/assertions/collector.test.ts +0 -457
  2815. package/src/assertions/collector.ts +0 -452
  2816. package/src/assertions/coverage.ts +0 -118
  2817. package/src/assertions/diff.ts +0 -120
  2818. package/src/assertions/display.test.ts +0 -175
  2819. package/src/assertions/display.ts +0 -213
  2820. package/src/assertions/evidence.test.ts +0 -194
  2821. package/src/assertions/judge.test.ts +0 -623
  2822. package/src/assertions/judge.ts +0 -448
  2823. package/src/assertions/match.ts +0 -79
  2824. package/src/assertions/scoped.test.ts +0 -359
  2825. package/src/assertions/scoped.ts +0 -551
  2826. package/src/assertions/types.ts +0 -286
  2827. package/src/cli.ts +0 -1762
  2828. package/src/context/context.test.ts +0 -759
  2829. package/src/context/context.ts +0 -816
  2830. package/src/context/control-flow.ts +0 -17
  2831. package/src/context/deferred-file-content.ts +0 -16
  2832. package/src/context/send-failures.test.ts +0 -122
  2833. package/src/context/send-failures.ts +0 -164
  2834. package/src/context/send-retry.test.ts +0 -112
  2835. package/src/context/send-retry.ts +0 -145
  2836. package/src/context/session.test.ts +0 -477
  2837. package/src/context/session.ts +0 -516
  2838. package/src/context/types.ts +0 -409
  2839. package/src/define-agent.test.ts +0 -99
  2840. package/src/define-eval.test.ts +0 -213
  2841. package/src/define-experiment.test.ts +0 -44
  2842. package/src/define.test.ts +0 -25
  2843. package/src/define.ts +0 -238
  2844. package/src/expect/index.test.ts +0 -39
  2845. package/src/expect/index.ts +0 -252
  2846. package/src/fresh-import.ts +0 -34
  2847. package/src/i18n/core.ts +0 -28
  2848. package/src/i18n/en.ts +0 -532
  2849. package/src/i18n/index.ts +0 -40
  2850. package/src/i18n/locale.test.ts +0 -41
  2851. package/src/i18n/zh-CN.ts +0 -533
  2852. package/src/index.ts +0 -91
  2853. package/src/load-config.ts +0 -39
  2854. package/src/loaders/criteria.test.ts +0 -305
  2855. package/src/loaders/glob.ts +0 -149
  2856. package/src/loaders/index.test.ts +0 -166
  2857. package/src/loaders/index.ts +0 -256
  2858. package/src/loaders/private.test.ts +0 -110
  2859. package/src/o11y/cost.test.ts +0 -41
  2860. package/src/o11y/cost.ts +0 -81
  2861. package/src/o11y/derive.test.ts +0 -161
  2862. package/src/o11y/derive.ts +0 -301
  2863. package/src/o11y/execution-tree.test.ts +0 -390
  2864. package/src/o11y/execution-tree.ts +0 -391
  2865. package/src/o11y/otlp/canonical.ts +0 -113
  2866. package/src/o11y/otlp/mappers/bub.ts +0 -30
  2867. package/src/o11y/otlp/mappers/claude-code.ts +0 -24
  2868. package/src/o11y/otlp/mappers/codex.ts +0 -40
  2869. package/src/o11y/otlp/mappers/index.ts +0 -14
  2870. package/src/o11y/otlp/parse.ts +0 -334
  2871. package/src/o11y/otlp/receiver.ts +0 -118
  2872. package/src/o11y/otlp/sandbox-receiver.test.ts +0 -301
  2873. package/src/o11y/otlp/sandbox-receiver.ts +0 -255
  2874. package/src/o11y/otlp/select.ts +0 -86
  2875. package/src/o11y/otlp/turn-otel.ts +0 -132
  2876. package/src/o11y/parsers/bub.test.ts +0 -30
  2877. package/src/o11y/parsers/bub.ts +0 -264
  2878. package/src/o11y/parsers/claude-code.ts +0 -302
  2879. package/src/o11y/parsers/codex.test.ts +0 -19
  2880. package/src/o11y/parsers/codex.ts +0 -476
  2881. package/src/o11y/parsers/hermes.ts +0 -199
  2882. package/src/o11y/parsers/index.ts +0 -28
  2883. package/src/o11y/parsers/openclaw.ts +0 -340
  2884. package/src/o11y/parsers/opencode.ts +0 -300
  2885. package/src/o11y/prices.json +0 -10812
  2886. package/src/o11y/tool-names.ts +0 -74
  2887. package/src/o11y/types.ts +0 -221
  2888. package/src/record/annotated-source.test.ts +0 -329
  2889. package/src/record/annotated-source.ts +0 -643
  2890. package/src/record/attempt-evidence.test.ts +0 -208
  2891. package/src/record/attempt-evidence.ts +0 -184
  2892. package/src/record/attempt-source.ts +0 -37
  2893. package/src/record/copy.ts +0 -303
  2894. package/src/record/evidence-schema.test.ts +0 -85
  2895. package/src/record/format.ts +0 -91
  2896. package/src/record/host-equivalence.test.ts +0 -539
  2897. package/src/record/index.ts +0 -119
  2898. package/src/record/locator.test.ts +0 -125
  2899. package/src/record/locator.ts +0 -178
  2900. package/src/record/manifest.ts +0 -72
  2901. package/src/record/open.ts +0 -758
  2902. package/src/record/publish.ts +0 -7
  2903. package/src/record/results.test.ts +0 -1563
  2904. package/src/record/skipped-notice.ts +0 -44
  2905. package/src/record/source-hash.ts +0 -28
  2906. package/src/record/timing-activity.test.ts +0 -395
  2907. package/src/record/truncate.ts +0 -116
  2908. package/src/record/types.ts +0 -319
  2909. package/src/record/writer.ts +0 -549
  2910. package/src/report/assets/colors.ts +0 -69
  2911. package/src/report/assets/enhance.js +0 -214
  2912. package/src/report/assets/series-encoding.tsx +0 -177
  2913. package/src/report/assets/styles.css +0 -1780
  2914. package/src/report/built-in/failures.tsx +0 -29
  2915. package/src/report/built-in/index.tsx +0 -66
  2916. package/src/report/built-in/result-components.tsx +0 -404
  2917. package/src/report/built-in/stability.tsx +0 -30
  2918. package/src/report/built-in/standard.tsx +0 -132
  2919. package/src/report/components/attempt-detail/attempt-components.test.tsx +0 -706
  2920. package/src/report/components/attempt-detail/compute.ts +0 -544
  2921. package/src/report/components/attempt-detail/content.tsx +0 -633
  2922. package/src/report/components/attempt-detail/index.tsx +0 -285
  2923. package/src/report/components/attempt-detail/validate.test.ts +0 -253
  2924. package/src/report/components/attempt-detail/validate.tsx +0 -361
  2925. package/src/report/components/cell.tsx +0 -79
  2926. package/src/report/components/compute.test.ts +0 -1540
  2927. package/src/report/components/entity-lists/compute.test.ts +0 -38
  2928. package/src/report/components/entity-lists/compute.ts +0 -383
  2929. package/src/report/components/entity-lists/content.test.ts +0 -611
  2930. package/src/report/components/entity-lists/content.ts +0 -591
  2931. package/src/report/components/entity-lists/index.tsx +0 -169
  2932. package/src/report/components/entity-lists/validate.test.ts +0 -161
  2933. package/src/report/components/entity-lists/validate.ts +0 -121
  2934. package/src/report/components/experiment-detail/compute.ts +0 -40
  2935. package/src/report/components/experiment-detail/experiment-detail.test.tsx +0 -181
  2936. package/src/report/components/experiment-detail/index.tsx +0 -89
  2937. package/src/report/components/fixtures.ts +0 -366
  2938. package/src/report/components/scope.harness.ts +0 -83
  2939. package/src/report/components/shared-compute.ts +0 -60
  2940. package/src/report/components/shared-faces.ts +0 -25
  2941. package/src/report/components/shared.test.ts +0 -62
  2942. package/src/report/components/shared.ts +0 -127
  2943. package/src/report/components/site-components/HeroCard.tsx +0 -87
  2944. package/src/report/components/site-components/PoweredBy.tsx +0 -20
  2945. package/src/report/components/site-components/compute.ts +0 -165
  2946. package/src/report/components/site-components/content.ts +0 -8
  2947. package/src/report/components/site-components/faces.ts +0 -46
  2948. package/src/report/components/site-components/hero-types.ts +0 -20
  2949. package/src/report/components/site-components/index.tsx +0 -109
  2950. package/src/report/components/site-components/projections.ts +0 -74
  2951. package/src/report/components/site-components/scope-warnings.ts +0 -160
  2952. package/src/report/components/site-components/site-components.test.tsx +0 -460
  2953. package/src/report/components/site-components/snapshot-diagnostics.ts +0 -69
  2954. package/src/report/components/site-components/validate.test.ts +0 -121
  2955. package/src/report/components/site-components/validators.ts +0 -97
  2956. package/src/report/components/summaries/compute.ts +0 -66
  2957. package/src/report/components/summaries/index.tsx +0 -255
  2958. package/src/report/components/summaries/stability-overview.test.tsx +0 -141
  2959. package/src/report/components/summaries/stability-overview.tsx +0 -105
  2960. package/src/report/components/summaries/validate.test.ts +0 -49
  2961. package/src/report/components/summaries/validate.ts +0 -21
  2962. package/src/report/definition/callouts.test.tsx +0 -146
  2963. package/src/report/definition/cell.ts +0 -203
  2964. package/src/report/definition/chart.test.tsx +0 -285
  2965. package/src/report/definition/conversation.test.tsx +0 -150
  2966. package/src/report/definition/copy-block.test.tsx +0 -71
  2967. package/src/report/definition/diff-view.test.tsx +0 -209
  2968. package/src/report/definition/grid-layout.test.tsx +0 -262
  2969. package/src/report/definition/grid-layout.ts +0 -203
  2970. package/src/report/definition/markdown.test.tsx +0 -179
  2971. package/src/report/definition/primitives/callouts-logic.ts +0 -117
  2972. package/src/report/definition/primitives/callouts.tsx +0 -185
  2973. package/src/report/definition/primitives/chart-map.ts +0 -214
  2974. package/src/report/definition/primitives/chart.tsx +0 -1012
  2975. package/src/report/definition/primitives/conversation.tsx +0 -345
  2976. package/src/report/definition/primitives/copy-block.tsx +0 -87
  2977. package/src/report/definition/primitives/diff-lines.ts +0 -212
  2978. package/src/report/definition/primitives/diff-view.tsx +0 -332
  2979. package/src/report/definition/primitives/markdown.tsx +0 -365
  2980. package/src/report/definition/primitives/marks-contract.test.tsx +0 -45
  2981. package/src/report/definition/primitives/marks.tsx +0 -254
  2982. package/src/report/definition/primitives/points-dataset.test.ts +0 -117
  2983. package/src/report/definition/primitives/points-dataset.ts +0 -168
  2984. package/src/report/definition/primitives/source-view.tsx +0 -359
  2985. package/src/report/definition/primitives/waterfall.tsx +0 -386
  2986. package/src/report/definition/primitives.test.tsx +0 -186
  2987. package/src/report/definition/primitives.tsx +0 -1150
  2988. package/src/report/definition/report-contract.test.ts +0 -119
  2989. package/src/report/definition/report.ts +0 -562
  2990. package/src/report/definition/shell-head.test.ts +0 -100
  2991. package/src/report/definition/source-view.test.tsx +0 -119
  2992. package/src/report/definition/stat.test.tsx +0 -45
  2993. package/src/report/definition/table-text.ts +0 -228
  2994. package/src/report/definition/table.test.tsx +0 -633
  2995. package/src/report/definition/tree.ts +0 -852
  2996. package/src/report/definition/waterfall.test.tsx +0 -581
  2997. package/src/report/extension/assets.ts +0 -154
  2998. package/src/report/extension/define.test.tsx +0 -228
  2999. package/src/report/extension/define.ts +0 -182
  3000. package/src/report/extension/index.ts +0 -23
  3001. package/src/report/extension/meta.ts +0 -21
  3002. package/src/report/extension/types.ts +0 -64
  3003. package/src/report/index.ts +0 -410
  3004. package/src/report/model/aggregate.ts +0 -463
  3005. package/src/report/model/calculation.test.ts +0 -354
  3006. package/src/report/model/calculation.ts +0 -659
  3007. package/src/report/model/chart/math.test.ts +0 -189
  3008. package/src/report/model/chart/math.ts +0 -245
  3009. package/src/report/model/chart/plot.ts +0 -144
  3010. package/src/report/model/conversions.ts +0 -150
  3011. package/src/report/model/dataset.ts +0 -80
  3012. package/src/report/model/evaluation-kind.ts +0 -35
  3013. package/src/report/model/flag.ts +0 -174
  3014. package/src/report/model/format.ts +0 -375
  3015. package/src/report/model/locale.ts +0 -510
  3016. package/src/report/model/metrics.ts +0 -256
  3017. package/src/report/model/panel.test.ts +0 -272
  3018. package/src/report/model/panel.ts +0 -340
  3019. package/src/report/model/presentation.test.ts +0 -141
  3020. package/src/report/model/text-layout.ts +0 -190
  3021. package/src/report/model/types.ts +0 -824
  3022. package/src/report/presentation.test.tsx +0 -474
  3023. package/src/report/presentation.ts +0 -354
  3024. package/src/report/react/index.tsx +0 -96
  3025. package/src/report/runtime/dual-render.test.tsx +0 -1088
  3026. package/src/report/runtime/host.test.ts +0 -86
  3027. package/src/report/runtime/host.ts +0 -317
  3028. package/src/report/runtime/load.test.ts +0 -34
  3029. package/src/report/runtime/load.ts +0 -159
  3030. package/src/report/runtime/page-render.test.tsx +0 -247
  3031. package/src/report/runtime/page-render.ts +0 -147
  3032. package/src/report/runtime/resolved-page.test.tsx +0 -81
  3033. package/src/report/runtime/resolved-page.ts +0 -169
  3034. package/src/report/runtime/target.ts +0 -50
  3035. package/src/report/runtime/text.ts +0 -155
  3036. package/src/report/runtime/web.ts +0 -65
  3037. package/src/report/slices/compute.ts +0 -979
  3038. package/src/report/slices/content.ts +0 -157
  3039. package/src/report/slices/delta-table.test.ts +0 -423
  3040. package/src/report/slices/stability-matrix.test.ts +0 -169
  3041. package/src/report/slices/validate.test.ts +0 -236
  3042. package/src/report/slices/validate.ts +0 -216
  3043. package/src/report/tasks.test.ts +0 -82
  3044. package/src/report/tasks.ts +0 -553
  3045. package/src/report/theme.test.ts +0 -32
  3046. package/src/report/theme.ts +0 -141
  3047. package/src/runner/accept-prompt.test.ts +0 -51
  3048. package/src/runner/accept-prompt.ts +0 -67
  3049. package/src/runner/accept.test.ts +0 -592
  3050. package/src/runner/accept.ts +0 -705
  3051. package/src/runner/attempt.test.ts +0 -1989
  3052. package/src/runner/attempt.ts +0 -1912
  3053. package/src/runner/build-preparation-plan.test.ts +0 -119
  3054. package/src/runner/build-preparation.ts +0 -104
  3055. package/src/runner/cleanup-timeout.test.ts +0 -16
  3056. package/src/runner/cleanup-timeout.ts +0 -23
  3057. package/src/runner/config-identity.test.ts +0 -277
  3058. package/src/runner/config-identity.ts +0 -318
  3059. package/src/runner/direct-agent-sandbox.test.ts +0 -48
  3060. package/src/runner/direct-agent-sandbox.ts +0 -68
  3061. package/src/runner/discover.test.ts +0 -262
  3062. package/src/runner/discover.ts +0 -469
  3063. package/src/runner/eval-selection.test.ts +0 -241
  3064. package/src/runner/eval-selection.ts +0 -139
  3065. package/src/runner/eval-source.test.ts +0 -108
  3066. package/src/runner/eval-source.ts +0 -82
  3067. package/src/runner/experiment-cleanup-registry.test.ts +0 -89
  3068. package/src/runner/experiment-cleanup-registry.ts +0 -39
  3069. package/src/runner/experiment-labels.test.ts +0 -100
  3070. package/src/runner/feedback/coordinator.test.ts +0 -367
  3071. package/src/runner/feedback/coordinator.ts +0 -511
  3072. package/src/runner/feedback/eval-conclusions.test.ts +0 -135
  3073. package/src/runner/feedback/eval-conclusions.ts +0 -115
  3074. package/src/runner/feedback/failure.test.ts +0 -104
  3075. package/src/runner/feedback/failure.ts +0 -60
  3076. package/src/runner/feedback/human.test.ts +0 -1722
  3077. package/src/runner/feedback/human.ts +0 -1499
  3078. package/src/runner/feedback/index.ts +0 -94
  3079. package/src/runner/feedback/input-guard.test.ts +0 -251
  3080. package/src/runner/feedback/input-guard.ts +0 -171
  3081. package/src/runner/feedback/io.ts +0 -82
  3082. package/src/runner/feedback/json.test.ts +0 -617
  3083. package/src/runner/feedback/json.ts +0 -708
  3084. package/src/runner/feedback/profile.test.ts +0 -28
  3085. package/src/runner/feedback/profile.ts +0 -23
  3086. package/src/runner/feedback/reducer.test.ts +0 -908
  3087. package/src/runner/feedback/reducer.ts +0 -411
  3088. package/src/runner/feedback/renderer.ts +0 -83
  3089. package/src/runner/feedback/sink.ts +0 -332
  3090. package/src/runner/feedback/testing.ts +0 -109
  3091. package/src/runner/fingerprint.test.ts +0 -1406
  3092. package/src/runner/fingerprint.ts +0 -924
  3093. package/src/runner/gate-lease.test.ts +0 -555
  3094. package/src/runner/gate-lease.ts +0 -398
  3095. package/src/runner/judge-config.test.ts +0 -32
  3096. package/src/runner/judge-config.ts +0 -26
  3097. package/src/runner/leak-gate.test.ts +0 -195
  3098. package/src/runner/leak-gate.ts +0 -364
  3099. package/src/runner/ledger.test.ts +0 -577
  3100. package/src/runner/ledger.ts +0 -533
  3101. package/src/runner/lock.test.ts +0 -498
  3102. package/src/runner/lock.ts +0 -334
  3103. package/src/runner/manifest.ts +0 -282
  3104. package/src/runner/report.test.ts +0 -238
  3105. package/src/runner/report.ts +0 -127
  3106. package/src/runner/reporters/artifacts.ts +0 -120
  3107. package/src/runner/reporters/braintrust.test.ts +0 -109
  3108. package/src/runner/reporters/braintrust.ts +0 -211
  3109. package/src/runner/reporters/index.ts +0 -7
  3110. package/src/runner/reporters/json.test.ts +0 -163
  3111. package/src/runner/reporters/json.ts +0 -79
  3112. package/src/runner/reporters/shared.ts +0 -14
  3113. package/src/runner/reuse-diagnostics.test.ts +0 -114
  3114. package/src/runner/reuse-diagnostics.ts +0 -92
  3115. package/src/runner/reuse-pool-key.test.ts +0 -22
  3116. package/src/runner/run.test.ts +0 -5319
  3117. package/src/runner/run.ts +0 -2656
  3118. package/src/runner/sandbox-pool-plan.test.ts +0 -180
  3119. package/src/runner/sandbox-pool.test.ts +0 -278
  3120. package/src/runner/sandbox-pool.ts +0 -337
  3121. package/src/runner/sandbox-prep.ts +0 -55
  3122. package/src/runner/sandbox-selection.test.ts +0 -288
  3123. package/src/runner/sandbox-selection.ts +0 -351
  3124. package/src/runner/session.test.ts +0 -112
  3125. package/src/runner/session.ts +0 -466
  3126. package/src/runner/teardown-registry.test.ts +0 -156
  3127. package/src/runner/teardown-registry.ts +0 -146
  3128. package/src/runner/timeout-attribution.test.ts +0 -34
  3129. package/src/runner/timeout.ts +0 -54
  3130. package/src/runner/timing.ts +0 -379
  3131. package/src/runner/types.ts +0 -1733
  3132. package/src/sample/index.ts +0 -483
  3133. package/src/sample/sample.test.ts +0 -622
  3134. package/src/sandbox/backend.ts +0 -140
  3135. package/src/sandbox/build-coordinator.test.ts +0 -333
  3136. package/src/sandbox/build-coordinator.ts +0 -444
  3137. package/src/sandbox/case-types.ts +0 -67
  3138. package/src/sandbox/checkpoint.test.ts +0 -55
  3139. package/src/sandbox/checkpoint.ts +0 -64
  3140. package/src/sandbox/cli-commands.test.ts +0 -524
  3141. package/src/sandbox/cli-commands.ts +0 -593
  3142. package/src/sandbox/commands.ts +0 -287
  3143. package/src/sandbox/compose.test.ts +0 -625
  3144. package/src/sandbox/compose.ts +0 -1291
  3145. package/src/sandbox/content.ts +0 -202
  3146. package/src/sandbox/deadline.ts +0 -73
  3147. package/src/sandbox/docker-agent-image.ts +0 -36
  3148. package/src/sandbox/docker-stream.ts +0 -116
  3149. package/src/sandbox/docker.test.ts +0 -263
  3150. package/src/sandbox/docker.ts +0 -836
  3151. package/src/sandbox/dockerfile-agent-cache.test.ts +0 -157
  3152. package/src/sandbox/dockerfile-agent-cache.ts +0 -155
  3153. package/src/sandbox/dockerfile-agent-runtime.test.ts +0 -166
  3154. package/src/sandbox/dockerfile-build.test.ts +0 -27
  3155. package/src/sandbox/dockerfile-build.ts +0 -269
  3156. package/src/sandbox/dockerfile-identity.ts +0 -129
  3157. package/src/sandbox/download-directory.test.ts +0 -68
  3158. package/src/sandbox/download-directory.ts +0 -36
  3159. package/src/sandbox/e2b-agent-template.test.ts +0 -107
  3160. package/src/sandbox/e2b-agent-template.ts +0 -194
  3161. package/src/sandbox/e2b-reconcile.test.ts +0 -126
  3162. package/src/sandbox/e2b.test.ts +0 -629
  3163. package/src/sandbox/e2b.ts +0 -781
  3164. package/src/sandbox/errors.test.ts +0 -72
  3165. package/src/sandbox/errors.ts +0 -203
  3166. package/src/sandbox/identity.ts +0 -203
  3167. package/src/sandbox/index.ts +0 -138
  3168. package/src/sandbox/io-retry.test.ts +0 -58
  3169. package/src/sandbox/io-retry.ts +0 -45
  3170. package/src/sandbox/keep-registry.test.ts +0 -141
  3171. package/src/sandbox/keep-registry.ts +0 -271
  3172. package/src/sandbox/keep.test.ts +0 -538
  3173. package/src/sandbox/keep.ts +0 -405
  3174. package/src/sandbox/layer.test.ts +0 -343
  3175. package/src/sandbox/layer.ts +0 -1641
  3176. package/src/sandbox/ledger-paths.ts +0 -37
  3177. package/src/sandbox/link.test.ts +0 -321
  3178. package/src/sandbox/link.ts +0 -484
  3179. package/src/sandbox/local-files.ts +0 -31
  3180. package/src/sandbox/local.test.ts +0 -216
  3181. package/src/sandbox/local.ts +0 -364
  3182. package/src/sandbox/official-baselines.test.ts +0 -175
  3183. package/src/sandbox/operations.test.ts +0 -391
  3184. package/src/sandbox/operations.ts +0 -187
  3185. package/src/sandbox/orphans.test.ts +0 -470
  3186. package/src/sandbox/orphans.ts +0 -261
  3187. package/src/sandbox/paths.test.ts +0 -141
  3188. package/src/sandbox/paths.ts +0 -132
  3189. package/src/sandbox/plan.test.ts +0 -487
  3190. package/src/sandbox/plan.ts +0 -353
  3191. package/src/sandbox/prepare-commands.test.ts +0 -168
  3192. package/src/sandbox/prepare-commands.ts +0 -342
  3193. package/src/sandbox/redaction.test.ts +0 -48
  3194. package/src/sandbox/redaction.ts +0 -50
  3195. package/src/sandbox/registry.ts +0 -78
  3196. package/src/sandbox/retry.test.ts +0 -138
  3197. package/src/sandbox/retry.ts +0 -86
  3198. package/src/sandbox/run-identity.ts +0 -120
  3199. package/src/sandbox/runtime.test.ts +0 -551
  3200. package/src/sandbox/runtime.ts +0 -984
  3201. package/src/sandbox/shell.test.ts +0 -23
  3202. package/src/sandbox/shell.ts +0 -18
  3203. package/src/sandbox/transfer-errors.test.ts +0 -116
  3204. package/src/sandbox/transfer-errors.ts +0 -118
  3205. package/src/sandbox/types.ts +0 -196
  3206. package/src/sandbox/vercel.test.ts +0 -180
  3207. package/src/sandbox/vercel.ts +0 -400
  3208. package/src/shared/aggregate.test.ts +0 -52
  3209. package/src/shared/aggregate.ts +0 -99
  3210. package/src/shared/entry-file-store.test.ts +0 -193
  3211. package/src/shared/entry-file-store.ts +0 -145
  3212. package/src/shared/external-cause.ts +0 -322
  3213. package/src/shared/facts.ts +0 -36
  3214. package/src/shared/failure-class.test.ts +0 -195
  3215. package/src/shared/failure-class.ts +0 -206
  3216. package/src/shared/format.ts +0 -26
  3217. package/src/shared/json-match.ts +0 -42
  3218. package/src/shared/json-value.test.ts +0 -24
  3219. package/src/shared/json-value.ts +0 -36
  3220. package/src/shared/turn-label.test.ts +0 -20
  3221. package/src/shared/turn-label.ts +0 -15
  3222. package/src/shared/types.ts +0 -101
  3223. package/src/shared/verdict.ts +0 -82
  3224. package/src/show/command.test.ts +0 -36
  3225. package/src/show/command.ts +0 -18
  3226. package/src/show/compose.ts +0 -89
  3227. package/src/show/index.test.ts +0 -95
  3228. package/src/show/index.ts +0 -1226
  3229. package/src/show/json.test.ts +0 -412
  3230. package/src/show/json.ts +0 -106
  3231. package/src/show/render.test.ts +0 -857
  3232. package/src/show/render.ts +0 -1510
  3233. package/src/source-loc.ts +0 -134
  3234. package/src/tty-line.ts +0 -14
  3235. package/src/types.ts +0 -37
  3236. package/src/util.test.ts +0 -77
  3237. package/src/util.ts +0 -138
  3238. package/src/view/app/App.tsx +0 -351
  3239. package/src/view/app/components/ui/dialog.tsx +0 -36
  3240. package/src/view/app/components/ui/tabs.tsx +0 -30
  3241. package/src/view/app/css.d.ts +0 -3
  3242. package/src/view/app/i18n.ts +0 -65
  3243. package/src/view/app/index.html +0 -13
  3244. package/src/view/app/lib/cn.ts +0 -7
  3245. package/src/view/app/lib/target-dialog.test.ts +0 -105
  3246. package/src/view/app/lib/target-dialog.ts +0 -110
  3247. package/src/view/app/main.tsx +0 -109
  3248. package/src/view/app/types.ts +0 -15
  3249. package/src/view/app/vite.config.ts +0 -26
  3250. package/src/view/data.test.ts +0 -541
  3251. package/src/view/data.ts +0 -950
  3252. package/src/view/index.ts +0 -91
  3253. package/src/view/server-rebuild.test.ts +0 -323
  3254. package/src/view/server-watch.test.ts +0 -106
  3255. package/src/view/server.ts +0 -484
  3256. package/src/view/shared/types.ts +0 -93
  3257. package/src/view/site-base.test.ts +0 -51
  3258. package/src/view/site-head.test.ts +0 -142
  3259. package/src/view/site-param-pages.test.ts +0 -186
  3260. package/src/view/site-renderer-assets.test.ts +0 -68
  3261. package/src/view/site.ts +0 -484
  3262. package/src/view/styles.css +0 -170
  3263. /package/dist/{report/components/site-components/hero-types.js → cli/bootstrap.d.cts} +0 -0
  3264. /package/{src → dist}/view/client-dist/app.css +0 -0
  3265. /package/{src → dist}/view/client-dist/app.js +0 -0
  3266. /package/{src → dist}/view/template.html +0 -0
package/src/runner/run.ts DELETED
@@ -1,2656 +0,0 @@
1
- // 运行器主调度:发现产出的 eval × agent × runs → attempt,有界并发调度。
2
- // 职责只有编排:指纹缓存在 fingerprint.ts,单 attempt 生命周期在 attempt.ts,
3
- // reporter 编排 / 汇总在 report.ts,Direct Agent 的 Sandbox 占位适配器在 direct-agent-sandbox.ts。
4
-
5
- import { readFile } from "node:fs/promises";
6
- import { randomUUID } from "node:crypto";
7
- import { Effect, Cause, Data, Either, Exit, Option } from "effect";
8
- import { probeJudge } from "../assertions/judge.ts";
9
- import { t } from "../i18n/index.ts";
10
- import { cacheKey, carriableAttempts, computeConfigHash, planCarry, resolvedTimeoutMsForCarry } from "./fingerprint.ts";
11
- import {
12
- agentInstallPlansForRun,
13
- configDeltas,
14
- configIdentityForRun,
15
- configIdentityFromResult,
16
- } from "./config-identity.ts";
17
- import { OtelReceiverPool } from "../o11y/otlp/turn-otel.ts";
18
- import {
19
- errorFromThrown,
20
- // attemptOrigin re-exported via timing for Run diagnostics
21
-
22
- attemptFailureDeclaration,
23
- experimentRunInfo,
24
- runAttemptEffect,
25
- type AttemptFailureDeclaration,
26
- } from "./attempt.ts";
27
- import { resolveJudge } from "./judge-config.ts";
28
- import type {
29
- DiagnosticRecord,
30
- EvalResult,
31
- InvocationShape,
32
- InvocationSummary,
33
- JsonValue,
34
- JudgeConfig,
35
- Reporter,
36
- ReporterRegistration,
37
- SandboxBuildRecord,
38
- } from "../types.ts";
39
- import type {
40
- AgentRun,
41
- Attempt,
42
- AttemptError,
43
- ExperimentHookContext,
44
- FingerprintMigration,
45
- LifecyclePhase,
46
- AttemptRef,
47
- RunOptions,
48
- } from "./types.ts";
49
- import { attemptOrigin, artifactPrepareTimingHook, createRunTimingRecorder, runOrigin } from "./timing.ts";
50
- import { buildFailureOrigin, startSandboxBuilds } from "../sandbox/build-coordinator.ts";
51
- import { ArtifactPrepareCoordinator } from "../agents/provisioner.ts";
52
- import { collectBuildPreparation, toBuildPreparation } from "./build-preparation.ts";
53
- import { digestOf, type BuildKey } from "../sandbox/identity.ts";
54
- import { firstLine } from "../util.ts";
55
- import { recordFact, type FactValue } from "../shared/facts.ts";
56
- import type { ConcurrencySlot } from "../context/send-retry.ts";
57
- import { runReporter, emitReporterEvent, scopeReporter, summarize } from "./report.ts";
58
- import {
59
- reportAttemptLifecycle,
60
- reportBudgetExhausted,
61
- reportDiagnostic,
62
- reportExperimentHook,
63
- reportExperimentProgress,
64
- reportFailure,
65
- reportInterrupted,
66
- reportLockWait,
67
- reportPrecheck,
68
- reportRunActivity,
69
- } from "./feedback/sink.ts";
70
- import { failureDetailFromResult } from "./feedback/failure.ts";
71
- import { encodeAttemptLocator, type AttemptLocator, type AttemptLocatorRegistration } from "../record/locator.ts";
72
- import { runWho, HALT_DIAGNOSTIC_CODE } from "./types.ts";
73
- import { runPairKey, type PreparedRunPair } from "./sandbox-selection.ts";
74
- import { ReusableSandboxPool } from "./sandbox-pool.ts";
75
- import { liveSandboxRuntimeServices } from "../sandbox/runtime.ts";
76
- import { detectReuseContamination, reuseContaminationMessage } from "./reuse-diagnostics.ts";
77
- import { selectedEvalsForRun } from "./eval-selection.ts";
78
- import { registerExperimentTeardown, unregisterExperimentTeardown } from "./experiment-cleanup-registry.ts";
79
- import { withCleanupTimeout } from "./cleanup-timeout.ts";
80
- import { resolveAttemptTimeout } from "./timeout.ts";
81
- import { hostname } from "node:os";
82
- import {
83
- isStaleTeardownRegistration,
84
- readTeardownRegistrations,
85
- removeTeardownRegistrationIfPresent,
86
- teardownEntryId,
87
- writeTeardownRegistration,
88
- } from "./teardown-registry.ts";
89
- import {
90
- acquireCaseLock,
91
- isCaseLockStale,
92
- readCaseLock,
93
- CASE_LOCK_HEARTBEAT_INTERVAL_MS,
94
- type CaseLockClaim,
95
- type CaseLockRecord,
96
- } from "./lock.ts";
97
- import { acquireGateSlot, type GateLeaseClaim, type GateLeaseRecord } from "./gate-lease.ts";
98
- import { assertFreshAttemptLocatorRegistrations, loadLatestResultsForCase, openRecord } from "../record/open.ts";
99
- import type { RunManifests } from "../record/manifest.ts";
100
-
101
- export class RunModeConflictError extends Data.TaggedError("RunModeConflictError")<{
102
- readonly keepSandbox: NonNullable<RunOptions["keepSandbox"]>;
103
- readonly conflictingExperimentIds: readonly string[];
104
- readonly message: string;
105
- }> {}
106
-
107
- /** 反馈层的 attempt 身份 + 展示 label,两个 sink.ts lifecycle 调用点共用,避免各自手写
108
- * 同一组字段(见 memory 的 live-who-key-mismatch-freezes-rows —— 手写副本漏改是真实事故源)。 */
109
- function feedbackIdentity(a: Attempt): AttemptRef {
110
- return { experimentId: a.run.experimentId, evalId: a.evalDef.id, attempt: a.attempt };
111
- }
112
- function feedbackWho(a: Attempt): string {
113
- return runWho({ agentName: a.run.agent.name, model: a.run.model, experimentId: a.run.experimentId });
114
- }
115
-
116
- function attemptIdentityKey(
117
- experimentId: string | undefined,
118
- agentName: string,
119
- model: string | undefined,
120
- evalId: string,
121
- ): string {
122
- return JSON.stringify([experimentId, agentName, model ?? null, evalId]);
123
- }
124
-
125
- function attemptGroupKey(run: AgentRun, evalId: string): string {
126
- return attemptIdentityKey(run.experimentId, run.agent.name, run.model, evalId);
127
- }
128
-
129
- function reuseResultRequiresRetirement(result: EvalResult): boolean {
130
- return result.error?.code === "timeout" ||
131
- result.error?.code === "agent-send-failed" ||
132
- result.diagnostics?.some((diagnostic) => diagnostic.code === "teardown-failed") === true;
133
- }
134
-
135
- export type { AgentRun, RunOptions } from "./types.ts";
136
-
137
- type SandboxReusePoolScope =
138
- | { readonly _tag: "Shared" }
139
- | { readonly _tag: "Eval"; readonly evalId: string };
140
-
141
- /** 复用池只按物理 Sandbox 与物理 lifecycle 分组;prepare commands 在每次 lease 后重放。 */
142
- export function sandboxReusePoolKey(input: {
143
- readonly providerPlan: JsonValue;
144
- readonly agentInstalls: readonly JsonValue[];
145
- readonly scope: SandboxReusePoolScope;
146
- }): string {
147
- return digestOf({
148
- version: 1,
149
- providerPlan: input.providerPlan,
150
- agentInstalls: [...input.agentInstalls],
151
- scope: input.scope,
152
- });
153
- }
154
-
155
- /** 收集本次要探测的 judge 配置:只看「实际要跑、且源码里出现 judge 字样」的 pair 的生效
156
- * 配置(Experiment / Eval / Config 逐字段合并,与 attempt.ts 的 resolveJudge 同一份),按
157
- * model|baseUrl|apiKeyEnv 去重。要跑的 eval 都不用 judge 时返回空 —— 全局配了 judge
158
- * 也不探测,纯确定性断言的运行不再被 judge key / 端点问题拦下。
159
- * 源码扫描是启发式:judge 调用藏在 import 的 helper 里时会漏判,漏判只是退回旧行为
160
- * (评分时才报 judge 错误,损失 fail fast),不影响正确性。 */
161
- export function judgeProbeTargets(
162
- evals: Array<{ source: string; judge: JudgeConfig | undefined; experimentJudge?: JudgeConfig }>,
163
- configJudge: JudgeConfig | undefined,
164
- ): JudgeConfig[] {
165
- return judgeProbePlan(
166
- evals.map((e, i) => ({
167
- id: `#${i}`,
168
- source: e.source,
169
- judge: e.judge,
170
- experimentJudge: e.experimentJudge,
171
- })),
172
- configJudge,
173
- ).targets.map((target) => target.judge);
174
- }
175
-
176
- /** 一份探测目标的去重键:同一个 (model, baseUrl, apiKeyEnv) 只探一次,也用来把探测结局
177
- * 归回「哪些 Experiment × Eval pair 依赖这个端点」。 */
178
- function judgeTargetKey(jc: JudgeConfig): string {
179
- return `${jc.model ?? ""}|${jc.baseUrl ?? ""}|${jc.apiKeyEnv ?? ""}`;
180
- }
181
-
182
- /** `judgeProbeTargets` 的完整形态:除了去重后的探测目标,还给出「哪个 pair 依赖哪个目标」——
183
- * 预检失败只作废需要 judge 的那些 pair(见 docs/feature/judge/library.md「派发前预检」),
184
- * 所以必须能把探测结局按 pair 归因,不能只知道有几个端点要探。 */
185
- export function judgeProbePlan(
186
- evals: Array<{
187
- id: string;
188
- source: string;
189
- judge: JudgeConfig | undefined;
190
- experimentJudge?: JudgeConfig;
191
- }>,
192
- configJudge: JudgeConfig | undefined,
193
- ): { targets: Array<{ key: string; judge: JudgeConfig }>; evalKeys: Map<string, string> } {
194
- const targets: Array<{ key: string; judge: JudgeConfig }> = [];
195
- const evalKeys = new Map<string, string>();
196
- const seen = new Set<string>();
197
- for (const e of evals) {
198
- const jc = resolveJudge(e.experimentJudge, e.judge, configJudge);
199
- if (!jc || !/\bjudge\b/.test(e.source)) continue;
200
- const key = judgeTargetKey(jc);
201
- evalKeys.set(e.id, key);
202
- if (seen.has(key)) continue;
203
- seen.add(key);
204
- targets.push({ key, judge: jc });
205
- }
206
- return { targets, evalKeys };
207
- }
208
-
209
- export async function runEvals(opts: RunOptions): Promise<InvocationSummary> {
210
- const startedAt = new Date().toISOString();
211
- // 本次 invocation 的快照身份锚点:在展开/调度任何 attempt 之前确定一次,不同 experiment
212
- // 共享它(locator 身份还含 experimentId,不会碰撞)。fresh EvalResult 的 locator(见下方
213
- // attempt 完成处)与 Artifacts writer 写进 run.json 的 startedAt 必须用同一个值——
214
- // 复用刚建立的 startedAt,不是另起一次 new Date(),避免两者出现毫秒级漂移
215
- // (docs/feature/experiments/cli.md「Locator 必须在 result 发布前确定」)。经 InvocationShape
216
- // 传给 reporter(见下方 shape 构造),run.ts 之外没有第二个入口能改这份身份。
217
- const snapshotStartedAt = startedAt;
218
- const t0 = Date.now();
219
- const niceevalRoot = opts.niceevalRoot ?? `${process.cwd()}/.niceeval`;
220
- const runIds = new Map(opts.runIds ?? []);
221
- for (const run of opts.agentRuns) {
222
- if (!runIds.has(run.experimentId)) runIds.set(run.experimentId, randomUUID());
223
- }
224
-
225
- // `--keep-sandbox` 要把单条 Attempt 的最终现场转交给用户,
226
- // `sandboxReuse` 则让整个 Invocation 的 pool 继续拥有并在收尾时销毁同一个 Case。
227
- // 两种 ownership 不能同时成立;在 carry planning/build/provider 等任何资源动作之前
228
- // 拒绝,避免产生“已登记 kept 但 pool finalizer 又销毁”的假现场。
229
- if (opts.keepSandbox !== undefined) {
230
- const conflictingExperiments = [...new Set(
231
- opts.agentRuns
232
- .filter((run) => run.sandboxReuse)
233
- .map((run) => run.experimentId),
234
- )];
235
- if (conflictingExperiments.length > 0) {
236
- throw new RunModeConflictError({
237
- keepSandbox: opts.keepSandbox,
238
- conflictingExperimentIds: Object.freeze(conflictingExperiments),
239
- message:
240
- `--keep-sandbox cannot be combined with sandboxReuse: true ` +
241
- `(experiments: ${conflictingExperiments.map((id) => JSON.stringify(id)).join(", ")}). ` +
242
- "Drop --keep-sandbox or use an experiment that does not reuse sandboxes.",
243
- });
244
- }
245
- }
246
-
247
- // 按 sourcePath 缓存文件内容,fingerprint 与 judge 预检共用:
248
- // 矩阵大时(实验 × eval)规划阶段不做串行重复文件读。
249
- const sourceCache = new Map<string, Promise<string>>();
250
- const readSource = (path: string): Promise<string> => {
251
- let p = sourceCache.get(path);
252
- if (!p) {
253
- p = readFile(path, "utf-8");
254
- sourceCache.set(path, p);
255
- }
256
- return p;
257
- };
258
-
259
- // 跨实验结果复用:上次 passed 或 failed 且 fingerprint 匹配的 (experimentId, evalId) 组合
260
- // 直接携入 —— 两者都是"跑完了、判定确定"的终态,没有理由重花一次 agent/sandbox 成本去
261
- // 复现同一个已知结果。errored 是框架/环境层面的不确定失败(超时、沙箱挂了、judge 探测失败
262
- // 等),判定本身不可信,必须重跑。跳过/fingerprint 不匹配同样重跑。--force 跳过此逻辑
263
- // (cli.ts 在 --force 时不传 priorResults,也不算 carryPlan)。
264
- // carryPlan 优先用调用方(cli.ts,为了 live 表格)已经算好的那份,不重算一遍。
265
- const carryPlan = opts.carryPlan ?? (await Effect.runPromise(planCarry(
266
- opts.evals,
267
- opts.agentRuns,
268
- opts.priorResults,
269
- opts.config.timeoutMs,
270
- {
271
- rerun: opts.rerun,
272
- configJudge: opts.config.judge,
273
- ...(opts.priorManifests ? { priorManifests: opts.priorManifests } : {}),
274
- keepSandbox: opts.keepSandbox,
275
- accept: opts.accept,
276
- },
277
- )));
278
- const {
279
- preparedPairsByKey,
280
- plannedConfigHashes,
281
- plannedFingerprints,
282
- acceptableFingerprints,
283
- carriedAttemptsByKey,
284
- carriedResults: planCarriedResults,
285
- carriedAcceptingByResult,
286
- migratedFromByResult: plannedMigratedFromByResult,
287
- manifestsByKey,
288
- } = carryPlan;
289
- const migratedFromByResult = plannedMigratedFromByResult ?? new Map<EvalResult, FingerprintMigration>();
290
- // CarryPlan 是冻结快照;派发重查期间新发现的 accept 留痕进入独立运行状态,绝不回写计划。
291
- const runtimeCarriedAcceptingByResult = new Map(carriedAcceptingByResult);
292
- if (preparedPairsByKey === undefined) {
293
- throw new Error("CarryPlan is incomplete: preparedPairsByKey must come from physical Sandbox planning.");
294
- }
295
- // Session 文件在首次派发前创建;它只记录 Run 身份与轻量计数,锁和实验闸仍各自维护。
296
- await opts.session?.start({
297
- runIds,
298
- agentRuns: opts.agentRuns,
299
- carriedAttemptsByKey,
300
- startedAt,
301
- });
302
-
303
- /**
304
- * 携带条目合入本次快照时,指纹按**本次**口径重新打戳。携带的含义就是「这条已落盘的结果对
305
- * 本次规划的输入依然成立」,那它在新快照里就该带本次的指纹——否则携带条目会一直背着产出
306
- * 它那一轮的指纹漂下去,而新快照记的是本轮的 `ExperimentRunInfo.flags`,两者对不上,
307
- * 下一轮的反事实重算(见 fingerprint.ts 的 `acceptableFingerprints`)就得靠翻更早的快照
308
- * 才能对上号。判定面不受影响:能走到这里,说明这条已经过了携带资格判据。
309
- */
310
- const restampCarried = (r: EvalResult): EvalResult => {
311
- if (r.experimentId === undefined) return r;
312
- const key = runPairKey(r.experimentId, r.id);
313
- const fp = plannedFingerprints.get(key);
314
- const configHash = plannedConfigHashes.get(key);
315
- const migration = migratedFromByResult.get(r);
316
- if (fp === undefined) return r;
317
- if (migration !== undefined) {
318
- const { acceptedFrom: _acceptedFrom, ...withoutAcceptedFrom } = r;
319
- void _acceptedFrom;
320
- return {
321
- ...withoutAcceptedFrom,
322
- fingerprint: fp,
323
- configHash,
324
- migratedFrom: migration,
325
- ...(runtimeCarriedAcceptingByResult.has(r)
326
- ? { carriedAccepting: [...(runtimeCarriedAcceptingByResult.get(r) ?? [])] }
327
- : {}),
328
- };
329
- }
330
- return {
331
- ...r,
332
- fingerprint: fp,
333
- configHash,
334
- ...(runtimeCarriedAcceptingByResult.has(r)
335
- ? { carriedAccepting: [...(runtimeCarriedAcceptingByResult.get(r) ?? [])] }
336
- : {}),
337
- };
338
- };
339
- const carriedResults = planCarriedResults.map(restampCarried);
340
-
341
- const preparedPlansByRun = new Map<AgentRun, globalThis.Record<string, JsonValue>>();
342
- for (const prepared of preparedPairsByKey.values()) {
343
- const plans = preparedPlansByRun.get(prepared.run) ?? {};
344
- plans[prepared.evalDef.id] = prepared.identity;
345
- preparedPlansByRun.set(prepared.run, plans);
346
- }
347
-
348
- // 展开 attempts
349
- // 外层按「round」(run index)迭代,内层按 eval 迭代:同一 key 的第 i+1 次 attempt 排在
350
- // 所有 eval 的第 i 次之后,earlyExit 开启时第 0 轮通过的 eval,其后续轮大多还没入池就被跳过。
351
- // 注意这只是省钱的吞吐优化,不是正确性前提 —— 即便同 key 的 attempt 同时在飞,
352
- // 首个通过会 abort 同 key 其余 attempt,且它们的结果被下面的去重检查丢弃,不会重复计入。
353
- const attempts: Attempt[] = [];
354
- for (const run of opts.agentRuns) {
355
- // selectedEvalIds 已由 CLI 在构造 AgentRun 时对候选 eval 各求值一次算好(见
356
- // eval-selection.ts 的 resolveExperimentEvals());这里只按 resolved id 取 eval,
357
- // 不重新调用用户谓词(见 docs/feature/record/architecture.md「selectedEvalIds」)。
358
- const evals = selectedEvalsForRun(opts.evals, run);
359
- for (let i = 0; i < run.attempts; i++) {
360
- for (const evalDef of evals) {
361
- const carryKey = cacheKey(run, evalDef.id);
362
- // 携带以 attempt 为粒度:只跳过这个具体序号确实被携入的那些(见 fingerprint.ts 的
363
- // `carriedAttemptsByKey`),不是"这个组合有过携入就跳过前 N 个"——attempts:5 里若只有
364
- // 序号 1 是上一轮的终态、序号 0 是 errored,这里必须只跳过序号 1、照常调度序号 0。
365
- if (carriedAttemptsByKey.get(carryKey)?.has(i)) continue;
366
- // key 标识「同一个运行配置下的同一条 eval」,earlyExit 的跳过/abort 只应作用于
367
- // 同 key 的重试轮。experimentId 必须进 key:两个实验可以同 agent 同 model、只差
368
- // flags(feature A/B 正是这种形状),漏掉它会让先过的实验把其它实验的同名 eval
369
- // 整个跳掉——花了钱还丢结果。
370
- const key = attemptGroupKey(run, evalDef.id);
371
- const prepared = preparedPairsByKey.get(cacheKey(run, evalDef.id));
372
- if (prepared === undefined) {
373
- throw new Error(`Missing prepared Sandbox plan for ${JSON.stringify(cacheKey(run, evalDef.id))}.`);
374
- }
375
- const configHash = plannedConfigHashes.get(cacheKey(run, evalDef.id));
376
- if (configHash === undefined) {
377
- throw new Error(`Missing planned config hash for ${JSON.stringify(cacheKey(run, evalDef.id))}.`);
378
- }
379
- const fingerprint = plannedFingerprints.get(cacheKey(run, evalDef.id));
380
- if (fingerprint === undefined) {
381
- throw new Error(`Missing planned fingerprint for ${JSON.stringify(cacheKey(run, evalDef.id))}.`);
382
- }
383
- const sandboxPlansByEval = preparedPlansByRun.get(run);
384
- if (sandboxPlansByEval === undefined) {
385
- throw new Error(`Missing Experiment plan map for ${JSON.stringify(run.experimentId)}.`);
386
- }
387
- attempts.push({
388
- evalDef,
389
- run,
390
- attempt: i,
391
- key,
392
- fingerprint,
393
- configHash,
394
- plan: prepared.plan,
395
- sandboxPlansByEval,
396
- // locator 在构造 fresh attempt plan 时即算好并作为身份贯穿执行、留存登记与落盘
397
- // (不是完成后写回,见 docs/cli.md);裸 run(无 experimentId)不产出。
398
- locator: encodeAttemptLocator({
399
- runId: runIds.get(run.experimentId)!,
400
- evalId: evalDef.id,
401
- attempt: i,
402
- }),
403
- });
404
- }
405
- }
406
- }
407
-
408
- if (attempts.length > 0) {
409
- const registrations: AttemptLocatorRegistration[] = attempts.map((attempt) => ({
410
- identity: {
411
- runId: runIds.get(attempt.run.experimentId)!,
412
- evalId: attempt.evalDef.id,
413
- attempt: attempt.attempt,
414
- },
415
- locator: attempt.locator,
416
- }));
417
- const existingRecord = await openRecord(niceevalRoot);
418
- assertFreshAttemptLocatorRegistrations(existingRecord, registrations);
419
- }
420
-
421
- // 派发顺序:瓶颈优先(docs/runner.md「派发顺序:瓶颈优先,追求最小总墙钟时间」)。
422
- // 单次 attempt 耗时未知且假设同批内大致均匀,轮次数(该 run 的 attempt 数 / 有效并发宽度,
423
- // 向上取整)就是耗时的代理指标——把 identical-machine 调度的 LPT 规则推广到 moldable job
424
- // 场景:轮次多的 run 是关键路径瓶颈,让它先抢到并发位,总时长才接近瓶颈自身的串行耗时,
425
- // 而不是「瓶颈耗时 + 排在它前面的其它 run 先跑完的耗时」。只在建 attempt 列表时算一次,
426
- // 不随 earlyExit / fail-fast / budget 实际提前收尾而重算(动态调整不值得为一个尽力而为的
427
- // 启发式引入)。只重排派发顺序,不改两级信号量本身;结果仍按发现顺序输出(见下方 sort)。
428
- {
429
- const byRun = new Map<AgentRun, Attempt[]>();
430
- for (const a of attempts) {
431
- let group = byRun.get(a.run);
432
- if (!group) byRun.set(a.run, (group = []));
433
- group.push(a);
434
- }
435
- const rounds = (run: AgentRun, count: number): number => {
436
- const width = Math.min(run.maxConcurrency ?? opts.maxConcurrency, opts.maxConcurrency);
437
- return Math.ceil(count / width);
438
- };
439
- const groups = [...byRun.entries()];
440
- groups.sort((a, b) => rounds(b[0], b[1].length) - rounds(a[0], a[1].length));
441
- attempts.length = 0;
442
- for (const [, group] of groups) attempts.push(...group);
443
- }
444
-
445
- // 预检 judge:验证 API key + 端点可达,避免跑完 agent 才发现 judge 不通。
446
- // 放在 attempts 展开之后,fail fast 只对会真正触发 judge 的运行生效
447
- // (目标收集逻辑见 judgeProbeTargets;全部结果携入、attempts 为空时也自然跳过)。
448
- // 预检失败的受影响 pair:experimentId|evalId → 失败原因(带实际探测端点)。同一个 Eval
449
- // 可被多个 Experiment 用不同 Judge 跑 A/B,不能让一个端点的失败连坐另一个配对。
450
- // 不派发、不建沙箱,逐条落成 errored(见下方 judgePrecheckFailures 的消费点);其余 eval
451
- // 照常派发——一条 judge 配置问题不没收整批与它无关的结果。
452
- const judgePrecheckFailures = new Map<string, string>();
453
- {
454
- const uniquePairs = [...new Map(attempts.map((a) => [cacheKey(a.run, a.evalDef.id), a])).entries()];
455
- const sources = await Promise.all(uniquePairs.map(([, a]) => readSource(a.evalDef.sourcePath)));
456
- const { targets, evalKeys } = judgeProbePlan(
457
- uniquePairs.map(([id, a], i) => ({
458
- id,
459
- source: sources[i] ?? "",
460
- judge: a.evalDef.judge,
461
- experimentJudge: a.run.judge,
462
- })),
463
- opts.config.judge,
464
- );
465
- if (targets.length > 0) {
466
- // judge 预检是一次真实网络往返,可能慢甚至长时间不返回:发运行级行(started/done/failed),
467
- // 让 live 面板在预检期间显示「为什么还停在 0 running · N queued」,而不是看起来卡死
468
- // (见 docs/feature/experiments/cli.md「判分预检的显示」)。
469
- reportPrecheck({ status: "started" });
470
- const precheckStartedAt = Date.now();
471
- // 逐个目标各记自己的结局:一个端点不通不该作废依赖另一个(可用)端点的 eval,
472
- // 而落进 attempt 的 error.message 也必须是它自己那个端点的失败原因。
473
- const failedByKey = new Map<string, string>();
474
- for (const target of targets) {
475
- const err = await probeJudge(target.judge, opts.signal);
476
- if (err) failedByKey.set(target.key, err);
477
- }
478
- for (const [pairKey, key] of evalKeys) {
479
- const err = failedByKey.get(key);
480
- if (err !== undefined) judgePrecheckFailures.set(pairKey, err);
481
- }
482
- reportPrecheck({
483
- status: failedByKey.size > 0 ? "failed" : "done",
484
- durationMs: Date.now() - precheckStartedAt,
485
- });
486
- }
487
- }
488
-
489
- // Run 级共享构建准备:携带规划后只为仍需 fresh 的 BuildKey 工作。独立并发、不占
490
- // attempt 并发位;失败按依赖 eval 扇出,origin 指向同一个 sandbox.build timing node。
491
- // 显式 buildPreparation 优先(测试注入);否则从 pair-owned ProviderPlan 自动收集。
492
- const runTiming = createRunTimingRecorder();
493
- let sandboxBuildRecords: SandboxBuildRecord[] = [];
494
- const buildFailureByPair = new Map<string, AttemptError>();
495
- const buildLocatorsByPair = new Map<string, Map<BuildKey, JsonValue>>();
496
-
497
- const collected =
498
- opts.buildPreparation === undefined
499
- ? await Effect.runPromise(collectBuildPreparation({
500
- preparedPairs: [...preparedPairsByKey.values()],
501
- carriedAttemptsByKey,
502
- }))
503
- : Option.none();
504
- const buildPreparation = opts.buildPreparation === undefined
505
- ? Option.flatMap(collected, toBuildPreparation)
506
- : Option.some(opts.buildPreparation);
507
- const buildPrep = Option.getOrUndefined(buildPreparation);
508
- // 共享构建**不阻塞派发**:整批 key 同时开工,每条 attempt 只等自己引用的那几个 key
509
- // (case.md「Run 级构建协调」第 4 条的逐 key 放行)。全局 barrier 会让 10 个已就绪的镜像
510
- // 陪着最慢的那个构建干等(台账见 memory/shared-build-single-barrier-not-per-buildkey.md)。
511
- const runningBuilds =
512
- buildPrep && buildPrep.works.length > 0
513
- ? startSandboxBuilds(buildPrep.works, {
514
- timing: runTiming,
515
- provider: buildPrep.provider,
516
- maxConcurrency: opts.maxBuildConcurrency ?? buildPrep.maxConcurrency ?? 2,
517
- ...(buildPrep.buildTimeoutMs !== undefined ? { buildTimeoutMs: buildPrep.buildTimeoutMs } : {}),
518
- ...(buildPrep.prepareBudgetMs !== undefined ? { prepareBudgetMs: buildPrep.prepareBudgetMs } : {}),
519
- signal: opts.signal,
520
- // 最小反馈钩子:共享构建投影为运行级 active 行 / 非 TTY 起止事件,不占 attempt 位。
521
- onActivity: (event) => {
522
- reportRunActivity({
523
- id: event.id,
524
- key: event.key,
525
- label: event.label,
526
- status: event.status,
527
- ...("durationMs" in event ? { durationMs: event.durationMs } : {}),
528
- });
529
- },
530
- })
531
- : undefined;
532
-
533
- // 逐 pair 的放行闸:第一次问到就记下等待,之后同 pair 的其它 attempt 复用同一条。
534
- const buildWaits = new Map<string, Promise<void>>();
535
- const awaitBuildsFor = (pairKey: string): Promise<void> => {
536
- const keys = buildPrep?.pairBuildKeys[pairKey];
537
- if (runningBuilds === undefined || keys === undefined || keys.length === 0) return Promise.resolve();
538
- let pending = buildWaits.get(pairKey);
539
- if (pending !== undefined) return pending;
540
- pending = (async () => {
541
- for (const key of keys) await runningBuilds.settled(key);
542
- const locators = new Map<BuildKey, JsonValue>();
543
- for (const key of keys) {
544
- const failure = runningBuilds.failures.get(key);
545
- if (failure !== undefined) {
546
- const originFields = buildFailureOrigin(failure);
547
- buildFailureByPair.set(pairKey, {
548
- code: originFields.code,
549
- message: originFields.message,
550
- origin: runOrigin(originFields.timingNodeId),
551
- ...(originFields.cause !== undefined ? { cause: originFields.cause } : {}),
552
- });
553
- return;
554
- }
555
- const locator = runningBuilds.locators.get(key);
556
- if (locator !== undefined) locators.set(key, locator);
557
- }
558
- if (locators.size > 0) buildLocatorsByPair.set(pairKey, locators);
559
- })();
560
- buildWaits.set(pairKey, pending);
561
- return pending;
562
- };
563
-
564
- // Run 级 Agent artifact prepare:由 attempt 内探测到目标 Sandbox 平台后触发 single-flight。
565
- // 绝不能在这里按宿主平台 eager prepare:macOS 宿主跑 Linux Sandbox 会拿到错误制品。
566
- const artifactPrepare =
567
- opts.artifactPrepare ??
568
- new ArtifactPrepareCoordinator(artifactPrepareTimingHook(runTiming));
569
- // 运行期依赖用新快照扩展,不回写调用方交进来的 RunOptions 计划对象。
570
- const attemptOptions: RunOptions = opts.artifactPrepare === undefined
571
- ? { ...opts, artifactPrepare }
572
- : opts;
573
-
574
- // 缓存携入只在 plan 的 Reuse 行给数量,不逐条铺 eval id 清单(见 cli.md「人在终端里怎么用」:
575
- // 哪些 eval 复用、哪些重跑属于 --dry 与 niceeval view,不占 human 的 scrollback)。
576
-
577
- // onInvocationStart 报「本次实际要跑的 eval」(过滤 + 去重),不是发现到的全部 —— 否则计数误导。
578
- const runningIds = new Set(attempts.map((a) => a.evalDef.id));
579
- const runningEvals = [...runningIds].map((id) => ({ id }));
580
- // 指纹输入清单与规划期 configHash 都按 experiment 分组交给落盘面(Artifacts → createWriter),
581
- // Run 目录建成那一刻与 run.json 同批写出。分组不切 `${experimentId}|${evalId}` 这个字符串键,
582
- // 而是按同一份 (run, evalDef) 组合重取一遍——id 里出现分隔符时切字符串会静默错位。
583
- const manifestsByExperiment = new Map<string, RunManifests>();
584
- const configHashesByExperiment = new Map<string, string>();
585
- for (const run of opts.agentRuns) {
586
- if (!run.experimentId) continue;
587
- for (const evalDef of selectedEvalsForRun(opts.evals, run)) {
588
- const key = cacheKey(run, evalDef.id);
589
- const manifest = manifestsByKey?.get(key);
590
- if (manifest !== undefined) {
591
- const bucket = manifestsByExperiment.get(run.experimentId) ?? {};
592
- bucket[evalDef.id] = manifest;
593
- manifestsByExperiment.set(run.experimentId, bucket);
594
- }
595
- const prepared = preparedPairsByKey.get(key);
596
- if (prepared !== undefined) {
597
- // run.json 的 configHash 只有一槽/experiment,因此必须是真正的 Run 级值——只含
598
- // agent/model/flags/sandboxLayer 等在 defineExperiment 层面就固定的字段。
599
- // plannedConfigHashes(fingerprint.ts)按 experiment > eval > config 链逐字段解析
600
- // judge 后混入携带判据,一条 eval 自己声明 judge 时(docs/feature/experiments/cache.md
601
- // 「指纹:两个哈希嵌套」)会让它单独跑出不同的值——这是刻意的携带正确性,不是配置身份
602
- // 分叉,不能拿它来校验/落盘 Run 级值。这里改用不带 judge 覆盖的
603
- // computeConfigHash(等价 configIdentityForRun(run, plan) 默认单层 run.judge)重算,
604
- // 校验的是它——真正应当逐 eval 恒等的那部分,不一致时才说明物理 plan 混进了配置身份。
605
- const configHash = computeConfigHash(prepared);
606
- const existing = configHashesByExperiment.get(run.experimentId);
607
- if (existing !== undefined && existing !== configHash) {
608
- throw new Error(
609
- `Planned config hash differs across evals within experiment ${JSON.stringify(run.experimentId)} ` +
610
- `(${JSON.stringify(existing)} vs ${JSON.stringify(configHash)} for eval ${JSON.stringify(evalDef.id)}). ` +
611
- "configHash is a Run-level value and must be identical for every eval scheduled under the same experiment.",
612
- );
613
- }
614
- configHashesByExperiment.set(run.experimentId, configHash);
615
- }
616
- }
617
- }
618
- const shape: InvocationShape = {
619
- evals: runningEvals.length,
620
- configs: opts.agentRuns.length,
621
- totalAttempts: attempts.length,
622
- maxConcurrency: opts.maxConcurrency,
623
- snapshotStartedAt,
624
- runIds,
625
- ...(manifestsByExperiment.size > 0 ? { manifests: manifestsByExperiment } : {}),
626
- ...(configHashesByExperiment.size > 0 ? { configHashes: configHashesByExperiment } : {}),
627
- };
628
- // eval 级 reporters:实例只观测引用它的 eval(经 scopeReporter 过滤转发)。
629
- // 已经挂在全局 reporters 里的同一实例不重复挂;同一实例被多个 eval 引用时合并观测集
630
- // (共享一个目的地,如同一个 Braintrust 实验)。本次没有任何被观测 eval 要跑时整个跳过。
631
- const scopedSets = new Map<Reporter, Set<string>>();
632
- for (const e of opts.evals) {
633
- for (const r of e.reporters ?? []) {
634
- if (opts.reporters.some((reg) => reg.reporter === r)) continue;
635
- let ids = scopedSets.get(r);
636
- if (!ids) scopedSets.set(r, (ids = new Set()));
637
- ids.add(e.id);
638
- }
639
- }
640
- const reporters: ReporterRegistration[] = [...opts.reporters];
641
- // EvalDef.reporters 是用户在单个 eval 上挂的补充观测(如「这个 eval 单独也发一份到某个
642
- // dashboard」),不是 CLI 显式注册的默认/机器出口——与 Config.reporters 同样默认
643
- // best-effort(见 ReporterRegistration 的字段注释:required 只留给 artifacts / --json /
644
- // --junit)。name 用「scope 内第几个」编号,足以在诊断里区分「哪一个 eval 级 reporter」,
645
- // 不需要用户自己起名字。
646
- let evalReporterIndex = 0;
647
- for (const [r, ids] of scopedSets) {
648
- const scopedRuns = attempts.filter((a) => ids.has(a.evalDef.id)).length;
649
- if (scopedRuns === 0) continue;
650
- reporters.push({
651
- reporter: scopeReporter(r, ids, {
652
- evals: [...ids].filter((id) => runningIds.has(id)).length,
653
- configs: opts.agentRuns.length,
654
- totalAttempts: scopedRuns,
655
- maxConcurrency: opts.maxConcurrency,
656
- snapshotStartedAt,
657
- runIds,
658
- }),
659
- name: `eval-reporter-${evalReporterIndex++}`,
660
- required: false,
661
- });
662
- }
663
-
664
- for (const reg of reporters) {
665
- // reporter 只是结果消费方:单个 reporter 抛错记 diagnostic,不能让整次调度崩,也不阻断
666
- // 其它 reporter 的必要收尾(required/best-effort 的判定权重在 runReporter 内部处理)。
667
- await runReporter(reg, "onInvocationStart", () => reg.reporter.onInvocationStart?.(runningEvals, shape));
668
- }
669
- await emitReporterEvent(reporters, {
670
- type: "invocation:start",
671
- evals: runningEvals,
672
- shape,
673
- });
674
-
675
- const results: EvalResult[] = [];
676
- // 用例锁释放/接管后重查携带命中的结果(见下方「用例锁」分组与 resolveCaseLockGate)。与
677
- // 静态 carriedResults 同一种身份:不触发 onEvalComplete / eval:complete(它们已经在另一次
678
- // Invocation 里被报告过一次),只随 allResults 一起进入本次快照与 experiment:complete 的
679
- // carriedResults 字段——见 docs/runner.md「并发 Invocation 靠用例锁把续跑扩展到多开」。
680
- const lateCarriedResults: EvalResult[] = [];
681
- const passedKeys = new Set<string>();
682
- // errored = 框架/环境层面的意外(超时、adapter 崩、eval 脚本抛异常……),不是 agent 表现的信号。
683
- // 同 key 一旦 errored 就会确定性地重复 error,再跑 runs 里剩下的次数纯烧钱;只有 failed(断言
684
- // 真的没过)才代表 agent 行为的样本,值得跑满 runs 去测通过率。earlyExit 开时两者都提前收尾。
685
- // run 级 fail-fast(见 docs/runner.md「首过即停」):同一错误 code 在同一 key 连续复现
686
- // 即判定确定性错误,停止派发受同一配置影响的后续 attempt(如实报 errored 的结果保留;
687
- // 这是止损,不是「首过即停」,两个机制互不混用)。
688
- const lastErrorCode = new Map<string, { code: string; streak: number }>();
689
- const failFastKeys = new Map<string, { code: string; skipped: number }>();
690
- // 携入的 passed 结果预置进 passedKeys:上面按序号回填的差额 attempt(carriedCount < run.attempts
691
- // 那部分)如果不预置这个,会在明明已经拿到过 passed 结果的情况下真的再调度一次 agent——
692
- // earlyExit 的语义是「已知会通过就不用再跑」,携入的 passed 同样是「已知会通过」,理应同等对待
693
- // (下面 preflight/body 的 earlyExit 判断本来就只在 a.run.earlyExit 为真时读这两个 Set,所以
694
- // 这里无条件预置对 --no-early-exit 场景没有副作用)。携入的 failed 故意不预置——failed 本来
695
- // 就不触发 earlyExit,回填的差额必须真的重跑,才对得起用户调大 runs 的意图(想看这次是不是
696
- // 还失败,或想凑够 pass@N 的样本量)。
697
- for (const r of carriedResults) {
698
- if (r.verdict === "passed" && r.experimentId) {
699
- passedKeys.add(attemptIdentityKey(r.experimentId, r.agent, r.model, r.id));
700
- }
701
- }
702
-
703
- // budget 护栏:只按「已完成 attempt 的实测花费」判断,不做预测性节流。之前的实现会按
704
- // 「平均成本 × 在飞数」预扣,快到顶就让还没起飞的 attempt 排队等——这在探测阶段(还没有任何
705
- // 成本样本时)等价于把同一 budgetKey 的并发摁到一个很小的数,且完全没有文档承诺过这个副作用
706
- // (`docs-site/zh/tutorials/write-experiment.mdx` 对 `budget` 的描述只有一句「这一格配置的预算
707
- // 上限」)。新语义:已完成 attempt 的花费加总一旦到顶,就不再放新 attempt 起飞(已经在飞的
708
- // 照常跑完,不会被中途打断);到顶之前不做任何预测性限流,并发完全由 globalSem / runSem 决定。
709
- // 代价是「已花 + 在飞未结算」的总花费可能短暂超出 budget——这是有意识的取舍:budget 是防止
710
- // 无限烧钱的安全网,不是精确计费闸,不应该反过来限制吞吐。
711
- interface BudgetState {
712
- spent: number;
713
- /** 已经真正发起过 agent turn、但仍拿不到成本的 attempt 数。provider/setup 在 agent
714
- * 运行前失败不计入——这种结果没有可执行的计费事实,不能据此声称 adapter 不报成本。 */
715
- completedAgentRunsNoCost: number;
716
- unenforceableWarned: boolean;
717
- /** 因这个 budgetKey 预算到顶而未派发的 attempt 累计数——反馈层 "budget-exhausted" 事件
718
- * (见 sink.ts 的 `BudgetExhaustedInput`)要求 emitter 自己维护这个累计值,reducer 不推导。 */
719
- unstartedCount: number;
720
- }
721
- const budgetStates = new Map<string, BudgetState>();
722
- const budgetState = (key: string): BudgetState => {
723
- let s = budgetStates.get(key);
724
- if (!s) {
725
- s = { spent: 0, completedAgentRunsNoCost: 0, unenforceableWarned: false, unstartedCount: 0 };
726
- budgetStates.set(key, s);
727
- }
728
- return s;
729
- };
730
- const budgetReported = new Set<string>();
731
-
732
- // reporter 的 onEvalComplete 要「每个 attempt 完成即时触发」(保流式输出),又不能让
733
- // 并发 worker 交错写 → 用一个 permit=1 的信号量串起来(替代原先手搓的 reportQueue 链)。
734
- const reportMutex = Effect.runSync(Effect.makeSemaphore(1));
735
- // 沙箱启动单独限流:与 agent 并发(maxConcurrency)解耦,防高并发下 daemon/API 过载。
736
- // 未显式指定时跟 maxConcurrency 走——各 provider 的推荐值已在 cli 层写进 maxConcurrency 默认值。
737
- const sandboxSem = Effect.runSync(Effect.makeSemaphore(opts.maxConcurrency));
738
- // 相同 provider physical identity 共享一个按需池;不从 AgentRun 重选 template。
739
- const reusePools = new Map<AgentRun, Map<string, ReusableSandboxPool>>();
740
- type ReusePoolSelection =
741
- | { readonly _tag: "Fresh" }
742
- | { readonly _tag: "Reuse"; readonly pool: ReusableSandboxPool };
743
- const reusePoolKeyOf = (a: Attempt): string | undefined => {
744
- if (!a.run.sandboxReuse || a.run.agent.kind !== "sandbox" || a.plan._tag !== "Sandbox") return undefined;
745
- return sandboxReusePoolKey({
746
- providerPlan: a.plan.providerPlan.identity,
747
- agentInstalls: [...agentInstallPlansForRun(a.run)],
748
- scope: a.plan.pair.hasEvalLifecycleHooks
749
- ? { _tag: "Eval", evalId: a.evalDef.id }
750
- : { _tag: "Shared" },
751
- });
752
- };
753
- const acquiredReuseAttempts = new WeakSet<Attempt>();
754
- const authorizedReuseAttempts = new WeakSet<Attempt>();
755
- const cancelledReuseAttempts = new WeakSet<Attempt>();
756
- const existingReusePoolFor = (a: Attempt): ReusableSandboxPool | undefined => {
757
- const key = reusePoolKeyOf(a);
758
- return key === undefined ? undefined : reusePools.get(a.run)?.get(key);
759
- };
760
- const cancelReuseAttempt = (a: Attempt, force = false): boolean => {
761
- if ((!force && authorizedReuseAttempts.has(a)) || acquiredReuseAttempts.has(a) || cancelledReuseAttempts.has(a)) {
762
- return false;
763
- }
764
- cancelledReuseAttempts.add(a);
765
- return true;
766
- };
767
- const reusePoolFor = (a: Attempt): Effect.Effect<ReusePoolSelection, never, import("effect").Scope.Scope> => {
768
- const key = reusePoolKeyOf(a);
769
- if (key === undefined || a.plan._tag !== "Sandbox") {
770
- return Effect.succeed({ _tag: "Fresh" });
771
- }
772
- let bySpec = reusePools.get(a.run);
773
- if (bySpec === undefined) {
774
- bySpec = new Map<string, ReusableSandboxPool>();
775
- reusePools.set(a.run, bySpec);
776
- }
777
- let pool = bySpec.get(key);
778
- if (!pool) {
779
- // 物理 Sandbox lifecycle 不属于任一 Attempt;反馈与事实落到所属 Experiment 的 Run。
780
- const setupContext = makeExperimentHookContext(a.run, "sandbox.create");
781
- const capacity = Math.max(1, Math.min(opts.maxConcurrency, a.run.maxConcurrency ?? opts.maxConcurrency));
782
- pool = new ReusableSandboxPool(a.plan, capacity, {
783
- progress: setupContext.progress,
784
- diagnostic: setupContext.diagnostic,
785
- }, setupContext, liveSandboxRuntimeServices, a.run.agent.kind === "sandbox" ? a.run.agent : undefined, runTiming);
786
- bySpec.set(key, pool);
787
- return pool.managed().pipe(Effect.map((managed) => ({ _tag: "Reuse", pool: managed }) as const));
788
- }
789
- return Effect.succeed({ _tag: "Reuse", pool });
790
- };
791
-
792
- // 两级并发闸:全局(opts.maxConcurrency)+ 实验级(AgentRun.maxConcurrency,可选)。
793
- // 实验级闸让「有共享状态、必须串行」的实验(如跨 eval 累积记忆,maxConcurrency: 1)只在
794
- // 自己内部排队,同批其它实验照常并发。它的名额域跨 Invocation 共用(见 gate-lease.ts 与
795
- // docs/feature/experiments/architecture.md「并发 Invocation:用例锁」末条),所以名额不是
796
- // 进程内信号量而是磁盘上的逐槽租约——多开不叠加 N,`maxConcurrency: 1` 的临界区声明在
797
- // 多开下同样成立。全局位反过来是每条 Invocation 私有的吞吐旋钮,仍是进程内信号量。
798
- const globalSem = Effect.runSync(Effect.makeSemaphore(opts.maxConcurrency));
799
- // 实验闸在进程内先垫一层同名额的信号量,再去取租约。两个原因:
800
- // ① 名额在本进程内部交接是即时的(Effect 信号量把 permit 直接递给排队的下一个 attempt),
801
- // 不必等租约轮询的下一个周期——单开是绝大多数场景,不该为跨进程协调付整整一个轮询周期
802
- // 的空转;② 同实验同时去拍磁盘的 attempt 至多 N 个,不让 runs 展开出的一大批兄弟一起
803
- // 轮询。它只会更严、不会更松:permit 数恒等于该实验 resolved 的 N,真正的名额权威仍是
804
- // 租约(跨 Invocation 共用、min-N 收紧)。裸 run(没有 experimentId、没有可共享的名额域)
805
- // 就只有这一层,不产生任何跨进程协调。
806
- const gateLocalSems = new Map<AgentRun, Effect.Semaphore>();
807
- for (const run of opts.agentRuns) {
808
- if (run.maxConcurrency !== undefined) {
809
- gateLocalSems.set(run, Effect.runSync(Effect.makeSemaphore(Math.max(1, run.maxConcurrency))));
810
- }
811
- }
812
-
813
- // provider 级独占串行闸(见 docs/runner.md「调度:有界并发」):声明了 exclusive 的 provider
814
- // (如 local——同一棵真实工作树不允许并发写)按 provider 名共享一把 permit=1 的信号量,
815
- // --max-concurrency / 实验级 maxConcurrency 都不解除。核心不认 provider 名分支:这里只读
816
- // physical plan 的中性 admission/lane 字段;相同 lane 共用一把锁,表示它们竞争同一份
817
- // 不可并发底层资源,不是 `provider === "local"` 的行为分支。
818
- const providerExclusiveSems = new Map<string, Effect.Semaphore>();
819
- let exclusiveConcurrencyWarned = false;
820
- const exclusiveSemFor = (plan: Attempt["plan"]): Effect.Semaphore | undefined => {
821
- if (plan._tag === "Direct" || plan.providerPlan.scheduling.admission._tag !== "Exclusive") return undefined;
822
- const laneKey = plan.providerPlan.scheduling.lane.key;
823
- let sem = providerExclusiveSems.get(laneKey);
824
- if (!sem) {
825
- sem = Effect.runSync(Effect.makeSemaphore(1));
826
- providerExclusiveSems.set(laneKey, sem);
827
- }
828
- // 如实标注串行事实(一次性,不管命中多少条 attempt):全局上限比 1 高时,这个 provider 的
829
- // attempt 实际仍然一个一个跑——不管 --max-concurrency 写了多少,这是正确性约束不是调度旋钮。
830
- if (opts.maxConcurrency > 1 && !exclusiveConcurrencyWarned) {
831
- exclusiveConcurrencyWarned = true;
832
- reportDiagnostic({
833
- key: `provider-exclusive-serial:${laneKey}`,
834
- code: "provider-exclusive-serial",
835
- severity: "warning",
836
- message: t("runner.providerExclusiveSerial", {
837
- provider: plan.providerPlan.provider,
838
- concurrency: opts.maxConcurrency,
839
- }).trimEnd(),
840
- data: { provider: plan.providerPlan.provider, concurrency: opts.maxConcurrency },
841
- });
842
- }
843
- return sem;
844
- };
845
-
846
- // 非沙箱 tracing agent 的共享 OTLP 接收池:被测应用是长驻进程,端点不能随
847
- // attempt 换 —— receiver 粒度跟被测进程走(每 agent 一个,整个 run 复用),run 结束回收。
848
- if (!opts.otelPool) {
849
- opts = { ...opts, otelPool: new OtelReceiverPool(opts.config.telemetry?.port) };
850
- }
851
-
852
- // 实验级生命周期(见 docs/feature/experiments/architecture.md「实验级生命周期」):
853
- // setup 整场至多一次——第一个通过派发许可(preflight)的 attempt 触发,后续 attempt 等同一个
854
- // memoized promise;等待发生在 gated 里、globalSem 之外,不占全局并发位。teardown 是
855
- // ExperimentDef.teardown 字段,在最后一个 attempt 收尾后执行,当且仅当 setup 时点走到过
856
- // ——setup 抛错不豁免,未声明 setup 不影响触发。pendingAttempts 按 Attempt 身份结算并挂在
857
- // Effect.ensuring 上,中断路径同样移除;重复结算不会像数字计数那样下溢。
858
- type ExperimentSetupOutcome =
859
- | { readonly _tag: "Succeeded" }
860
- | { readonly _tag: "Failed"; readonly error: AttemptError };
861
-
862
- type ExperimentSetup =
863
- | { readonly _tag: "InProgress"; readonly promise: Promise<void> }
864
- | ExperimentSetupOutcome;
865
-
866
- /**
867
- * 生命周期是一条闭合状态链,而不是 optional promise、boolean 与计数器的笛卡尔积:
868
- *
869
- * Dormant → Active(setup 进行中/成功/失败) → TearingDown → TornDown
870
- * ↘ UntriggeredComplete(所有 attempt 都在触发点前结算)
871
- *
872
- * TearingDown/TornDown 仍携带 setup 与 pendingAttempts,因为强清 drain 可以在 setup 或
873
- * attempt 尚在飞时先取得收尾执行权;后续 attempt 恢复时仍须读到 setup 的失败结果。
874
- */
875
- type ExperimentLifecycle =
876
- | { readonly _tag: "Dormant"; readonly pendingAttempts: ReadonlySet<Attempt> }
877
- | {
878
- readonly _tag: "Active";
879
- readonly pendingAttempts: ReadonlySet<Attempt>;
880
- readonly setup: ExperimentSetup;
881
- }
882
- | {
883
- readonly _tag: "TearingDown";
884
- readonly pendingAttempts: ReadonlySet<Attempt>;
885
- readonly setup: ExperimentSetup;
886
- readonly promise: Promise<void>;
887
- }
888
- | {
889
- readonly _tag: "TornDown";
890
- readonly pendingAttempts: ReadonlySet<Attempt>;
891
- readonly setup: ExperimentSetupOutcome;
892
- }
893
- | { readonly _tag: "UntriggeredComplete" };
894
-
895
- interface ExperimentLifecycleCell {
896
- state: ExperimentLifecycle;
897
- }
898
- const expLifecycles = new Map<AgentRun, ExperimentLifecycleCell>();
899
- for (const a of attempts) {
900
- if (!a.run.setup && !a.run.teardown) continue;
901
- const cell = expLifecycles.get(a.run);
902
- if (cell) {
903
- if (cell.state._tag !== "Dormant") throw new Error("Experiment lifecycle initialized after dispatch.");
904
- cell.state = { _tag: "Dormant", pendingAttempts: new Set([...cell.state.pendingAttempts, a]) };
905
- } else {
906
- expLifecycles.set(a.run, { state: { _tag: "Dormant", pendingAttempts: new Set([a]) } });
907
- }
908
- }
909
-
910
- // 实验域诊断累积器(docs/runner.md「实验域诊断持久化」):只接无法归属单 Attempt 的实验
911
- // 事实——ctx.diagnostic、teardown failed/late、budget-unenforceable。相同 dedupeKey 只在
912
- // 同一个 experimentId 桶内折叠 count;不同 Experiment 各自独立累计,不跨来源合并。裸 run
913
- // (没有 experimentId)没有 Run 可挂,直接丢弃不进这个累积器——只留 reportDiagnostic
914
- // 的运行期反馈。与之配套的收尾时刻(捕捉每个 Experiment 真正完成的那一刻,不是整个
915
- // Invocation 收尾的那一刻,才诚实)。
916
- const experimentDiagnostics = new Map<string, DiagnosticRecord[]>();
917
- const experimentDedupeIndex = new Map<string, Map<string, DiagnosticRecord>>();
918
- const experimentCompletedAt = new Map<string, string>();
919
- // experiment 作用域 ctx.fact() 的累加器(与 experimentDiagnostics 同一种「按 experimentId 分桶」
920
- // 模式):同一实验内后写覆盖先写,与 completedAt 同批在快照封口补写进 RunMeta.facts
921
- // (见 docs/feature/record/architecture.md#facts运行事实)。没有 experimentId 的裸 run 没有
922
- // Run 可挂,调用直接丢弃(与 recordExperimentDiagnostic 同一条纪律)。
923
- const experimentFacts = new Map<string, globalThis.Record<string, FactValue>>();
924
- const recordExperimentFact = (experimentId: string | undefined, key: string, value: FactValue): void => {
925
- if (!experimentId) return;
926
- const facts = experimentFacts.get(experimentId) ?? {};
927
- recordFact(facts, key, value);
928
- experimentFacts.set(experimentId, facts);
929
- };
930
- const recordExperimentDiagnostic = (input: {
931
- experimentId: string | undefined;
932
- code: string;
933
- level: "warning" | "error";
934
- message: string;
935
- phase: LifecyclePhase;
936
- data?: Readonly<globalThis.Record<string, JsonValue>>;
937
- command?: string;
938
- dedupeKey?: string;
939
- }): void => {
940
- if (!input.experimentId) return;
941
- const dedupeIndex = experimentDedupeIndex.get(input.experimentId) ?? new Map<string, DiagnosticRecord>();
942
- experimentDedupeIndex.set(input.experimentId, dedupeIndex);
943
- if (input.dedupeKey !== undefined) {
944
- const existing = dedupeIndex.get(input.dedupeKey);
945
- if (existing) {
946
- existing.count = (existing.count ?? 1) + 1;
947
- return;
948
- }
949
- }
950
- const record: DiagnosticRecord = {
951
- code: input.code,
952
- level: input.level,
953
- detail: input.message,
954
- origin: attemptOrigin(input.phase),
955
- ...(input.data !== undefined || input.command !== undefined
956
- ? {
957
- context: {
958
- ...(input.data ?? {}),
959
- ...(input.command !== undefined ? { command: input.command } : {}),
960
- },
961
- }
962
- : {}),
963
- };
964
- if (input.dedupeKey !== undefined) dedupeIndex.set(input.dedupeKey, record);
965
- const list = experimentDiagnostics.get(input.experimentId) ?? [];
966
- list.push(record);
967
- experimentDiagnostics.set(input.experimentId, list);
968
- };
969
- // 授权携入在 Run 侧也留一条痕:条目自己带的 `carriedAccepting` 跟着结果走,这一条回答
970
- // 「本次调用采信了哪些差异」。同一批 selector 折叠成一条,不逐条目刷屏。
971
- if (carriedAcceptingByResult !== undefined) {
972
- for (const [result, deltas] of carriedAcceptingByResult) {
973
- const selectors = deltas.map((delta) => delta.selector);
974
- recordExperimentDiagnostic({
975
- experimentId: result.experimentId,
976
- code: "accept",
977
- level: "warning",
978
- message: `Carried prior results across accepted differences: ${selectors.join(", ")}.`,
979
- phase: "experiment.setup",
980
- data: { selectors: [...selectors] },
981
- dedupeKey: `accept:${selectors.join(",")}`,
982
- });
983
- }
984
- }
985
- // 强杀后的收尾兜底(docs/feature/experiments/architecture.md「强杀后的收尾兜底」)的磁盘登记
986
- // 挂在结果根下,与留存注册表 `.niceeval/sandboxes/` 同一个根(省略时退回 cwd/.niceeval,
987
- // 与 attempt.ts 的 niceevalRoot 兜底同一口径)。
988
- const currentHost = hostname();
989
- const makeExperimentHookContext = (run: AgentRun, phase: LifecyclePhase): ExperimentHookContext => {
990
- const experimentId = run.experimentId;
991
- return {
992
- experimentId: run.experimentId,
993
- selectedEvalIds: run.selectedEvalIds,
994
- signal: opts.signal ?? new AbortController().signal,
995
- // progress 是短命状态:只更新本实验运行级行的 detail,不属于任何 attempt 的 active 条目。
996
- progress: (u) => {
997
- const suffix = u.current !== undefined && u.total !== undefined ? ` (${u.current}/${u.total})` : "";
998
- reportExperimentProgress({ experimentId, detail: `${u.message}${suffix}` });
999
- },
1000
- // diagnostic 双落:运行级永久事件流(human/json 都有即时反馈)+ 实验域诊断累积器
1001
- // (持久化,该 Experiment 的 Run 封口时一次写入)——两条通路相互独立,互不派生
1002
- // (docs/runner.md「实验域诊断持久化」)。实验级钩子的事实不属于任何单个 Attempt,不落
1003
- // result.json。
1004
- diagnostic: (input) => {
1005
- reportDiagnostic({
1006
- key: input.dedupeKey ?? `${input.code}:experiment:${experimentId}`,
1007
- code: input.code,
1008
- severity: input.level,
1009
- message: input.message,
1010
- data: { experimentId, ...(input.data ?? {}) },
1011
- });
1012
- recordExperimentDiagnostic({
1013
- experimentId: run.experimentId,
1014
- code: input.code,
1015
- level: input.level,
1016
- message: input.message,
1017
- phase,
1018
- ...(input.data !== undefined ? { data: input.data } : {}),
1019
- ...(input.dedupeKey !== undefined ? { dedupeKey: input.dedupeKey } : {}),
1020
- });
1021
- },
1022
- fact: (key, value) => recordExperimentFact(run.experimentId, key, value),
1023
- };
1024
- };
1025
- const replaceSetup = (cell: ExperimentLifecycleCell, setup: ExperimentSetupOutcome): void => {
1026
- const state = cell.state;
1027
- if (state._tag === "Active") {
1028
- cell.state = { ...state, setup };
1029
- } else if (state._tag === "TearingDown") {
1030
- cell.state = { ...state, setup };
1031
- }
1032
- };
1033
- const setupPromiseOf = (setup: ExperimentSetup): Promise<void> =>
1034
- setup._tag === "InProgress" ? setup.promise : Promise.resolve();
1035
- const setupOutcomeOf = (state: ExperimentLifecycle): ExperimentSetupOutcome => {
1036
- if (state._tag === "Active" || state._tag === "TearingDown") {
1037
- if (state.setup._tag === "InProgress") {
1038
- throw new Error(`Experiment setup is still in progress while lifecycle is ${state._tag}.`);
1039
- }
1040
- return state.setup;
1041
- }
1042
- if (state._tag === "TornDown") return state.setup;
1043
- throw new Error(`Experiment setup has no outcome in lifecycle state ${state._tag}.`);
1044
- };
1045
- const runExperimentTeardown = (run: AgentRun, cell: ExperimentLifecycleCell): Promise<void> => {
1046
- const current = cell.state;
1047
- // setup 时点没走到就没有收尾义务;已完成与在飞状态分别复用自己的确定结论/promise。
1048
- if (current._tag === "Dormant" || current._tag === "UntriggeredComplete") return Promise.resolve();
1049
- if (current._tag === "TearingDown") return current.promise;
1050
- if (current._tag === "TornDown") return Promise.resolve();
1051
-
1052
- // memoized 一次性执行体(docs/cli.md「中断:三级响应」):正常路径(attempt 集合归零 / run
1053
- // 收尾扫尾)、强清 drain、崩溃路径谁先到都把 Active 原子转成 TearingDown,后到者只等
1054
- // 该状态携带的同一个 promise——不双跑、也不空转。
1055
- const experimentId = run.experimentId ?? run.agent.name;
1056
- const teardownPromise = (async () => {
1057
- try {
1058
- // 与 setup 串行:强清 drain 可能在 setup 仍在飞时先取得收尾执行权;等 memoized setup
1059
- // settle 后再清理。setup 的 rejection 已在边界归一进闭合 outcome,这里不会 reject。
1060
- await setupPromiseOf(current.setup);
1061
- if (!run.teardown) return;
1062
- // 起止由 runner 发布,不依赖钩子自己调 progress(见 cli.md「实验级 Hook 的显示」)。
1063
- reportExperimentHook({ experimentId, hook: "teardown", status: "started" });
1064
- const startedAt = Date.now();
1065
- try {
1066
- // 有界执行(docs/cli.md 的有界性前提):挂起的 teardown 到点按失败收束,不能无限拖住
1067
- // 退出;超时后遗留的 promise 悬空,随进程退出消亡。
1068
- const ctx = makeExperimentHookContext(run, "experiment.teardown");
1069
- await withCleanupTimeout(() => run.teardown!(ctx));
1070
- reportExperimentHook({ experimentId, hook: "teardown", status: "done", durationMs: Date.now() - startedAt });
1071
- } catch (e) {
1072
- reportExperimentHook({ experimentId, hook: "teardown", status: "failed", durationMs: Date.now() - startedAt });
1073
- // teardown 失败只作运行级诊断,不改任何已产出的 verdict(与 sandbox.teardown 的
1074
- // teardown-failed 同一语义);资源可能泄漏,所以要说出来。同时进实验域诊断累积器,
1075
- // 供该 Experiment 的 Run 封口时持久化(docs/runner.md「实验域诊断持久化」)。
1076
- // 止损闸边界:实验级 teardown 里抛糖衣类**不落闸**,降级为这条普通 teardown 诊断
1077
- // (docs/feature/error-classification/architecture.md「生命周期边界」)——这个时点
1078
- // 本实验已无可保护的派发余量,且止损状态不跨 invocation,声明无处生效。所以这里
1079
- // 刻意不读 FailureClass:少一行代码就是契约本身,别顺手补上。
1080
- const message = t("runner.experimentTeardownFailed", {
1081
- experimentId,
1082
- message: e instanceof Error ? e.message : String(e),
1083
- }).trimEnd();
1084
- reportDiagnostic({ key: `experiment-teardown-failed:${experimentId}`, code: "experiment-teardown-failed", severity: "warning", message, data: { experimentId } });
1085
- recordExperimentDiagnostic({
1086
- experimentId: run.experimentId,
1087
- code: "experiment-teardown-failed",
1088
- level: "warning",
1089
- message,
1090
- phase: "experiment.teardown",
1091
- });
1092
- }
1093
- // 这个 Experiment 真正走完了 teardown(不论成败)的时刻——诚实的 Run completedAt,
1094
- // 不是整个 Invocation 收尾那一刻(见下方 experiment:complete 事件的发送处)。
1095
- experimentCompletedAt.set(experimentId, new Date().toISOString());
1096
- } finally {
1097
- // teardown promise resolve 之前 setup 必已 settle;把 outcome 留在终态,使强清先完成、
1098
- // attempt 后恢复的竞态仍能读取 setup 失败,而不是把它随 teardown 状态一起丢掉。
1099
- cell.state = {
1100
- _tag: "TornDown",
1101
- pendingAttempts: cell.state._tag === "TearingDown"
1102
- ? cell.state.pendingAttempts
1103
- : current.pendingAttempts,
1104
- setup: setupOutcomeOf(cell.state),
1105
- };
1106
- // settle 后才注销:drain 的「启动全部未启动 + 等待全部未 settle」依赖条目在飞期间仍可见。
1107
- unregisterExperimentTeardown(experimentId);
1108
- // 磁盘镜像同一时点删除(所有触发路径:完成 / 中断 / 强清 drain 都经这条 finally)——
1109
- // 不变量:磁盘上存在登记,当且仅当某次 run 的实验级收尾义务尚未完成(docs/feature/
1110
- // experiments/architecture.md「强杀后的收尾兜底」)。没写过(裸 run / 无 teardown)
1111
- // 时删除是 no-op。
1112
- if (run.experimentId) {
1113
- await removeTeardownRegistrationIfPresent(
1114
- niceevalRoot,
1115
- teardownEntryId(run.experimentId, process.pid),
1116
- ).catch(() => {});
1117
- }
1118
- }
1119
- })();
1120
- cell.state = {
1121
- _tag: "TearingDown",
1122
- pendingAttempts: current.pendingAttempts,
1123
- setup: current.setup,
1124
- promise: teardownPromise,
1125
- };
1126
- return teardownPromise;
1127
- };
1128
- /**
1129
- * 启动自愈:本实验触发 setup 之前,先核对磁盘上是否有它自己的遗留登记——上一次运行同一
1130
- * experimentId 被强杀、来不及删除。同宿主且 pid 已死才是遗留义务;pid 活或异宿主可能是
1131
- * 并发 run,不触碰。先原子删登记拿到执行权,再补执行一次它的 teardown(新进程语义:
1132
- * ctx.selectedEvalIds 从登记恢复,不依赖已丢失的 setup 产物)。失败只记诊断,不阻断、
1133
- * 不重试本次 run 的调度——recovery 补偿的是上一次的泄漏,不是这一次的前提条件。
1134
- */
1135
- const recoverStaleTeardownRegistration = async (run: AgentRun, experimentId: string): Promise<void> => {
1136
- if (!run.experimentId || !run.teardown) return;
1137
- let registrations;
1138
- try {
1139
- registrations = await readTeardownRegistrations(niceevalRoot);
1140
- } catch {
1141
- return;
1142
- }
1143
- for (const { id, entry } of registrations) {
1144
- if (entry.experimentId !== run.experimentId || !isStaleTeardownRegistration(entry, currentHost)) continue;
1145
- const claimed = await removeTeardownRegistrationIfPresent(niceevalRoot, id).catch(() => false);
1146
- if (!claimed) continue; // 已被另一个进程抢先删除,义务已被别处接手
1147
- reportExperimentHook({ experimentId, hook: "teardown", status: "started", recovery: true });
1148
- const startedAt = Date.now();
1149
- const recoveryCtx: ExperimentHookContext = {
1150
- experimentId,
1151
- selectedEvalIds: entry.selectedEvalIds,
1152
- signal: opts.signal ?? new AbortController().signal,
1153
- progress: (u) => {
1154
- const suffix = u.current !== undefined && u.total !== undefined ? ` (${u.current}/${u.total})` : "";
1155
- reportExperimentProgress({ experimentId, detail: `${u.message}${suffix}` });
1156
- },
1157
- diagnostic: (input) => {
1158
- reportDiagnostic({
1159
- key: input.dedupeKey ?? `${input.code}:experiment:${experimentId}`,
1160
- code: input.code,
1161
- severity: input.level,
1162
- message: input.message,
1163
- data: { experimentId, ...(input.data ?? {}) },
1164
- });
1165
- recordExperimentDiagnostic({
1166
- experimentId: run.experimentId,
1167
- code: input.code,
1168
- level: input.level,
1169
- message: input.message,
1170
- phase: "experiment.teardown",
1171
- ...(input.data !== undefined ? { data: input.data } : {}),
1172
- ...(input.dedupeKey !== undefined ? { dedupeKey: input.dedupeKey } : {}),
1173
- });
1174
- },
1175
- fact: (key, value) => recordExperimentFact(run.experimentId, key, value),
1176
- };
1177
- try {
1178
- await withCleanupTimeout(() => run.teardown!(recoveryCtx));
1179
- reportExperimentHook({
1180
- experimentId,
1181
- hook: "teardown",
1182
- status: "done",
1183
- durationMs: Date.now() - startedAt,
1184
- recovery: true,
1185
- });
1186
- } catch (e) {
1187
- reportExperimentHook({
1188
- experimentId,
1189
- hook: "teardown",
1190
- status: "failed",
1191
- durationMs: Date.now() - startedAt,
1192
- recovery: true,
1193
- });
1194
- const message = t("runner.experimentTeardownFailed", {
1195
- experimentId,
1196
- message: e instanceof Error ? e.message : String(e),
1197
- }).trimEnd();
1198
- reportDiagnostic({ key: `experiment-teardown-failed:${experimentId}`, code: "experiment-teardown-failed", severity: "warning", message, data: { experimentId } });
1199
- recordExperimentDiagnostic({
1200
- experimentId: run.experimentId,
1201
- code: "experiment-teardown-failed",
1202
- level: "warning",
1203
- message,
1204
- phase: "experiment.teardown",
1205
- });
1206
- }
1207
- }
1208
- };
1209
- const ensureExperimentSetup = (a: Attempt): Promise<void> => {
1210
- const cell = expLifecycles.get(a.run)!;
1211
- const current = cell.state;
1212
- if (current._tag === "Active" || current._tag === "TearingDown") {
1213
- return setupPromiseOf(current.setup);
1214
- }
1215
- if (current._tag === "TornDown") return Promise.resolve();
1216
- if (current._tag === "UntriggeredComplete") {
1217
- throw new Error("Experiment lifecycle cannot be triggered after all attempts settled.");
1218
- }
1219
-
1220
- const run = a.run;
1221
- const experimentId = run.experimentId ?? run.agent.name;
1222
- // teardown 从触发时点起就静态可达:立即登记进宿主机侧兜底表,setup 挂起 / 抛错都不会
1223
- // 丢收尾——强清退出(二次中断/看门狗/崩溃路径)时 cli 由此排空未被运行路径消费的
1224
- // teardown(docs/cli.md「中断:三级响应」)。
1225
- if (run.teardown) registerExperimentTeardown(experimentId, () => runExperimentTeardown(run, cell));
1226
- const ctx = run.setup ? makeExperimentHookContext(run, "experiment.setup") : undefined;
1227
- const setupPromise = (async () => {
1228
- // 强杀后的收尾兜底(docs/feature/experiments/architecture.md「强杀后的收尾兜底」):
1229
- // 先核对并补执行本实验自己的遗留登记,再原子写入本次的登记——两步都先于 setup。
1230
- if (run.teardown && run.experimentId) {
1231
- await recoverStaleTeardownRegistration(run, experimentId);
1232
- await writeTeardownRegistration(niceevalRoot, {
1233
- experimentId: run.experimentId,
1234
- selectedEvalIds: run.selectedEvalIds,
1235
- pid: process.pid,
1236
- host: currentHost,
1237
- startedAt: new Date().toISOString(),
1238
- }).catch((e) => {
1239
- const message = t("runner.teardownRegistrationWriteFailed", {
1240
- experimentId,
1241
- message: e instanceof Error ? e.message : String(e),
1242
- }).trimEnd();
1243
- reportDiagnostic({ key: `teardown-registration-write-failed:${experimentId}`, code: "teardown-registration-write-failed", severity: "warning", message, data: { experimentId } });
1244
- recordExperimentDiagnostic({
1245
- experimentId: run.experimentId,
1246
- code: "teardown-registration-write-failed",
1247
- level: "warning",
1248
- message,
1249
- phase: "experiment.setup",
1250
- });
1251
- });
1252
- }
1253
- if (!run.setup) return;
1254
- // 起止由 runner 发布(见 cli.md「实验级 Hook 的显示」):一个什么都不调的 setup 也必须
1255
- // 可见,不能让「0 running · N queued 长时间不动」看起来像调度卡死。
1256
- reportExperimentHook({ experimentId, hook: "setup", status: "started" });
1257
- const startedAt = Date.now();
1258
- try {
1259
- const returned = (await run.setup(ctx!)) as unknown;
1260
- if (typeof returned === "function") {
1261
- // 迁移护栏:tsx 用户没有类型检查,旧式「setup 返回 cleanup」会被静默忽略而泄漏资源。
1262
- // best-effort 执行一次返回的函数(把已起的资源收掉),然后按 setup 失败报清晰错误。
1263
- try {
1264
- await withCleanupTimeout(returned as () => unknown);
1265
- } catch {
1266
- // 迁移护栏里的旧式 cleanup 失败不再叠加报错,主错误(下一行)已指明修法。
1267
- }
1268
- throw new Error(
1269
- t("runner.setupReturnedCleanup", {
1270
- layer: `ExperimentDef.setup (${experimentId})`,
1271
- hint: "ExperimentDef.teardown",
1272
- }).trimEnd(),
1273
- );
1274
- }
1275
- } catch (e) {
1276
- reportExperimentHook({ experimentId, hook: "setup", status: "failed", durationMs: Date.now() - startedAt });
1277
- throw e;
1278
- }
1279
- reportExperimentHook({ experimentId, hook: "setup", status: "done", durationMs: Date.now() - startedAt });
1280
- })().then(
1281
- () => replaceSetup(cell, { _tag: "Succeeded" }),
1282
- (e: unknown) => replaceSetup(cell, {
1283
- _tag: "Failed",
1284
- error: { ...errorFromThrown(e, "experiment.setup"), code: "experiment-setup-failed" },
1285
- }),
1286
- );
1287
- // 先写 Active 再让 promise continuation 有机会落 outcome;JS microtask 保证即使 hook 同步
1288
- // 返回,then 也只能在这次同步 transition 之后执行。
1289
- cell.state = {
1290
- _tag: "Active",
1291
- pendingAttempts: current.pendingAttempts,
1292
- setup: { _tag: "InProgress", promise: setupPromise },
1293
- };
1294
- return setupPromise;
1295
- };
1296
-
1297
- // 自愈是「选中实验」的启动期职责,不是首个派发 attempt 的副作用:全携带使 attempts 为空时,
1298
- // 仍必须补上上一进程强杀遗留的收尾。无 teardown 的新定义无法安全补执行,交由 CLI 提醒。
1299
- const recoveredExperimentIds = new Set<string>();
1300
- for (const run of opts.agentRuns) {
1301
- if (!run.experimentId || !run.teardown || recoveredExperimentIds.has(run.experimentId)) continue;
1302
- recoveredExperimentIds.add(run.experimentId);
1303
- await recoverStaleTeardownRegistration(run, run.experimentId);
1304
- }
1305
-
1306
- // ─────────────────────── 派发许可链(docs/runner.md「调度:有界并发」) ───────────────────────
1307
- // 一条 attempt 要真正开跑,顺序通过四道许可,顺序本身是契约:
1308
- // ① 止损闸(checkDispatchHalt)→ ② 实验闸(跨 Invocation 逐槽租约)→ ③ 全局并发位
1309
- // → ④ 派发时刻非阻塞试锁(用例锁)→ preflight → body
1310
- // ②③ 是资源许可,④ 是「这条用例归谁跑」的仲裁。撞上别人持有的新鲜锁时,④ 立刻把 ③ 和 ②
1311
- // 都还回去(不还就会拿着实验闸名额干等持锁方——同一实验的名额域跨 Invocation 共用,
1312
- // maxConcurrency: 1 下这是必然死锁),该用例转 elsewhere 挂起,腾出的位子由排队中的下一条
1313
- // attempt 接手;锁释放/过期后重查携带,仍要自跑的那些从 ① 重新走一遍这条链。
1314
-
1315
- /**
1316
- * 一把止损闸(docs/feature/error-classification/architecture.md「止损执行体」)。粒度两级:
1317
- * 每个 experiment 一把实验闸,每个 (experiment, eval) 一把 eval 闸;实验闸落下**蕴含**该实验
1318
- * 全部 eval 闸——检查点同时读两把,不做物理级联(eval 闸的数量随选择集变化,级联要遍历,
1319
- * 蕴含只要多读一个字段)。
1320
- *
1321
- * 三个状态载体各有不可替代的角色,不是同一件事的三份副本:
1322
- * - `latch`:`Effect.unsafeMakeLatch(false)`,落闸 = `unsafeOpen()`。`open` 幂等且不可回退,
1323
- * 「落闸幂等、invocation 内不可逆」因此是结构保证而不是调用方自律;`latch.await` 同时是
1324
- * 「等到这把闸落下」的 Effect,给等在全局并发位上的 fiber 当中止信号(见 withGlobalSlot)。
1325
- * - `halted`:同步读的镜像。派发检查点在每轮循环开头问一次,不能为此付一次 await
1326
- * (`Effect.Latch` 没有同步状态读)。恒在 `unsafeOpen()` 之前置位,两者不会互相领先。
1327
- * - `abort`:同一时刻 abort。Promise 世界的两处长等待——实验闸名额租约、撞用例锁后的
1328
- * elsewhere 轮询——一律经 AbortSignal 中止,那是本仓既有的 interruption 通路,不为止损闸
1329
- * 另造一条。
1330
- */
1331
- interface HaltGate {
1332
- readonly scope: "eval" | "experiment";
1333
- /** 展示与折叠用的实验身份(裸 run 退回 agent 名,与 budgetKey / teardown 诊断同一口径)。 */
1334
- readonly experimentId: string;
1335
- /** 持久化用的真实 experimentId;裸 run 没有 Run 可挂,为 undefined。 */
1336
- readonly persistedExperimentId: string | undefined;
1337
- /** eval 闸才有。 */
1338
- readonly evalId: string | undefined;
1339
- /** 两条诊断通路共用的折叠键(= scope + evalId,契约见 architecture.md「诊断」)。 */
1340
- readonly dedupeKey: string;
1341
- readonly latch: Effect.Latch;
1342
- readonly abort: AbortController;
1343
- halted: boolean;
1344
- /** 被这把闸拦下、未派发的 attempt 数(进 InvocationCompletion.unstarted)。 */
1345
- unstarted: number;
1346
- /** 触发落闸的失败 message,即作者的修复提示;走完通知与诊断两条通路。 */
1347
- message: string;
1348
- /** 触发落闸的失败所在的生命周期阶段;`--json` 的 warning 事件从 data.phase 读它。 */
1349
- phase: LifecyclePhase;
1350
- }
1351
- const haltGates = new Map<string, HaltGate>();
1352
- const haltGateKey = (run: AgentRun, evalId: string | undefined): string =>
1353
- evalId === undefined
1354
- ? `dispatch-halted:experiment:${run.experimentId ?? run.agent.name}`
1355
- : `dispatch-halted:eval:${run.experimentId ?? run.agent.name}|${evalId}`;
1356
- const haltGateOf = (run: AgentRun, evalId: string | undefined): HaltGate => {
1357
- const dedupeKey = haltGateKey(run, evalId);
1358
- let gate = haltGates.get(dedupeKey);
1359
- if (!gate) {
1360
- gate = {
1361
- scope: evalId === undefined ? "experiment" : "eval",
1362
- experimentId: run.experimentId ?? run.agent.name,
1363
- persistedExperimentId: run.experimentId,
1364
- evalId,
1365
- dedupeKey,
1366
- latch: Effect.unsafeMakeLatch(false),
1367
- abort: new AbortController(),
1368
- halted: false,
1369
- unstarted: 0,
1370
- message: "",
1371
- phase: "eval.run",
1372
- };
1373
- haltGates.set(dedupeKey, gate);
1374
- }
1375
- return gate;
1376
- };
1377
- // 闸预先建好(而不是落闸那一刻懒建):等待中的 fiber 要能先订阅 latch / abort,懒建会让
1378
- // 「先开始等、后落闸」的 attempt 订阅到一个已经被换掉的对象上,永远等不到中止。
1379
- for (const a of attempts) {
1380
- haltGateOf(a.run, undefined);
1381
- haltGateOf(a.run, a.evalDef.id);
1382
- }
1383
- /** 这条 attempt 头上的两把闸,实验闸在前(蕴含关系:实验闸落下即视为本 eval 也落闸)。 */
1384
- const haltGatesOf = (a: Attempt): readonly [HaltGate, HaltGate] => [
1385
- haltGateOf(a.run, undefined),
1386
- haltGateOf(a.run, a.evalDef.id),
1387
- ];
1388
-
1389
- /**
1390
- * 止损闸检查点:「这条 attempt 是否被作者声明的止损闸拦下」。落闸后本 eval / 本实验剩余
1391
- * attempt 不再派发,计入 `unstarted`、完成状态落 `incomplete`(契约见
1392
- * docs/feature/error-classification/README.md「自愈阶梯与止损阶梯」)。
1393
- *
1394
- * 每轮循环都会重新问一次:挂起在 elsewhere 的用例被唤醒后同样先过这道闸,不会绕开已经落下
1395
- * 的闸重新入场。检查点存在良性竞态——闸落下的瞬间可能有 attempt 已越过检查、照常跑完,
1396
- * 代价是多烧一个沙箱,不为它引入额外互斥(architecture.md「派发」)。
1397
- */
1398
- const checkDispatchHalt = (
1399
- a: Attempt,
1400
- ): { halted: false } | { halted: true; scope: "eval" | "experiment"; gate: HaltGate } => {
1401
- const [experimentGate, evalGate] = haltGatesOf(a);
1402
- if (experimentGate.halted) return { halted: true, scope: "experiment", gate: experimentGate };
1403
- if (evalGate.halted) return { halted: true, scope: "eval", gate: evalGate };
1404
- return { halted: false };
1405
- };
1406
-
1407
- /** 落闸后唤醒 Promise 世界等待的中止信号:两把闸任一落下、或用户中断,都算这次等待到头了。 */
1408
- const haltAbortSignal = (a: Attempt, extra?: AbortSignal): AbortSignal => {
1409
- const [experimentGate, evalGate] = haltGatesOf(a);
1410
- const signals = [experimentGate.abort.signal, evalGate.abort.signal];
1411
- if (opts.signal) signals.push(opts.signal);
1412
- if (extra) signals.push(extra);
1413
- return AbortSignal.any(signals);
1414
- };
1415
- /** 「等到这条 attempt 头上任一把闸落下」;给 Effect 世界的等待(全局并发位)当中止信号。 */
1416
- const haltAwait = (a: Attempt): Effect.Effect<void> => {
1417
- const [experimentGate, evalGate] = haltGatesOf(a);
1418
- return Effect.raceFirst(experimentGate.latch.await, evalGate.latch.await);
1419
- };
1420
-
1421
- /**
1422
- * 运行期即时通知:反馈流一条 error 级通知(architecture.md「观察面」的落闸形态)。与持久化的
1423
- * `dispatch-halted` 诊断**同源互不派生**——两条通路各自从同一份 gate 状态取值,谁都不是谁的
1424
- * 派生物。`data.unstarted` 随未派发数增长刷新(reducer 的 upsert 用最新 data 覆盖、count 自增),
1425
- * cli.ts 的 assembleInvocationCompletion 读它折成 InvocationCompletion.unstarted。
1426
- */
1427
- const reportHaltNotice = (gate: HaltGate): void => {
1428
- reportDiagnostic({
1429
- key: gate.dedupeKey,
1430
- // 稳定词法与持久化侧同一个字面量;折叠到哪一条实验 / 用例由 dedupeKey 与 data 的
1431
- // experimentId / evalId 回答,不编进 code(见 sink.ts 的 DiagnosticInput.code)。
1432
- code: HALT_DIAGNOSTIC_CODE,
1433
- severity: "error",
1434
- message: t(
1435
- gate.scope === "experiment" ? "runner.dispatchHaltedExperiment" : "runner.dispatchHaltedEval",
1436
- { message: gate.message },
1437
- ).trimEnd(),
1438
- data: {
1439
- experimentId: gate.experimentId,
1440
- scope: gate.scope,
1441
- ...(gate.evalId !== undefined ? { evalId: gate.evalId } : {}),
1442
- phase: gate.phase,
1443
- unstarted: gate.unstarted,
1444
- },
1445
- });
1446
- };
1447
-
1448
- /**
1449
- * 落闸:attempt 封口的空间轴回执携带超出 `"attempt"` 的 scope 时调用(唯一入口)。
1450
- * 幂等——并发 attempt 同时声明同一死因是常态,重复触发只折叠两条通路的诊断计数;不可逆——
1451
- * latch 只开不关,在飞 attempt 之后成功也不重开派发;不抢占——本函数只置状态,不碰任何
1452
- * 已经在跑的 attempt。
1453
- */
1454
- const closeHaltGate = (a: Attempt, declaration: AttemptFailureDeclaration): void => {
1455
- const scope = declaration.class.scope;
1456
- if (scope !== "eval" && scope !== "experiment") return; // 缺省档:死因只属于本次执行,无闸可落
1457
- const gate = haltGateOf(a.run, scope === "experiment" ? undefined : a.evalDef.id);
1458
- const message = firstLine(declaration.text);
1459
- // 持久化通路:按 dedupeKey 折叠成一条 dispatch-halted(docs 的形状),落进该 Experiment 的
1460
- // run.json。裸 run 没有 Run 可挂,recordExperimentDiagnostic 自己丢弃。
1461
- recordExperimentDiagnostic({
1462
- experimentId: gate.persistedExperimentId,
1463
- code: HALT_DIAGNOSTIC_CODE,
1464
- level: "error",
1465
- message,
1466
- phase: declaration.phase,
1467
- dedupeKey: gate.dedupeKey,
1468
- data: { scope, ...(gate.evalId !== undefined ? { evalId: gate.evalId } : {}) },
1469
- });
1470
- if (!gate.halted) {
1471
- gate.message = message;
1472
- gate.phase = declaration.phase;
1473
- gate.halted = true; // 同步镜像先置位,再开 latch:两者不会互相领先
1474
- gate.latch.unsafeOpen();
1475
- gate.abort.abort();
1476
- }
1477
- reportHaltNotice(gate);
1478
- };
1479
-
1480
- /**
1481
- * 未派发记账:与 run 级 fail-fast / budget 停派发同一条通路——每个未派发 attempt 各发一次
1482
- * `attempt:early-exit`(queued → completed,反馈层五项计数守恒),再把当次累计的未派发数刷进
1483
- * 同一条 `dispatch-halted` 诊断。不为没跑过的 attempt 制造 `errored` 记录(architecture.md
1484
- * 「记账」);退出码由观察到失败的那条 `errored` attempt 判红。
1485
- */
1486
- const accountDispatchHalted = (a: Attempt, gate: HaltGate): void => {
1487
- gate.unstarted += 1;
1488
- reportAttemptLifecycle({
1489
- type: "attempt:early-exit",
1490
- at: Date.now(),
1491
- identity: feedbackIdentity(a),
1492
- who: feedbackWho(a),
1493
- });
1494
- reportHaltNotice(gate);
1495
- };
1496
-
1497
- const lockIdentity = { pid: process.pid, host: currentHost };
1498
- /** 调度整体收束(forEach 已结算)后置位:兜住被 Effect 抛下的挂起轮询,不让它无主空转。 */
1499
- let dispatchClosed = false;
1500
-
1501
- /** 可被 abort 打断的定时等待;abort 或到点都以 resolve 收束(调用方自己复查中断状态),
1502
- * 不留悬挂的定时器——真实的用户 Ctrl+C 不能被别人的锁拖着无限期挂住。 */
1503
- const delayOrAbort = (ms: number, signal: AbortSignal | undefined): Promise<void> =>
1504
- new Promise<void>((resolve) => {
1505
- if (signal?.aborted) return resolve();
1506
- const done = (): void => {
1507
- clearTimeout(timer);
1508
- signal?.removeEventListener("abort", done);
1509
- resolve();
1510
- };
1511
- const timer = setTimeout(done, ms);
1512
- signal?.addEventListener("abort", done, { once: true });
1513
- });
1514
-
1515
- const combinedSignal = (extra: AbortSignal): AbortSignal =>
1516
- opts.signal ? AbortSignal.any([opts.signal, extra]) : extra;
1517
-
1518
- // 用例锁(docs/feature/experiments/architecture.md「并发 Invocation:用例锁」):按
1519
- // (experimentId, evalId) 给这批已经确定要真实派发的 attempt 分组——被静态携带筛掉的组合
1520
- // 从不出现在 attempts[] 里,天然满足「全携带用例不取锁」;裸 run(无 experimentId)不接入。
1521
- // 一组(runs > 1 的兄弟 attempt)共享同一把锁:谁先到派发时刻谁试,自己已持有的直接放行,
1522
- // 别人持有则全体挂在同一个等待窗口上,不重复试锁、不各自轮询。
1523
- /** 一次非阻塞试锁的结论。`busy` 直接带出这一条用例的挂起窗口——「发现撞锁」与「挂进哪个
1524
- * 窗口」必须是同一步:分成两步的话,兄弟 attempt 归还许可的那几个 microtask 里窗口可能
1525
- * 已经解决并重新取到锁,它再去建窗口就会读到**自己**的新鲜锁、永久等下去。 */
1526
- type CaseLockTry =
1527
- | { kind: "acquired" }
1528
- | { kind: "busy"; window: Promise<void> }
1529
- | { kind: "aborted" };
1530
- interface CaseLockState {
1531
- experimentId: string;
1532
- evalId: string;
1533
- /** 本用例这次计划的全部 attempt;持有者一次认领它们全部,不按 attempt 拆锁。 */
1534
- group: Attempt[];
1535
- /** 还没收尾、也还没被重查携带命中的 attempt 序号——`lock_wait` 的计数与「锁还留不留」都读它。 */
1536
- pending: Set<number>;
1537
- /** 重查携带命中的 attempt 序号(elsewhere → reused,不再派发)。 */
1538
- carried: Set<number>;
1539
- /** 本进程此刻持有的锁;undefined = 没持有(还没试 / 撞锁挂起中)。 */
1540
- claim?: CaseLockClaim;
1541
- /** 在飞的一次非阻塞试锁:同组兄弟共享同一次尝试的结论,不各自拍一遍磁盘。 */
1542
- trying?: Promise<CaseLockTry>;
1543
- /** 在飞的挂起窗口:撞锁的兄弟全体等同一个 promise。 */
1544
- suspension?: Promise<void>;
1545
- /** 已经用 `lock_wait started` 报进 `elsewhere`、还没被 `resolved` 报出来的 attempt 数。
1546
- * 五项恒等式要求「报进去多少条就要报出来多少条」:收尾时不能拿当下的 `pending.size`
1547
- * 当迁移数——等待期间被中断而提前 settle 的 attempt 会让 `pending` 缩水,差额就永远
1548
- * 挂在 `elsewhere` 上。 */
1549
- inElsewhere: number;
1550
- }
1551
- const caseLocks = new Map<string, CaseLockState>();
1552
- for (const a of attempts) {
1553
- if (!a.run.experimentId) continue;
1554
- const key = cacheKey(a.run, a.evalDef.id);
1555
- let st = caseLocks.get(key);
1556
- if (!st) {
1557
- st = {
1558
- experimentId: a.run.experimentId,
1559
- evalId: a.evalDef.id,
1560
- group: [],
1561
- pending: new Set<number>(),
1562
- carried: new Set<number>(),
1563
- inElsewhere: 0,
1564
- };
1565
- caseLocks.set(key, st);
1566
- }
1567
- st.group.push(a);
1568
- st.pending.add(a.attempt);
1569
- }
1570
- const caseStateOf = (a: Attempt): CaseLockState | undefined =>
1571
- a.run.experimentId ? caseLocks.get(cacheKey(a.run, a.evalDef.id)) : undefined;
1572
-
1573
- /** 取锁之后值不值得重新读盘查携带。`--force` 下 opts.priorResults 恒为 undefined——
1574
- * force 关掉的是缓存,等完同样全部自跑;中断路径同样不再读盘。注意这只关掉「重查」,
1575
- * 不关掉挂起窗口的 `resolved` 事件:少发一次 resolved,elsewhere 就永远挂着,五项恒等式
1576
- * 当场破(旧实现在 `--force` + 真实撞锁等待这条组合上就是这么漏的)。 */
1577
- const carryRecheckEnabled = (): boolean => opts.priorResults !== undefined && !opts.signal?.aborted;
1578
-
1579
- /**
1580
- * 对这个用例**重新做一次携带规划**:别的 Invocation 落盘的终态此刻已可读。判定逐 attempt
1581
- * 进行(见 memory 的 carry-must-be-per-attempt-not-whole-eval-key —— 按整段 key 判定会让同
1582
- * eval 里一个 attempt 的终态连带携入其它序号):命中的序号 elsewhere → reused 不再派发,
1583
- * 仍缺的序号 elsewhere → queued 自跑。
1584
- *
1585
- * `waitStartedAt` 有值 = 这次重查在关闭一个真实的挂起窗口,`resolved` 必须发(哪怕一条都
1586
- * 没携入,不然 elsewhere 永远挂着);省略 = 没有窗口要关(全新取锁 / 接管),只有真的携入了
1587
- * 才补一对瞬时的 started/resolved 把这些 attempt 从 queued 迁进 reused。
1588
- *
1589
- * 读盘走**收窄读**(`loadLatestResultsForCase`):这次 I/O 是在握着全局并发位 + 实验闸名额
1590
- * + 用例锁的状态下做的,per-case 的问题("这条用例现在还缺哪些 attempt")不能用全根扫描去
1591
- * 回答——实测 110 ms/条 vs 0.3 ms/条,后者才付得起「每次取锁都重查」。
1592
- *
1593
- * 判据不重跑 `planCarry`:本次 Invocation 的 `acceptableFingerprints` 整场是常量,重查只需要
1594
- * 逐条 attempt 过 `carriableAttempts`(终态 + 指纹在可携带集合里 + durationMs ≤ resolved
1595
- * timeoutMs),与静态规划共用同一个函数。
1596
- */
1597
- const recheckCarry = async (
1598
- st: CaseLockState,
1599
- waitStartedAt: number | undefined,
1600
- holder: CaseLockRecord | undefined,
1601
- ): Promise<void> => {
1602
- const { experimentId, evalId } = st;
1603
- // 这个窗口当初报进 elsewhere 的条数,收尾必须原数报回来(见 CaseLockState.inElsewhere)。
1604
- const inElsewhere = st.inElsewhere;
1605
- st.inElsewhere = 0;
1606
- const newlyCarried: number[] = [];
1607
- if (carryRecheckEnabled()) {
1608
- const a0 = st.group[0]!;
1609
- const key = cacheKey(a0.run, evalId);
1610
- const freshPrior = await loadLatestResultsForCase(niceevalRoot, experimentId, evalId).catch(
1611
- (): EvalResult[] => [],
1612
- );
1613
- const carried = carriableAttempts(
1614
- freshPrior,
1615
- key,
1616
- plannedConfigHashes?.get(key),
1617
- acceptableFingerprints.get(key),
1618
- resolvedTimeoutMsForCarry(a0.run, a0.evalDef, opts.config.timeoutMs),
1619
- {
1620
- rerun: opts.rerun,
1621
- keepSandbox: opts.keepSandbox,
1622
- accept: opts.accept,
1623
- },
1624
- );
1625
- for (const r of carried) {
1626
- if (!st.pending.has(r.attempt)) continue; // 已经跑过 / 上一轮已经携入过的序号不重复计
1627
- st.pending.delete(r.attempt);
1628
- st.carried.add(r.attempt);
1629
- newlyCarried.push(r.attempt);
1630
- // 迟到携带同样可能是被授权跨过差异才进来的(它的指纹不是本次规划那个)。留痕在这里
1631
- // 补齐:静态规划算好的那份映射只认规划时刻见过的条目,别的 Invocation 刚落盘的这条
1632
- // 不在里面,漏掉就成了「授权携入却没有任何账」。
1633
- if (opts.accept?.length && r.fingerprint !== plannedFingerprints.get(key)) {
1634
- const historical = configIdentityFromResult(r);
1635
- const crossed = historical === undefined
1636
- ? []
1637
- : configDeltas(
1638
- historical,
1639
- configIdentityForRun(
1640
- a0.run,
1641
- a0.plan,
1642
- resolveJudge(a0.run.judge, a0.evalDef.judge, opts.config.judge),
1643
- ),
1644
- )
1645
- .filter((delta) => opts.accept!.includes(delta.selector));
1646
- if (crossed.length > 0) {
1647
- runtimeCarriedAcceptingByResult.set(r, crossed);
1648
- recordExperimentDiagnostic({
1649
- experimentId,
1650
- code: "accept",
1651
- level: "warning",
1652
- message: `Carried prior results across accepted differences: ${crossed.map((d) => d.selector).join(", ")}.`,
1653
- phase: "experiment.setup",
1654
- data: { selectors: crossed.map((d) => d.selector) },
1655
- dedupeKey: `accept:${crossed.map((d) => d.selector).join(",")}`,
1656
- });
1657
- }
1658
- }
1659
- lateCarriedResults.push(restampCarried(r));
1660
- if (r.verdict === "passed") {
1661
- passedKeys.add(attemptGroupKey(a0.run, evalId));
1662
- }
1663
- }
1664
- }
1665
- if (waitStartedAt === undefined) {
1666
- if (newlyCarried.length === 0) return; // 没有窗口要关、也没有迁移要报:一个事件都不发
1667
- // 没有等待窗口要关(接管 / 多开下的全新取锁)。真正携入的那几条此刻仍停在 queued
1668
- // (从没被标记过 elsewhere),必须先补一个瞬时的 "started",下面的 "resolved" 才能把
1669
- // 它们正确迁进 reused,否则会打破五项恒等式。**只报这几条**:没携入的兄弟从没离开
1670
- // queued,把它们也报一遍会在两条事件之间露出一帧「queued 被扣穿」的中间态——极端时序
1671
- // 下兄弟 attempt 可能已经在这次 await 期间进了 running,那一扣就是负数。
1672
- const startedAt = Date.now();
1673
- reportLockWait({
1674
- experimentId,
1675
- evalId,
1676
- status: "started",
1677
- ...(holder?.pid !== undefined ? { holderPid: holder.pid } : {}),
1678
- ...(holder?.host !== undefined ? { holderHost: holder.host } : {}),
1679
- attempts: newlyCarried.length,
1680
- });
1681
- reportLockWait({
1682
- experimentId,
1683
- evalId,
1684
- status: "resolved",
1685
- carried: newlyCarried.length,
1686
- dispatched: 0,
1687
- waitedMs: Date.now() - startedAt,
1688
- });
1689
- return;
1690
- }
1691
- // 真实挂起窗口收尾:carried + dispatched 恒等于 "started" 报进去的 attempts,这条
1692
- // 恒等式是 elsewhere 不挂账的唯一保证(reducer 只按事件携带的数字增减,不自己推)。
1693
- const carried = Math.min(newlyCarried.length, inElsewhere);
1694
- reportLockWait({
1695
- experimentId,
1696
- evalId,
1697
- status: "resolved",
1698
- carried,
1699
- dispatched: inElsewhere - carried,
1700
- waitedMs: Date.now() - waitStartedAt,
1701
- });
1702
- };
1703
-
1704
- /**
1705
- * 派发时刻的一次**非阻塞**试锁。非阻塞语义借 `acquireCaseLock` 的 `onWaitStart` 实现:确认
1706
- * 要等待的那一刻立刻自我中断,只保留「一次尝试」的部分——这样仍然复用它的心跳续租与强清
1707
- * 登记(lock.ts 的 held 表),而 `tryAcquireCaseLockOnce` 两件都不做。撞上过期锁属于「一次
1708
- * 尝试」内部的 rename 接管,照常返回 acquired。
1709
- */
1710
- const tryAcquireCase = (st: CaseLockState): Promise<CaseLockTry> => {
1711
- // 同组兄弟:自己已持有,直接放行。
1712
- if (st.claim) return Promise.resolve<CaseLockTry>({ kind: "acquired" });
1713
- // 已经有兄弟挂在窗口上:全体等同一个窗口,不重复试锁。
1714
- if (st.suspension) return Promise.resolve<CaseLockTry>({ kind: "busy", window: st.suspension });
1715
- if (st.trying) return st.trying;
1716
- const attempt = (async (): Promise<CaseLockTry> => {
1717
- const { experimentId, evalId } = st;
1718
- // 接管诊断要报"原持有者是谁",但 acquireCaseLock 只回传 takenOver 布尔值——取锁前先
1719
- // 无副作用地读一眼当前记录(纯尽力而为:极端时序下这份快照可能已经不是真正被接管的
1720
- // 那条记录,但诊断本来就是人读提示,不是判定依据)。
1721
- const priorHolder = await readCaseLock(niceevalRoot, experimentId, evalId).catch(() => undefined);
1722
- const giveUp = new AbortController();
1723
- let busyWith: CaseLockRecord | undefined;
1724
- try {
1725
- const { claim, takenOver } = await acquireCaseLock(niceevalRoot, experimentId, evalId, lockIdentity, {
1726
- signal: combinedSignal(giveUp.signal),
1727
- onWaitStart: (h) => {
1728
- busyWith = h;
1729
- giveUp.abort(); // 撞上新鲜锁 = 这次尝试到此为止,不进入 acquireCaseLock 自己的轮询
1730
- },
1731
- });
1732
- st.claim = claim;
1733
- if (takenOver) {
1734
- const message = t("runner.lockTakenOver", {
1735
- experimentId,
1736
- evalId,
1737
- pid: priorHolder?.pid ?? "?",
1738
- host: priorHolder?.host ?? "?",
1739
- }).trimEnd();
1740
- reportDiagnostic({
1741
- key: `lock-taken-over:${experimentId}|${evalId}`,
1742
- code: "lock-taken-over",
1743
- severity: "warning",
1744
- message,
1745
- data: { experimentId, evalId },
1746
- });
1747
- recordExperimentDiagnostic({
1748
- experimentId,
1749
- code: "lock-taken-over",
1750
- level: "warning",
1751
- message,
1752
- phase: "eval.run",
1753
- dedupeKey: `lock-taken-over:${experimentId}|${evalId}`,
1754
- data: { experimentId, evalId },
1755
- });
1756
- }
1757
- // 取到锁就重查携带,**无条件**。启动时算的静态规划有效期只到「这条用例真正派发」为止:
1758
- // 另一条 Invocation 完全可能在这中间把它整条跑完并释放锁,而我们随后干干净净地取到那把
1759
- // 空锁——既没等过也没接管过。任何「有没有碰上别人」的启发式在这条路径上都恒假:那类
1760
- // 判据全是「此刻碰上了对方」或「对方死了」的证据,观测不到「对方干净地来过又走了」,
1761
- // 于是先起跑的一侧全程零信号,第二波里被对方跑掉的每一条都会被重跑,是确定性的,不是
1762
- // 低概率时序(见 memory 的 multi-open-residual-window-closed-by-narrow-read)。
1763
- // 闭合性来自这条 happens-before 链:对方 result.json 落盘 → 对方
1764
- // 释放锁 → 我们取到锁 → 我们读盘,所以重查必须在取锁**之后**,顺序反了什么都不保证。
1765
- // 收窄读把这次重查压到 ~0.3 ms,单开也付得起。
1766
- await recheckCarry(st, undefined, priorHolder);
1767
- return { kind: "acquired" };
1768
- } catch (e) {
1769
- // 撞新鲜锁:就地开(或加入)挂起窗口,窗口对象随结论一起交给调用方。
1770
- if (busyWith) return { kind: "busy", window: suspendUntilCaseFree(st, busyWith) };
1771
- if (opts.signal?.aborted) return { kind: "aborted" };
1772
- throw e;
1773
- }
1774
- })();
1775
- st.trying = attempt;
1776
- return attempt.finally(() => {
1777
- st.trying = undefined;
1778
- });
1779
- };
1780
-
1781
- /**
1782
- * 撞新鲜锁后的挂起窗口:这一条用例转 `elsewhere`(不占全局并发位、不占实验闸名额),每个
1783
- * 心跳周期重读一次锁文件;锁消失(正常释放)或过期(可接管)即结束等待并重查携带。等待没有
1784
- * 超时——心跳新鲜就一直等,用户中断照常退出。同组兄弟共享同一个窗口。
1785
- */
1786
- const suspendUntilCaseFree = (st: CaseLockState, holder: CaseLockRecord): Promise<void> => {
1787
- if (st.suspension) return st.suspension;
1788
- const startedAt = Date.now();
1789
- // 等待期间本 eval / 本实验的止损闸落下 → 这一轮等待到头(对方可能还要跑很久,没必要陪着)。
1790
- // 窗口照常走完 recheckCarry 并发出 `lock_wait resolved`:少发一次 resolved,这批 attempt 就
1791
- // 永远挂在 elsewhere 上,五项恒等式当场破。
1792
- const waitSignal = haltAbortSignal(st.group[0]!);
1793
- // 窗口打开这一刻本组还没派发的 attempt 全在 queued(本进程没持锁 = 没有一条开跑),
1794
- // 整批迁进 elsewhere;记下条数,收尾的 resolved 原数迁回(见 CaseLockState.inElsewhere)。
1795
- st.inElsewhere = st.pending.size;
1796
- reportLockWait({
1797
- experimentId: st.experimentId,
1798
- evalId: st.evalId,
1799
- status: "started",
1800
- holderPid: holder.pid,
1801
- holderHost: holder.host,
1802
- attempts: st.inElsewhere,
1803
- });
1804
- const window = (async (): Promise<void> => {
1805
- for (;;) {
1806
- await delayOrAbort(CASE_LOCK_HEARTBEAT_INTERVAL_MS, waitSignal);
1807
- if (waitSignal.aborted || dispatchClosed) break;
1808
- const record = await readCaseLock(niceevalRoot, st.experimentId, st.evalId).catch(() => undefined);
1809
- if (record === undefined || isCaseLockStale(record, Date.now())) break;
1810
- }
1811
- await recheckCarry(st, startedAt, holder);
1812
- })();
1813
- st.suspension = window.finally(() => {
1814
- st.suspension = undefined;
1815
- });
1816
- return st.suspension;
1817
- };
1818
-
1819
- /** 用例全部 attempt(不论真实派发还是被重查携带命中而跳过)都 settle 后删锁;与
1820
- * ExperimentLifecycle.pendingAttempts 清空触发 teardown 同一种「逐 attempt 身份结算」模式。 */
1821
- const releaseCaseLockIfDone = async (st: CaseLockState, attempt: number): Promise<void> => {
1822
- st.pending.delete(attempt);
1823
- if (st.pending.size > 0) return;
1824
- const claim = st.claim;
1825
- st.claim = undefined;
1826
- if (claim) await claim.release().catch(() => {});
1827
- };
1828
-
1829
- /**
1830
- * 实验闸的取位:声明了 `maxConcurrency` 的实验从**跨 Invocation 共用**的逐槽租约取名额
1831
- * (gate-lease.ts);未声明的实验不走租约、不产生任何跨进程协调。取位在全局位之前——等名额
1832
- * 的 attempt 不占别的实验的并发位。返回 undefined 表示等待期间被中断,这条 attempt 就此放弃。
1833
- */
1834
- /**
1835
- * 撞满实验闸名额时报一条 warning:名额域跨 Invocation,所以「等」的对象是别的进程,用户无从
1836
- * 从本进程的面板推断。生效名额与本次声明分开报——两者不等就是 min-N 夹低了(别的运行声明了
1837
- * 更小的 maxConcurrency),这是「我明明写了 3 却只跑 1 条」的唯一解释,不说清就只能去翻锁目录。
1838
- * 按实验折叠:同一实验的一堆 attempt 会前后脚撞上同一批持有者,不该刷屏。
1839
- */
1840
- const reportGateLeaseWait = (
1841
- experimentId: string,
1842
- declaredN: number,
1843
- holders: readonly GateLeaseRecord[],
1844
- ): void => {
1845
- const effectiveN = holders.reduce((n, h) => Math.min(n, h.declaredN), declaredN);
1846
- const who = [...new Set(holders.map((h) => `pid ${h.pid}@${h.host}`))].join(", ") || "another run";
1847
- reportDiagnostic({
1848
- key: `gate-lease-waiting:${experimentId}`,
1849
- code: "gate-lease-waiting",
1850
- severity: "warning",
1851
- message: t("runner.gateLeaseWaiting", { experimentId, effectiveN, declaredN, holders: who }).trimEnd(),
1852
- data: { experimentId, effectiveN, declaredN },
1853
- });
1854
- };
1855
-
1856
- const acquireGateLease = async (
1857
- experimentId: string,
1858
- maxConcurrency: number,
1859
- fiberSignal: AbortSignal,
1860
- haltSignal: AbortSignal,
1861
- ): Promise<GateLeaseClaim | undefined> => {
1862
- // 等名额期间止损闸落下 → 立刻放弃取位(不占别人还在用的名额、也不干等一个不会派发的位子);
1863
- // 与用户中断走同一条 AbortSignal 通路,调用方按 undefined 分辨「没取到」的两种成因。
1864
- const signal = AbortSignal.any([combinedSignal(fiberSignal), haltSignal]);
1865
- try {
1866
- const { claim, takenOver, takenOverFrom } = await acquireGateSlot(
1867
- niceevalRoot,
1868
- experimentId,
1869
- maxConcurrency,
1870
- lockIdentity,
1871
- {
1872
- signal,
1873
- // 撞满名额只发生在「别的 Invocation 正占着这个实验的位子」——本进程自己的并发早被
1874
- // gateLocalSems 挡在这一层之前了。不报的话面板就只剩 `0 running · N queued` 干等,
1875
- // 看不出在等什么、等谁,也看不出生效名额被对方更小的声明夹低了(min-N)。
1876
- onWaitStart: (holders) => reportGateLeaseWait(experimentId, maxConcurrency, holders),
1877
- },
1878
- );
1879
- if (takenOver) {
1880
- const message = t("runner.gateLeaseTakenOver", {
1881
- experimentId,
1882
- slot: claim.slot,
1883
- pid: takenOverFrom?.pid ?? "?",
1884
- host: takenOverFrom?.host ?? "?",
1885
- }).trimEnd();
1886
- const dedupeKey = `gate-lease-taken-over:${experimentId}`;
1887
- reportDiagnostic({ key: dedupeKey, code: "gate-lease-taken-over", severity: "warning", message, data: { experimentId } });
1888
- recordExperimentDiagnostic({
1889
- experimentId,
1890
- code: "gate-lease-taken-over",
1891
- level: "warning",
1892
- message,
1893
- phase: "eval.run",
1894
- dedupeKey,
1895
- data: { experimentId, slot: claim.slot },
1896
- });
1897
- }
1898
- return claim;
1899
- } catch (e) {
1900
- if (signal.aborted) return undefined; // 等名额期间被中断:立刻退出,不留悬挂
1901
- throw e;
1902
- }
1903
- };
1904
-
1905
- /** 派发链一轮的结局:`done` = 这条 attempt 已经了结(跑完 / 被跳过 / 携入 / 中断),
1906
- * `suspend` = 撞上别人持有的用例锁,许可全部归还、挂进 `window` 这个 elsewhere 窗口后重来,
1907
- * `recheck` = 许可获取被止损闸打断,许可全部归还、回到许可链 ① 重新过闸(记账在那里做)。
1908
- * `recheck` 只在闸已经落下时产生,循环顶因此必然收束,不会空转。 */
1909
- type DispatchOutcome =
1910
- | { kind: "done" }
1911
- | { kind: "suspend"; window: Promise<void> }
1912
- | { kind: "recheck" };
1913
-
1914
- /** 全局并发位的显式持有句柄:`withPermits` 的作用域语义没法表达「中途让位、回来再拿」,
1915
- * 而实验级 setup 与 turn 退避都要求让位(docs/runner.md「调度:有界并发」)。两个成员都
1916
- * 幂等——让位后收尾 finalizer 不会重复归还,回来之后中断也只归还一次。 */
1917
- interface GlobalSlotHold {
1918
- readonly release: Effect.Effect<void>;
1919
- readonly reacquire: Effect.Effect<void>;
1920
- }
1921
-
1922
- const withGlobalSlot = <R>(
1923
- haltSignal: Effect.Effect<void>,
1924
- use: (slot: GlobalSlotHold) => Effect.Effect<DispatchOutcome, never, R>,
1925
- ): Effect.Effect<DispatchOutcome, never, R> =>
1926
- Effect.uninterruptibleMask((restore) => {
1927
- const state = { held: false };
1928
- const release = Effect.suspend(() =>
1929
- state.held
1930
- ? globalSem.release(1).pipe(
1931
- Effect.map(() => {
1932
- state.held = false;
1933
- }),
1934
- )
1935
- : Effect.void,
1936
- );
1937
- const reacquire = Effect.suspend(() =>
1938
- state.held
1939
- ? Effect.void
1940
- : globalSem.take(1).pipe(
1941
- Effect.map(() => {
1942
- state.held = true;
1943
- }),
1944
- ),
1945
- );
1946
- // 取位本身可中断(restore):Ctrl+C 不该被「等一个全局位」拖住;拿到之后的执行体同样
1947
- // 可中断,只有归还挂在 ensuring 上,中断路径照样跑。
1948
- //
1949
- // 排队等位期间止损闸落下 → 竞速的 haltSignal 先到,这一轮不进场(交回 recheck,由许可链
1950
- // ① 做未派发记账)。这是「等待集中同闸 attempt 经 interruption 中止」在 Effect 世界的落点;
1951
- // 竞速只覆盖「还在等位」这一段——拿到位子那一刻竞速已结算,之后的执行体不再被抢占。
1952
- // `ensuring(release)` 提到最外层(而不是只挂在拿到位子之后):极端时序下 take 已经成功、
1953
- // 竞速却判 haltSignal 赢,位子照样归还,不泄漏一个全局名额。
1954
- return Effect.raceFirst(restore(reacquire).pipe(Effect.as(true)), restore(haltSignal).pipe(Effect.as(false)))
1955
- .pipe(
1956
- Effect.flatMap((entered) =>
1957
- entered
1958
- ? restore(use({ release, reacquire }))
1959
- : Effect.succeed<DispatchOutcome>({ kind: "recheck" }),
1960
- ),
1961
- Effect.ensuring(release),
1962
- );
1963
- });
1964
-
1965
- /**
1966
- * 实验闸(② 道许可)的持有作用域:名额与 attempt **同生命周期**——从这里持有到执行体收尾
1967
- * (teardown 链、沙箱销毁)之后才归还,turn 退避等内部等待一律不释放
1968
- * (docs/runner.md「调度:有界并发」)。撞用例锁挂起是唯一的例外:那时执行体以 `suspend`
1969
- * 正常返回,作用域退出、名额归还,挂起结束后重新取——挂起的用例不占名额,否则同实验的
1970
- * 持锁方(可能就在另一条 Invocation 里)会被自己的等待方饿死。
1971
- */
1972
- const withExperimentGate = <R>(
1973
- a: Attempt,
1974
- use: Effect.Effect<DispatchOutcome, never, R>,
1975
- ): Effect.Effect<DispatchOutcome, never, R> => {
1976
- const { maxConcurrency, experimentId } = a.run;
1977
- const localSem = gateLocalSems.get(a.run);
1978
- if (maxConcurrency === undefined || localSem === undefined) return use;
1979
- if (experimentId === undefined) return localSem.withPermits(1)(use);
1980
- const haltSignal = haltAbortSignal(a);
1981
- const leased = Effect.uninterruptibleMask((restore) =>
1982
- restore(Effect.promise((sig) => acquireGateLease(experimentId, maxConcurrency, sig, haltSignal))).pipe(
1983
- Effect.flatMap((claim) =>
1984
- claim === undefined
1985
- ? // 没取到名额有两种成因:用户中断(就此了结)与止损闸落下(回到许可链 ① 记账)。
1986
- Effect.succeed<DispatchOutcome>(
1987
- checkDispatchHalt(a).halted ? { kind: "recheck" } : { kind: "done" },
1988
- )
1989
- : restore(use).pipe(
1990
- Effect.ensuring(Effect.promise(() => claim.release().catch(() => {}))),
1991
- ),
1992
- ),
1993
- ),
1994
- );
1995
- return localSem.withPermits(1)(leased);
1996
- };
1997
-
1998
- // earlyExit:为每个 key 各建一个 AbortController。某 attempt 通过或 errored 时 abort 它,
1999
- // 让并发进行中的同 key attempt 通过 signal 尽早退出,而不只是等排队的才能被跳过。
2000
- const evalAbortControllers = new Map<string, AbortController>();
2001
- for (const a of attempts) {
2002
- if (a.run.earlyExit && !evalAbortControllers.has(a.key)) {
2003
- evalAbortControllers.set(a.key, new AbortController());
2004
- }
2005
- }
2006
-
2007
- // 有界并发调度:forEach 本身 unbounded(每个 attempt 立刻有自己的 fiber),真正的
2008
- // 并发上限由上面那条许可链把守——执行体依次过止损闸、实验闸(若有)、全局 permit、
2009
- // 派发时刻试锁才开跑。获取定序恒为 实验闸 → globalSem → 用例锁,无环等待;实验闸的
2010
- // 持有者在等全局 permit 时不占别的实验的并发位(并发位就是 globalSem 的 permit,
2011
- // 不再是 forEach 的 fiber 槽)。
2012
- // runAttemptEffect 只把「执行错误」收进 EvalResult.error(不 fail),
2013
- // 但中断(Ctrl+C / kill)照常向上传播 —— 所以一条挂掉不会中断其它 attempt,而中断能停掉全部。
2014
- //
2015
- // signal:把 opts.signal 喂给 run → abort 触发根 fiber 中断 → forEach 中断所有子 fiber
2016
- // → 每个 attempt 的 Sample 跑 release(sb.stop)→ 容器全部停掉(治孤儿)。Effect 保证
2017
- // 所有 finalizer 跑完后才结算,所以下面 summarize 时容器已清理干净。
2018
- //
2019
- // 用 runPromiseExit 而非 runPromise:{ signal } 触发的中断会让整个 Exit 标记为 interrupted,
2020
- // 即便内层 catchAllCause 已把中断咽下 —— runPromise 这种情况下会直接 reject,把 Ctrl+C 变成
2021
- // 一条「niceeval 出错」崩溃栈、并跳过下面的部分汇总。runPromiseExit 返回 Exit 不抛,我们据此
2022
- // 把「中断/signal 已 abort」当正常的部分结果收尾,只有真·非中断缺陷才上抛。
2023
- let interrupted = false;
2024
- const exit = await Effect.runPromiseExit(
2025
- Effect.scoped(Effect.forEach(
2026
- attempts,
2027
- (a) => {
2028
- const budgetKey = a.run.experimentId ?? a.run.agent.name;
2029
- const caseState = caseStateOf(a);
2030
-
2031
- // preflight:「要不要开始跑」的许可判断(首过即停 + budget 上限检查)。两类判断都是
2032
- // 即时返回、不做任何等待,所以放在授位之后没有「占着全局并发槽位干等」的问题;放在
2033
- // 派发时刻(而不是排队时刻)判,读到的是这一刻最新的通过集与已花费。
2034
- const preflight = Effect.gen(function* () {
2035
- // 首过即停:只由 passed 触发(errored 不中止其余样本,见 docs/feature/experiments/
2036
- // architecture.md「调度接口」)。
2037
- if (a.run.earlyExit && passedKeys.has(a.key)) {
2038
- cancelReuseAttempt(a);
2039
- yield* reportMutex.withPermits(1)(
2040
- Effect.promise(() =>
2041
- emitReporterEvent(reporters, {
2042
- type: "invocation:earlyExit",
2043
- evalId: a.evalDef.id,
2044
- experimentId: a.run.experimentId,
2045
- }),
2046
- ),
2047
- );
2048
- reportAttemptLifecycle({
2049
- type: "attempt:early-exit",
2050
- at: Date.now(),
2051
- identity: feedbackIdentity(a),
2052
- who: feedbackWho(a),
2053
- });
2054
- return false;
2055
- }
2056
-
2057
- // run 级 fail-fast:确定性错误(同一 code 在同一 key 连续复现)已识别 → 停止派发,
2058
- // 未派发计入 unstarted(结论落 incomplete,不伪装成全绿;与首过即停互不混用)。
2059
- const failFast = failFastKeys.get(a.key);
2060
- if (failFast !== undefined) {
2061
- cancelReuseAttempt(a);
2062
- failFast.skipped += 1;
2063
- reportAttemptLifecycle({
2064
- type: "attempt:early-exit",
2065
- at: Date.now(),
2066
- identity: feedbackIdentity(a),
2067
- who: feedbackWho(a),
2068
- });
2069
- reportDiagnostic({
2070
- key: `fail-fast:${a.key}`,
2071
- code: "fail-fast",
2072
- severity: "warning",
2073
- message: t("runner.failFast", { evalId: a.evalDef.id, code: failFast.code }).trimEnd(),
2074
- identity: feedbackIdentity(a),
2075
- data: { evalId: a.evalDef.id, code: failFast.code, ...(a.run.experimentId ? { experimentId: a.run.experimentId } : {}) },
2076
- });
2077
- return false;
2078
- }
2079
-
2080
- const budget = a.run.budget;
2081
- if (budget !== undefined) {
2082
- // 只看已完成 attempt 的实测花费(见上方 BudgetState 注释),到顶就跳过新 attempt,
2083
- // 没到顶就立即放行——不等待、不做预测性节流。
2084
- const s = budgetState(budgetKey);
2085
- if (s.spent >= budget) {
2086
- cancelReuseAttempt(a);
2087
- if (!budgetReported.has(budgetKey)) {
2088
- budgetReported.add(budgetKey);
2089
- yield* reportMutex.withPermits(1)(
2090
- Effect.promise(() =>
2091
- emitReporterEvent(reporters, { type: "invocation:budgetExceeded", budget, spent: s.spent }),
2092
- ),
2093
- );
2094
- }
2095
- // 反馈层:对每一个因预算到顶而不派发的 attempt 各发一次(与上面的
2096
- // attempt:early-exit 同构),让 RunFeedbackState 的 queued/completed 计数与
2097
- // cli.ts 的 assembleRunCompletion() 都能感知到「有 attempt 因预算未派发」——
2098
- // 上面 emitReporterEvent 的 invocation:budgetExceeded 只对旧版 Reporter 接口每
2099
- // budgetKey 报一次,不满足反馈层「每个未派发 attempt 各一条」的计数契约,两者
2100
- // 独立并存。只在挂靠 experiment 时报(budget-exhausted 事件要求真实
2101
- // experimentId;裸 run 不产出这类永久事件,与 locator 的省略规则一致)。
2102
- if (a.run.experimentId) {
2103
- s.unstartedCount += 1;
2104
- reportBudgetExhausted({
2105
- experimentId: a.run.experimentId,
2106
- spent: s.spent,
2107
- unstarted: s.unstartedCount,
2108
- });
2109
- }
2110
- return false;
2111
- }
2112
- }
2113
- return true;
2114
- });
2115
-
2116
- // body:许可链全部通过之后才跑,真正的执行段。
2117
- const body = (slot: GlobalSlotHold) =>
2118
- Effect.gen(function* () {
2119
- // 合并全局信号与本 eval 的首过即停信号:任一 abort → 本 attempt 的信号 abort。
2120
- const evalAc = evalAbortControllers.get(a.key);
2121
- const attemptSignal =
2122
- evalAc && opts.signal
2123
- ? AbortSignal.any([opts.signal, evalAc.signal])
2124
- : (evalAc?.signal ?? opts.signal);
2125
- // BuildKey / CaseKey 已在 Attempt.plan 的 physical completion state 中确定;
2126
- // 这里只把协调器执行结果作为必填运行输入传给 materializer,不回写 Attempt。
2127
- const buildLocators = buildLocatorsByPair.get(cacheKey(a.run, a.evalDef.id)) ?? new Map<BuildKey, JsonValue>();
2128
-
2129
- // turn 级重试退避期间释放/收回的并发槽位——两级闸按持有期分工的单点契约见
2130
- // docs/runner.md「调度:有界并发」与 docs/feature/error-classification/
2131
- // architecture.md「退避与槽位」:这里只释放/收回全局并发位(globalSem),它管
2132
- // 吞吐,内部等待一律让位。实验闸管正确性,名额与 attempt 同生命周期、退避这类
2133
- // 内部等待不释放——继续由外层的租约(或裸 run 的回退信号量)全程持有,这个槽位
2134
- // 对象因此不接触实验闸,否则同实验的下一个 attempt 会趁退避窗口提前进场,击穿
2135
- // maxConcurrency: 1 的串行契约(bug 台账见
2136
- // memory/turn-retry-backoff-releases-experiment-serial-lock.md)。
2137
- // 走 slot 的显式持有对象(而不是直接 take/release 信号量):让「谁此刻还握着位子」
2138
- // 只有一份真相,退避期间被中断时收尾 finalizer 才不会重复归还一个已经让出的位。
2139
- const concurrencySlot: ConcurrencySlot = {
2140
- release: async () => {
2141
- await Effect.runPromise(slot.release);
2142
- },
2143
- reacquire: async () => {
2144
- await Effect.runPromise(slot.reacquire);
2145
- },
2146
- };
2147
-
2148
- yield* reportMutex.withPermits(1)(
2149
- Effect.promise(() =>
2150
- emitReporterEvent(reporters, {
2151
- type: "eval:start",
2152
- eval: { id: a.evalDef.id },
2153
- agent: a.run.agent,
2154
- model: a.run.model,
2155
- attempt: a.attempt,
2156
- experimentId: a.run.experimentId,
2157
- }),
2158
- ),
2159
- );
2160
- // attempt:start 是这个 attempt 从 queued 移进 running 的唯一时刻(见
2161
- // src/runner/feedback/reducer.ts 的 attempt:start 分支),必须与 eval:start 同一
2162
- // 调用点、恰好发生一次 —— 否则 RunFeedbackState 的守恒计数会被破坏。phase 只是粗粒度
2163
- // 占位(sandbox 型 attempt 恒为 sandbox.queue,一定正确;非 sandbox 型给
2164
- // eval.run,attempt.ts 内部一旦跑到第一个真实边界会用 attempt:phase 立即纠正,见
2165
- // attempt.ts 的 enterPhase)——attempt.ts 自己不再发 attempt:start,只发
2166
- // attempt:phase,避免两处各发一次导致计数翻倍。
2167
- const initialPhase: LifecyclePhase = a.run.agent.kind === "sandbox" ? "sandbox.queue" : "eval.run";
2168
- reportAttemptLifecycle({
2169
- type: "attempt:start",
2170
- at: Date.now(),
2171
- identity: feedbackIdentity(a),
2172
- who: feedbackWho(a),
2173
- phase: initialPhase,
2174
- });
2175
- // 派发前的确定性失败(实验级 setup 失败 / 判分预检失败):不派发 agent、不建沙箱,
2176
- // 为这条 attempt 合成结构化 errored 结果,走与真实结果完全相同的下游路径
2177
- // (locator / 反馈事件 / reporter / 落盘)——环境起不来、判分端点不通都是每条 eval
2178
- // 都没跑成的事实,要逐条进报告,不是一条一次性日志(见 docs/feature/experiments/
2179
- // architecture.md「实验级生命周期」、docs/feature/judge/library.md「派发前预检」)。
2180
- const expLc = expLifecycles.get(a.run);
2181
- const setupFailure = expLc === undefined
2182
- ? Option.none<AttemptError>()
2183
- : (() => {
2184
- const outcome = setupOutcomeOf(expLc.state);
2185
- return outcome._tag === "Failed" ? Option.some(outcome.error) : Option.none<AttemptError>();
2186
- })();
2187
- const precheckFailure = judgePrecheckFailures.get(cacheKey(a.run, a.evalDef.id));
2188
- const buildFailure = buildFailureByPair.get(cacheKey(a.run, a.evalDef.id));
2189
- const blockedError: AttemptError | undefined = Option.isSome(setupFailure)
2190
- ? setupFailure.value
2191
- : precheckFailure !== undefined
2192
- ? { code: "judge-precheck-failed", message: precheckFailure, origin: attemptOrigin("judge.precheck") }
2193
- : buildFailure !== undefined
2194
- ? buildFailure
2195
- : undefined;
2196
- if (blockedError !== undefined) cancelReuseAttempt(a, true);
2197
- const poolSelection: ReusePoolSelection = blockedError === undefined
2198
- ? yield* reusePoolFor(a)
2199
- : { _tag: "Fresh" };
2200
- // 复用池的租借失败(实例创建、SandboxLayer setup 钩子、寿命确认都在池内)是**这条
2201
- // attempt 的终局失败**,不是调度缺陷:失败原样交回这里,先读空间轴回执(作者在
2202
- // setup 钩子里抛的 ExperimentFatalError 由此落闸),再折成 errored 结果走与
2203
- // blockedError 完全相同的下游路径。
2204
- // 拒绝不能直接穿过 Effect.promise:那会变成 defect 打断 forEach,连坐同批其它实验,
2205
- // 且混进兄弟 fiber 的 interrupt 后被当成用户中断吞掉正文(见
2206
- // docs/feature/error-classification/architecture.md「Effect 边界」:attempt fiber 的
2207
- // E 恒为 never;memory/experiment-fatal-presented-as-user-interrupt.md)。
2208
- const result = yield* Effect.scoped(Effect.gen(function* () {
2209
- const leased = poolSelection._tag === "Reuse"
2210
- ? Either.match(yield* Effect.either(poolSelection.pool.acquire(
2211
- resolveAttemptTimeout(a.run, a.evalDef, opts.config)?.timeoutMs,
2212
- buildLocators,
2213
- )), {
2214
- onLeft: (error) => ({ _tag: "Failed" as const, error }),
2215
- onRight: (lease) => {
2216
- acquiredReuseAttempts.add(a);
2217
- return { _tag: "Acquired" as const, lease };
2218
- },
2219
- })
2220
- : { _tag: "NotRequested" as const };
2221
- const lease = leased._tag === "Acquired" ? leased.lease : undefined;
2222
- // 租借失败归 `sandbox.create` 阶段:池把「创建实例 + 跑 SandboxLayer setup + 确认寿命」
2223
- // 打包成一次借出,调度器这一侧只知道这条 attempt 没能拿到可用实例。
2224
- const leaseError: AttemptError | undefined =
2225
- leased._tag === "Failed" ? errorFromThrown(leased.error, "sandbox.create") : undefined;
2226
- if (leased._tag === "Failed") {
2227
- cancelReuseAttempt(a, true);
2228
- const declaration = attemptFailureDeclaration(a.run.classifyFailure, "sandbox.create", leased.error);
2229
- if (declaration) closeHaltGate(a, declaration);
2230
- }
2231
- const failedBeforeDispatch = blockedError ?? leaseError;
2232
- const evaluated = failedBeforeDispatch
2233
- ? ({
2234
- id: a.evalDef.id,
2235
- description: a.evalDef.description,
2236
- experimentId: a.run.experimentId,
2237
- experiment: experimentRunInfo(
2238
- a.run,
2239
- a.plan,
2240
- a.sandboxPlansByEval,
2241
- opts.config,
2242
- a.evalDef.judge,
2243
- ),
2244
- agent: a.run.agent.name,
2245
- model: a.run.model,
2246
- verdict: "errored",
2247
- fingerprint: a.fingerprint,
2248
- attempt: a.attempt,
2249
- startedAt: new Date().toISOString(),
2250
- durationMs: 0,
2251
- assertions: [],
2252
- evidenceCoverage: a.run.agent.evidenceCoverage,
2253
- error: failedBeforeDispatch,
2254
- } satisfies EvalResult)
2255
- : yield* runAttemptEffect(
2256
- a,
2257
- attemptOptions,
2258
- sandboxSem,
2259
- {
2260
- buildLocators,
2261
- runTiming,
2262
- parentSignal: attemptSignal,
2263
- concurrencySlot,
2264
- ...(lease
2265
- ? {
2266
- reusedSandbox: {
2267
- sandbox: lease.sandbox,
2268
- reuseSandbox: lease.reuseSandbox,
2269
- reuseOrdinal: lease.reuseOrdinal,
2270
- },
2271
- }
2272
- : {}),
2273
- // 止损闸的消费点:attempt 封口读终局失败的空间轴。scope 经这条**封口回执**
2274
- // 到达调度器,不走错误通道向上传播——attempt fiber 的 E 保持 never,`errored`
2275
- // 仍是 eval runner 的合法结果而不是调度失败(architecture.md「Effect 边界」)。
2276
- onFailureClass: (declaration) => closeHaltGate(a, declaration),
2277
- },
2278
- );
2279
- if (lease) {
2280
- // Attempt 的 Eval/Agent 收尾已在 runAttemptEffect 内完成;reset 失败会淘汰实例,
2281
- // 本条结果如实保留,后续派发创建替代实例。
2282
- const mustRetire = reuseResultRequiresRetirement(evaluated);
2283
- yield* lease.commit(mustRetire ? { _tag: "Retire" } : { _tag: "Reset" });
2284
- }
2285
- return evaluated;
2286
- }));
2287
- // locator 在这里确定 —— 早于本 attempt 触发的任何 reporter 回调 / 事件
2288
- // (onEvalComplete、eval:complete),所以每一个观察者看到的都已经是最终值,
2289
- // 和落盘 result.json 完全一致(writer.ts 的 entry.locator ?? 兜底分支因此
2290
- // 对 niceeval 自己的运行永不触发,只服务第三方直调 RunWriter 的场景)。
2291
- // 没有 experimentId 的裸 run(非 exp 命令)不产出 locator,与
2292
- // writer.writeAttemptFor() 要求 experimentId 的既有约束一致 ——
2293
- // encodeAttemptLocator 本身也会在 experimentId 为空时直接抛错。
2294
- // 单独存一份本地变量(而不是只写 result.locator 再读回来):下面报 "failure" 永久
2295
- // 事件时需要一个已知是 AttemptLocator 品牌类型的值,result.locator 字段本身是
2296
- // 落盘/reporter 契约用的裸 string(见 EvalResult.locator 的类型注释)。
2297
- // locator 在 attempt plan 构造时已算好(见 attempts 构建处);这里只把同一个值写进
2298
- // 结果,早于本 attempt 触发的任何 reporter 回调 / 事件。
2299
- const locator: AttemptLocator | undefined = a.locator;
2300
- if (locator) result.locator = locator;
2301
- // attempt:complete 与上面的 attempt:start 严格一一配对(同一个 body Effect,唯一
2302
- // 出口),覆盖每一个真正跑过 runAttemptEffect 的 attempt(包括之后被下面的并发去重
2303
- // 分支丢弃、不计入 results 的那些)——reducer 的 attempt:complete 无条件
2304
- // running-1/completed+1,少配对一次就会让 running 计数漂移。
2305
- reportAttemptLifecycle({
2306
- type: "attempt:complete",
2307
- at: Date.now(),
2308
- identity: feedbackIdentity(a),
2309
- who: feedbackWho(a),
2310
- verdict: result.verdict,
2311
- tokenCount: result.usage
2312
- ? (result.usage.inputTokens ?? 0) + (result.usage.outputTokens ?? 0)
2313
- : undefined,
2314
- estimatedCostUSD: result.estimatedCostUSD,
2315
- });
2316
- if (a.run.budget !== undefined) {
2317
- const s = budgetState(budgetKey);
2318
- if (result.estimatedCostUSD !== undefined) {
2319
- s.spent += result.estimatedCostUSD;
2320
- } else if (result.phases?.some((phase) => phase.children?.some((child) => child.key === "agent.turn"))) {
2321
- s.completedAgentRunsNoCost += 1;
2322
- if (s.spent === 0 && s.completedAgentRunsNoCost >= 3 && !s.unenforceableWarned) {
2323
- // 连续几次真正跑过 agent 的 attempt 都拿不到成本:budget 对这个 agent
2324
- // 不可执行,说清楚一次。sandbox.create/setup 等前置失败没有 turn,跳过这里:
2325
- // 此时应由 attempt error 回答根因,不能再用计费 warning 抢走注意力。
2326
- // s.unenforceableWarned 已经是 per-budgetKey 的一次性闸门;稳定 key 上的
2327
- // reportDiagnostic 去重是双保险,不依赖它单独生效。
2328
- s.unenforceableWarned = true;
2329
- {
2330
- const message = t("runner.budgetUnenforceable", { budgetKey }).trimEnd();
2331
- reportDiagnostic({ key: `budget-unenforceable:${budgetKey}`, code: "budget-unenforceable", severity: "warning", message, data: { budgetKey } });
2332
- recordExperimentDiagnostic({
2333
- experimentId: a.run.experimentId,
2334
- code: "budget-unenforceable",
2335
- level: "warning",
2336
- message,
2337
- phase: "eval.run",
2338
- data: { budgetKey },
2339
- });
2340
- }
2341
- }
2342
- }
2343
- }
2344
-
2345
- if (result.verdict === "passed") {
2346
- passedKeys.add(a.key);
2347
- lastErrorCode.delete(a.key);
2348
- evalAc?.abort(); // 让同 key 并发 attempt 尽早退出
2349
- } else if (a.run.earlyExit && passedKeys.has(a.key)) {
2350
- // 并发情况:同 key 另一个 attempt 已通过后本 attempt 才完成(被 abort 后产出
2351
- // errored),不计入结果。
2352
- return;
2353
- } else if (result.verdict === "errored" && !blockedError) {
2354
- // errored 不中止其余样本(基建可能自愈);只有同一错误 code 连续复现才判定为
2355
- // 确定性错误,进 run 级 fail-fast 停止派发(不 abort 已在飞的 attempt)。
2356
- // 派发前确定性失败(实验级 setup 失败、判分预检失败)的合成结果不进 fail-fast:
2357
- // 它不派发 agent、零成本,契约是受影响的「所有」attempt 逐条记 errored 进报告,
2358
- // 不该被止损机制截短。
2359
- const code = result.error?.code ?? "unexpected-error";
2360
- const prev = lastErrorCode.get(a.key);
2361
- const streak = prev?.code === code ? prev.streak + 1 : 1;
2362
- lastErrorCode.set(a.key, { code, streak });
2363
- if (streak >= 2 && !failFastKeys.has(a.key)) {
2364
- failFastKeys.set(a.key, { code, skipped: 0 });
2365
- }
2366
- } else {
2367
- lastErrorCode.delete(a.key);
2368
- }
2369
-
2370
- results.push(result);
2371
- // 反馈层的永久失败通知(见 sink.ts 的 FailureInput / docs/feature/experiments/
2372
- // cli.md「什么动态更新,什么逐条追加」表的「failed / errored + locator」行)——
2373
- // 只在拿到 locator 时报(裸 run 没有 locator,不产出这类事件,与上面 result.locator
2374
- // 的省略规则一致),且只报真正计入 results 的 attempt(上面的并发去重分支已经
2375
- // return 掉、不会走到这里,不会为一条被丢弃的重复 attempt 误报失败)。
2376
- if (locator) {
2377
- const failure = failureDetailFromResult(result);
2378
- if (failure) reportFailure(failure);
2379
- }
2380
- yield* reportMutex.withPermits(1)(
2381
- // 每个 reporter 单独兜错:一个写文件失败 / 自定义 reporter 抛错只记 diagnostic,
2382
- // 不让 Promise.all 整体 reject —— 否则 Effect.promise 把它当 defect,fail 掉 forEach、
2383
- // 停掉后续 attempt(P2)。
2384
- Effect.promise(() =>
2385
- Promise.all(
2386
- reporters.map((reg) =>
2387
- runReporter(reg, "onEvalComplete", () => reg.reporter.onEvalComplete?.(result)),
2388
- ),
2389
- ),
2390
- ),
2391
- );
2392
- // 和上面的 onEvalComplete 同一把 reportMutex:两条回调路径都要串行化,否则并发
2393
- // attempt 各自触发的 eval:complete 会绕开 permit=1 直接并发跑,和文档承诺的
2394
- // 「报告回调串行化」不一致。
2395
- yield* reportMutex.withPermits(1)(
2396
- Effect.promise(() => emitReporterEvent(reporters, { type: "eval:complete", result })),
2397
- );
2398
- });
2399
- // ③ 全局并发位 → ④ 派发时刻试锁 → preflight → 实验级 setup → body。
2400
- // 独占串行 provider(如 local):同一 provider 名的所有 attempt 共享一把 permit=1 的锁,
2401
- // 包在全局位之外(见上面 exclusiveSemFor 的注释)。
2402
- const exclusiveSem = exclusiveSemFor(a.plan);
2403
- const dispatch = withGlobalSlot(haltAwait(a), (slot) =>
2404
- Effect.gen(function* () {
2405
- // 拿到位子的这一刻再问一次闸:排在独占 provider 锁 / 实验闸本地信号量上的那段等待
2406
- // 不在上面的竞速覆盖范围里(竞速只包全局位),闸可能正是在那段时间落下的。
2407
- if (checkDispatchHalt(a).halted) return { kind: "recheck" } as const;
2408
- // 派发时刻取锁:授位之后才试,非阻塞。撞上别人持有的新鲜锁就把这个位子连同实验闸
2409
- // 名额一起还回去(返回 "suspend"),由外层转入 elsewhere 挂起;位子当场空出来,
2410
- // 排队中的下一条没被锁的用例接手。
2411
- if (caseState) {
2412
- const outcome = yield* Effect.promise(() => tryAcquireCase(caseState));
2413
- if (outcome.kind === "aborted") return { kind: "done" } as const;
2414
- if (outcome.kind === "busy") return { kind: "suspend", window: outcome.window } as const;
2415
- // 取锁时顺带重查过携带(接管 / 多开)且这个序号已经被对方跑完:不重复派发。
2416
- if (caseState.carried.has(a.attempt)) return { kind: "done" } as const;
2417
- }
2418
- const proceed = yield* preflight;
2419
- if (!proceed) return { kind: "done" } as const;
2420
- authorizedReuseAttempts.add(a);
2421
- if (a.run.setup || a.run.teardown) {
2422
- // 实验级 setup:第一个通过派发许可的 attempt 真正执行,其余等同一个 memoized
2423
- // promise(它从不 reject——失败收进 lc.setupFailed,由 body 合成 errored 结果)。
2424
- // 等它的时候让出全局并发位(docs/runner.md「调度:有界并发」——内部等待一律让位,
2425
- // 慢启动的 setup 不许饿死同批其它实验),回来再重新拿位。实验闸名额不让。
2426
- yield* slot.release;
2427
- yield* Effect.promise(() => ensureExperimentSetup(a));
2428
- yield* slot.reacquire;
2429
- }
2430
- yield* body(slot);
2431
- return { kind: "done" } as const;
2432
- }),
2433
- );
2434
- const guarded = exclusiveSem ? exclusiveSem.withPermits(1)(dispatch) : dispatch;
2435
-
2436
- // 许可链的循环外壳:撞锁挂起的用例解决后从 ① 重新走一遍(实验闸名额与全局位都要
2437
- // 重新取,不能拿着别人在等的名额干等),携入的直接收工。
2438
- const pipeline = Effect.gen(function* () {
2439
- // ⓪ 逐 BuildKey 放行:只等本 eval 引用的那几个 key,不引用任何 key 的 attempt
2440
- // 立刻进入许可链。等在这里不占全局并发位,慢构建因此不挡住同批别的 eval。
2441
- const pairKey = cacheKey(a.run, a.evalDef.id);
2442
- yield* Effect.promise(() => awaitBuildsFor(pairKey));
2443
- for (;;) {
2444
- // ① 止损闸:落闸 → 本 attempt 不派发,计 unstarted(完成状态因此落 incomplete)。
2445
- const halt = checkDispatchHalt(a);
2446
- if (halt.halted) {
2447
- cancelReuseAttempt(a);
2448
- accountDispatchHalted(a, halt.gate);
2449
- return;
2450
- }
2451
- // ② 实验闸 → ③ 全局位 → ④ 用例锁 → preflight → body
2452
- const outcome = yield* withExperimentGate(a, guarded);
2453
- if (outcome.kind === "done") return;
2454
- // 许可获取被落下的闸打断:许可已随作用域归还,回到 ① 让上面的检查点记账。
2455
- if (outcome.kind === "recheck") continue;
2456
- // ② ③ 已随作用域归还。挂起等锁:不占并发位、计入 elsewhere;锁释放或过期后重查
2457
- // 携带——携入的收工,仍要自跑的按原优先级回到派发队列(下一轮循环)。
2458
- yield* Effect.promise(() => outcome.window);
2459
- if (caseState!.carried.has(a.attempt)) {
2460
- cancelReuseAttempt(a);
2461
- return;
2462
- }
2463
- if (opts.signal?.aborted) {
2464
- cancelReuseAttempt(a);
2465
- return;
2466
- }
2467
- }
2468
- });
2469
- // 实验级 teardown 结算:每个 attempt 收尾(含被 preflight 跳过、被中断的、被用例锁
2470
- // late-carry 跳过的)都从身份集合移除;最后一个触发 ExperimentDef.teardown。ensuring
2471
- // 在中断路径同样执行,重复 finalizer 也不会让状态下溢。
2472
- const withExpLifecycle =
2473
- !a.run.setup && !a.run.teardown
2474
- ? pipeline
2475
- : pipeline.pipe(
2476
- Effect.ensuring(
2477
- Effect.promise(async () => {
2478
- const cell = expLifecycles.get(a.run)!;
2479
- const state = cell.state;
2480
- if (state._tag === "UntriggeredComplete") return;
2481
- const pendingAttempts = new Set(state.pendingAttempts);
2482
- pendingAttempts.delete(a);
2483
- if (state._tag === "Dormant") {
2484
- cell.state = pendingAttempts.size === 0
2485
- ? { _tag: "UntriggeredComplete" }
2486
- : { _tag: "Dormant", pendingAttempts };
2487
- return;
2488
- }
2489
- if (state._tag === "Active") {
2490
- cell.state = { ...state, pendingAttempts };
2491
- if (pendingAttempts.size === 0) await runExperimentTeardown(a.run, cell);
2492
- return;
2493
- }
2494
- cell.state = { ...state, pendingAttempts };
2495
- }),
2496
- ),
2497
- );
2498
- if (!caseState) return withExpLifecycle;
2499
- // 用例锁释放:这个 key 的全部 attempt(真实派发的与被 late-carry 跳过的)都 settle 后
2500
- // 删锁,与上面的实验级 teardown 计数同一种「逐 attempt 收尾时递减,归零触发」模式,
2501
- // 挂在最外层确保晚于实验级 teardown 计数结算(docs「用例全部 attempt 收尾(含沙箱销毁)
2502
- // 后删除自己的锁」)。
2503
- return withExpLifecycle.pipe(
2504
- Effect.ensuring(Effect.promise(() => releaseCaseLockIfDone(caseState, a.attempt))),
2505
- );
2506
- },
2507
- { concurrency: "unbounded", discard: true },
2508
- ).pipe(
2509
- // 中断(用户 Ctrl+C):finalizer 已在中断过程中跑完(容器已停),这里只是把它咽下,
2510
- // 好让流程走到 summarize / onInvocationComplete,用已完成的 results 出一份部分汇总,而不是抛栈。
2511
- // 判据是 `isInterruptedOnly` 而不是 `isInterrupted`:一条 fiber 的缺陷会连带中断兄弟 fiber,
2512
- // 合成的 cause 里同时有 die 与 interrupt,`isInterrupted` 对它同样为真——按它咽下等于把
2513
- // 真·缺陷的正文吞掉、冒充成用户中断(退出码 130),正是
2514
- // memory/experiment-fatal-presented-as-user-interrupt.md 的现象。
2515
- Effect.catchAllCause((cause) => {
2516
- if (Cause.isInterruptedOnly(cause)) {
2517
- interrupted = true;
2518
- return Effect.void;
2519
- }
2520
- return Effect.failCause(cause); // 非中断的意外缺陷:照常抛出
2521
- }),
2522
- )),
2523
- { signal: opts.signal },
2524
- );
2525
- // 调度已经结算:任何被中断路径抛下的挂起轮询到下一个心跳周期自行收束,不无主空转。
2526
- dispatchClosed = true;
2527
- // provenance 在这里齐全:没有任何 attempt 依赖的 key 也照样跑完并留下自己那条记录,
2528
- // 中断路径下同批构建随 signal 收束成 cancelled,不把 run.json 的 sandboxBuilds 落空。
2529
- if (runningBuilds !== undefined) {
2530
- sandboxBuildRecords = [...(await runningBuilds.done).records];
2531
- }
2532
- await opts.otelPool?.close();
2533
-
2534
- // 复用污染线索:按实例 × 承接序号聚合本次 Run 真实跑出的结果(携带条目不参与——复用实验
2535
- // 不消费也不产出结果沿用)。只指路,不改判定(见 reuse-diagnostics.ts)。
2536
- for (const notice of detectReuseContamination(results)) {
2537
- reportDiagnostic({
2538
- key: `sandbox-reuse-contamination:${notice.experimentId ?? ""}:${notice.reuseSandbox}:${notice.phase}`,
2539
- code: "sandbox-reuse-contamination",
2540
- severity: "warning",
2541
- message: reuseContaminationMessage(notice),
2542
- data: {
2543
- ...(notice.experimentId !== undefined ? { experimentId: notice.experimentId } : {}),
2544
- reuseSandbox: notice.reuseSandbox,
2545
- phase: notice.phase,
2546
- fromOrdinal: notice.fromOrdinal,
2547
- toOrdinal: notice.toOrdinal,
2548
- count: notice.count,
2549
- },
2550
- });
2551
- }
2552
-
2553
- // 实验级 teardown 兜底扫尾:正常路径由 per-attempt ensuring 的身份集合归零触发(见上),但一次
2554
- // 真实批跑观察到过结算路径未触发的间歇现象(根因未定位,排查记录见 memory 的
2555
- // experiment-teardown-missed-once-in-batch)。走到这里时 forEach 的全部 fiber 连同 finalizer
2556
- // 都已结算,任何仍停在 Active 的实验都意味着泄漏;在此强制收尾并报警示诊断——
2557
- // 扫尾幂等(cleanup 消费一次性),宁可多一道兜底,不把宿主机资源(隧道/容器)留给用户手拆。
2558
- // 真·缺陷抛出前同样要扫(finalizer 语义,见 docs/feature/experiments/architecture.md
2559
- // 「实验级生命周期」);cli 的 main().catch() 只兜沙箱,不知道实验级 cleanup 的存在。
2560
- const sweepExperimentTeardowns = async (): Promise<void> => {
2561
- for (const [run, cell] of expLifecycles) {
2562
- const state = cell.state;
2563
- // 未触发、已完成均无事可扫;在飞的 teardown 只等 settle,不算漏。
2564
- if (state._tag === "Dormant" || state._tag === "UntriggeredComplete" || state._tag === "TornDown") {
2565
- continue;
2566
- }
2567
- if (state._tag === "TearingDown") {
2568
- await state.promise;
2569
- continue;
2570
- }
2571
- if (!run.teardown) {
2572
- await runExperimentTeardown(run, cell);
2573
- continue;
2574
- }
2575
- // 只有扫尾从 Active 启动时才报「late」诊断。
2576
- {
2577
- const experimentId = run.experimentId ?? run.agent.name;
2578
- const message = t("runner.experimentTeardownLate", { experimentId }).trimEnd();
2579
- reportDiagnostic({ key: `experiment-teardown-late:${experimentId}`, code: "experiment-teardown-late", severity: "warning", message, data: { experimentId, remaining: state.pendingAttempts.size } });
2580
- recordExperimentDiagnostic({
2581
- experimentId: run.experimentId,
2582
- code: "experiment-teardown-late",
2583
- level: "warning",
2584
- message,
2585
- phase: "experiment.teardown",
2586
- data: { remaining: state.pendingAttempts.size },
2587
- });
2588
- }
2589
- await runExperimentTeardown(run, cell);
2590
- }
2591
- };
2592
- if (Exit.isFailure(exit)) {
2593
- // signal abort 或纯中断的 cause → 当作用户中断,走部分汇总;否则是真·缺陷,照常抛出
2594
- // (混着 die 的 cause 归缺陷,见上面 catchAllCause 的判据)。
2595
- if (opts.signal?.aborted || Cause.isInterruptedOnly(exit.cause)) {
2596
- interrupted = true;
2597
- } else {
2598
- await sweepExperimentTeardowns();
2599
- throw Cause.squash(exit.cause);
2600
- }
2601
- }
2602
- if (interrupted) reportInterrupted();
2603
- await sweepExperimentTeardowns();
2604
-
2605
- // Experiment 收尾协议(docs/runner.md):每个真正出现在这次 Invocation 里的 experimentId
2606
- // 各发一次 experiment:complete,携带它自己的 completedAt(真实 teardown 完成时刻,没有
2607
- // teardown 或未触发时退回当前时刻)与实验域诊断累积器里attribute 给它的记录。全部
2608
- // Experiment 此刻都已经收尾(sweepExperimentTeardowns 已经等过),严格早于下面的
2609
- // invocation:summary——供 Artifacts 据此对每个 Run 原子封口,不用等到整个 Invocation
2610
- // 结束才一次性全部封口(interrupted、reporter error 等 Invocation 级事实不在这条通道里,
2611
- // 不会误落进任一 Run)。
2612
- const invocationExperimentIds = new Set(
2613
- opts.agentRuns.map((r) => r.experimentId).filter((id): id is string => id !== undefined),
2614
- );
2615
- const runTimings = runTiming.finalize();
2616
- for (const experimentId of invocationExperimentIds) {
2617
- await emitReporterEvent(reporters, {
2618
- type: "experiment:complete",
2619
- experimentId,
2620
- completedAt: experimentCompletedAt.get(experimentId) ?? new Date().toISOString(),
2621
- // 静态携带(启动时已知)与用例锁释放/接管后重查携带命中的迟到携带(lateCarriedResults)
2622
- // 对 Artifacts 封口而言是同一种东西——都是"这个 Experiment 本次没有真实执行、但要计入
2623
- // 快照的终态结果",合并后一起按 experimentId 过滤。
2624
- carriedResults: [...carriedResults, ...lateCarriedResults].filter((r) => r.experimentId === experimentId),
2625
- diagnostics: experimentDiagnostics.get(experimentId) ?? [],
2626
- ...(experimentFacts.has(experimentId) ? { facts: experimentFacts.get(experimentId) } : {}),
2627
- // Run 级共享构建时间与 provenance:属于产出它们的 Run;携带条目不继承。
2628
- ...(runTimings !== undefined ? { timings: runTimings } : {}),
2629
- ...(sandboxBuildRecords.length > 0 ? { sandboxBuilds: sandboxBuildRecords } : {}),
2630
- name: opts.config.name,
2631
- });
2632
- }
2633
-
2634
- // 稳定排序:按发现顺序 + attempt;携带结果(静态 + 用例锁迟到携带)并入后一起排
2635
- const order = new Map(opts.evals.map((e, i) => [e.id, i]));
2636
- const allResults = [...carriedResults, ...lateCarriedResults, ...results];
2637
- allResults.sort(
2638
- (a, b) =>
2639
- (order.get(a.id) ?? 0) - (order.get(b.id) ?? 0) ||
2640
- a.agent.localeCompare(b.agent) ||
2641
- a.attempt - b.attempt,
2642
- );
2643
-
2644
- const summary = summarize(allResults, startedAt, Date.now() - t0, opts.config.name);
2645
- await emitReporterEvent(reporters, { type: "invocation:summary", summary });
2646
- for (const reg of reporters) {
2647
- // required reporter(默认 artifacts、显式 --json/--junit)在这一步失败,不能中断其它
2648
- // reporter 的收尾——继续跑完剩下的循环,让每个 reporter 都拿到 onInvocationComplete 的机会;
2649
- // 失败本身经 runReporter → reportReporterError 折成诊断,由调用方(cli.ts)读取
2650
- // RunFeedbackState 组装成 InvocationCompletion,让最终 completion/退出码判红(见
2651
- // docs/feature/experiments/cli.md「运行完成状态不只看 verdict 计数」)。
2652
- await runReporter(reg, "onInvocationComplete", () => reg.reporter.onInvocationComplete?.(summary));
2653
- }
2654
- await emitReporterEvent(reporters, { type: "invocation:saved", summary });
2655
- return summary;
2656
- }