niceeval 0.13.3 → 0.13.4-canary.39

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 (487) hide show
  1. package/INDEX.md +5 -5
  2. package/dist/agents/index.cjs +2 -2
  3. package/dist/agents/index.cjs.map +1 -1
  4. package/dist/agents/project.json +6 -0
  5. package/dist/agents/streaming.cjs.map +1 -1
  6. package/dist/agents/types.cjs.map +1 -1
  7. package/dist/agents/types.d.cts +1 -1
  8. package/dist/agents/types.d.mts +1 -1
  9. package/dist/agents/types.d.ts +1 -1
  10. package/dist/analysis/bindings.d.cts +8 -8
  11. package/dist/analysis/bindings.d.mts +8 -8
  12. package/dist/analysis/bindings.d.ts +8 -8
  13. package/dist/analysis/contracts.cjs.map +1 -1
  14. package/dist/analysis/contracts.d.cts +8 -19
  15. package/dist/analysis/contracts.d.mts +8 -19
  16. package/dist/analysis/contracts.d.ts +8 -19
  17. package/dist/analysis/experiment-groups.cjs +7 -14
  18. package/dist/analysis/experiment-groups.cjs.map +1 -1
  19. package/dist/analysis/index.cjs.map +1 -1
  20. package/dist/analysis/index.d.cts +1 -1
  21. package/dist/analysis/index.d.mts +1 -1
  22. package/dist/analysis/index.d.ts +1 -1
  23. package/dist/cli/application.cjs +4 -13
  24. package/dist/cli/application.cjs.map +1 -1
  25. package/dist/cli/application.d.cts +62 -59
  26. package/dist/cli/application.d.mts +62 -59
  27. package/dist/cli/application.d.ts +62 -59
  28. package/dist/cli/application.js +6 -12
  29. package/dist/cli/bootstrap.cjs +28 -2
  30. package/dist/cli/bootstrap.cjs.map +1 -1
  31. package/dist/cli/contribution.cjs +185 -0
  32. package/dist/cli/contribution.cjs.map +1 -0
  33. package/dist/cli/contribution.d.cts +55 -0
  34. package/dist/cli/contribution.d.mts +55 -0
  35. package/dist/cli/contribution.d.ts +55 -0
  36. package/dist/cli/contribution.js +20 -0
  37. package/dist/cli/contribution.js.map +1 -0
  38. package/dist/cli/node-application.cjs +119 -87
  39. package/dist/cli/node-application.cjs.map +1 -1
  40. package/dist/cli/node-application.d.cts +2 -8
  41. package/dist/cli/node-application.d.mts +2 -8
  42. package/dist/cli/node-application.d.ts +2 -8
  43. package/dist/cli/node-application.js +12 -22
  44. package/dist/cli/program.cjs +87 -2756
  45. package/dist/cli/program.cjs.map +1 -1
  46. package/dist/cli/program.d.cts +11 -332
  47. package/dist/cli/program.d.mts +11 -332
  48. package/dist/cli/program.d.ts +11 -332
  49. package/dist/cli/program.js +4 -28
  50. package/dist/cli.cjs +0 -3
  51. package/dist/cli.cjs.map +1 -1
  52. package/dist/cli.d.cts +0 -1
  53. package/dist/cli.d.mts +0 -1
  54. package/dist/cli.d.ts +0 -1
  55. package/dist/cli.js +6 -14
  56. package/dist/define.cjs +1 -1
  57. package/dist/define.cjs.map +1 -1
  58. package/dist/docker/cache-administration.cjs +8 -0
  59. package/dist/docker/cache-administration.cjs.map +1 -0
  60. package/dist/docker/cache-administration.d.cts +33 -0
  61. package/dist/docker/cache-administration.d.mts +33 -0
  62. package/dist/docker/cache-administration.d.ts +33 -0
  63. package/dist/docker/cache-administration.js +6 -0
  64. package/dist/docker/cache-administration.js.map +1 -0
  65. package/dist/docker/cache-live.cjs +27 -0
  66. package/dist/docker/cache-live.cjs.map +1 -0
  67. package/dist/docker/cache-live.d.cts +3 -0
  68. package/dist/docker/cache-live.d.mts +3 -0
  69. package/dist/docker/cache-live.d.ts +3 -0
  70. package/dist/docker/cache-live.js +6 -0
  71. package/dist/docker/cache-live.js.map +1 -0
  72. package/dist/docker/cli/contribution.cjs +223 -0
  73. package/dist/docker/cli/contribution.cjs.map +1 -0
  74. package/dist/docker/cli/contribution.d.cts +48 -0
  75. package/dist/docker/cli/contribution.d.mts +48 -0
  76. package/dist/docker/cli/contribution.d.ts +48 -0
  77. package/dist/docker/cli/contribution.js +8 -0
  78. package/dist/docker/cli/contribution.js.map +1 -0
  79. package/dist/eval/cli/contribution.cjs +62 -0
  80. package/dist/eval/cli/contribution.cjs.map +1 -0
  81. package/dist/eval/cli/contribution.d.cts +21 -0
  82. package/dist/eval/cli/contribution.d.mts +21 -0
  83. package/dist/eval/cli/contribution.d.ts +21 -0
  84. package/dist/eval/cli/contribution.js +8 -0
  85. package/dist/eval/cli/contribution.js.map +1 -0
  86. package/dist/eval/host/index.cjs +23 -0
  87. package/dist/eval/host/index.cjs.map +1 -0
  88. package/dist/eval/host/index.d.cts +27 -0
  89. package/dist/eval/host/index.d.mts +27 -0
  90. package/dist/eval/host/index.d.ts +27 -0
  91. package/dist/eval/host/index.js +8 -0
  92. package/dist/eval/host/index.js.map +1 -0
  93. package/dist/eval/host/index.mjs +8 -0
  94. package/dist/eval/host/index.mjs.map +1 -0
  95. package/dist/experiment/host/cli/contribution.cjs +835 -0
  96. package/dist/experiment/host/cli/contribution.cjs.map +1 -0
  97. package/dist/experiment/host/cli/contribution.d.cts +329 -0
  98. package/dist/experiment/host/cli/contribution.d.mts +329 -0
  99. package/dist/experiment/host/cli/contribution.d.ts +329 -0
  100. package/dist/experiment/host/cli/contribution.js +22 -0
  101. package/dist/experiment/host/cli/contribution.js.map +1 -0
  102. package/dist/experiment/host/cli/index.cjs +9 -0
  103. package/dist/experiment/host/cli/index.cjs.map +1 -0
  104. package/dist/experiment/host/cli/index.d.cts +2 -0
  105. package/dist/experiment/host/cli/index.d.mts +2 -0
  106. package/dist/experiment/host/cli/index.d.ts +2 -0
  107. package/dist/experiment/host/cli/index.js +10 -0
  108. package/dist/experiment/host/cli/index.js.map +1 -0
  109. package/dist/experiment/host/cli/terminal.cjs +15 -0
  110. package/dist/experiment/host/cli/terminal.cjs.map +1 -0
  111. package/dist/experiment/host/cli/terminal.d.cts +14 -0
  112. package/dist/experiment/host/cli/terminal.d.mts +14 -0
  113. package/dist/experiment/host/cli/terminal.d.ts +14 -0
  114. package/dist/experiment/host/cli/terminal.js +8 -0
  115. package/dist/experiment/host/cli/terminal.js.map +1 -0
  116. package/dist/experiment/host/index.cjs +35 -58
  117. package/dist/experiment/host/index.cjs.map +1 -1
  118. package/dist/experiment/host/index.d.cts +5 -79
  119. package/dist/experiment/host/index.d.mts +5 -79
  120. package/dist/experiment/host/index.d.ts +5 -79
  121. package/dist/experiment/host/index.js +4 -2
  122. package/dist/experiment/host/index.mjs +4 -2
  123. package/dist/experiment/host/operations.cjs +678 -0
  124. package/dist/experiment/host/operations.cjs.map +1 -0
  125. package/dist/experiment/host/operations.d.cts +19 -0
  126. package/dist/experiment/host/operations.d.mts +19 -0
  127. package/dist/experiment/host/operations.d.ts +19 -0
  128. package/dist/experiment/host/operations.js +24 -0
  129. package/dist/experiment/host/operations.js.map +1 -0
  130. package/dist/experiment/host/presentation.cjs +81 -0
  131. package/dist/experiment/host/presentation.cjs.map +1 -0
  132. package/dist/experiment/host/presentation.d.cts +9 -0
  133. package/dist/experiment/host/presentation.d.mts +9 -0
  134. package/dist/experiment/host/presentation.d.ts +9 -0
  135. package/dist/experiment/host/presentation.js +8 -0
  136. package/dist/experiment/host/presentation.js.map +1 -0
  137. package/dist/experiment/host/teardown.cjs +394 -0
  138. package/dist/experiment/host/teardown.cjs.map +1 -0
  139. package/dist/experiment/host/teardown.d.cts +5 -0
  140. package/dist/experiment/host/teardown.d.mts +5 -0
  141. package/dist/experiment/host/teardown.d.ts +5 -0
  142. package/dist/experiment/host/teardown.js +8 -0
  143. package/dist/experiment/host/teardown.js.map +1 -0
  144. package/dist/experiment/host/types.cjs +9 -0
  145. package/dist/experiment/host/types.cjs.map +1 -0
  146. package/dist/experiment/host/types.d.cts +423 -0
  147. package/dist/experiment/host/types.d.mts +423 -0
  148. package/dist/experiment/host/types.d.ts +423 -0
  149. package/dist/experiment/host/types.js +6 -0
  150. package/dist/experiment/host/types.js.map +1 -0
  151. package/dist/i18n/en.cjs +8 -50
  152. package/dist/i18n/en.cjs.map +1 -1
  153. package/dist/i18n/en.d.cts +2 -6
  154. package/dist/i18n/en.d.mts +2 -6
  155. package/dist/i18n/en.d.ts +2 -6
  156. package/dist/o11y/project.json +6 -0
  157. package/dist/project/cli/contribution.cjs +66 -0
  158. package/dist/project/cli/contribution.cjs.map +1 -0
  159. package/dist/project/cli/contribution.d.cts +17 -0
  160. package/dist/project/cli/contribution.d.mts +17 -0
  161. package/dist/project/cli/contribution.d.ts +17 -0
  162. package/dist/project/cli/contribution.js +8 -0
  163. package/dist/project/cli/contribution.js.map +1 -0
  164. package/dist/project/cli/index.cjs +7 -0
  165. package/dist/project/cli/index.cjs.map +1 -0
  166. package/dist/project/cli/index.d.cts +1 -0
  167. package/dist/project/cli/index.d.mts +1 -0
  168. package/dist/project/cli/index.d.ts +1 -0
  169. package/dist/project/cli/index.js +8 -0
  170. package/dist/project/cli/index.js.map +1 -0
  171. package/dist/project/host/index.cjs +11 -0
  172. package/dist/project/host/index.cjs.map +1 -0
  173. package/dist/project/host/index.d.cts +4 -0
  174. package/dist/project/host/index.d.mts +4 -0
  175. package/dist/project/host/index.d.ts +4 -0
  176. package/dist/project/host/index.js +14 -0
  177. package/dist/project/host/index.js.map +1 -0
  178. package/dist/project/host/index.mjs +14 -0
  179. package/dist/project/host/index.mjs.map +1 -0
  180. package/dist/project/host.cjs +59 -0
  181. package/dist/project/host.cjs.map +1 -0
  182. package/dist/project/host.d.cts +17 -0
  183. package/dist/project/host.d.mts +17 -0
  184. package/dist/project/host.d.ts +17 -0
  185. package/dist/project/host.js +6 -0
  186. package/dist/project/host.js.map +1 -0
  187. package/dist/project/index.cjs +11 -0
  188. package/dist/project/index.cjs.map +1 -0
  189. package/dist/project/index.d.cts +4 -0
  190. package/dist/project/index.d.mts +4 -0
  191. package/dist/project/index.d.ts +4 -0
  192. package/dist/project/index.js +14 -0
  193. package/dist/project/index.js.map +1 -0
  194. package/dist/project/node.cjs +91 -0
  195. package/dist/project/node.cjs.map +1 -0
  196. package/dist/project/node.d.cts +6 -0
  197. package/dist/project/node.d.mts +6 -0
  198. package/dist/project/node.d.ts +6 -0
  199. package/dist/project/node.js +12 -0
  200. package/dist/project/node.js.map +1 -0
  201. package/dist/project/services.cjs +17 -0
  202. package/dist/project/services.cjs.map +1 -0
  203. package/dist/project/services.d.cts +47 -0
  204. package/dist/project/services.d.mts +47 -0
  205. package/dist/project/services.d.ts +47 -0
  206. package/dist/project/services.js +12 -0
  207. package/dist/project/services.js.map +1 -0
  208. package/dist/project/templates.cjs +28 -0
  209. package/dist/project/templates.cjs.map +1 -0
  210. package/dist/project/templates.d.cts +4 -0
  211. package/dist/project/templates.d.mts +4 -0
  212. package/dist/project/templates.d.ts +4 -0
  213. package/dist/project/templates.js +12 -0
  214. package/dist/project/templates.js.map +1 -0
  215. package/dist/project.json +6 -0
  216. package/dist/record/family/catalog.d.cts +10 -10
  217. package/dist/record/family/catalog.d.mts +10 -10
  218. package/dist/record/family/catalog.d.ts +10 -10
  219. package/dist/record/family/file-changes.d.cts +8 -8
  220. package/dist/record/family/file-changes.d.mts +8 -8
  221. package/dist/record/family/file-changes.d.ts +8 -8
  222. package/dist/record/host/cli/contribution.cjs +206 -0
  223. package/dist/record/host/cli/contribution.cjs.map +1 -0
  224. package/dist/record/host/cli/contribution.d.cts +32 -0
  225. package/dist/record/host/cli/contribution.d.mts +32 -0
  226. package/dist/record/host/cli/contribution.d.ts +32 -0
  227. package/dist/record/host/cli/contribution.js +10 -0
  228. package/dist/record/host/cli/contribution.js.map +1 -0
  229. package/dist/record/host/cli/index.cjs +8 -0
  230. package/dist/record/host/cli/index.cjs.map +1 -0
  231. package/dist/record/host/cli/index.d.cts +1 -0
  232. package/dist/record/host/cli/index.d.mts +1 -0
  233. package/dist/record/host/cli/index.d.ts +1 -0
  234. package/dist/record/host/cli/index.js +10 -0
  235. package/dist/record/host/cli/index.js.map +1 -0
  236. package/dist/record/host/cli/presentation.cjs +122 -0
  237. package/dist/record/host/cli/presentation.cjs.map +1 -0
  238. package/dist/record/host/cli/presentation.d.cts +7 -0
  239. package/dist/record/host/cli/presentation.d.mts +7 -0
  240. package/dist/record/host/cli/presentation.d.ts +7 -0
  241. package/dist/record/host/cli/presentation.js +12 -0
  242. package/dist/record/host/cli/presentation.js.map +1 -0
  243. package/dist/record/host/index.cjs.map +1 -1
  244. package/dist/record/host/index.d.cts +1 -1
  245. package/dist/record/host/index.d.mts +1 -1
  246. package/dist/record/host/index.d.ts +1 -1
  247. package/dist/record/host/runtime.cjs +184 -1
  248. package/dist/record/host/runtime.cjs.map +1 -1
  249. package/dist/record/host/types.cjs.map +1 -1
  250. package/dist/record/host/types.d.cts +120 -0
  251. package/dist/record/host/types.d.mts +120 -0
  252. package/dist/record/host/types.d.ts +120 -0
  253. package/dist/record/project.json +6 -0
  254. package/dist/report/assets/styles.css +80 -0
  255. package/dist/report/cli/contribution.cjs +325 -0
  256. package/dist/report/cli/contribution.cjs.map +1 -0
  257. package/dist/report/cli/contribution.d.cts +143 -0
  258. package/dist/report/cli/contribution.d.mts +143 -0
  259. package/dist/report/cli/contribution.d.ts +143 -0
  260. package/dist/report/cli/contribution.js +12 -0
  261. package/dist/report/cli/contribution.js.map +1 -0
  262. package/dist/report/client-dist/app.js +9 -9
  263. package/dist/report/components/attempt-detail/content.cjs +1 -1
  264. package/dist/report/components/attempt-detail/content.cjs.map +1 -1
  265. package/dist/report/components/entity-lists/compute.cjs +5 -0
  266. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  267. package/dist/report/components/entity-lists/compute.d.cts +2 -0
  268. package/dist/report/components/entity-lists/compute.d.mts +2 -0
  269. package/dist/report/components/entity-lists/compute.d.ts +2 -0
  270. package/dist/report/components/entity-lists/content.cjs +35 -12
  271. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  272. package/dist/report/components/entity-lists/index.cjs +0 -3
  273. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  274. package/dist/report/components/summaries/index.cjs +2 -4
  275. package/dist/report/components/summaries/index.cjs.map +1 -1
  276. package/dist/report/definition/cell.cjs +7 -2
  277. package/dist/report/definition/cell.cjs.map +1 -1
  278. package/dist/report/definition/cell.d.cts +2 -0
  279. package/dist/report/definition/cell.d.mts +2 -0
  280. package/dist/report/definition/cell.d.ts +2 -0
  281. package/dist/report/definition/primitives/assertion-evidence.cjs +190 -4
  282. package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -1
  283. package/dist/report/definition/primitives/assertion-evidence.d.cts +4 -0
  284. package/dist/report/definition/primitives/assertion-evidence.d.mts +4 -0
  285. package/dist/report/definition/primitives/assertion-evidence.d.ts +4 -0
  286. package/dist/report/execution/machine.cjs +2 -3
  287. package/dist/report/execution/machine.cjs.map +1 -1
  288. package/dist/report/execution/machine.d.cts +11 -8
  289. package/dist/report/execution/machine.d.mts +11 -8
  290. package/dist/report/execution/machine.d.ts +11 -8
  291. package/dist/report/host/from-record.cjs +13 -8
  292. package/dist/report/host/from-record.cjs.map +1 -1
  293. package/dist/report/host/index.cjs +5 -1
  294. package/dist/report/host/index.cjs.map +1 -1
  295. package/dist/report/host/index.d.cts +1 -0
  296. package/dist/report/host/index.d.mts +1 -0
  297. package/dist/report/host/index.d.ts +1 -0
  298. package/dist/report/host/index.js +8 -2
  299. package/dist/report/host/index.mjs +8 -2
  300. package/dist/report/host/machine.cjs +23 -22
  301. package/dist/report/host/machine.cjs.map +1 -1
  302. package/dist/report/host/machine.d.cts +1 -1
  303. package/dist/report/host/machine.d.mts +1 -1
  304. package/dist/report/host/machine.d.ts +1 -1
  305. package/dist/report/host/node/loader.cjs +4 -2
  306. package/dist/report/host/node/loader.cjs.map +1 -1
  307. package/dist/report/host/node/loader.d.cts +3 -1
  308. package/dist/report/host/node/loader.d.mts +3 -1
  309. package/dist/report/host/node/loader.d.ts +3 -1
  310. package/dist/report/host/node.cjs +44 -9
  311. package/dist/report/host/node.cjs.map +1 -1
  312. package/dist/report/host/node.d.cts +13 -3
  313. package/dist/report/host/node.d.mts +13 -3
  314. package/dist/report/host/node.d.ts +13 -3
  315. package/dist/report/host/node.js +44 -32
  316. package/dist/report/host/operations.cjs +14 -0
  317. package/dist/report/host/operations.cjs.map +1 -0
  318. package/dist/report/host/operations.d.cts +39 -0
  319. package/dist/report/host/operations.d.mts +39 -0
  320. package/dist/report/host/operations.d.ts +39 -0
  321. package/dist/report/host/operations.js +10 -0
  322. package/dist/report/host/operations.js.map +1 -0
  323. package/dist/report/model/chart/plot.cjs +1 -1
  324. package/dist/report/model/chart/plot.cjs.map +1 -1
  325. package/dist/report/model/locale.cjs +4 -0
  326. package/dist/report/model/locale.cjs.map +1 -1
  327. package/dist/report/model/locale.d.cts +3 -1
  328. package/dist/report/model/locale.d.mts +3 -1
  329. package/dist/report/model/locale.d.ts +3 -1
  330. package/dist/report/react/styles.css +80 -0
  331. package/dist/runner/build-preparation.cjs +5 -5
  332. package/dist/runner/build-preparation.cjs.map +1 -1
  333. package/dist/runner/build-preparation.d.cts +2 -3
  334. package/dist/runner/build-preparation.d.mts +2 -3
  335. package/dist/runner/build-preparation.d.ts +2 -3
  336. package/dist/runner/feedback/coordinator.cjs +18 -15
  337. package/dist/runner/feedback/coordinator.cjs.map +1 -1
  338. package/dist/runner/feedback/coordinator.d.cts +6 -0
  339. package/dist/runner/feedback/coordinator.d.mts +6 -0
  340. package/dist/runner/feedback/coordinator.d.ts +6 -0
  341. package/dist/runner/ledger.cjs +3 -13
  342. package/dist/runner/ledger.cjs.map +1 -1
  343. package/dist/runner/ledger.d.cts +1 -3
  344. package/dist/runner/ledger.d.mts +1 -3
  345. package/dist/runner/ledger.d.ts +1 -3
  346. package/dist/runner/run.cjs +63 -18
  347. package/dist/runner/run.cjs.map +1 -1
  348. package/dist/runner/session.cjs +10 -0
  349. package/dist/runner/session.cjs.map +1 -1
  350. package/dist/runner/session.d.cts +25 -0
  351. package/dist/runner/session.d.mts +25 -0
  352. package/dist/runner/session.d.ts +25 -0
  353. package/dist/runner/types.cjs.map +1 -1
  354. package/dist/runner/types.d.cts +1 -2
  355. package/dist/runner/types.d.mts +1 -2
  356. package/dist/runner/types.d.ts +1 -2
  357. package/dist/sandbox/build-coordinator.cjs +38 -19
  358. package/dist/sandbox/build-coordinator.cjs.map +1 -1
  359. package/dist/sandbox/build-coordinator.d.cts +47 -7
  360. package/dist/sandbox/build-coordinator.d.mts +47 -7
  361. package/dist/sandbox/build-coordinator.d.ts +47 -7
  362. package/dist/sandbox/build-coordinator.js +8 -4
  363. package/dist/sandbox/cli/contribution.cjs +128 -0
  364. package/dist/sandbox/cli/contribution.cjs.map +1 -0
  365. package/dist/sandbox/cli/contribution.d.cts +71 -0
  366. package/dist/sandbox/cli/contribution.d.mts +71 -0
  367. package/dist/sandbox/cli/contribution.d.ts +71 -0
  368. package/dist/sandbox/cli/contribution.js +8 -0
  369. package/dist/sandbox/cli/contribution.js.map +1 -0
  370. package/dist/sandbox/cli-commands.cjs +14 -21
  371. package/dist/sandbox/cli-commands.cjs.map +1 -1
  372. package/dist/sandbox/cli-commands.d.cts +12 -8
  373. package/dist/sandbox/cli-commands.d.mts +12 -8
  374. package/dist/sandbox/cli-commands.d.ts +12 -8
  375. package/dist/sandbox/compose.cjs +22 -2
  376. package/dist/sandbox/compose.cjs.map +1 -1
  377. package/dist/sandbox/compose.d.cts +1 -1
  378. package/dist/sandbox/compose.d.mts +1 -1
  379. package/dist/sandbox/compose.d.ts +1 -1
  380. package/dist/sandbox/docker-profile/cli.cjs +13 -9
  381. package/dist/sandbox/docker-profile/cli.cjs.map +1 -1
  382. package/dist/sandbox/docker-profile/cli.d.cts +2 -0
  383. package/dist/sandbox/docker-profile/cli.d.mts +2 -0
  384. package/dist/sandbox/docker-profile/cli.d.ts +2 -0
  385. package/dist/sandbox/docker-profile/runtime.cjs +68 -7
  386. package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
  387. package/dist/sandbox/docker-profile/runtime.d.cts +19 -1
  388. package/dist/sandbox/docker-profile/runtime.d.mts +19 -1
  389. package/dist/sandbox/docker-profile/runtime.d.ts +19 -1
  390. package/dist/sandbox/docker-profile/runtime.js +10 -8
  391. package/dist/sandbox/docker-profile/schema.cjs +68 -19
  392. package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
  393. package/dist/sandbox/docker-profile/schema.d.cts +23 -9
  394. package/dist/sandbox/docker-profile/schema.d.mts +23 -9
  395. package/dist/sandbox/docker-profile/schema.d.ts +23 -9
  396. package/dist/sandbox/docker-task-build-cache.cjs +532 -0
  397. package/dist/sandbox/docker-task-build-cache.cjs.map +1 -0
  398. package/dist/sandbox/docker-task-build-cache.d.cts +68 -0
  399. package/dist/sandbox/docker-task-build-cache.d.mts +68 -0
  400. package/dist/sandbox/docker-task-build-cache.d.ts +68 -0
  401. package/dist/sandbox/docker-task-build-cache.js +20 -0
  402. package/dist/sandbox/docker-task-build-cache.js.map +1 -0
  403. package/dist/sandbox/docker.cjs +50 -0
  404. package/dist/sandbox/docker.cjs.map +1 -1
  405. package/dist/sandbox/docker.d.cts +15 -0
  406. package/dist/sandbox/docker.d.mts +15 -0
  407. package/dist/sandbox/docker.d.ts +15 -0
  408. package/dist/sandbox/dockerfile-build.cjs +55 -5
  409. package/dist/sandbox/dockerfile-build.cjs.map +1 -1
  410. package/dist/sandbox/dockerfile-build.d.cts +2 -2
  411. package/dist/sandbox/dockerfile-build.d.mts +2 -2
  412. package/dist/sandbox/dockerfile-build.d.ts +2 -2
  413. package/dist/sandbox/index.cjs +5 -3
  414. package/dist/sandbox/index.cjs.map +1 -1
  415. package/dist/sandbox/index.d.cts +4 -3
  416. package/dist/sandbox/index.d.mts +4 -3
  417. package/dist/sandbox/index.d.ts +4 -3
  418. package/dist/sandbox/index.js +16 -14
  419. package/dist/sandbox/index.mjs +16 -14
  420. package/dist/sandbox/keep.cjs +1 -3
  421. package/dist/sandbox/keep.cjs.map +1 -1
  422. package/dist/sandbox/layer.cjs +70 -79
  423. package/dist/sandbox/layer.cjs.map +1 -1
  424. package/dist/sandbox/layer.d.cts +6 -12
  425. package/dist/sandbox/layer.d.mts +6 -12
  426. package/dist/sandbox/layer.d.ts +6 -12
  427. package/dist/sandbox/layer.js +16 -18
  428. package/dist/sandbox/ledger-paths.cjs +4 -18
  429. package/dist/sandbox/ledger-paths.cjs.map +1 -1
  430. package/dist/sandbox/ledger-paths.d.cts +3 -13
  431. package/dist/sandbox/ledger-paths.d.mts +3 -13
  432. package/dist/sandbox/ledger-paths.d.ts +3 -13
  433. package/dist/sandbox/ledger-paths.js +4 -8
  434. package/dist/sandbox/registry.cjs +1 -1
  435. package/dist/sandbox/registry.cjs.map +1 -1
  436. package/dist/sandbox/runtime.cjs +27 -37
  437. package/dist/sandbox/runtime.cjs.map +1 -1
  438. package/dist/sandbox/runtime.d.cts +1 -2
  439. package/dist/sandbox/runtime.d.mts +1 -2
  440. package/dist/sandbox/runtime.d.ts +1 -2
  441. package/dist/sandbox/runtime.js +6 -8
  442. package/dist/sandbox/types.cjs.map +1 -1
  443. package/dist/sandbox/types.d.cts +3 -3
  444. package/dist/sandbox/types.d.mts +3 -3
  445. package/dist/sandbox/types.d.ts +3 -3
  446. package/dist/sources/project.json +6 -0
  447. package/dist/vendor/remark/remark-gfm.cjs +72 -72
  448. package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
  449. package/dist/vendor/remark/remark-parse.cjs +54 -54
  450. package/dist/vendor/remark/remark-parse.cjs.map +1 -1
  451. package/dist/vendor/remark/remark.cjs +125 -125
  452. package/dist/vendor/remark/remark.cjs.map +2 -2
  453. package/docs-site/zh/README.md +1 -1
  454. package/docs-site/zh/explanation/assert.mdx +4 -0
  455. package/docs-site/zh/explanation/judge.mdx +40 -9
  456. package/docs-site/zh/reference/cli.mdx +67 -43
  457. package/docs-site/zh/reference/define-agent.mdx +2 -2
  458. package/docs-site/zh/reference/report-components.mdx +4 -3
  459. package/docs-site/zh/troubleshooting/debug-sandbox.mdx +6 -0
  460. package/docs-site/zh/troubleshooting/debugging.mdx +28 -1
  461. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +4 -2
  462. package/docs-site/zh/tutorials/concurrency.mdx +2 -2
  463. package/docs-site/zh/tutorials/custom-reports.mdx +175 -9
  464. package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -7
  465. package/docs-site/zh/tutorials/eval-groups.mdx +1 -2
  466. package/docs-site/zh/tutorials/evaluation-kinds.mdx +39 -6
  467. package/docs-site/zh/tutorials/nixos-managed-dind.mdx +14 -5
  468. package/docs-site/zh/tutorials/sandbox-providers.mdx +1 -28
  469. package/docs-site/zh/tutorials/sandbox-reuse.mdx +1 -1
  470. package/docs-site/zh/tutorials/viewing-results.mdx +2 -0
  471. package/package.json +24 -19
  472. package/README.md +0 -176
  473. package/README.zh.md +0 -176
  474. package/dist/cli/record.cjs +0 -246
  475. package/dist/cli/record.cjs.map +0 -1
  476. package/dist/cli/record.d.cts +0 -40
  477. package/dist/cli/record.d.mts +0 -40
  478. package/dist/cli/record.d.ts +0 -40
  479. package/dist/cli/record.js +0 -10
  480. package/dist/cli/record.js.map +0 -1
  481. package/dist/sandbox/local.cjs +0 -361
  482. package/dist/sandbox/local.cjs.map +0 -1
  483. package/dist/sandbox/local.d.cts +0 -80
  484. package/dist/sandbox/local.d.mts +0 -80
  485. package/dist/sandbox/local.d.ts +0 -80
  486. package/dist/sandbox/local.js +0 -6
  487. package/dist/sandbox/local.js.map +0 -1
@@ -0,0 +1,394 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inspectTeardown = inspectTeardown;
4
+ exports.runTeardown = runTeardown;
5
+ const node_path_1 = require("node:path");
6
+ const effect_1 = require("effect");
7
+ const cleanup_timeout_ts_1 = require("../../runner/cleanup-timeout.cjs");
8
+ const discover_ts_1 = require("../../runner/discover.cjs");
9
+ const eval_selection_ts_1 = require("../../runner/eval-selection.cjs");
10
+ const shared_state_lease_ts_1 = require("../../runner/shared-state-lease.cjs");
11
+ const teardown_registry_ts_1 = require("../../runner/teardown-registry.cjs");
12
+ const aggregate_ts_1 = require("../../shared/aggregate.cjs");
13
+ const types_ts_1 = require("./types.cjs");
14
+ function operationError(operation, cause) {
15
+ if (cause instanceof types_ts_1.ExperimentHostError)
16
+ return cause;
17
+ const code = typeof cause === "object" && cause !== null && typeof Reflect.get(cause, "code") === "string"
18
+ ? String(Reflect.get(cause, "code"))
19
+ : "experiment-host-operation-failed";
20
+ return new types_ts_1.ExperimentHostError({
21
+ operation,
22
+ code,
23
+ message: cause instanceof Error ? cause.message : String(cause),
24
+ });
25
+ }
26
+ function closeOperation(operation, effect) {
27
+ return effect.pipe(effect_1.Effect.mapError((cause) => operationError(operation, cause)));
28
+ }
29
+ function recoveryOperationError(code, cause) {
30
+ return new types_ts_1.ExperimentHostError({
31
+ operation: "teardown-run",
32
+ code,
33
+ message: cause instanceof Error ? cause.message : String(cause),
34
+ });
35
+ }
36
+ function freezeArray(values) {
37
+ return Object.freeze([...values]);
38
+ }
39
+ function selectTeardowns(input) {
40
+ return effect_1.Effect.gen(function* () {
41
+ const evals = yield* (0, discover_ts_1.discoverEvals)(input.cwd);
42
+ const experiments = yield* (0, discover_ts_1.discoverExperiments)(input.cwd);
43
+ const experimentIds = freezeArray(experiments.map((experiment) => experiment.id));
44
+ const matched = input.experimentSelector === undefined
45
+ ? experiments
46
+ : experiments.filter((experiment) => (0, aggregate_ts_1.matchExperimentSelector)(experimentIds, input.experimentSelector).includes(experiment.id));
47
+ return Object.freeze({
48
+ experimentIds,
49
+ selected: freezeArray(matched.map((experiment) => {
50
+ const selection = (0, eval_selection_ts_1.resolveExperimentEvals)({
51
+ experimentId: experiment.id,
52
+ selector: experiment.evals,
53
+ cliPatterns: [],
54
+ evals,
55
+ });
56
+ return Object.freeze({
57
+ experiment,
58
+ selectedEvalIds: freezeArray(selection.selectedEvalIds),
59
+ });
60
+ })),
61
+ });
62
+ });
63
+ }
64
+ function teardownOf(experiment) {
65
+ return typeof experiment.teardown === "function" ? experiment.teardown : undefined;
66
+ }
67
+ function evidenceOf(record) {
68
+ return Object.freeze({
69
+ key: record.key,
70
+ experimentId: record.experimentId,
71
+ ownerToken: record.ownerToken,
72
+ host: record.host,
73
+ pid: record.pid,
74
+ processIdentity: record.processIdentity,
75
+ heartbeatAt: record.heartbeatAt,
76
+ });
77
+ }
78
+ function noExperimentMatch(selector, selection) {
79
+ return Object.freeze({
80
+ status: "experiment-no-match",
81
+ selector,
82
+ candidates: freezeArray([...selection.experimentIds].sort()),
83
+ });
84
+ }
85
+ function inspectExactRegistration(input) {
86
+ const id = (0, teardown_registry_ts_1.teardownEntryId)(input.record.experimentId, input.record.pid);
87
+ return effect_1.Effect.gen(function* () {
88
+ const registration = yield* (0, teardown_registry_ts_1.readExactTeardownRegistrationEffect)(input.coordinationRoot, input.record.experimentId, input.record.pid);
89
+ if (registration === undefined)
90
+ return false;
91
+ if (registration.host !== input.record.host) {
92
+ return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} belongs to host ${JSON.stringify(registration.host)}, ` +
93
+ `not immutable sharedState owner host ${JSON.stringify(input.record.host)}`));
94
+ }
95
+ const terminated = yield* (0, teardown_registry_ts_1.isExactTeardownRegistrationOwnerTerminatedEffect)({
96
+ registration,
97
+ owner: input.record,
98
+ currentHost: input.currentHost,
99
+ });
100
+ if (!terminated) {
101
+ return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} still belongs to a live exact sharedState owner`));
102
+ }
103
+ return true;
104
+ });
105
+ }
106
+ function clearExactRegistration(input) {
107
+ const id = (0, teardown_registry_ts_1.teardownEntryId)(input.record.experimentId, input.record.pid);
108
+ return effect_1.Effect.gen(function* () {
109
+ const present = yield* inspectExactRegistration(input);
110
+ if (!present) {
111
+ if (input.expectedRegistration) {
112
+ return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} disappeared before recovery could clear it`));
113
+ }
114
+ return;
115
+ }
116
+ if (!input.expectedRegistration) {
117
+ return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} appeared after recovery was claimed`));
118
+ }
119
+ if (!(yield* (0, teardown_registry_ts_1.removeTeardownRegistrationIfPresentEffect)(input.coordinationRoot, id))) {
120
+ return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} changed before recovery could clear it`));
121
+ }
122
+ });
123
+ }
124
+ function emit(observer, event) {
125
+ try {
126
+ observer?.observe(Object.freeze(event));
127
+ }
128
+ catch {
129
+ // Feedback is transient and must never hold recovery authority closed.
130
+ }
131
+ }
132
+ function hookContext(input) {
133
+ return {
134
+ experimentId: input.experimentId,
135
+ selectedEvalIds: input.selectedEvalIds,
136
+ signal: input.signal ?? new AbortController().signal,
137
+ progress: (progress) => emit(input.observer, {
138
+ type: "experiment-progress",
139
+ experimentId: input.experimentId,
140
+ detail: progress.message,
141
+ }),
142
+ diagnostic: (diagnostic) => emit(input.observer, {
143
+ type: "diagnostic",
144
+ code: diagnostic.code,
145
+ level: diagnostic.level,
146
+ message: diagnostic.message,
147
+ ...(diagnostic.data === undefined ? {} : { data: Object.freeze({ ...diagnostic.data }) }),
148
+ }),
149
+ };
150
+ }
151
+ function runAuthorTeardown(input) {
152
+ const teardown = teardownOf(input.experiment);
153
+ if (teardown === undefined)
154
+ return effect_1.Effect.succeed(false);
155
+ return effect_1.Effect.gen(function* () {
156
+ const startedAt = yield* effect_1.Clock.currentTimeMillis;
157
+ emit(input.observer, {
158
+ type: "experiment-hook",
159
+ experimentId: input.experiment.id,
160
+ hook: "teardown",
161
+ status: "started",
162
+ ...(input.recovery ? { recovery: true } : {}),
163
+ });
164
+ const outcome = yield* effect_1.Effect.either((0, cleanup_timeout_ts_1.cleanupCallback)(() => teardown(hookContext({
165
+ experimentId: input.experiment.id,
166
+ selectedEvalIds: input.selectedEvalIds,
167
+ ...(input.observer === undefined ? {} : { observer: input.observer }),
168
+ ...(input.signal === undefined ? {} : { signal: input.signal }),
169
+ }))));
170
+ const completedAt = yield* effect_1.Clock.currentTimeMillis;
171
+ emit(input.observer, {
172
+ type: "experiment-hook",
173
+ experimentId: input.experiment.id,
174
+ hook: "teardown",
175
+ status: effect_1.Either.isRight(outcome) ? "done" : "failed",
176
+ durationMs: Math.max(0, completedAt - startedAt),
177
+ });
178
+ return outcome;
179
+ });
180
+ }
181
+ function inspectTeardown(input) {
182
+ return closeOperation("teardown-inspect", effect_1.Effect.gen(function* () {
183
+ const selection = yield* selectTeardowns(input);
184
+ if (input.experimentSelector !== undefined && selection.selected.length === 0) {
185
+ return noExperimentMatch(input.experimentSelector, selection);
186
+ }
187
+ const coordinationRoot = (0, node_path_1.resolve)(input.cwd, input.coordinationRoot ?? ".niceeval");
188
+ if (input.recoveryKey !== undefined) {
189
+ const record = yield* (0, shared_state_lease_ts_1.readSharedStateLeaseRecoveryTargetEffect)(coordinationRoot, input.recoveryKey);
190
+ if (record === undefined) {
191
+ return Object.freeze({ status: "no-evidence", key: input.recoveryKey });
192
+ }
193
+ const evidence = evidenceOf(record);
194
+ if (selection.selected.length !== 1) {
195
+ return Object.freeze({
196
+ status: "selection-not-unique",
197
+ experimentIds: freezeArray(selection.selected.map(({ experiment }) => experiment.id)),
198
+ evidence,
199
+ });
200
+ }
201
+ const target = selection.selected[0];
202
+ if (target.experiment.id !== record.experimentId) {
203
+ return Object.freeze({
204
+ status: "experiment-mismatch",
205
+ selectedExperimentId: target.experiment.id,
206
+ evidence,
207
+ });
208
+ }
209
+ if (teardownOf(target.experiment) === undefined) {
210
+ return Object.freeze({
211
+ status: "teardown-required",
212
+ experimentId: target.experiment.id,
213
+ evidence,
214
+ });
215
+ }
216
+ const registrations = yield* (0, teardown_registry_ts_1.readTeardownRegistrationsEffect)(coordinationRoot);
217
+ return Object.freeze({
218
+ status: "ready",
219
+ experimentIds: Object.freeze([target.experiment.id]),
220
+ orphanedRegistrations: registrations.filter(({ entry }) => entry.experimentId === target.experiment.id &&
221
+ (0, teardown_registry_ts_1.isOrphanedTeardownRegistration)(entry, input.currentHost)).length,
222
+ evidence,
223
+ });
224
+ }
225
+ const registrations = yield* (0, teardown_registry_ts_1.readTeardownRegistrationsEffect)(coordinationRoot);
226
+ const selectedIds = new Set(selection.selected.map(({ experiment }) => experiment.id));
227
+ return Object.freeze({
228
+ status: "ready",
229
+ experimentIds: freezeArray(selectedIds),
230
+ orphanedRegistrations: registrations.filter(({ entry }) => selectedIds.has(entry.experimentId) &&
231
+ (0, teardown_registry_ts_1.isOrphanedTeardownRegistration)(entry, input.currentHost)).length,
232
+ });
233
+ }));
234
+ }
235
+ function runExplicitRecovery(input, selection, record) {
236
+ return effect_1.Effect.gen(function* () {
237
+ const evidence = evidenceOf(record);
238
+ if (selection.selected.length !== 1) {
239
+ return Object.freeze({
240
+ status: "selection-not-unique",
241
+ experimentIds: freezeArray(selection.selected.map(({ experiment }) => experiment.id)),
242
+ evidence,
243
+ });
244
+ }
245
+ const target = selection.selected[0];
246
+ if (target.experiment.id !== record.experimentId) {
247
+ return Object.freeze({
248
+ status: "experiment-mismatch",
249
+ selectedExperimentId: target.experiment.id,
250
+ evidence,
251
+ });
252
+ }
253
+ if (teardownOf(target.experiment) === undefined) {
254
+ return Object.freeze({
255
+ status: "teardown-required",
256
+ experimentId: target.experiment.id,
257
+ evidence,
258
+ });
259
+ }
260
+ if (input.ownerToken === undefined ||
261
+ input.confirmOwnerTerminated !== true ||
262
+ input.confirmRemoteQuiesced !== true) {
263
+ return Object.freeze({ status: "recovery-confirmation-required", evidence });
264
+ }
265
+ const coordinationRoot = (0, node_path_1.resolve)(input.cwd, input.coordinationRoot ?? ".niceeval");
266
+ const begun = yield* (0, shared_state_lease_ts_1.beginExplicitSharedStateRecoveryEffect)({
267
+ niceevalRoot: coordinationRoot,
268
+ key: record.key,
269
+ ownerToken: input.ownerToken,
270
+ localHost: input.currentHost,
271
+ confirmOwnerTerminated: true,
272
+ confirmRemoteQuiesced: true,
273
+ });
274
+ const claimedEvidence = evidenceOf(begun.record);
275
+ const registrationFailureCode = begun._tag === "AlreadyReleased"
276
+ ? "shared-state-recovery-already-released-registration-failed"
277
+ : "shared-state-recovery-registration-failed";
278
+ const registrationWasPresent = yield* inspectExactRegistration({
279
+ coordinationRoot,
280
+ record: begun.record,
281
+ currentHost: input.currentHost,
282
+ }).pipe(effect_1.Effect.mapError((cause) => recoveryOperationError(registrationFailureCode, cause)));
283
+ if (begun._tag === "AlreadyReleased") {
284
+ yield* clearExactRegistration({
285
+ coordinationRoot,
286
+ record: begun.record,
287
+ currentHost: input.currentHost,
288
+ expectedRegistration: registrationWasPresent,
289
+ }).pipe(effect_1.Effect.mapError((cause) => recoveryOperationError(registrationFailureCode, cause)));
290
+ return Object.freeze({
291
+ status: "already-released",
292
+ key: begun.record.key,
293
+ experimentId: begun.record.experimentId,
294
+ ownerToken: begun.record.ownerToken,
295
+ });
296
+ }
297
+ const outcome = yield* runAuthorTeardown({
298
+ experiment: target.experiment,
299
+ selectedEvalIds: target.selectedEvalIds,
300
+ ...(input.observer === undefined ? {} : { observer: input.observer }),
301
+ ...(input.signal === undefined ? {} : { signal: input.signal }),
302
+ recovery: true,
303
+ });
304
+ if (outcome === false) {
305
+ return yield* effect_1.Effect.fail(new Error("Recovery target lost its required teardown callback."));
306
+ }
307
+ if (effect_1.Either.isLeft(outcome)) {
308
+ return Object.freeze({
309
+ status: "recovery-teardown-failed",
310
+ evidence: claimedEvidence,
311
+ error: outcome.left instanceof Error ? outcome.left.message : String(outcome.left),
312
+ });
313
+ }
314
+ yield* clearExactRegistration({
315
+ coordinationRoot,
316
+ record: begun.record,
317
+ currentHost: input.currentHost,
318
+ expectedRegistration: registrationWasPresent,
319
+ }).pipe(effect_1.Effect.mapError((cause) => recoveryOperationError(registrationFailureCode, cause)));
320
+ yield* (0, shared_state_lease_ts_1.completeExplicitSharedStateRecoveryEffect)({
321
+ niceevalRoot: coordinationRoot,
322
+ key: begun.record.key,
323
+ ownerToken: begun.record.ownerToken,
324
+ recoveryId: begun.recoveryId,
325
+ localHost: input.currentHost,
326
+ }).pipe(effect_1.Effect.mapError((cause) => recoveryOperationError("shared-state-recovery-completion-failed", cause)));
327
+ return Object.freeze({
328
+ status: "recovered",
329
+ key: begun.record.key,
330
+ experimentId: begun.record.experimentId,
331
+ ownerToken: begun.record.ownerToken,
332
+ });
333
+ });
334
+ }
335
+ function runTeardown(input) {
336
+ return closeOperation("teardown-run", effect_1.Effect.gen(function* () {
337
+ const inspection = yield* inspectTeardown(input);
338
+ if (inspection.status !== "ready")
339
+ return inspection;
340
+ const selection = yield* selectTeardowns(input);
341
+ if (input.recoveryKey !== undefined) {
342
+ if (inspection.evidence === undefined || selection.selected.length !== 1)
343
+ return inspection;
344
+ const record = yield* (0, shared_state_lease_ts_1.readSharedStateLeaseRecoveryTargetEffect)((0, node_path_1.resolve)(input.cwd, input.coordinationRoot ?? ".niceeval"), input.recoveryKey);
345
+ if (record === undefined) {
346
+ return Object.freeze({ status: "no-evidence", key: input.recoveryKey });
347
+ }
348
+ return yield* runExplicitRecovery(input, selection, record);
349
+ }
350
+ const coordinationRoot = (0, node_path_1.resolve)(input.cwd, input.coordinationRoot ?? ".niceeval");
351
+ const registrations = yield* (0, teardown_registry_ts_1.readTeardownRegistrationsEffect)(coordinationRoot);
352
+ const results = [];
353
+ for (const target of selection.selected) {
354
+ if (teardownOf(target.experiment) === undefined) {
355
+ results.push(Object.freeze({
356
+ experimentId: target.experiment.id,
357
+ executions: 0,
358
+ outcome: "not-configured",
359
+ }));
360
+ continue;
361
+ }
362
+ const matching = registrations.filter(({ entry }) => entry.experimentId === target.experiment.id);
363
+ const orphaned = matching.filter(({ entry }) => (0, teardown_registry_ts_1.isOrphanedTeardownRegistration)(entry, input.currentHost));
364
+ const claimed = yield* effect_1.Effect.all(orphaned.map(({ id }) => (0, teardown_registry_ts_1.removeTeardownRegistrationIfPresentEffect)(coordinationRoot, id)), {
365
+ concurrency: "unbounded",
366
+ });
367
+ const executions = matching.length === 0 ? 1 : claimed.filter(Boolean).length;
368
+ let failure;
369
+ for (let index = 0; index < executions; index += 1) {
370
+ const outcome = yield* runAuthorTeardown({
371
+ experiment: target.experiment,
372
+ selectedEvalIds: target.selectedEvalIds,
373
+ ...(input.observer === undefined ? {} : { observer: input.observer }),
374
+ ...(input.signal === undefined ? {} : { signal: input.signal }),
375
+ recovery: true,
376
+ });
377
+ if (outcome !== false && effect_1.Either.isLeft(outcome)) {
378
+ failure = outcome.left instanceof Error ? outcome.left.message : String(outcome.left);
379
+ }
380
+ }
381
+ results.push(Object.freeze({
382
+ experimentId: target.experiment.id,
383
+ executions,
384
+ outcome: failure === undefined ? "succeeded" : "failed",
385
+ ...(failure === undefined ? {} : { error: failure }),
386
+ }));
387
+ }
388
+ return Object.freeze({
389
+ status: "completed",
390
+ experiments: freezeArray(results),
391
+ });
392
+ }));
393
+ }
394
+ //# sourceMappingURL=teardown.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teardown.js","sourceRoot":"","sources":["teardown.ts"],"names":[],"mappings":";;AAgNA,0CAqDC;AAqGD,kCA+DC;AAzaD,yCAAoC;AACpC,mCAA+C;AAC/C,wEAAkE;AAClE,0DAA8E;AAC9E,sEAAwE;AACxE,8EAA+M;AAC/M,4EAAwQ;AAExQ,4DAAoE;AACpE,yCAAiD;AAEjD,SAAS,cAAc,CAAC,SAAkC,EAAE,KAAc;IACtE,IAAI,KAAK,YAAY,8BAAmB;QACpC,OAAO,KAAK,CAAC;IACjB,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,QAAQ;QACtG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpC,CAAC,CAAC,kCAAkC,CAAC;IACzC,OAAO,IAAI,8BAAmB,CAAC;QAC3B,SAAS;QACT,IAAI;QACJ,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAClE,CAAC,CAAC;AACP,CAAC;AACD,SAAS,cAAc,CAAU,SAAkC,EAAE,MAA8B;IAC/F,OAAO,MAAM,C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AAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;oBACrE,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;oBAC/D,QAAQ,EAAE,IAAI;iBACjB,CAAC,CAAC;gBACH,IAAI,OAAO,KAAK,KAAK,IAAI,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9C,OAAO,GAAG,OAAO,CAAC,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC1F,CAAC;YACL,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;gBACvB,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE;gBAClC,UAAU;gBACV,OAAO,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,WAAoB,CAAC,CAAC,CAAC,QAAiB;gBACzE,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;aACvD,CAAC,CAAC,CAAC;QACR,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;YACjB,MAAM,EAAE,WAAoB;YAC5B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;SACpC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC,CAAC;AACR,CAAC","sourcesContent":["import { resolve } from \"node:path\";\nimport { Clock, Effect, Either } from \"effect\";\nimport { cleanupCallback } from \"../../runner/cleanup-timeout.ts\";\nimport { discoverEvals, discoverExperiments } from \"../../runner/discover.ts\";\nimport { resolveExperimentEvals } from \"../../runner/eval-selection.ts\";\nimport { beginExplicitSharedStateRecoveryEffect, completeExplicitSharedStateRecoveryEffect, readSharedStateLeaseRecoveryTargetEffect, type SharedStateLeaseRecord, } from \"../../runner/shared-state-lease.ts\";\nimport { isExactTeardownRegistrationOwnerTerminatedEffect, isOrphanedTeardownRegistration, readExactTeardownRegistrationEffect, readTeardownRegistrationsEffect, removeTeardownRegistrationIfPresentEffect, teardownEntryId, } from \"../../runner/teardown-registry.ts\";\nimport type { DiscoveredExperiment, ExperimentHook, ExperimentHookContext, } from \"../../runner/types.ts\";\nimport { matchExperimentSelector } from \"../../shared/aggregate.ts\";\nimport { ExperimentHostError } from \"./types.ts\";\nimport type { ExperimentHostTeardownEvent, ExperimentHostTeardownObserver, ExperimentHostOperation, ExperimentHostSharedStateEvidence, ExperimentHostTeardownInspection, ExperimentHostTeardownInspectRequest, ExperimentHostTeardownRequest, ExperimentHostTeardownResult, } from \"./types.ts\";\nfunction operationError(operation: ExperimentHostOperation, cause: unknown): ExperimentHostError {\n if (cause instanceof ExperimentHostError)\n return cause;\n const code = typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"code\") === \"string\"\n ? String(Reflect.get(cause, \"code\"))\n : \"experiment-host-operation-failed\";\n return new ExperimentHostError({\n operation,\n code,\n message: cause instanceof Error ? cause.message : String(cause),\n });\n}\nfunction closeOperation<A, E, R>(operation: ExperimentHostOperation, effect: Effect.Effect<A, E, R>): Effect.Effect<A, ExperimentHostError, R> {\n return effect.pipe(Effect.mapError((cause) => operationError(operation, cause)));\n}\nfunction recoveryOperationError(code: string, cause: unknown): ExperimentHostError {\n return new ExperimentHostError({\n operation: \"teardown-run\",\n code,\n message: cause instanceof Error ? cause.message : String(cause),\n });\n}\ninterface TeardownSelection {\n readonly experimentIds: readonly string[];\n readonly selected: readonly {\n readonly experiment: DiscoveredExperiment;\n readonly selectedEvalIds: readonly string[];\n }[];\n}\nfunction freezeArray<A>(values: Iterable<A>): readonly A[] {\n return Object.freeze([...values]);\n}\nfunction selectTeardowns(input: {\n readonly cwd: string;\n readonly experimentSelector?: string;\n}): Effect.Effect<TeardownSelection, unknown> {\n return Effect.gen(function* () {\n const evals = yield* discoverEvals(input.cwd);\n const experiments = yield* discoverExperiments(input.cwd);\n const experimentIds = freezeArray(experiments.map((experiment) => experiment.id));\n const matched = input.experimentSelector === undefined\n ? experiments\n : experiments.filter((experiment) => matchExperimentSelector(experimentIds, input.experimentSelector!).includes(experiment.id));\n return Object.freeze({\n experimentIds,\n selected: freezeArray(matched.map((experiment) => {\n const selection = resolveExperimentEvals({\n experimentId: experiment.id,\n selector: experiment.evals,\n cliPatterns: [],\n evals,\n });\n return Object.freeze({\n experiment,\n selectedEvalIds: freezeArray(selection.selectedEvalIds),\n });\n })),\n });\n });\n}\nfunction teardownOf(experiment: DiscoveredExperiment): ExperimentHook | undefined {\n return typeof experiment.teardown === \"function\" ? experiment.teardown : undefined;\n}\nfunction evidenceOf(record: SharedStateLeaseRecord): ExperimentHostSharedStateEvidence {\n return Object.freeze({\n key: record.key,\n experimentId: record.experimentId,\n ownerToken: record.ownerToken,\n host: record.host,\n pid: record.pid,\n processIdentity: record.processIdentity,\n heartbeatAt: record.heartbeatAt,\n });\n}\nfunction noExperimentMatch(selector: string, selection: TeardownSelection): ExperimentHostTeardownInspection {\n return Object.freeze({\n status: \"experiment-no-match\" as const,\n selector,\n candidates: freezeArray([...selection.experimentIds].sort()),\n });\n}\nfunction inspectExactRegistration(input: {\n readonly coordinationRoot: string;\n readonly record: SharedStateLeaseRecord;\n readonly currentHost: string;\n}): Effect.Effect<boolean, unknown> {\n const id = teardownEntryId(input.record.experimentId, input.record.pid);\n return Effect.gen(function* () {\n const registration = yield* readExactTeardownRegistrationEffect(input.coordinationRoot, input.record.experimentId, input.record.pid);\n if (registration === undefined)\n return false;\n if (registration.host !== input.record.host) {\n return yield* Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} belongs to host ${JSON.stringify(registration.host)}, ` +\n `not immutable sharedState owner host ${JSON.stringify(input.record.host)}`));\n }\n const terminated = yield* isExactTeardownRegistrationOwnerTerminatedEffect({\n registration,\n owner: input.record,\n currentHost: input.currentHost,\n });\n if (!terminated) {\n return yield* Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} still belongs to a live exact sharedState owner`));\n }\n return true;\n });\n}\nfunction clearExactRegistration(input: {\n readonly coordinationRoot: string;\n readonly record: SharedStateLeaseRecord;\n readonly currentHost: string;\n readonly expectedRegistration: boolean;\n}): Effect.Effect<void, unknown> {\n const id = teardownEntryId(input.record.experimentId, input.record.pid);\n return Effect.gen(function* () {\n const present = yield* inspectExactRegistration(input);\n if (!present) {\n if (input.expectedRegistration) {\n return yield* Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} disappeared before recovery could clear it`));\n }\n return;\n }\n if (!input.expectedRegistration) {\n return yield* Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} appeared after recovery was claimed`));\n }\n if (!(yield* removeTeardownRegistrationIfPresentEffect(input.coordinationRoot, id))) {\n return yield* Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} changed before recovery could clear it`));\n }\n });\n}\nfunction emit(observer: ExperimentHostTeardownObserver | undefined, event: ExperimentHostTeardownEvent): void {\n try {\n observer?.observe(Object.freeze(event));\n }\n catch {\n // Feedback is transient and must never hold recovery authority closed.\n }\n}\nfunction hookContext(input: {\n readonly experimentId: string;\n readonly selectedEvalIds: readonly string[];\n readonly observer?: ExperimentHostTeardownObserver;\n readonly signal?: AbortSignal;\n}): ExperimentHookContext {\n return {\n experimentId: input.experimentId,\n selectedEvalIds: input.selectedEvalIds,\n signal: input.signal ?? new AbortController().signal,\n progress: (progress) => emit(input.observer, {\n type: \"experiment-progress\",\n experimentId: input.experimentId,\n detail: progress.message,\n }),\n diagnostic: (diagnostic) => emit(input.observer, {\n type: \"diagnostic\",\n code: diagnostic.code,\n level: diagnostic.level,\n message: diagnostic.message,\n ...(diagnostic.data === undefined ? {} : { data: Object.freeze({ ...diagnostic.data }) }),\n }),\n };\n}\nfunction runAuthorTeardown(input: {\n readonly experiment: DiscoveredExperiment;\n readonly selectedEvalIds: readonly string[];\n readonly observer?: ExperimentHostTeardownObserver;\n readonly signal?: AbortSignal;\n readonly recovery: boolean;\n}) {\n const teardown = teardownOf(input.experiment);\n if (teardown === undefined)\n return Effect.succeed(false as const);\n return Effect.gen(function* () {\n const startedAt = yield* Clock.currentTimeMillis;\n emit(input.observer, {\n type: \"experiment-hook\",\n experimentId: input.experiment.id,\n hook: \"teardown\",\n status: \"started\",\n ...(input.recovery ? { recovery: true } : {}),\n });\n const outcome = yield* Effect.either(cleanupCallback(() => teardown(hookContext({\n experimentId: input.experiment.id,\n selectedEvalIds: input.selectedEvalIds,\n ...(input.observer === undefined ? {} : { observer: input.observer }),\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n }))));\n const completedAt = yield* Clock.currentTimeMillis;\n emit(input.observer, {\n type: \"experiment-hook\",\n experimentId: input.experiment.id,\n hook: \"teardown\",\n status: Either.isRight(outcome) ? \"done\" : \"failed\",\n durationMs: Math.max(0, completedAt - startedAt),\n });\n return outcome;\n });\n}\nexport function inspectTeardown(input: ExperimentHostTeardownInspectRequest): Effect.Effect<ExperimentHostTeardownInspection, ExperimentHostError> {\n return closeOperation(\"teardown-inspect\", Effect.gen(function* () {\n const selection = yield* selectTeardowns(input);\n if (input.experimentSelector !== undefined && selection.selected.length === 0) {\n return noExperimentMatch(input.experimentSelector, selection);\n }\n const coordinationRoot = resolve(input.cwd, input.coordinationRoot ?? \".niceeval\");\n if (input.recoveryKey !== undefined) {\n const record = yield* readSharedStateLeaseRecoveryTargetEffect(coordinationRoot, input.recoveryKey);\n if (record === undefined) {\n return Object.freeze({ status: \"no-evidence\" as const, key: input.recoveryKey });\n }\n const evidence = evidenceOf(record);\n if (selection.selected.length !== 1) {\n return Object.freeze({\n status: \"selection-not-unique\" as const,\n experimentIds: freezeArray(selection.selected.map(({ experiment }) => experiment.id)),\n evidence,\n });\n }\n const target = selection.selected[0]!;\n if (target.experiment.id !== record.experimentId) {\n return Object.freeze({\n status: \"experiment-mismatch\" as const,\n selectedExperimentId: target.experiment.id,\n evidence,\n });\n }\n if (teardownOf(target.experiment) === undefined) {\n return Object.freeze({\n status: \"teardown-required\" as const,\n experimentId: target.experiment.id,\n evidence,\n });\n }\n const registrations = yield* readTeardownRegistrationsEffect(coordinationRoot);\n return Object.freeze({\n status: \"ready\" as const,\n experimentIds: Object.freeze([target.experiment.id]),\n orphanedRegistrations: registrations.filter(({ entry }) => entry.experimentId === target.experiment.id &&\n isOrphanedTeardownRegistration(entry, input.currentHost)).length,\n evidence,\n });\n }\n const registrations = yield* readTeardownRegistrationsEffect(coordinationRoot);\n const selectedIds = new Set(selection.selected.map(({ experiment }) => experiment.id));\n return Object.freeze({\n status: \"ready\" as const,\n experimentIds: freezeArray(selectedIds),\n orphanedRegistrations: registrations.filter(({ entry }) => selectedIds.has(entry.experimentId) &&\n isOrphanedTeardownRegistration(entry, input.currentHost)).length,\n });\n }));\n}\nfunction runExplicitRecovery(input: ExperimentHostTeardownRequest, selection: TeardownSelection, record: SharedStateLeaseRecord): Effect.Effect<ExperimentHostTeardownResult, unknown> {\n return Effect.gen(function* () {\n const evidence = evidenceOf(record);\n if (selection.selected.length !== 1) {\n return Object.freeze({\n status: \"selection-not-unique\" as const,\n experimentIds: freezeArray(selection.selected.map(({ experiment }) => experiment.id)),\n evidence,\n });\n }\n const target = selection.selected[0]!;\n if (target.experiment.id !== record.experimentId) {\n return Object.freeze({\n status: \"experiment-mismatch\" as const,\n selectedExperimentId: target.experiment.id,\n evidence,\n });\n }\n if (teardownOf(target.experiment) === undefined) {\n return Object.freeze({\n status: \"teardown-required\" as const,\n experimentId: target.experiment.id,\n evidence,\n });\n }\n if (input.ownerToken === undefined ||\n input.confirmOwnerTerminated !== true ||\n input.confirmRemoteQuiesced !== true) {\n return Object.freeze({ status: \"recovery-confirmation-required\" as const, evidence });\n }\n const coordinationRoot = resolve(input.cwd, input.coordinationRoot ?? \".niceeval\");\n const begun = yield* beginExplicitSharedStateRecoveryEffect({\n niceevalRoot: coordinationRoot,\n key: record.key,\n ownerToken: input.ownerToken,\n localHost: input.currentHost,\n confirmOwnerTerminated: true,\n confirmRemoteQuiesced: true,\n });\n const claimedEvidence = evidenceOf(begun.record);\n const registrationFailureCode = begun._tag === \"AlreadyReleased\"\n ? \"shared-state-recovery-already-released-registration-failed\"\n : \"shared-state-recovery-registration-failed\";\n const registrationWasPresent = yield* inspectExactRegistration({\n coordinationRoot,\n record: begun.record,\n currentHost: input.currentHost,\n }).pipe(Effect.mapError((cause) => recoveryOperationError(registrationFailureCode, cause)));\n if (begun._tag === \"AlreadyReleased\") {\n yield* clearExactRegistration({\n coordinationRoot,\n record: begun.record,\n currentHost: input.currentHost,\n expectedRegistration: registrationWasPresent,\n }).pipe(Effect.mapError((cause) => recoveryOperationError(registrationFailureCode, cause)));\n return Object.freeze({\n status: \"already-released\" as const,\n key: begun.record.key,\n experimentId: begun.record.experimentId,\n ownerToken: begun.record.ownerToken,\n });\n }\n const outcome = yield* runAuthorTeardown({\n experiment: target.experiment,\n selectedEvalIds: target.selectedEvalIds,\n ...(input.observer === undefined ? {} : { observer: input.observer }),\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n recovery: true,\n });\n if (outcome === false) {\n return yield* Effect.fail(new Error(\"Recovery target lost its required teardown callback.\"));\n }\n if (Either.isLeft(outcome)) {\n return Object.freeze({\n status: \"recovery-teardown-failed\" as const,\n evidence: claimedEvidence,\n error: outcome.left instanceof Error ? outcome.left.message : String(outcome.left),\n });\n }\n yield* clearExactRegistration({\n coordinationRoot,\n record: begun.record,\n currentHost: input.currentHost,\n expectedRegistration: registrationWasPresent,\n }).pipe(Effect.mapError((cause) => recoveryOperationError(registrationFailureCode, cause)));\n yield* completeExplicitSharedStateRecoveryEffect({\n niceevalRoot: coordinationRoot,\n key: begun.record.key,\n ownerToken: begun.record.ownerToken,\n recoveryId: begun.recoveryId,\n localHost: input.currentHost,\n }).pipe(Effect.mapError((cause) => recoveryOperationError(\"shared-state-recovery-completion-failed\", cause)));\n return Object.freeze({\n status: \"recovered\" as const,\n key: begun.record.key,\n experimentId: begun.record.experimentId,\n ownerToken: begun.record.ownerToken,\n });\n });\n}\nexport function runTeardown(input: ExperimentHostTeardownRequest): Effect.Effect<ExperimentHostTeardownResult, ExperimentHostError> {\n return closeOperation(\"teardown-run\", Effect.gen(function* () {\n const inspection = yield* inspectTeardown(input);\n if (inspection.status !== \"ready\")\n return inspection;\n const selection = yield* selectTeardowns(input);\n if (input.recoveryKey !== undefined) {\n if (inspection.evidence === undefined || selection.selected.length !== 1)\n return inspection;\n const record = yield* readSharedStateLeaseRecoveryTargetEffect(resolve(input.cwd, input.coordinationRoot ?? \".niceeval\"), input.recoveryKey);\n if (record === undefined) {\n return Object.freeze({ status: \"no-evidence\" as const, key: input.recoveryKey });\n }\n return yield* runExplicitRecovery(input, selection, record);\n }\n const coordinationRoot = resolve(input.cwd, input.coordinationRoot ?? \".niceeval\");\n const registrations = yield* readTeardownRegistrationsEffect(coordinationRoot);\n const results: Array<{\n readonly experimentId: string;\n readonly executions: number;\n readonly outcome: \"succeeded\" | \"failed\" | \"not-configured\";\n readonly error?: string;\n }> = [];\n for (const target of selection.selected) {\n if (teardownOf(target.experiment) === undefined) {\n results.push(Object.freeze({\n experimentId: target.experiment.id,\n executions: 0,\n outcome: \"not-configured\" as const,\n }));\n continue;\n }\n const matching = registrations.filter(({ entry }) => entry.experimentId === target.experiment.id);\n const orphaned = matching.filter(({ entry }) => isOrphanedTeardownRegistration(entry, input.currentHost));\n const claimed = yield* Effect.all(orphaned.map(({ id }) => removeTeardownRegistrationIfPresentEffect(coordinationRoot, id)), {\n concurrency: \"unbounded\",\n });\n const executions = matching.length === 0 ? 1 : claimed.filter(Boolean).length;\n let failure: string | undefined;\n for (let index = 0; index < executions; index += 1) {\n const outcome = yield* runAuthorTeardown({\n experiment: target.experiment,\n selectedEvalIds: target.selectedEvalIds,\n ...(input.observer === undefined ? {} : { observer: input.observer }),\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n recovery: true,\n });\n if (outcome !== false && Either.isLeft(outcome)) {\n failure = outcome.left instanceof Error ? outcome.left.message : String(outcome.left);\n }\n }\n results.push(Object.freeze({\n experimentId: target.experiment.id,\n executions,\n outcome: failure === undefined ? \"succeeded\" as const : \"failed\" as const,\n ...(failure === undefined ? {} : { error: failure }),\n }));\n }\n return Object.freeze({\n status: \"completed\" as const,\n experiments: freezeArray(results),\n });\n }));\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { ExperimentHostError } from "./types.cjs";
3
+ import type { ExperimentHostTeardownInspection, ExperimentHostTeardownInspectRequest, ExperimentHostTeardownRequest, ExperimentHostTeardownResult } from "./types.cjs";
4
+ export declare function inspectTeardown(input: ExperimentHostTeardownInspectRequest): Effect.Effect<ExperimentHostTeardownInspection, ExperimentHostError>;
5
+ export declare function runTeardown(input: ExperimentHostTeardownRequest): Effect.Effect<ExperimentHostTeardownResult, ExperimentHostError>;
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { ExperimentHostError } from "./types.mjs";
3
+ import type { ExperimentHostTeardownInspection, ExperimentHostTeardownInspectRequest, ExperimentHostTeardownRequest, ExperimentHostTeardownResult } from "./types.mjs";
4
+ export declare function inspectTeardown(input: ExperimentHostTeardownInspectRequest): Effect.Effect<ExperimentHostTeardownInspection, ExperimentHostError>;
5
+ export declare function runTeardown(input: ExperimentHostTeardownRequest): Effect.Effect<ExperimentHostTeardownResult, ExperimentHostError>;
@@ -0,0 +1,5 @@
1
+ import { Effect } from "effect";
2
+ import { ExperimentHostError } from "./types.js";
3
+ import type { ExperimentHostTeardownInspection, ExperimentHostTeardownInspectRequest, ExperimentHostTeardownRequest, ExperimentHostTeardownResult } from "./types.js";
4
+ export declare function inspectTeardown(input: ExperimentHostTeardownInspectRequest): Effect.Effect<ExperimentHostTeardownInspection, ExperimentHostError>;
5
+ export declare function runTeardown(input: ExperimentHostTeardownRequest): Effect.Effect<ExperimentHostTeardownResult, ExperimentHostError>;
@@ -0,0 +1,8 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./teardown.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["inspectTeardown"];
5
+ export { __niceevalExport0 as inspectTeardown };
6
+ const __niceevalExport1 = __niceevalCanonical["runTeardown"];
7
+ export { __niceevalExport1 as runTeardown };
8
+ //# sourceMappingURL=teardown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teardown.js","sources":[],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExperimentHostError = void 0;
4
+ const effect_1 = require("effect");
5
+ /** Stable typed failure boundary; defects and interruption remain separate. */
6
+ class ExperimentHostError extends effect_1.Data.TaggedError("ExperimentHostError") {
7
+ }
8
+ exports.ExperimentHostError = ExperimentHostError;
9
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAc3C,+EAA+E;AAC/E,MAAa,mBAAoB,SAAQ,aAAI,CAAC,WAAW,CAAC,qBAAqB,CAI7E;CACD;AALD,kDAKC","sourcesContent":["import { Data, type Effect } from \"effect\";\nimport type { Config } from \"../../types.ts\";\nimport type { AnalysisCurrentSlotIdentity, AnalysisSelectionRequest } from \"../../analysis/contracts.ts\";\nimport type { RecordAutomaticMigrationResult } from \"../../record/host/types.ts\";\nimport type { FeedbackCoordinator } from \"../../runner/feedback/coordinator.ts\";\nimport type { InvocationCompletion } from \"../../runner/types.ts\";\nimport type { SessionListDocument, SessionShowDocument } from \"../../runner/session.ts\";\nimport type { CurrentReuseReadbackSnapshot } from \"../../runner/reuse-readback.ts\";\nexport type ExperimentHostJsonValue = null | boolean | number | string | readonly ExperimentHostJsonValue[] | {\n readonly [key: string]: ExperimentHostJsonValue;\n};\n/** Services supplied once by the outer Node/application composition edge. */\nexport type ExperimentHostRequirements = import(\"../../record/platform/services.ts\").RecordFileSystem | import(\"../../record/platform/services.ts\").RecordEntropy | import(\"../../record/platform/services.ts\").RecordGit | import(\"../../coordination/record-leases.ts\").RecordCoordination;\nexport type ExperimentHostOperation = \"catalog\" | \"check\" | \"debug\" | \"invocation-plan\" | \"invocation-run\" | \"rename-plan\" | \"rename-apply\" | \"accept\" | \"resolve-project-current\" | \"invocation-status-list\" | \"invocation-status-show\" | \"teardown-inspect\" | \"teardown-run\";\n/** Stable typed failure boundary; defects and interruption remain separate. */\nexport class ExperimentHostError extends Data.TaggedError(\"ExperimentHostError\")<{\n readonly operation: ExperimentHostOperation;\n readonly code: string;\n readonly message: string;\n}> {\n}\n/** Inputs shared by discovery, link checking, and invocation planning. */\nexport interface ExperimentHostSelectionInput {\n readonly cwd: string;\n readonly experimentSelector?: string;\n readonly evalSelectors?: readonly string[];\n readonly tag?: string;\n}\nexport interface ExperimentHostEvalSummary {\n readonly id: string;\n readonly description?: string;\n readonly tags: readonly string[];\n readonly evaluationKind: \"pass\" | \"score\";\n}\nexport interface ExperimentHostExperimentSummary {\n readonly id: string;\n readonly description?: string;\n readonly agent: string;\n readonly model?: string;\n readonly attempts: number;\n readonly evalIds: readonly string[];\n readonly labels: Readonly<Record<string, string | number>>;\n readonly hasSetup: boolean;\n readonly hasTeardown: boolean;\n readonly sharedStateKey?: string;\n}\nexport interface ExperimentHostCatalog {\n readonly status: \"listed\";\n readonly evals: readonly ExperimentHostEvalSummary[];\n readonly experimentIds: readonly string[];\n readonly experiments: readonly ExperimentHostExperimentSummary[];\n}\nexport type ExperimentHostSelectionProblem = {\n readonly status: \"experiment-no-match\";\n readonly selector: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"eval-no-match\";\n readonly selector: string;\n readonly experimentIds: readonly string[];\n readonly candidates: readonly string[];\n} | {\n readonly status: \"empty-selection\";\n readonly experimentIds: readonly string[];\n readonly candidates: readonly string[];\n};\nexport interface ExperimentHostRunOverrides {\n readonly attempts?: number;\n readonly earlyExit?: boolean;\n readonly timeoutMs?: number;\n readonly budget?: number;\n readonly rerun?: \"failed\" | \"all\";\n readonly keepSandbox?: \"failed\" | \"all\";\n readonly maxConcurrency?: number;\n readonly maxBuildConcurrency?: number;\n}\nexport interface ExperimentHostCheckRequest extends ExperimentHostSelectionInput {\n readonly config: Config;\n readonly overrides?: ExperimentHostRunOverrides;\n}\nexport type ExperimentHostCheckResult = ExperimentHostSelectionProblem | {\n readonly status: \"linked\";\n readonly experimentIds: readonly string[];\n readonly evalIds: readonly string[];\n readonly pairCount: number;\n};\ndeclare const invocationPlanBrand: unique symbol;\n/**\n * Opaque in-memory authority issued by `experimentHost.invocation.plan`.\n * Its Runner graph is held in Host-private storage and cannot be forged or\n * reconstructed by a CLI.\n */\nexport interface ExperimentHostInvocationPlan {\n readonly [invocationPlanBrand]: typeof invocationPlanBrand;\n}\nexport interface ExperimentHostInvocationShape {\n readonly experiments: number;\n readonly evals: number;\n readonly configurations: number;\n readonly totalAttempts: number;\n readonly attempts: number;\n readonly maxConcurrency: number;\n readonly maxBuildConcurrency: number;\n readonly experimentConcurrency: Readonly<Record<string, number>>;\n}\nexport interface ExperimentHostDrySlotTarget {\n readonly runId: string;\n readonly slotId: string;\n readonly experimentId: string;\n readonly evalId: string;\n readonly evalGroupId?: string;\n readonly evalGroupIndex?: number;\n readonly attempt: number;\n}\nexport interface ExperimentHostDryComparison {\n readonly attachment: string;\n readonly recordedClaim: string;\n readonly sourceState: string;\n readonly result: string;\n readonly reason: string;\n}\nexport type ExperimentHostDrySlot = {\n readonly state: \"reuse\";\n readonly target: ExperimentHostDrySlotTarget;\n readonly source: {\n readonly attemptId: string;\n readonly originRunId: string;\n readonly originSlotId: string;\n readonly sourceRunId: string;\n };\n readonly comparisons: readonly ExperimentHostDryComparison[];\n} | {\n readonly state: \"gap\";\n readonly target: ExperimentHostDrySlotTarget;\n readonly reason: string;\n readonly scope: \"slot\" | \"experiment\" | \"target\";\n readonly issues: readonly ExperimentHostJsonValue[];\n readonly comparisons: readonly ExperimentHostDryComparison[];\n};\nexport interface ExperimentHostDryPlan {\n readonly policy: {\n readonly name: \"project-target\";\n readonly version: 1;\n };\n readonly slots: readonly ExperimentHostDrySlot[];\n readonly readbacks: readonly CurrentReuseReadbackSnapshot[];\n readonly lockedPairs: readonly string[];\n}\nexport type ExperimentHostInvocationPlanResult = (ExperimentHostSelectionProblem | {\n readonly status: \"ready\";\n readonly plan: ExperimentHostInvocationPlan;\n readonly shape: ExperimentHostInvocationShape;\n readonly experimentIds: readonly string[];\n readonly evalIds: readonly string[];\n readonly pluginAudit: {\n readonly occurrences: readonly ExperimentHostJsonValue[];\n };\n readonly dry?: ExperimentHostDryPlan;\n}) & {\n /** Exact Record Host result for the ordinary-entry migration notice. */\n readonly automaticMigration: RecordAutomaticMigrationResult;\n};\nexport interface ExperimentHostInvocationPlanRequest extends ExperimentHostSelectionInput {\n readonly config: Config;\n /** Host path to the portable Record root; defaults to cwd/.niceeval/record. */\n readonly recordRoot?: string;\n /** Host path to process coordination state; defaults to cwd/.niceeval. */\n readonly coordinationRoot?: string;\n readonly overrides?: ExperimentHostRunOverrides;\n readonly preview?: boolean;\n}\n/** Lossless Experiment presentation owned by the calling Host surface. */\nexport interface ExperimentHostInvocationFeedback {\n readonly coordinator: FeedbackCoordinator;\n}\nexport interface ExperimentHostInvocationRunRequest {\n readonly plan: ExperimentHostInvocationPlan;\n readonly signal?: AbortSignal;\n readonly feedback?: ExperimentHostInvocationFeedback;\n /** Optional required JUnit reporter target, owned and invoked inside Host. */\n readonly junitPath?: string;\n}\n/**\n * Closed project-current selection issued by the Experiment Host. It carries\n * identities, never a Runner, reader, or project discovery capability.\n */\nexport interface ExperimentHostProjectCurrentTarget {\n readonly selection: AnalysisSelectionRequest;\n readonly currentSlots: readonly AnalysisCurrentSlotIdentity[];\n /** Source files whose changes require a fresh project-current calculation. */\n readonly watchInputs: readonly string[];\n}\nexport interface ExperimentHostProjectCurrentRequest {\n readonly cwd: string;\n readonly config: Config;\n /** Exact Experiment selectors supplied by a Report-facing caller. */\n readonly experimentSelectors?: readonly string[];\n /** Rebuild trusted definition modules before resolving the target. */\n readonly freshImport?: boolean;\n}\n/**\n * Invocation status is project-local and ephemeral. It is an observation of\n * the coordination directory, not recoverable Record fact data.\n */\nexport interface ExperimentHostInvocationStatusListRequest {\n readonly cwd: string;\n readonly all?: boolean;\n readonly experimentSelector?: string;\n}\nexport interface ExperimentHostInvocationStatusShowRequest {\n readonly cwd: string;\n readonly invocationSelector: string;\n}\nexport type ExperimentHostInvocationStatusList = SessionListDocument;\nexport type ExperimentHostInvocationStatusShow = SessionShowDocument;\nexport interface ExperimentHostInvocationReceipt {\n readonly invocationId: string;\n readonly runIds: readonly string[];\n readonly startedAt: string;\n readonly completedAt?: string;\n readonly completion: \"completed\" | \"interrupted\" | \"failed\";\n}\nexport interface ExperimentHostInvocationSummary {\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly skipped: number;\n readonly errored: number;\n readonly durationMs: number;\n readonly inputTokens?: number;\n readonly outputTokens?: number;\n readonly estimatedCostUSD?: number;\n}\nexport interface ExperimentHostInvocationResult {\n readonly status: \"finished\";\n readonly receipt: ExperimentHostInvocationReceipt;\n readonly summary: ExperimentHostInvocationSummary;\n /** Present when the caller supplied the one feedback reducer/presentation. */\n readonly completion?: InvocationCompletion;\n /** Exact CLI exit fold for the supplied presentation. */\n readonly exitCode?: number;\n}\nexport interface ExperimentHostRenameRequest {\n readonly cwd: string;\n readonly oldId: string;\n readonly newId: string;\n readonly recordRoot?: string;\n readonly sourceRunId?: string;\n readonly config?: Config;\n readonly operatorReason?: string;\n}\nexport type ExperimentHostRenameReason = \"source-empty\" | \"target-not-found\" | \"target-has-results\" | \"source-unreadable\" | \"artifact-unavailable\" | \"nothing-to-migrate\";\nexport interface ExperimentHostRenamePlan {\n readonly status: \"plan\";\n readonly oldId: string;\n readonly newId: string;\n readonly migrations: readonly {\n readonly evalId: string;\n readonly sourceLocator: string;\n readonly targetExperimentId: string;\n readonly fingerprint: string;\n }[];\n readonly excluded: readonly {\n readonly evalId: string;\n readonly reason: string;\n }[];\n readonly blocked?: {\n readonly reason: ExperimentHostRenameReason;\n readonly evalId?: string;\n readonly conflictingEvals?: readonly string[];\n readonly detail?: string;\n };\n}\nexport type ExperimentHostRenameResult = {\n readonly status: \"rejected\";\n readonly oldId: string;\n readonly newId: string;\n readonly reason: ExperimentHostRenameReason;\n readonly evalId?: string;\n readonly conflictingEvals?: readonly string[];\n readonly detail?: string;\n} | {\n readonly status: \"done\";\n readonly invocationId: string;\n readonly runId: string;\n readonly snapshotPath: string;\n readonly oldId: string;\n readonly newId: string;\n readonly migrated: readonly {\n readonly evalId: string;\n readonly sourceLocator: string;\n readonly locator: string;\n readonly fingerprint: string;\n readonly verdict: \"passed\" | \"failed\";\n }[];\n};\nexport interface ExperimentHostAcceptRequest {\n readonly cwd: string;\n readonly locators: readonly string[];\n readonly recordRoot?: string;\n readonly config?: Config;\n readonly operatorReason?: string;\n}\nexport interface ExperimentHostAcceptedAttempt {\n readonly invocationId: string;\n readonly runId: string;\n readonly slotId: string;\n readonly locator: string;\n readonly sourceLocator: string;\n readonly fingerprint: string;\n}\nexport interface ExperimentHostSharedStateEvidence {\n readonly key: string;\n readonly experimentId: string;\n readonly ownerToken: string;\n readonly host: string;\n readonly pid: number;\n readonly processIdentity: string;\n readonly heartbeatAt: string;\n}\nexport interface ExperimentHostTeardownInspectRequest {\n readonly cwd: string;\n readonly experimentSelector?: string;\n readonly coordinationRoot?: string;\n readonly currentHost: string;\n readonly recoveryKey?: string;\n}\nexport type ExperimentHostTeardownInspection = {\n readonly status: \"no-evidence\";\n readonly key: string;\n} | ExperimentHostSelectionProblem | {\n readonly status: \"selection-not-unique\";\n readonly experimentIds: readonly string[];\n readonly evidence: ExperimentHostSharedStateEvidence;\n} | {\n readonly status: \"experiment-mismatch\";\n readonly selectedExperimentId: string;\n readonly evidence: ExperimentHostSharedStateEvidence;\n} | {\n readonly status: \"teardown-required\";\n readonly experimentId: string;\n readonly evidence: ExperimentHostSharedStateEvidence;\n} | {\n readonly status: \"ready\";\n readonly experimentIds: readonly string[];\n readonly orphanedRegistrations: number;\n readonly evidence?: ExperimentHostSharedStateEvidence;\n};\nexport interface ExperimentHostTeardownRequest extends ExperimentHostTeardownInspectRequest {\n readonly observer?: ExperimentHostTeardownObserver;\n readonly signal?: AbortSignal;\n readonly ownerToken?: string;\n readonly confirmOwnerTerminated?: boolean;\n readonly confirmRemoteQuiesced?: boolean;\n}\nexport type ExperimentHostTeardownEvent = {\n readonly type: \"experiment-progress\";\n readonly experimentId: string;\n readonly detail: string;\n} | {\n readonly type: \"diagnostic\";\n readonly code: string;\n readonly level: \"info\" | \"warning\" | \"error\";\n readonly message: string;\n readonly data?: Readonly<Record<string, ExperimentHostJsonValue>>;\n} | {\n readonly type: \"experiment-hook\";\n readonly experimentId: string;\n readonly hook: \"teardown\";\n readonly status: \"started\" | \"done\" | \"failed\";\n readonly durationMs?: number;\n readonly recovery?: true;\n};\nexport interface ExperimentHostTeardownObserver {\n readonly observe: (event: ExperimentHostTeardownEvent) => void;\n}\nexport type ExperimentHostTeardownResult = ExperimentHostTeardownInspection | {\n readonly status: \"completed\";\n readonly experiments: readonly {\n readonly experimentId: string;\n readonly executions: number;\n readonly outcome: \"succeeded\" | \"failed\" | \"not-configured\";\n readonly error?: string;\n }[];\n} | {\n readonly status: \"recovered\" | \"already-released\";\n readonly key: string;\n readonly experimentId: string;\n readonly ownerToken: string;\n} | {\n readonly status: \"recovery-confirmation-required\";\n readonly evidence: ExperimentHostSharedStateEvidence;\n} | {\n readonly status: \"recovery-teardown-failed\";\n readonly evidence: ExperimentHostSharedStateEvidence;\n readonly error: string;\n};\nexport interface ExperimentHostHighLevelSDK {\n readonly catalog: (input: ExperimentHostSelectionInput) => Effect.Effect<ExperimentHostCatalog, ExperimentHostError, ExperimentHostRequirements>;\n readonly check: (input: ExperimentHostCheckRequest) => Effect.Effect<ExperimentHostCheckResult, ExperimentHostError, ExperimentHostRequirements>;\n readonly invocation: {\n readonly plan: (input: ExperimentHostInvocationPlanRequest) => Effect.Effect<ExperimentHostInvocationPlanResult, ExperimentHostError, ExperimentHostRequirements>;\n readonly run: (input: ExperimentHostInvocationRunRequest) => Effect.Effect<ExperimentHostInvocationResult, ExperimentHostError, ExperimentHostRequirements>;\n };\n readonly resolveProjectCurrentTarget: (input: ExperimentHostProjectCurrentRequest) => Effect.Effect<ExperimentHostProjectCurrentTarget, ExperimentHostError, ExperimentHostRequirements>;\n readonly invocationStatus: {\n readonly list: (input: ExperimentHostInvocationStatusListRequest) => Effect.Effect<ExperimentHostInvocationStatusList, ExperimentHostError, ExperimentHostRequirements>;\n readonly show: (input: ExperimentHostInvocationStatusShowRequest) => Effect.Effect<ExperimentHostInvocationStatusShow, ExperimentHostError, ExperimentHostRequirements>;\n };\n readonly rename: {\n readonly plan: (input: ExperimentHostRenameRequest) => Effect.Effect<ExperimentHostRenamePlan, ExperimentHostError, ExperimentHostRequirements>;\n readonly apply: (input: ExperimentHostRenameRequest) => Effect.Effect<ExperimentHostRenameResult, ExperimentHostError, ExperimentHostRequirements>;\n };\n readonly teardown: {\n readonly inspect: (input: ExperimentHostTeardownInspectRequest) => Effect.Effect<ExperimentHostTeardownInspection, ExperimentHostError, ExperimentHostRequirements>;\n readonly run: (input: ExperimentHostTeardownRequest) => Effect.Effect<ExperimentHostTeardownResult, ExperimentHostError, ExperimentHostRequirements>;\n };\n readonly accept: (input: ExperimentHostAcceptRequest) => Effect.Effect<readonly ExperimentHostAcceptedAttempt[], ExperimentHostError, ExperimentHostRequirements>;\n}\n"]}