niceeval 0.13.1 → 0.13.2

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 (548) hide show
  1. package/INDEX.md +25 -2
  2. package/README.md +9 -10
  3. package/README.zh.md +9 -10
  4. package/dist/agents/ai-sdk.cjs.map +1 -1
  5. package/dist/agents/ai-sdk.d.cts +1 -1
  6. package/dist/agents/ai-sdk.d.mts +1 -1
  7. package/dist/agents/ai-sdk.d.ts +1 -1
  8. package/dist/agents/bub-install-spec.cjs +19 -5
  9. package/dist/agents/bub-install-spec.cjs.map +1 -1
  10. package/dist/agents/bub-install-spec.d.cts +9 -2
  11. package/dist/agents/bub-install-spec.d.mts +9 -2
  12. package/dist/agents/bub-install-spec.d.ts +9 -2
  13. package/dist/agents/bub-install-spec.js +14 -12
  14. package/dist/agents/bub.cjs +10 -6
  15. package/dist/agents/bub.cjs.map +1 -1
  16. package/dist/agents/bub.d.cts +2 -2
  17. package/dist/agents/bub.d.mts +2 -2
  18. package/dist/agents/bub.d.ts +2 -2
  19. package/dist/agents/claude-code.cjs.map +1 -1
  20. package/dist/agents/claude-code.d.cts +2 -2
  21. package/dist/agents/claude-code.d.mts +2 -2
  22. package/dist/agents/claude-code.d.ts +2 -2
  23. package/dist/agents/codex.cjs +4 -4
  24. package/dist/agents/codex.cjs.map +1 -1
  25. package/dist/agents/codex.d.cts +3 -3
  26. package/dist/agents/codex.d.mts +3 -3
  27. package/dist/agents/codex.d.ts +3 -3
  28. package/dist/agents/coding-cli-versions.cjs +10 -1
  29. package/dist/agents/coding-cli-versions.cjs.map +1 -1
  30. package/dist/agents/coding-cli-versions.d.cts +8 -3
  31. package/dist/agents/coding-cli-versions.d.mts +8 -3
  32. package/dist/agents/coding-cli-versions.d.ts +8 -3
  33. package/dist/agents/coding-cli-versions.js +18 -12
  34. package/dist/agents/deepseek-harness.cjs +151 -0
  35. package/dist/agents/deepseek-harness.cjs.map +1 -0
  36. package/dist/agents/deepseek-harness.d.cts +14 -0
  37. package/dist/agents/deepseek-harness.d.mts +14 -0
  38. package/dist/agents/deepseek-harness.d.ts +14 -0
  39. package/dist/agents/deepseek-harness.js +7 -0
  40. package/dist/agents/deepseek-harness.js.map +1 -0
  41. package/dist/agents/exact-npm-plugins.cjs +28 -0
  42. package/dist/agents/exact-npm-plugins.cjs.map +1 -0
  43. package/dist/agents/exact-npm-plugins.d.cts +10 -0
  44. package/dist/agents/exact-npm-plugins.d.mts +10 -0
  45. package/dist/agents/exact-npm-plugins.d.ts +10 -0
  46. package/dist/agents/exact-npm-plugins.js +8 -0
  47. package/dist/agents/exact-npm-plugins.js.map +1 -0
  48. package/dist/agents/index.cjs +5 -1
  49. package/dist/agents/index.cjs.map +1 -1
  50. package/dist/agents/index.d.cts +4 -0
  51. package/dist/agents/index.d.mts +4 -0
  52. package/dist/agents/index.d.ts +4 -0
  53. package/dist/agents/index.js +54 -50
  54. package/dist/agents/index.mjs +54 -50
  55. package/dist/agents/omp.cjs +170 -0
  56. package/dist/agents/omp.cjs.map +1 -0
  57. package/dist/agents/omp.d.cts +14 -0
  58. package/dist/agents/omp.d.mts +14 -0
  59. package/dist/agents/omp.d.ts +14 -0
  60. package/dist/agents/omp.js +7 -0
  61. package/dist/agents/omp.js.map +1 -0
  62. package/dist/agents/openclaw.cjs +51 -2
  63. package/dist/agents/openclaw.cjs.map +1 -1
  64. package/dist/agents/openclaw.d.cts +2 -0
  65. package/dist/agents/openclaw.d.mts +2 -0
  66. package/dist/agents/openclaw.d.ts +2 -0
  67. package/dist/agents/types.cjs.map +1 -1
  68. package/dist/agents/types.d.cts +4 -4
  69. package/dist/agents/types.d.mts +4 -4
  70. package/dist/agents/types.d.ts +4 -4
  71. package/dist/agents/ui-message-stream.cjs +24 -7
  72. package/dist/agents/ui-message-stream.cjs.map +1 -1
  73. package/dist/analysis/api.cjs +28 -2
  74. package/dist/analysis/api.cjs.map +1 -1
  75. package/dist/analysis/api.d.cts +22 -1
  76. package/dist/analysis/api.d.mts +22 -1
  77. package/dist/analysis/api.d.ts +22 -1
  78. package/dist/analysis/api.js +8 -6
  79. package/dist/analysis/bindings.cjs +11 -18
  80. package/dist/analysis/bindings.cjs.map +1 -1
  81. package/dist/analysis/bindings.d.cts +177 -49
  82. package/dist/analysis/bindings.d.mts +177 -49
  83. package/dist/analysis/bindings.d.ts +177 -49
  84. package/dist/analysis/contracts.cjs +1 -0
  85. package/dist/analysis/contracts.cjs.map +1 -1
  86. package/dist/analysis/contracts.d.cts +43 -3
  87. package/dist/analysis/contracts.d.mts +43 -3
  88. package/dist/analysis/contracts.d.ts +43 -3
  89. package/dist/analysis/cost-projection.cjs +2 -1
  90. package/dist/analysis/cost-projection.cjs.map +1 -1
  91. package/dist/analysis/cost-projection.d.cts +1 -1
  92. package/dist/analysis/cost-projection.d.mts +1 -1
  93. package/dist/analysis/cost-projection.d.ts +1 -1
  94. package/dist/analysis/cost.cjs +13 -3
  95. package/dist/analysis/cost.cjs.map +1 -1
  96. package/dist/analysis/cost.d.cts +10 -3
  97. package/dist/analysis/cost.d.mts +10 -3
  98. package/dist/analysis/cost.d.ts +10 -3
  99. package/dist/analysis/experiment-groups.cjs +96 -0
  100. package/dist/analysis/experiment-groups.cjs.map +1 -0
  101. package/dist/analysis/experiment-groups.d.cts +9 -0
  102. package/dist/analysis/experiment-groups.d.mts +9 -0
  103. package/dist/analysis/experiment-groups.d.ts +9 -0
  104. package/dist/analysis/experiment-groups.js +10 -0
  105. package/dist/analysis/experiment-groups.js.map +1 -0
  106. package/dist/analysis/index.cjs +4 -1
  107. package/dist/analysis/index.cjs.map +1 -1
  108. package/dist/analysis/index.d.cts +4 -2
  109. package/dist/analysis/index.d.mts +4 -2
  110. package/dist/analysis/index.d.ts +4 -2
  111. package/dist/analysis/index.js +40 -36
  112. package/dist/analysis/index.mjs +40 -36
  113. package/dist/assertions/limits.cjs +4 -0
  114. package/dist/assertions/limits.cjs.map +1 -1
  115. package/dist/assertions/limits.d.cts +4 -0
  116. package/dist/assertions/limits.d.mts +4 -0
  117. package/dist/assertions/limits.d.ts +4 -0
  118. package/dist/assertions/match.cjs +63 -25
  119. package/dist/assertions/match.cjs.map +1 -1
  120. package/dist/assertions/match.d.cts +7 -0
  121. package/dist/assertions/match.d.mts +7 -0
  122. package/dist/assertions/match.d.ts +7 -0
  123. package/dist/assertions/record/attachment.cjs +32 -4
  124. package/dist/assertions/record/attachment.cjs.map +1 -1
  125. package/dist/assertions/record/diff.cjs +10 -4
  126. package/dist/assertions/record/diff.cjs.map +1 -1
  127. package/dist/assertions/record/producer.cjs +101 -4
  128. package/dist/assertions/record/producer.cjs.map +1 -1
  129. package/dist/assertions/record/producer.d.cts +4 -1
  130. package/dist/assertions/record/producer.d.mts +4 -1
  131. package/dist/assertions/record/producer.d.ts +4 -1
  132. package/dist/assertions/runtime.cjs +45 -5
  133. package/dist/assertions/runtime.cjs.map +1 -1
  134. package/dist/cli/record.cjs +113 -8
  135. package/dist/cli/record.cjs.map +1 -1
  136. package/dist/cli/record.d.cts +20 -1
  137. package/dist/cli/record.d.mts +20 -1
  138. package/dist/cli/record.d.ts +20 -1
  139. package/dist/cli/record.js +4 -2
  140. package/dist/cli.cjs +386 -31
  141. package/dist/cli.cjs.map +1 -1
  142. package/dist/cli.d.cts +10 -2
  143. package/dist/cli.d.mts +10 -2
  144. package/dist/cli.d.ts +10 -2
  145. package/dist/context/send-retry.cjs +4 -4
  146. package/dist/context/send-retry.cjs.map +1 -1
  147. package/dist/coordination/host/runtime.cjs +8 -30
  148. package/dist/coordination/host/runtime.cjs.map +1 -1
  149. package/dist/coordination/host/runtime.d.cts +3 -3
  150. package/dist/coordination/host/runtime.d.mts +3 -3
  151. package/dist/coordination/host/runtime.d.ts +3 -3
  152. package/dist/coordination/host/types.cjs.map +1 -1
  153. package/dist/coordination/host/types.d.cts +0 -5
  154. package/dist/coordination/host/types.d.mts +0 -5
  155. package/dist/coordination/host/types.d.ts +0 -5
  156. package/dist/coordination/platform/node.cjs +90 -9
  157. package/dist/coordination/platform/node.cjs.map +1 -1
  158. package/dist/define.cjs +25 -1
  159. package/dist/define.cjs.map +1 -1
  160. package/dist/experiment/host/index.cjs +1 -0
  161. package/dist/experiment/host/index.cjs.map +1 -1
  162. package/dist/i18n/en.cjs +26 -8
  163. package/dist/i18n/en.cjs.map +1 -1
  164. package/dist/i18n/en.d.cts +19 -6
  165. package/dist/i18n/en.d.mts +19 -6
  166. package/dist/i18n/en.d.ts +19 -6
  167. package/dist/index.cjs.map +1 -1
  168. package/dist/index.d.cts +1 -1
  169. package/dist/index.d.mts +1 -1
  170. package/dist/index.d.ts +1 -1
  171. package/dist/o11y/parsers/hermes.cjs +1 -1
  172. package/dist/o11y/parsers/hermes.cjs.map +1 -1
  173. package/dist/o11y/prices.json +1 -1
  174. package/dist/o11y/record/families.cjs +12 -3
  175. package/dist/o11y/record/families.cjs.map +1 -1
  176. package/dist/o11y/record/families.d.cts +8 -8
  177. package/dist/o11y/record/families.d.mts +8 -8
  178. package/dist/o11y/record/families.d.ts +8 -8
  179. package/dist/o11y/record/family-projectors.d.cts +66 -18
  180. package/dist/o11y/record/family-projectors.d.mts +66 -18
  181. package/dist/o11y/record/family-projectors.d.ts +66 -18
  182. package/dist/o11y/record/family-writers.d.cts +11 -3
  183. package/dist/o11y/record/family-writers.d.mts +11 -3
  184. package/dist/o11y/record/family-writers.d.ts +11 -3
  185. package/dist/o11y/record/runner-producer.cjs +14 -4
  186. package/dist/o11y/record/runner-producer.cjs.map +1 -1
  187. package/dist/record/codec/core.d.cts +2 -2
  188. package/dist/record/codec/core.d.mts +2 -2
  189. package/dist/record/codec/core.d.ts +2 -2
  190. package/dist/record/family/catalog.d.cts +44 -12
  191. package/dist/record/family/catalog.d.mts +44 -12
  192. package/dist/record/family/catalog.d.ts +44 -12
  193. package/dist/record/family/index.js +128 -124
  194. package/dist/record/family/observability-v1.cjs +35 -0
  195. package/dist/record/family/observability-v1.cjs.map +1 -0
  196. package/dist/record/family/observability-v1.d.cts +3 -0
  197. package/dist/record/family/observability-v1.d.mts +3 -0
  198. package/dist/record/family/observability-v1.d.ts +3 -0
  199. package/dist/record/family/observability-v1.js +6 -0
  200. package/dist/record/family/observability-v1.js.map +1 -0
  201. package/dist/record/family/observability.cjs +58 -9
  202. package/dist/record/family/observability.cjs.map +1 -1
  203. package/dist/record/family/observability.d.cts +1014 -15
  204. package/dist/record/family/observability.d.mts +1014 -15
  205. package/dist/record/family/observability.d.ts +1014 -15
  206. package/dist/record/family/observability.js +22 -18
  207. package/dist/record/host/runtime.cjs +600 -31
  208. package/dist/record/host/runtime.cjs.map +1 -1
  209. package/dist/record/host/types.cjs.map +1 -1
  210. package/dist/record/host/types.d.cts +33 -9
  211. package/dist/record/host/types.d.mts +33 -9
  212. package/dist/record/host/types.d.ts +33 -9
  213. package/dist/record/maintenance/runtime.cjs +1 -2
  214. package/dist/record/maintenance/runtime.cjs.map +1 -1
  215. package/dist/record/model/core.cjs.map +1 -1
  216. package/dist/record/model/core.d.cts +1 -1
  217. package/dist/record/model/core.d.mts +1 -1
  218. package/dist/record/model/core.d.ts +1 -1
  219. package/dist/record/model/definition.d.cts +6 -6
  220. package/dist/record/model/definition.d.mts +6 -6
  221. package/dist/record/model/definition.d.ts +6 -6
  222. package/dist/record/model/identifiers.cjs +1 -1
  223. package/dist/record/model/identifiers.cjs.map +1 -1
  224. package/dist/record/model/identifiers.d.cts +1 -1
  225. package/dist/record/model/identifiers.d.mts +1 -1
  226. package/dist/record/model/identifiers.d.ts +1 -1
  227. package/dist/record/platform/node.cjs +159 -23
  228. package/dist/record/platform/node.cjs.map +1 -1
  229. package/dist/record/platform/services.cjs.map +1 -1
  230. package/dist/record/platform/services.d.cts +15 -2
  231. package/dist/record/platform/services.d.mts +15 -2
  232. package/dist/record/platform/services.d.ts +15 -2
  233. package/dist/record/reader/errors.cjs +37 -1
  234. package/dist/record/reader/errors.cjs.map +1 -1
  235. package/dist/record/reader/errors.d.cts +49 -1
  236. package/dist/record/reader/errors.d.mts +49 -1
  237. package/dist/record/reader/errors.d.ts +49 -1
  238. package/dist/record/reader/errors.js +22 -12
  239. package/dist/record/reader/format.cjs +76 -17
  240. package/dist/record/reader/format.cjs.map +1 -1
  241. package/dist/record/reader/format.d.cts +11 -4
  242. package/dist/record/reader/format.d.mts +11 -4
  243. package/dist/record/reader/format.d.ts +11 -4
  244. package/dist/record/reader/format.js +2 -0
  245. package/dist/record/reader/index.js +32 -18
  246. package/dist/record/reader/runtime.cjs +64 -0
  247. package/dist/record/reader/runtime.cjs.map +1 -1
  248. package/dist/record/reader/runtime.d.cts +15 -0
  249. package/dist/record/reader/runtime.d.mts +15 -0
  250. package/dist/record/reader/runtime.d.ts +15 -0
  251. package/dist/record/reader/runtime.js +2 -0
  252. package/dist/report/assets/styles.css +53 -29
  253. package/dist/report/built-in/analysis-values.cjs +21 -13
  254. package/dist/report/built-in/analysis-values.cjs.map +1 -1
  255. package/dist/report/built-in/analysis-values.d.cts +11 -22
  256. package/dist/report/built-in/analysis-values.d.mts +11 -22
  257. package/dist/report/built-in/analysis-values.d.ts +11 -22
  258. package/dist/report/built-in/analysis-values.js +4 -6
  259. package/dist/report/built-in/index.cjs +1 -3
  260. package/dist/report/built-in/index.cjs.map +1 -1
  261. package/dist/report/built-in/index.d.cts +1 -1
  262. package/dist/report/built-in/index.d.mts +1 -1
  263. package/dist/report/built-in/index.d.ts +1 -1
  264. package/dist/report/built-in/index.js +4 -8
  265. package/dist/report/built-in/index.mjs +4 -8
  266. package/dist/report/built-in/machine.cjs +0 -2
  267. package/dist/report/built-in/machine.cjs.map +1 -1
  268. package/dist/report/built-in/machine.d.cts +0 -2
  269. package/dist/report/built-in/machine.d.mts +0 -2
  270. package/dist/report/built-in/machine.d.ts +0 -2
  271. package/dist/report/built-in/result-components.cjs +49 -51
  272. package/dist/report/built-in/result-components.cjs.map +1 -1
  273. package/dist/report/built-in/result-components.d.cts +16 -17
  274. package/dist/report/built-in/result-components.d.mts +16 -17
  275. package/dist/report/built-in/result-components.d.ts +16 -17
  276. package/dist/report/built-in/result-components.js +0 -4
  277. package/dist/report/built-in/run-membership-overview.cjs +126 -17
  278. package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
  279. package/dist/report/built-in/run-membership-overview.d.cts +14 -0
  280. package/dist/report/built-in/run-membership-overview.d.mts +14 -0
  281. package/dist/report/built-in/run-membership-overview.d.ts +14 -0
  282. package/dist/report/built-in/run-membership-overview.js +4 -2
  283. package/dist/report/built-in/standard.cjs +80 -45
  284. package/dist/report/built-in/standard.cjs.map +1 -1
  285. package/dist/report/built-in/standard.d.cts +19 -41
  286. package/dist/report/built-in/standard.d.mts +19 -41
  287. package/dist/report/built-in/standard.d.ts +19 -41
  288. package/dist/report/built-in/standard.js +6 -6
  289. package/dist/report/components/attempt-detail/compute.cjs +78 -2
  290. package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
  291. package/dist/report/components/attempt-detail/compute.d.cts +1 -1
  292. package/dist/report/components/attempt-detail/compute.d.mts +1 -1
  293. package/dist/report/components/attempt-detail/compute.d.ts +1 -1
  294. package/dist/report/components/attempt-detail/content.cjs +1 -1
  295. package/dist/report/components/attempt-detail/content.cjs.map +1 -1
  296. package/dist/report/components/entity-lists/compute.cjs +42 -5
  297. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  298. package/dist/report/components/entity-lists/compute.d.cts +10 -8
  299. package/dist/report/components/entity-lists/compute.d.mts +10 -8
  300. package/dist/report/components/entity-lists/compute.d.ts +10 -8
  301. package/dist/report/components/entity-lists/content.cjs +31 -6
  302. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  303. package/dist/report/components/entity-lists/index.cjs +9 -4
  304. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  305. package/dist/report/components/entity-lists/index.d.cts +4 -7
  306. package/dist/report/components/entity-lists/index.d.mts +4 -7
  307. package/dist/report/components/entity-lists/index.d.ts +4 -7
  308. package/dist/report/components/summaries/compute.cjs +8 -1
  309. package/dist/report/components/summaries/compute.cjs.map +1 -1
  310. package/dist/report/components/summaries/compute.d.cts +9 -1
  311. package/dist/report/components/summaries/compute.d.mts +9 -1
  312. package/dist/report/components/summaries/compute.d.ts +9 -1
  313. package/dist/report/components/summaries/index.cjs +48 -4
  314. package/dist/report/components/summaries/index.cjs.map +1 -1
  315. package/dist/report/components/summaries/index.d.cts +7 -4
  316. package/dist/report/components/summaries/index.d.mts +7 -4
  317. package/dist/report/components/summaries/index.d.ts +7 -4
  318. package/dist/report/definition/cell.cjs +3 -0
  319. package/dist/report/definition/cell.cjs.map +1 -1
  320. package/dist/report/definition/cell.d.cts +2 -0
  321. package/dist/report/definition/cell.d.mts +2 -0
  322. package/dist/report/definition/cell.d.ts +2 -0
  323. package/dist/report/definition/primitives/chart.cjs +8 -5
  324. package/dist/report/definition/primitives/chart.cjs.map +1 -1
  325. package/dist/report/definition/primitives/points-dataset.cjs +1 -0
  326. package/dist/report/definition/primitives/points-dataset.cjs.map +1 -1
  327. package/dist/report/definition/primitives.cjs +15 -2
  328. package/dist/report/definition/primitives.cjs.map +1 -1
  329. package/dist/report/definition/report.cjs +27 -3
  330. package/dist/report/definition/report.cjs.map +1 -1
  331. package/dist/report/definition/report.d.cts +8 -0
  332. package/dist/report/definition/report.d.mts +8 -0
  333. package/dist/report/definition/report.d.ts +8 -0
  334. package/dist/report/execution/machine.cjs +30 -14
  335. package/dist/report/execution/machine.cjs.map +1 -1
  336. package/dist/report/execution/machine.d.cts +20 -10
  337. package/dist/report/execution/machine.d.mts +20 -10
  338. package/dist/report/execution/machine.d.ts +20 -10
  339. package/dist/report/execution/machine.js +6 -6
  340. package/dist/report/host/execute.cjs +25 -16
  341. package/dist/report/host/execute.cjs.map +1 -1
  342. package/dist/report/host/execute.d.cts +4 -0
  343. package/dist/report/host/execute.d.mts +4 -0
  344. package/dist/report/host/execute.d.ts +4 -0
  345. package/dist/report/host/from-record.cjs +22 -5
  346. package/dist/report/host/from-record.cjs.map +1 -1
  347. package/dist/report/host/machine.cjs +53 -11
  348. package/dist/report/host/machine.cjs.map +1 -1
  349. package/dist/report/host/site-runtime.cjs +9 -8
  350. package/dist/report/host/site-runtime.cjs.map +1 -1
  351. package/dist/report/host/site-runtime.d.cts +1 -1
  352. package/dist/report/host/site-runtime.d.mts +1 -1
  353. package/dist/report/host/site-runtime.d.ts +1 -1
  354. package/dist/report/host/static.cjs +56 -9
  355. package/dist/report/host/static.cjs.map +1 -1
  356. package/dist/report/index.cjs.map +1 -1
  357. package/dist/report/index.d.cts +1 -1
  358. package/dist/report/index.d.mts +1 -1
  359. package/dist/report/index.d.ts +1 -1
  360. package/dist/report/model/dataset.cjs +7 -2
  361. package/dist/report/model/dataset.cjs.map +1 -1
  362. package/dist/report/model/locale.cjs +2 -0
  363. package/dist/report/model/locale.cjs.map +1 -1
  364. package/dist/report/model/locale.d.cts +1 -0
  365. package/dist/report/model/locale.d.mts +1 -0
  366. package/dist/report/model/locale.d.ts +1 -0
  367. package/dist/report/model/metrics.cjs +3 -1
  368. package/dist/report/model/metrics.cjs.map +1 -1
  369. package/dist/report/model/pricing.cjs +16 -11
  370. package/dist/report/model/pricing.cjs.map +1 -1
  371. package/dist/report/react/styles.css +53 -29
  372. package/dist/runner/adoption.cjs +1 -0
  373. package/dist/runner/adoption.cjs.map +1 -1
  374. package/dist/runner/attempt.cjs +44 -5
  375. package/dist/runner/attempt.cjs.map +1 -1
  376. package/dist/runner/attempt.d.cts +13 -1
  377. package/dist/runner/attempt.d.mts +13 -1
  378. package/dist/runner/attempt.d.ts +13 -1
  379. package/dist/runner/config-identity.cjs +10 -2
  380. package/dist/runner/config-identity.cjs.map +1 -1
  381. package/dist/runner/config-identity.d.cts +4 -2
  382. package/dist/runner/config-identity.d.mts +4 -2
  383. package/dist/runner/config-identity.d.ts +4 -2
  384. package/dist/runner/feedback/human.cjs +298 -59
  385. package/dist/runner/feedback/human.cjs.map +1 -1
  386. package/dist/runner/feedback/json.cjs +14 -6
  387. package/dist/runner/feedback/json.cjs.map +1 -1
  388. package/dist/runner/feedback/json.d.cts +3 -2
  389. package/dist/runner/feedback/json.d.mts +3 -2
  390. package/dist/runner/feedback/json.d.ts +3 -2
  391. package/dist/runner/feedback/reducer.cjs +2 -0
  392. package/dist/runner/feedback/reducer.cjs.map +1 -1
  393. package/dist/runner/judge-config.cjs +1 -1
  394. package/dist/runner/judge-config.cjs.map +1 -1
  395. package/dist/runner/ledger.cjs +124 -12
  396. package/dist/runner/ledger.cjs.map +1 -1
  397. package/dist/runner/project-current.cjs +13 -5
  398. package/dist/runner/project-current.cjs.map +1 -1
  399. package/dist/runner/run.cjs +564 -256
  400. package/dist/runner/run.cjs.map +1 -1
  401. package/dist/runner/sandbox-pool.cjs +161 -30
  402. package/dist/runner/sandbox-pool.cjs.map +1 -1
  403. package/dist/runner/sandbox-pool.d.cts +34 -2
  404. package/dist/runner/sandbox-pool.d.mts +34 -2
  405. package/dist/runner/sandbox-pool.d.ts +34 -2
  406. package/dist/runner/shared-state-lease.cjs +803 -0
  407. package/dist/runner/shared-state-lease.cjs.map +1 -0
  408. package/dist/runner/shared-state-lease.d.cts +121 -0
  409. package/dist/runner/shared-state-lease.d.mts +121 -0
  410. package/dist/runner/shared-state-lease.d.ts +121 -0
  411. package/dist/runner/shared-state-lease.js +24 -0
  412. package/dist/runner/shared-state-lease.js.map +1 -0
  413. package/dist/runner/teardown-registry.cjs +97 -34
  414. package/dist/runner/teardown-registry.cjs.map +1 -1
  415. package/dist/runner/teardown-registry.d.cts +27 -1
  416. package/dist/runner/teardown-registry.d.mts +27 -1
  417. package/dist/runner/teardown-registry.d.ts +27 -1
  418. package/dist/runner/teardown-registry.js +20 -16
  419. package/dist/runner/types.cjs.map +1 -1
  420. package/dist/runner/types.d.cts +31 -5
  421. package/dist/runner/types.d.mts +31 -5
  422. package/dist/runner/types.d.ts +31 -5
  423. package/dist/sample/analysis.cjs +249 -459
  424. package/dist/sample/analysis.cjs.map +1 -1
  425. package/dist/sample/capability.cjs +138 -7
  426. package/dist/sample/capability.cjs.map +1 -1
  427. package/dist/sample/capability.d.cts +3 -1
  428. package/dist/sample/capability.d.mts +3 -1
  429. package/dist/sample/capability.d.ts +3 -1
  430. package/dist/sample/capability.js +8 -6
  431. package/dist/sandbox/docker-agent-image.cjs +5 -1
  432. package/dist/sandbox/docker-agent-image.cjs.map +1 -1
  433. package/dist/sandbox/docker-agent-image.d.cts +2 -0
  434. package/dist/sandbox/docker-agent-image.d.mts +2 -0
  435. package/dist/sandbox/docker-agent-image.d.ts +2 -0
  436. package/dist/sandbox/docker-agent-image.js +14 -10
  437. package/dist/sandbox/docker-profile/schema.cjs +283 -534
  438. package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
  439. package/dist/sandbox/docker-profile/schema.d.cts +10 -27
  440. package/dist/sandbox/docker-profile/schema.d.mts +10 -27
  441. package/dist/sandbox/docker-profile/schema.d.ts +10 -27
  442. package/dist/sandbox/e2b-agent-template.cjs +5 -2
  443. package/dist/sandbox/e2b-agent-template.cjs.map +1 -1
  444. package/dist/sandbox/index.cjs +4 -2
  445. package/dist/sandbox/index.cjs.map +1 -1
  446. package/dist/sandbox/index.d.cts +1 -1
  447. package/dist/sandbox/index.d.mts +1 -1
  448. package/dist/sandbox/index.d.ts +1 -1
  449. package/dist/sandbox/index.js +120 -116
  450. package/dist/sandbox/index.mjs +120 -116
  451. package/dist/sandbox/keep-registry.cjs +28 -66
  452. package/dist/sandbox/keep-registry.cjs.map +1 -1
  453. package/dist/sandbox/types.cjs.map +1 -1
  454. package/dist/sandbox/types.d.cts +1 -1
  455. package/dist/sandbox/types.d.mts +1 -1
  456. package/dist/sandbox/types.d.ts +1 -1
  457. package/dist/shared/aggregate.cjs +16 -6
  458. package/dist/shared/aggregate.cjs.map +1 -1
  459. package/dist/shared/aggregate.d.cts +12 -4
  460. package/dist/shared/aggregate.d.mts +12 -4
  461. package/dist/shared/aggregate.d.ts +12 -4
  462. package/dist/shared/turn-label.cjs +20 -2
  463. package/dist/shared/turn-label.cjs.map +1 -1
  464. package/dist/shared/turn-label.d.cts +2 -0
  465. package/dist/shared/turn-label.d.mts +2 -0
  466. package/dist/shared/turn-label.d.ts +2 -0
  467. package/dist/shared/turn-label.js +4 -2
  468. package/dist/vendor/remark/remark-gfm.cjs +7 -7
  469. package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
  470. package/dist/vendor/remark/remark-parse.cjs +12 -12
  471. package/dist/vendor/remark/remark-parse.cjs.map +1 -1
  472. package/dist/vendor/remark/remark.cjs +13 -13
  473. package/dist/vendor/remark/remark.cjs.map +1 -1
  474. package/dist/view/server.cjs +6 -0
  475. package/dist/view/server.cjs.map +1 -1
  476. package/docs-site/images/hitl-handshake-zh.svg +3 -3
  477. package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
  478. package/docs-site/zh/examples/coding-agent-extensions.mdx +1 -1
  479. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +4 -3
  480. package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
  481. package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
  482. package/docs-site/zh/examples/integrations/langgraph.mdx +4 -4
  483. package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
  484. package/docs-site/zh/explanation/adapter.mdx +5 -5
  485. package/docs-site/zh/explanation/assert.mdx +7 -7
  486. package/docs-site/zh/explanation/drive.mdx +4 -2
  487. package/docs-site/zh/explanation/evals.mdx +10 -8
  488. package/docs-site/zh/explanation/experiment.mdx +2 -2
  489. package/docs-site/zh/explanation/hitl.mdx +9 -9
  490. package/docs-site/zh/explanation/judge.mdx +5 -5
  491. package/docs-site/zh/explanation/overview.mdx +3 -3
  492. package/docs-site/zh/explanation/runner.mdx +1 -1
  493. package/docs-site/zh/index.mdx +3 -3
  494. package/docs-site/zh/reference/builtin-agents.mdx +13 -13
  495. package/docs-site/zh/reference/capabilities.mdx +1 -1
  496. package/docs-site/zh/reference/cli.mdx +18 -12
  497. package/docs-site/zh/reference/define-agent.mdx +130 -5
  498. package/docs-site/zh/reference/define-config.mdx +2 -2
  499. package/docs-site/zh/reference/define-eval.mdx +4 -4
  500. package/docs-site/zh/reference/events.mdx +11 -11
  501. package/docs-site/zh/reference/official-adapters.mdx +6 -6
  502. package/docs-site/zh/reference/results-data.mdx +6 -0
  503. package/docs-site/zh/troubleshooting/debugging.mdx +1 -1
  504. package/docs-site/zh/troubleshooting/recover-after-kill.mdx +37 -5
  505. package/docs-site/zh/tutorials/accept-results.mdx +72 -0
  506. package/docs-site/zh/tutorials/agent-onboarding.mdx +6 -6
  507. package/docs-site/zh/tutorials/authoring.mdx +9 -13
  508. package/docs-site/zh/tutorials/ci-integration.mdx +6 -6
  509. package/docs-site/zh/tutorials/compare-runs.mdx +61 -0
  510. package/docs-site/zh/tutorials/concurrency.mdx +13 -12
  511. package/docs-site/zh/tutorials/configuration.mdx +4 -6
  512. package/docs-site/zh/tutorials/connect-your-agent.mdx +1 -1
  513. package/docs-site/zh/tutorials/control-run-cost.mdx +58 -0
  514. package/docs-site/zh/tutorials/criteria-files.mdx +2 -2
  515. package/docs-site/zh/tutorials/custom-reports.mdx +2 -2
  516. package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +46 -0
  517. package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -43
  518. package/docs-site/zh/tutorials/eval-groups.mdx +6 -6
  519. package/docs-site/zh/tutorials/evaluation-kinds.mdx +3 -3
  520. package/docs-site/zh/tutorials/experiments.mdx +2 -3
  521. package/docs-site/zh/tutorials/handle-execution-failures.mdx +18 -10
  522. package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +16 -8
  523. package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
  524. package/docs-site/zh/tutorials/plugins.mdx +14 -0
  525. package/docs-site/zh/tutorials/rerun-and-cache.mdx +4 -2
  526. package/docs-site/zh/tutorials/sandbox-agent.mdx +17 -11
  527. package/docs-site/zh/tutorials/sandbox-providers.mdx +17 -13
  528. package/docs-site/zh/tutorials/sandbox-reuse.mdx +12 -19
  529. package/docs-site/zh/tutorials/select-and-preview.mdx +65 -0
  530. package/docs-site/zh/tutorials/verify-judge.mdx +78 -0
  531. package/docs-site/zh/tutorials/viewing-results.mdx +38 -1
  532. package/docs-site/zh/tutorials/write-experiment.mdx +7 -5
  533. package/docs-site/zh/tutorials/write-send.mdx +9 -8
  534. package/package.json +9 -5
  535. package/dist/report/built-in/overview.cjs +0 -44
  536. package/dist/report/built-in/overview.cjs.map +0 -1
  537. package/dist/report/built-in/overview.d.cts +0 -6
  538. package/dist/report/built-in/overview.d.mts +0 -6
  539. package/dist/report/built-in/overview.d.ts +0 -6
  540. package/dist/report/built-in/overview.js +0 -9
  541. package/dist/report/built-in/overview.js.map +0 -1
  542. package/dist/runner/gate-lease.cjs +0 -283
  543. package/dist/runner/gate-lease.cjs.map +0 -1
  544. package/dist/runner/gate-lease.d.cts +0 -62
  545. package/dist/runner/gate-lease.d.mts +0 -62
  546. package/dist/runner/gate-lease.d.ts +0 -62
  547. package/dist/runner/gate-lease.js +0 -22
  548. package/dist/runner/gate-lease.js.map +0 -1
@@ -61,7 +61,7 @@ export default defineSandboxAgent({
61
61
  name: "my-cli-agent",
62
62
  evidenceCoverage: completeEvidenceCoverage,
63
63
  ensure: {
64
- identity: { agent: "my-cli-agent", version: "1.0.0" },
64
+ identity: { agent: "my-cli-agent", version: "1.0.0", revision: "1" },
65
65
  probe: command("my-agent", ["--version"]),
66
66
  },
67
67
  async send(input, ctx) {
@@ -303,7 +303,7 @@ SandboxLayer command 按实验隔离跨 attempt 的基础设施内容,或 adap
303
303
  readonly evalId?: string;
304
304
  ```
305
305
 
306
- 当前 Attempt 对应的 eval id。NiceEval runner 始终从 discovery 后的 Eval 身份填入;
306
+ 当前 Attempt 对应的 eval ID。NiceEval Runner 始终从 discovery 后的评估用例身份填入;
307
307
  第三方直接构造 AgentContext 时可省略。Adapter 可用它定位与题目同目录的只读宿主资产,
308
308
  但不能据此绕过 Sandbox 的隐藏判据隔离。
309
309
 
@@ -316,7 +316,7 @@ readonly evalGroup?: {
316
316
  };
317
317
  ```
318
318
 
319
- 当前 Attempt 的 Eval Group;未分组 Eval 省略。
319
+ 当前 Attempt 的评估组;未分组评估用例省略。
320
320
 
321
321
  #### `attempt`
322
322
 
@@ -388,12 +388,137 @@ log(msg: string): void;
388
388
 
389
389
  ## Sandbox 接口
390
390
 
391
- Sandbox 型 agent 的 `ctx.sandbox`(`Sandbox`)是当前隔离环境的句柄。`CommandOptions` 是 `runCommand` / `runShell` 的可选项:
391
+ Sandbox 型 agent 的 `ctx.sandbox`(`Sandbox`)是当前隔离环境的句柄。`Sandbox` 继承 `SandboxOperations` 与 `SandboxTransferOperations`,下方按声明接口列出全部成员。`CommandOptions` 是 `runCommand` / `runShell` 的可选项:
392
392
 
393
393
  {/* GENERATED:BEGIN sandbox-methods */}
394
394
 
395
395
  {/* 本区块由 pnpm docs:reference 从源码注释生成,勿手改;要改文案,改对应源码的 TSDoc/JSDoc(映射见 scripts/generate-reference.ts) */}
396
396
 
397
+ ### `SandboxOperations`
398
+
399
+ #### `workdir`
400
+
401
+ ```ts
402
+ readonly workdir: string;
403
+ ```
404
+
405
+ Sandbox 内项目/工作区根目录的绝对路径(agent 命令的默认 cwd,也是 git baseline 提交的位置)。各方法的相对路径都以此为基准解析,省略 `cwd`/`targetDir` 时也落到这里。
406
+
407
+ #### `runCommand`
408
+
409
+ ```ts
410
+ runCommand(cmd: string, args?: readonly string[], opts?: CommandOptions): Promise<CommandResult>;
411
+ ```
412
+
413
+ 执行单个命令,`args` 作为独立 argv 传递、不经 shell 解释(无 `&&`、管道、通配符展开)。
414
+ 只想跑一个可执行文件、参数来自外部输入、担心注入时优先用它。
415
+
416
+ #### `runShell`
417
+
418
+ ```ts
419
+ runShell(script: string, opts?: CommandOptions): Promise<CommandResult>;
420
+ ```
421
+
422
+ 执行一整段脚本,经 shell(bash)解释,支持 `&&`、管道、`$()`、重定向等。
423
+ 需要拼多条命令或做条件判断时用它。
424
+
425
+ #### `runCommandOrThrow`
426
+
427
+ ```ts
428
+ runCommandOrThrow(
429
+ cmd: string,
430
+ args?: readonly string[],
431
+ opts?: CommandOptions,
432
+ ): Promise<SuccessfulCommandResult>;
433
+ ```
434
+
435
+ 像 `runCommand` 一样执行单个命令,但非零退出时抛出 `SandboxCommandExitError`。错误消息附带
436
+ 有界、已清理和脱敏的 stderr 尾部;stderr 为空时回退 stdout。完整输出保留在异常的
437
+ `result` 字段中。成功结果的 `exitCode` 在类型上固定为 `0`。
438
+
439
+ #### `runShellOrThrow`
440
+
441
+ ```ts
442
+ runShellOrThrow(script: string, opts?: CommandOptions): Promise<SuccessfulCommandResult>;
443
+ ```
444
+
445
+ 像 `runShell` 一样执行 shell 脚本,但非零退出时抛出 `SandboxCommandExitError`。错误摘要、
446
+ 完整输出和成功结果的语义与 `runCommandOrThrow` 相同。
447
+
448
+ #### `readText`
449
+
450
+ ```ts
451
+ readText(path: string): Promise<string>;
452
+ ```
453
+
454
+ 读取 Sandbox 内文件的文本内容(UTF-8)。文件不存在时抛错。
455
+
456
+ #### `writeText`
457
+
458
+ ```ts
459
+ writeText(path: string, content: string): Promise<void>;
460
+ ```
461
+
462
+ 写入 Sandbox 内一个 UTF-8 文本文件;父目录不存在时自动创建。
463
+
464
+ #### `readBytes`
465
+
466
+ ```ts
467
+ readBytes(path: string): Promise<Uint8Array>;
468
+ ```
469
+
470
+ 精确读取 Sandbox 内文件字节;公共契约不绑定 Node Buffer。
471
+
472
+ #### `writeBytes`
473
+
474
+ ```ts
475
+ writeBytes(path: string, content: Uint8Array): Promise<void>;
476
+ ```
477
+
478
+ 精确写入 Sandbox 内文件字节;父目录不存在时自动创建。
479
+
480
+ #### `pathExists`
481
+
482
+ ```ts
483
+ pathExists(path: string): Promise<boolean>;
484
+ ```
485
+
486
+ 检查 Sandbox 内文件或目录路径是否存在。
487
+
488
+ ### `SandboxTransferOperations`
489
+
490
+ #### `uploadFile`
491
+
492
+ ```ts
493
+ uploadFile(source: string | URL, targetPath: string): Promise<void>;
494
+ ```
495
+
496
+ #### `uploadDirectory`
497
+
498
+ ```ts
499
+ uploadDirectory(
500
+ sourceDir: string | URL,
501
+ targetDir?: string,
502
+ options?: { readonly ignore?: readonly string[] },
503
+ ): Promise<void>;
504
+ ```
505
+
506
+ #### `downloadFile`
507
+
508
+ ```ts
509
+ downloadFile(sourcePath: string, target: string | URL): Promise<void>;
510
+ ```
511
+
512
+ #### `downloadDirectory`
513
+
514
+ ```ts
515
+ downloadDirectory(
516
+ sourceDir: string,
517
+ targetDir: string | URL,
518
+ options?: { readonly ignore?: readonly string[] },
519
+ ): Promise<void>;
520
+ ```
521
+
397
522
  ### `Sandbox`
398
523
 
399
524
  #### `stop`
@@ -508,7 +633,7 @@ docs/feature/sandbox/library.md「执行身份」)。
508
633
 
509
634
  语义跨 provider 一致,各 provider 映射到自己的原生机制(docker:`exec --user`;E2B:
510
635
  `{ user }`;Vercel:只认 `"root"`,映射 `{ sudo: true }`,其它值报错;local:任何值都报错)。
511
- 本就全程 root 的 provider视作 no-op;完全无法换身份的 provider 可不支持(抛错)—— 但**省略与
636
+ 本就全程 root 的 provider 视作 no-op;完全无法换身份的 provider 可不支持(抛错)——但**省略与
512
637
  显式值的语义保持一致**,不因 provider 而变。
513
638
 
514
639
  #### `timeoutMs`
@@ -128,6 +128,6 @@ pricing?: globalThis.Record<string, PriceOverride>;
128
128
 
129
129
  {/* GENERATED:END config-fields */}
130
130
 
131
- > 成本边界:这里的 `pricing` 只提供 Runner 的 Config/runtime price table 输入,Runner 会独立产生 `estimatedCostUSD`,不论是否已有 `Usage.costUSD`。`maxCost` 只使用该 estimateReport 不读取此配置;它必须在 Report module 以 `definePricingProfile()` 显式声明自己的 USD Profile,并只对 sealed Usage 做 Analysis 投影。
131
+ > 成本边界:这里的 `pricing` 只提供 Runner 的 Config/runtime price table 输入。Runner 不论是否已有 `Usage.costUSD`,都会从 `model`、上报的 token 用量和这个表独立产生 `estimatedCostUSD`。Experiment 的预算与 `t.maxCost()` 使用该 estimate,`Usage.costUSD` 不驱动它。Report 不读取此配置;它必须在 Report module 以 `definePricingProfile()` 显式声明自己的 USD Profile,并只对 sealed Usage 做 Analysis 投影。
132
132
 
133
- [NiceEval](https://niceeval.com/) 把环境准备放在普通代码里:评估用例自己需要的文件写在 `test(t)`,agent 自己的准备写在 adapter 的 setup。`Config` 刻意没有 `sandbox` 字段,也不自动探测 provider。请在 Eval 或 Experiment 上声明 template-bearing `SandboxLayer`,让 link planning 在创建任何资源前确定它的 owner 与配对结果。
133
+ [NiceEval](https://niceeval.com/) 把环境准备放在普通代码里:评估用例自己需要的文件写在 `test(t)`,agent 自己的准备写在 adapter 的 setup。`Config` 刻意没有 `sandbox` 字段,也不自动探测 provider。请在评估用例或 Experiment 上声明 template-bearing `SandboxLayer`,让 link planning 在创建任何资源前确定它的 owner 与配对结果。
@@ -51,7 +51,7 @@ sandbox?: SandboxLayer;
51
51
  ```
52
52
 
53
53
  这道题贡献的 Sandbox 声明层。省略等价于空 command-only layer,不提供隐式 template。
54
- 每个实际 Eval x Experiment 配对必须恰好一方提供 template-bearing layer。
54
+ 每个实际评估用例 × Experiment 配对必须恰好一方提供 template-bearing layer。
55
55
 
56
56
  #### `plugins`
57
57
 
@@ -59,7 +59,7 @@ sandbox?: SandboxLayer;
59
59
  plugins?: readonly PluginInstance<"eval">[];
60
60
  ```
61
61
 
62
- Explicit, immutable Eval Plugin occurrences; no directory inheritance exists.
62
+ 显式且不可变的评估用例 Plugin occurrence;不存在目录继承。
63
63
 
64
64
  #### `judge`
65
65
 
@@ -116,7 +116,7 @@ test(t: TestContext): EvalTestReturn;
116
116
 
117
117
  `t`(`TestContext`)是评估用例作者拿到的高层上下文。每一次作者入口调用都直接登记一条 Assertion。`t.check(value, match)` 严格接收两个参数。`t.succeeded()`、`session.succeeded()`、`turn.succeeded()`、`calledTool(...)`、`notCalledTool(...)` 与 Judge recipe 也直接登记 Assertion。handle 只配置同一条 entry 的 `key`、`label`、`.atLeast(n)`、`.gate(n)` 与 `.score(n)`。`.orStop()` 也只作用于此 entry,绝不登记第二条 Assertion。
118
118
 
119
- Pass Eval 用 Boolean condition 折叠 Attempt Verdict。measurement 用 `.gate(n)` 才进入 failed,`.atLeast(n)` 只增加局部 condition;`await handle.orStop()` 在 mismatch 或 below 时停止当前 continuation。
119
+ 通过制评估用 Boolean condition 折叠 Attempt Verdict。measurement 用 `.gate(n)` 才进入 failed,`.atLeast(n)` 只增加局部 condition;`await handle.orStop()` 在 mismatch 或 below 时停止当前 continuation。
120
120
 
121
121
  `defineScoreEval` 的 `ScoreTestContext` 额外提供 `t.score(n)` 直接登记 contribution,`n` 必须 finite 且不小于零;已有 Assertion 用 `.score(n)` 贡献分数,`n` 必须 finite 且大于零。`calledTool` 与 `notCalledTool` 的完整契约见 [Scoped assertions](https://github.com/NiceEval/NiceEval/blob/main/docs/feature/assertions/library/scoped-assertions.md)。全部成员:
122
122
 
@@ -332,7 +332,7 @@ turn.judge.autoevals.closedQA(question).gate(0.7).label("回答质量");
332
332
  turn.judge.autoevals.summarizes(sourceText).score(20).label("摘要质量");
333
333
  ```
334
334
 
335
- `t.judge.autoevals` 的根级 recipe 额外接收 `{ input, output }` 字符串材料。`turn.judge` 已绑定 immutable Turn 材料。模型配置按 Eval、Experiment、项目配置解析一次;没有单次模型覆盖或 `{ on }` 选项。Pass Eval 使用 `.gate(n)`;Score Eval 直接 `.score(n)`。
335
+ `t.judge.autoevals` 的根级 recipe 额外接收 `{ input, output }` 字符串材料。`turn.judge` 已绑定 immutable Turn 材料。模型配置按评估用例、Experiment、项目配置解析一次;没有单次模型覆盖或 `{ on }` 选项。通过制评估使用 `.gate(n)`;计分制评估直接 `.score(n)`。
336
336
 
337
337
  ## `Turn` 返回类型
338
338
 
@@ -87,7 +87,7 @@ token 用量或 OTel span 反推得到)。与顶层 `estimatedCostUSD`(价目表
87
87
 
88
88
  {/* GENERATED:END usage-fields */}
89
89
 
90
- > 成本边界:`Usage.costUSD` 只表示 provider / adapter 返回的 USD observed 成本,绝不由 token、模型目录或本地价目表推导。Runner Config/runtime price table 独立计算 `estimatedCostUSD`,即使 observed 成本存在也照常计算,且只有 `maxCost` 消费它。Report 成本投影只接受显式 `PricingProfile` 与 sealed Usage,不读取 Runner estimate。
90
+ > 成本边界:`Usage.costUSD` 只表示 Provider / Adapter 返回的 USD observed 成本,绝不由 token、模型目录或本地价目表推导。Runner 即使已有 observed 成本,也会从 `model`、上报的 token 用量和 Config/runtime price table 独立计算 `estimatedCostUSD`。Experiment 的预算与 `t.maxCost()` 使用这个 estimate,`Usage.costUSD` 不驱动它。Report 成本投影只接受显式 `PricingProfile` 与 sealed Usage,不读取 Runner estimate。
91
91
 
92
92
  ## StreamEvent 变体一览
93
93
 
@@ -200,14 +200,14 @@ token 用量或 OTel span 反推得到)。与顶层 `estimatedCostUSD`(价目表
200
200
  | `message` | agent(或用户)说了一段话 | `turn.message`、`turn.event(eventMatch("message", ...))`、Judge 的材料 |
201
201
  | `operation.started`(`kind: "tool"`) | 发起一次工具调用 | `turn.calledTool(...)`、`turn.toolOrder(...)`、`turn.event(...)` |
202
202
  | `operation.finished`(`kind: "tool"`) | 该次工具调用的结果 | 带状态条件的 `ToolMatch` |
203
- | `operation.started`(`kind: "subagent"`) | 委派一个子 agent | `turn.event(eventMatch("operation.started", ...))` |
204
- | `operation.finished`(`kind: "subagent"`) | 子 agent 返回 | `turn.event(eventMatch("operation.finished", ...))` |
205
- | `input.requested` | 停下来等人输入(HITL) | `t.requireInputRequest()`、`turn.event(...)` |
206
- | `thinking` | 思考文本 | `turn.event(eventMatch("thinking", ...))`、view 展示 |
207
- | `compaction` | 上下文被压缩 | `turn.event(eventMatch("compaction"))` |
208
- | `error` | 本轮出错 | `turn.event(eventMatch("error", ...))`、view 展示 |
203
+ | `operation.started`(`kind: "subagent"`) | 委派一个子 agent | 原始事件与报告;当前没有子 agent 专用断言 |
204
+ | `operation.finished`(`kind: "subagent"`) | 子 agent 返回 | 原始事件与报告;失败会进入 `noFailedActions()` 的汇总事实 |
205
+ | `input.requested` | 停下来等人输入(HITL) | `t.check(turn.status, equals("waiting"))`、`t.requireInputRequest()` |
206
+ | `thinking` | 思考文本 | view 展示;当前没有 `eventMatch` selector |
207
+ | `compaction` | 上下文被压缩 | view 展示;当前没有 `eventMatch` selector |
208
+ | `error` | 本轮出错 | view 展示;当前没有 `eventMatch` selector |
209
209
 
210
- 事件断言共用三个入口:`event(match)`、`notEvent(match)` 与 `eventOrder(matches)`;它们都接收 `eventMatch(...)`,不另造 selector object 或匿名事件 predicate。
210
+ 事件断言共用三个入口:`event(match)`、`notEvent(match)` 与 `eventOrder(matches)`;它们都接收 `eventMatch(...)`,不另造 selector object 或匿名事件 predicate。当前 `eventMatch` 只有 `message`、工具 `operation.started` 与工具 `operation.finished` 三种形状,不能把全部原始 `StreamEvent` 当成可断言 selector
211
211
 
212
212
  ## 逐事件说明
213
213
 
@@ -280,7 +280,7 @@ events.push({
280
280
  output?: JsonValue, status: "completed" | "failed" }
281
281
  ```
282
282
 
283
- 被测系统把任务委派给子 agent(等它返回)时吐这一对,`operationId` 配对规则同上。评估作者用 `eventMatch("operation.started", ...)` / `eventMatch("operation.finished", ...)` 比较对应事件。
283
+ 被测系统把任务委派给子 agent(等它返回)时吐这一对,`operationId` 配对规则同上。它们会保留在原始事件流与报告中,但当前公开 Assert-first API 没有 `calledSubagent`,`eventMatch(...)` 也不能选择子 agent operation;不要凭空换成另一个 selector。
284
284
 
285
285
  ### `input.requested` —— 停下等人(HITL)
286
286
 
@@ -304,11 +304,11 @@ agent 停轮等人时,每个待回答的问题吐一条,同时该 Turn 的 `
304
304
  { type: "error", message: string }
305
305
  ```
306
306
 
307
- 有就吐,没有不硬造。`compaction` 主要来自 coding agent CLI(上下文满了自动压缩)。
307
+ 有就吐,没有不硬造。`compaction` 主要来自 coding agent CLI(上下文满了自动压缩)。这几种原始事件保留给报告与诊断;当前公开 `eventMatch` 不能选择它们。
308
308
 
309
309
  ## 映射的三条纪律
310
310
 
311
- 1. **时序即事实**:事件按真实发生顺序排。`toolOrder` / `eventOrder` 用单调 cursor 匹配不同 occurrence 的子序列,顺序错了断言就失真。
311
+ 1. **时序即事实**:事件按真实发生顺序排。`toolOrder` / `eventOrder` 用单调 cursor 匹配不同 occurrence 的子序列,顺序错了断言就失真。`eventOrder` 只排公开 `eventMatch` 支持的事件。
312
312
  2. **`operationId` 配对**:每个 started operation 都要有同 `kind`、同 id 的 finished operation。只有配对完成,框架才能把状态与 input 归到同一个逻辑工具 occurrence。
313
313
  3. **完整性必须显式**:官方转换器按实际 adapter 能力声明 evidence coverage。负向断言在相关输入或 action coverage 不完整时是 `unavailable`,不会把“没观察到”冒充“没有发生”。手工映射同样要如实声明覆盖范围,见[能力位参考](/zh/reference/capabilities)。
314
314
 
@@ -16,7 +16,7 @@ description: "NiceEval 内置的 Sandbox 和非 Sandbox 适配器分别是什么
16
16
 
17
17
  - **鉴权**:`ANTHROPIC_API_KEY`(工厂参数 `apiKey` 可覆盖),可选 `ANTHROPIC_BASE_URL`(工厂参数 `baseUrl`)。
18
18
  - **装 MCP server**:`mcpServers` 配置项,`setup` 阶段写进 Sandbox 里用户级的 `~/.claude.json`(顶层 `mcpServers` 字段)。两种形态按字段区分:本地 stdio 进程写 `command`(可带 `args` / `env`)。远程 Streamable HTTP 端点写 `url`(可带 `headers`,逐字进请求头,常用于 `Authorization`),写成 `{ "type": "http", "url": …, "headers": … }` 条目。`url` 要 Sandbox 内可达:服务跑在你自己机器上时,先用 cloudflared / tailscale 这类隧道暴露成公网地址。
19
- - **装 Skill**:`skills: SkillSpec[]`。本地 Skill(`{ kind: "local", path }`,从项目根读文件或目录)或 Repo Skill(`{ kind: "repo", source, ref, skills }`,可钉 commit/tag、可只启用多 Skill 仓库里的一部分)。装进 Sandbox 的 project 级 `.claude/skills/<name>/`,claude CLI 原生发现(原生 `Skill` 工具调用被 adapter 归一为 `skill.loaded` 事件,不重复记成工具调用。用 `t.loadedSkill()` 断言,不是 `t.calledTool("Skill", ...)`)。
19
+ - **装 Skill**:`skills: SkillSpec[]`。本地 Skill(`{ kind: "local", path }`,从项目根读文件或目录)或 Repo Skill(`{ kind: "repo", source, ref, skills }`,可钉 commit/tag、可只启用多 Skill 仓库里的一部分)。装进 Sandbox 的 project 级 `.claude/skills/<name>/`,claude CLI 原生发现。adapter 会把原生 `Skill` 调用归一为 `skill.loaded` 原始事件,不重复记成工具调用;当前公开 Assert-first API 没有专用 Skill 断言,也不能把它伪装成 `calledTool("Skill", ...)`。
20
20
  - **装原生 Plugin**:`plugins: ClaudeCodePluginSpec[]`,每一项声明 Marketplace 连接(`name` / `source` / 可选 `ref`)和其中的 Plugin 名。这个类型只属于 claude-code,传不进 codex。复用 Sandbox 的 Experiment 不用额外处理残留:每条 Attempt 开始前,同名 marketplace 注册与已装 Plugin 都会按声明的 `source` / `ref` 重新安装。
21
21
  - **官方配置文件**:`settingsFile` 是运行 NiceEval 的机器上的本地项目路径,不是 Sandbox 内路径。它指向一份完整的 Claude Code `settings.json`。路径相对项目根,只允许普通相对路径或 `./` 前缀。`..`、绝对路径、`~` 和解析后逃出项目根的符号链接都会报错。
22
22
 
@@ -64,8 +64,8 @@ export default defineExperiment({
64
64
 
65
65
  ### codex
66
66
 
67
- - **鉴权**:`CODEX_API_KEY`(工厂参数 `apiKey` 可覆盖,不是 `OPENAI_API_KEY`),可选 `CODEX_BASE_URL`(工厂参数 `baseUrl`)接 OpenAI 兼容代理。
68
- - **Agent 进程环境**:`env` 会注入每次 `codex exec` 与 `codex exec resume`。Codex 启动的 Session 生命周期 Hook、MCP 动态请求头和命令子进程都会继承。值不会拼进 shell 文本或写入安装清单,并按潜在敏感值从 timing、execution 与错误证据中脱敏。`CODEX_API_KEY` 仍由 `apiKey` 或宿主环境提供,并覆盖 `env` 里的同名键。`PATH` 是 Sandbox 受管变量,不接受经 `env` 声明——出现即在 `codexAgent()` 调用时报错,改用 Sandbox 的 `pathPrepend`(见 [Sandbox provider](/zh/tutorials/sandbox-providers))。
67
+ - **鉴权**:`OPENAI_API_KEY`(工厂参数 `apiKey` 可覆盖),可选 `OPENAI_BASE_URL`(工厂参数 `baseUrl`)接 OpenAI 兼容代理。
68
+ - **Agent 进程环境**:`env` 会注入每次 `codex exec` 与 `codex exec resume`。Codex 启动的 Session 生命周期 Hook、MCP 动态请求头和命令子进程都会继承。值不会拼进 shell 文本或写入安装清单,并按潜在敏感值从 timing、execution 与错误证据中脱敏。`OPENAI_API_KEY` 仍由 `apiKey` 或宿主环境提供,并覆盖 `env` 里的同名键。`PATH` 是 Sandbox 受管变量,不接受经 `env` 声明——出现即在 `codexAgent()` 调用时报错,改用 Sandbox 的 `pathPrepend`(见 [Sandbox provider](/zh/tutorials/sandbox-providers))。
69
69
  - **装 MCP server**:`mcpServers` 配置项,`setup` 阶段追加进 `~/.codex/config.toml` 的 `[mcp_servers.<name>]` 段。两种形态按字段区分:本地 stdio 进程写 `command`(可带 `args` / `env`)。远程 Streamable HTTP 端点写 `url`(可带 `headers`,写成 `[mcp_servers.<name>.http_headers]` 子表)。`url` 要 Sandbox 内可达:服务跑在你自己机器上时,先用 cloudflared / tailscale 这类隧道暴露成公网地址。
70
70
 
71
71
  <Warning>
@@ -120,7 +120,7 @@ export default defineExperiment({
120
120
 
121
121
  ### bub
122
122
 
123
- - **鉴权**:`BUB_API_KEY` + `BUB_API_BASE`(OpenAI 兼容代理),工厂参数 `apiKey` / `apiBase` 可覆盖。
123
+ - **鉴权**:`OPENAI_API_KEY` + `OPENAI_BASE_URL`(OpenAI 兼容代理),工厂参数 `apiKey` / `apiBase` 可覆盖。
124
124
  - **装 Skill**:`skills: SkillSpec[]`,与另外两个 Adapter 同一个类型。装进 `.agents/skills/<name>/`,发现指引写进 AGENTS.md。
125
125
  - **装插件**:`pythonPlugins: PythonPluginSpec[]`(`{ package }`:PyPI 包、版本约束或 git URL),`setup` 阶段进 `uv tool install … --with <package>`。这个类型只属于 bub。package 集合进安装 checkpoint key,插件不同的两个变体不会复用同一份安装缓存。
126
126
  - **预制 Bub**:NiceEval 的 E2B 配方会把 Bub、OTel 插件和 Python 插件集合算成安装指纹。Adapter 只复用指纹完全一致的环境。仅在 PATH 里放一个 `bub` 不足以证明兼容。构建入口见 [Sandbox provider · 从官方基线继续构建以提速](/zh/tutorials/sandbox-providers#从官方基线继续构建以提速)。
@@ -148,7 +148,7 @@ export default defineExperiment({
148
148
 
149
149
  | | claude-code | codex | bub |
150
150
  |---|---|---|---|
151
- | 鉴权环境变量 | `ANTHROPIC_API_KEY` | `CODEX_API_KEY` | `BUB_API_KEY` + `BUB_API_BASE` |
151
+ | 鉴权环境变量 | `ANTHROPIC_API_KEY` | `OPENAI_API_KEY` + 可选 `OPENAI_BASE_URL` | `OPENAI_API_KEY` + `OPENAI_BASE_URL` |
152
152
  | 额外 Agent 进程环境 | ❌ | ✅ `env` | ❌ |
153
153
  | MCP server | ✅ `mcpServers`(stdio + HTTP) | ✅ `mcpServers`(stdio + HTTP) | ❌ |
154
154
  | Skill | ✅ `skills: SkillSpec[]`(原生发现) | ✅ `skills: SkillSpec[]`(+ 发现指引) | ✅ `skills: SkillSpec[]`(+ 发现指引) |
@@ -159,7 +159,7 @@ export default defineExperiment({
159
159
  | tracing | ✅(beta,仅结构与计时) | ✅ | ✅ |
160
160
  | 安装方式 | npm 全局包(需镜像自带 Node) | 自带运行时的原生包(解压即用,镜像无需 Node) | `uv tool install`(PyPI) |
161
161
 
162
- 装了什么有据可查:Adapter 在 `setup` 收尾把安装清单交给运行器,存成 Attempt Artifact `agent-setup.json`(库里读 `attempt.agentSetup()`。清单不落沙箱磁盘,agent 看不到它)。清单只记来源、ref、Skill/Plugin 名、解析出的版本,以及官方配置文件的项目相对路径和 SHA-256。不保存配置正文、API Key 或环境变量值。MCP server 同理只记非敏感字段:stdio 形态记 `name` / `command` / `args` 不记 `env`,HTTP 形态记 `name` / `url` 不记 `headers`。
162
+ 装了什么有据可查:Adapter 在 `setup` 收尾把安装清单交给运行器,存成 Attempt Artifact `agent-setup.json`(库里读 `attempt.agentSetup()`。清单不落 Sandbox 磁盘,Agent 看不到它)。清单只记来源、ref、Skill/Plugin 名、解析出的版本,以及官方配置文件的项目相对路径和 SHA-256。不保存配置正文、API Key 或环境变量值。MCP server 同理只记非敏感字段:stdio 形态记 `name` / `command` / `args` 不记 `env`,HTTP 形态记 `name` / `url` 不记 `headers`。
163
163
 
164
164
  ## 非 Sandbox 适配器
165
165
 
@@ -12,6 +12,8 @@ Sample 固定本次选择的 Run、logical Slot 与分母。每个位置保留 `
12
12
 
13
13
  `--run` 保留指定 Run 的完整计划范围。`project-current` 只保留仍与当前项目身份匹配的范围。两种选择都不会因为某个度量缺少输入而缩小分母。
14
14
 
15
+ `project-current` 的成员单位是匹配的 Run slot occurrence,不是去重后的 `(experiment, eval, ordinal)`。同一位置出现在多个匹配 Run 中时,每个 occurrence 都进入 `MetricValue.total`。重复运行或逐条 `accept` 因此可能增加分母。
16
+
15
17
  Sample 只能在 `load()`、Page 或组合组件执行期间传给 Report facade。回调结束后,页面只保留已经关闭的值,不能再次读取结果。
16
18
 
17
19
  ## 用 `aggregate()` 取得 rows
@@ -58,6 +60,10 @@ Attempt Evidence、Observability、File Changes、Sources 和 Sandbox history
58
60
 
59
61
  `available`、`partial`、`empty`、`unsupported` 和 `failed` 都是不同状态。不要把 `null` 当成零,也不要用只剩下的可见行数替换总分母。
60
62
 
63
+ 例如 `formatMetricValue()` 输出的 `2 / 4 slot · partial` 表示四个已选 occurrence 中只有两个提供该 Measure 的输入。这组计数只描述覆盖率;它不是 earned score、通过率或工作完成比例。Measure 自己的 `value` 才是读数。
64
+
65
+ 默认 Overview 不把这组计数重复追加到每个指标单元格。它按题型显示通过率或 earned score,并在结果不完整时用独立的 `Result coverage` 区域显示可用结果数。终端把这个区域渲染成有标题的边框;底层 `MetricValue` 的字段保持不变。
66
+
61
67
  ## 相关页面
62
68
 
63
69
  - [报告 API](/zh/reference/report-components):Page、组件、JSON 和全站构建边界。
@@ -66,7 +66,7 @@ Measure 和领域视图会把自己的状态与问题带进页面:
66
66
 
67
67
  `npx niceeval exp <experiment> --json` 只有在成功建立 Invocation 后,最后才会输出 receipt。命令在建立 Invocation 前就因输入错误退出时,没有 `runIds` 可读取。
68
68
 
69
- 先修正 Experiment、Eval 选择或命令参数,再重新运行。成功时,使用 receipt 的 `runIds` 运行 `show`、`view` 或 `view --out`。
69
+ 先修正 Experiment、评估用例选择或命令参数,再重新运行。成功时,使用 receipt 的 `runIds` 运行 `show`、`view` 或 `view --out`。
70
70
 
71
71
  ## 静态报告站无法导出
72
72
 
@@ -1,25 +1,27 @@
1
1
  ---
2
2
  title: "运行被强杀后恢复"
3
- description: "进程被 kill -9、CI 超时或断电杀掉后,重跑同一条命令续跑没跑完的部分,用 niceeval sandbox prune 收回没清理的容器,用 --teardown 补齐实验收尾。"
3
+ description: "进程被 kill -9、CI 超时或断电杀掉后,从已发布结果重跑、收回遗留 Sandbox、补齐实验收尾,并显式恢复共享状态租约。"
4
4
  ---
5
5
 
6
6
  `niceeval exp` 跑到一半被 `kill -9`、CI 时限或断电直接杀掉时,进程没有机会做任何清理。你会碰到三种残留:没跑完的评估、还在 Provider 侧占资源的 Sandbox 实例、实验 `setup` 起过但没关掉的外部服务(隧道、共享服务、license 席位)。三种各有一个恢复入口,都不需要手工翻 Docker 或云控制台。
7
7
 
8
8
  正常的 Ctrl+C 或 SIGTERM 不在本页范围:那些路径 NiceEval 会自己走完全部收尾,不留残留。
9
9
 
10
- ## 重跑同一条命令,续跑没跑完的部分
10
+ ## 从已发布结果重跑
11
11
 
12
- 已经跑完并落盘的 Attempt 是可信结果,重跑时自动带入,不再花一次 Agent 和 Sandbox 的成本:
12
+ 只有成功 seal、完整发布的 Run 里的 Attempt 才是 Record 事实。重跑可以自动沿用其中仍符合资格的结果,不再花一次 Agent 和 Sandbox 的成本。强杀 Invocation 留下的 incomplete Run directory 会被整体忽略:里面的草稿 Attempt 不展示、不引用、也不沿用。
13
13
 
14
14
  ```bash
15
15
  niceeval exp compare/bub-e2b memory/commit0
16
16
  ```
17
17
 
18
- - 只补跑缺的部分:`--attempts 5` 已经落盘 3 次,就只再跑 2 次。
18
+ - 如果另一个完整 Run 已经为 `--attempts 5` 发布 3 个符合资格的 Attempt,就只再跑 2 次。如果那 3 个草稿只存在于强杀 Run、尚未到达 `complete` 发布点,它们一个也不会沿用,5 个位置都可能重跑。
19
19
  - 被强杀的实验如果留了没做完的收尾,重跑会先补一次实验级 `teardown` 再开始,泄漏不会越积越多。
20
20
  - 判定为 `errored` 的 Attempt 不复用,照常重跑。
21
21
  - 想全部重来,加 `--rerun all`。
22
22
 
23
+ 确认没有活跃 Invocation 占用 Record root 后,运行 `niceeval clean` 删除 incomplete Run 残留。清理不会把草稿 Attempt 变成可复用结果。
24
+
23
25
  ## 收回没清理的 Sandbox 实例
24
26
 
25
27
  先核对有哪些实例属于已经死掉的运行:
@@ -57,7 +59,37 @@ niceeval exp compare/bub-e2b --teardown
57
59
  - 随时可以执行,不依赖上次运行留下的记录。`teardown` 自身要能容忍重复执行。
58
60
  - 强杀后原进程的内存已经丢失,`teardown` 里要从容器名、pid 文件或幂等的关停脚本这类持久信息找回要关的资源,不要依赖 `setup` 存在内存里的对象。
59
61
 
62
+ ## 恢复共享状态租约
63
+
64
+ 声明了 `sharedState.key` 的实验会把租约持有到 Sandbox teardown、Provider finalizer 和实验 `teardown` 全部成功。进程被强杀或其中一项 cleanup 失败时,租约会保留;同 key 的新 Invocation 会继续等待,不会根据 PID、超时或 heartbeat 自动接管。
65
+
66
+ 先只检查当前 owner evidence,不带 token 或确认参数:
67
+
68
+ ```bash
69
+ niceeval exp compare/bub-e2b --teardown \
70
+ --recover-shared-state mempal/codex/cohort-a
71
+ ```
72
+
73
+ 命令会显示 key、Experiment、owner token、host、PID、process identity 和最新 heartbeat,然后以非零状态退出。先确认原 owner 已终止,再确认它操作的 checkpoint、远端服务和回存流程都已静止。这个恢复入口只补跑实验 `teardown`,不会回滚已经写到一半的业务状态。
74
+
75
+ 核对完后,复制刚显示的完整 owner token,并显式确认两个条件:
76
+
77
+ ```bash
78
+ niceeval exp compare/bub-e2b --teardown \
79
+ --recover-shared-state mempal/codex/cohort-a \
80
+ --owner-token <displayed-token> \
81
+ --confirm-owner-terminated \
82
+ --confirm-remote-quiesced
83
+ ```
84
+
85
+ - 同机的原进程仍然存活时,NiceEval 拒绝恢复;暂停的进程仍算存活。
86
+ - 错误或过期的 token 不会修改租约,也不会释放后来 owner 的租约。
87
+ - 两条恢复命令同时竞争时,只有一条能取得恢复 ownership。
88
+ - 补偿 `teardown` 失败时,租约继续保留。解决 teardown 问题后重新检查,再用当前显示的 token 重试。
89
+ - 成功后,同 key 的等待 Invocation 才能取得租约并开始 Experiment setup 或创建 Sandbox。
90
+
60
91
  ## 预防:让下一次强杀无害
61
92
 
62
- - 长任务放在有时限的环境(CI、外部看门狗)里跑时,把时限内跑不完当成常态:靠上面的续跑机制分多次跑完,不必强求单次完成。
93
+ - 长任务放在有时限的环境(CI、外部看门狗)里跑时,要为 Run 留出到达 `complete` 发布点的时间。后续运行只能沿用完整 Run 已经发布的结果。
63
94
  - 实验 `teardown` 写成幂等的:重复执行不报错、目标已经关掉也算成功。这是补收尾机制正确工作的前提。
95
+ - 使用 `sharedState.key` 时,让 checkpoint 回存具备原子性或可补偿性。显式恢复协调租约不能修复半次业务写入。
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: "审阅并采用历史 Attempt"
3
+ sidebarTitle: "采用历史 Attempt"
4
+ description: "从 --dry 取得候选 locator,核对不可变 Attempt,再用 niceeval accept 原子采用明确结果,并用新 Run ID 验证分母与来源。"
5
+ ---
6
+
7
+ 配置身份改变后,自动沿用可能被拒绝。如果你已经核对某个历史 Attempt,确认它在新配置下仍然成立,可以用 `niceeval accept` 明确采用它。
8
+
9
+ 不要用这个命令跨过真实的评估条件变化。任务、断言、Agent 行为或 Sandbox 起点已经改变时,应重新运行并取得新证据。
10
+
11
+ ## 从计划取得候选 locator
12
+
13
+ 先预览当前目标:
14
+
15
+ ```sh
16
+ pnpm exec niceeval exp checkout --dry
17
+ ```
18
+
19
+ 被身份差异挡住的历史结果会显示完整 Attempt locator 和可执行的 `accept` 提示。Locator 是本次授权的唯一范围;命令不会隐含选择同一 Run 或同一 Experiment 的其它结果。
20
+
21
+ ## 核对历史 Attempt
22
+
23
+ 使用完整 locator 查看不可变结果:
24
+
25
+ ```sh
26
+ pnpm exec niceeval show @1K1P0VJAPVJ12
27
+ ```
28
+
29
+ 核对 Verdict、Assertion、用量、时间和详情页中的证据。需要回看来源 Run 的完整分母时,再使用:
30
+
31
+ ```sh
32
+ pnpm exec niceeval show --run <source-run-id>
33
+ ```
34
+
35
+ ## 一次采用需要的结果
36
+
37
+ ```sh
38
+ pnpm exec niceeval accept @1K1P0VJAPVJ12
39
+ ```
40
+
41
+ 同一个 Experiment 有多个结果需要采用时,把 locator 放进同一条命令:
42
+
43
+ ```sh
44
+ pnpm exec niceeval accept @1K1P0VJAPVJ12 @1K1P0VJAPVJ13
45
+ ```
46
+
47
+ NiceEval 会先预检全部输入。任一 locator 无效、不符合资格或与另一个输入冲突时,整条命令都不会发布业务结果。
48
+
49
+ 成功后,每个目标 slot 以 `reference` 指向原 Attempt,并记录 `accepted` action。源 Attempt 的事实、来源 Run 和 locator 都不会被修改或复制。
50
+
51
+ ## 核对新 Run
52
+
53
+ 成功反馈会显示新 Run ID:
54
+
55
+ ```sh
56
+ pnpm exec niceeval show --run <accepted-run-id>
57
+ ```
58
+
59
+ 这个 Run 保留当前 Experiment 的完整 expected-slot 分母。命令中选择的位置是 `accepted`;没有选择的 sibling slot 是 `not-dispatched`。一次只采用部分位置时,报告会如实显示结果覆盖不足。
60
+
61
+ 每次 `accept` 都发布新 Run,不会修改或合并上一次调用。需要同一批结果组成同一个采用边界时,应放在同一条命令中。
62
+
63
+ ## 常见失败
64
+
65
+ | 错误 | 下一步 |
66
+ | --- | --- |
67
+ | `malformed-locator` | 从 `--dry` 或 `show` 复制完整的大写 locator,不使用旧 UUID 或模糊前缀。 |
68
+ | `locator-not-found` | 确认读取的是同一 Record;其它结果根显式传 `--record`。 |
69
+ | `accept-ineligible` | 按提示检查 Verdict、timeout、身份或 Observability;不能证明仍成立时重新运行。 |
70
+ | `duplicate-accept-member` | 每个目标 slot 只保留一个 locator,去掉重复或冲突输入。 |
71
+
72
+ 自动沿用与强制重跑的选择见[重跑与沿用结果](/zh/tutorials/rerun-and-cache)。
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "Coding Agent 从零接入项目"
3
3
  sidebarTitle: "Coding Agent 从零接入"
4
- description: "给 Coding Agent 的完整接入流程:探索项目、与用户确认路径、配置 Judge、写出 Adapter / Experiment / 评估用例并跑通第一个实验。"
4
+ description: "给 Coding Agent 的完整接入流程:探索项目、与用户确认路径、配置 Judge、写出 AdapterExperiment 与评估用例,并跑通第一个实验。"
5
5
  ---
6
6
 
7
7
  这一页是 Coding Agent 把 NiceEval 接入一个项目的执行步骤。前提:`niceeval` 依赖已经装进项目、`niceeval init` 已经运行,你是从随包 `INDEX.md` 进入本页的。用用户的语言与用户交流。所有 API、字段和 CLI 行为以随包文档为准,不要凭训练记忆现编。
@@ -14,10 +14,10 @@ description: "给 Coding Agent 的完整接入流程:探索项目、与用户
14
14
  2. **前端和 Agent 怎么通信**:HTTP 还是 gRPC / WebSocket?协议是标准的还是自己实现的——AI SDK UI Message Stream、OpenAI Responses / Chat Completions 这类标准协议,还是 SDK 原生事件流透传,还是用户自定义的 JSON/SSE 帧?这直接决定 Adapter 是用内置的(零映射)还是手写 `send`(要自己写事件映射)。
15
15
  3. **后端有没有接 OTel**:搜有没有 OTel SDK 初始化、AI SDK telemetry、LangSmith / OpenLLMetry / OpenInference 这类埋点。已经有的话 Tier 2 几乎零成本。
16
16
  4. **用户自己有没有做 A/B Test / feature flag**:应用里已有变体开关的话,Experiment 的 `flags` 可以直接透传给它(Tier 3 的现成入口)。
17
- 5. **Judge 用什么**:语义评估(`t.judge.autoevals.*`)要一个**与被测 Agent 分离的 Judge 模型**,走 OpenAI 兼容的 `/chat/completions` 协议。问用户手上有哪个服务的 key、想用什么 Judge 模型。缺 key 不会静默通过:Judge Assertion 会记为 `unavailable`;它参与 Pass grading,或在 Score Eval 中配置了 `.score()` / `.orStop()` 时,Attempt 的 grading 不可用。没有 Judge 配置时,先只写精确 Match。
17
+ 5. **Judge 用什么**:语义评估(`t.judge.autoevals.*`)要一个**与被测 Agent 分离的 Judge 模型**,走 OpenAI 兼容的 `/chat/completions` 协议。问用户手上有哪个服务的 key、想用什么 Judge 模型。缺 key 不会静默通过:Judge Assertion 会记为 `unavailable`;它参与 Pass grading,或在计分制评估中配置了 `.score()` / `.orStop()` 时,Attempt 的 grading 不可用。没有 Judge 配置时,先只写精确 Match。
18
18
  6. **是不是 Agent 本体要进 Sandbox**:被测对象是 coding agent CLI、或给 coding agent 写的 Skill/Plugin/Hook/MCP server(要在隔离 workspace 里改文件/跑命令)的话,必须走 Sandbox,不能像 HTTP 服务那样直接 `send`。
19
19
 
20
- 默认建议 `dockerSandbox({ source: { type: "image", image: "node:24-slim" } })`,但**要先跟用户确认**——本机/CI 有没有 Docker、要不要 Vercel Sandbox 或其它远程 Provider。用户没有异议就默认走 Docker。Provider 声明在 Eval 或 Experiment 上,没有 CLI flag、项目级默认值或自动探测——见[选择 Sandbox Provider](/zh/tutorials/sandbox-providers)。
20
+ 默认建议 `dockerSandbox({ source: { type: "image", image: "node:24-slim" } })`,但**要先跟用户确认**——本机/CI 有没有 Docker、要不要 Vercel Sandbox 或其它远程 Provider。用户没有异议就默认走 Docker。Provider 声明在评估用例或 Experiment 上,没有 CLI flag、项目级默认值或自动探测——见[选择 Sandbox Provider](/zh/tutorials/sandbox-providers)。
21
21
 
22
22
  探完之后,向用户**介绍接入等级**并给出推荐(详见[接入等级](/zh/explanation/tier)):
23
23
 
@@ -59,9 +59,9 @@ export default defineConfig({
59
59
  三个要提醒用户的点:
60
60
 
61
61
  - **配错不会假装通过。** 模型或 key 解析不到、网关拒绝鉴权、评估请求超时时,Judge Assertion 记为 `unavailable` 并带上原因;读取面不会把缺失 measurement 伪装成 mismatch 或零分。
62
- - **配完先验一次。** 写一条带 `judge: true` 的轻量 Pass Eval,调用 `turn.judge.autoevals.closedQA(...).gate(0.8)`。跑完 `niceeval show <评估用例 id>`,确认能看到 measurement、threshold、condition 与 Assertion 证据。
62
+ - **配完先验一次。** 写一条带 `judge: true` 的轻量通过制评估,调用 `turn.judge.autoevals.closedQA(...).gate(0.8)`。跑完后用 `niceeval show --run <run-id>` 查看结果,确认能看到 measurement、threshold、condition 与 Assertion 证据。
63
63
  - **没有用户在场(自治接入)时不要直接跳过 Judge**:先看环境里是否已有可用 key,例如 `OPENAI_API_KEY` 或 `DEEPSEEK_API_KEY`。有就用 `apiKeyEnv` 指向它并验证;没有时先写精确 Match,并在收尾说明 Judge 没有配置。
64
- - Judge 模型要**与被测 Agent 分离**,避免同一个模型给自己的输出打分。配置按 Eval、Experiment、项目配置逐字段解析;三种 recipe 见 [Judge](/zh/explanation/judge)。
64
+ - Judge 模型要**与被测 Agent 分离**,避免同一个模型给自己的输出打分。配置按评估用例、Experiment、项目配置逐字段解析;三种 recipe 见 [Judge](/zh/explanation/judge)。
65
65
 
66
66
  ## 第 3 步:写三件套
67
67
 
@@ -100,7 +100,7 @@ export default defineConfig({
100
100
  - [ ] 有 key 时 Judge 已配置,且在 `niceeval view` 里看到过 Judge 分数。没 key 时总结里说明了
101
101
  - [ ] Experiment 里声明的 `model` / `flags` 确实被 Adapter 消费(没有写了没人读的死配置,也没有编造被测系统不存在的 model 值)
102
102
 
103
- 跑通之后先总结,再谈下一步。总结要说清:接了什么被测对象、生成了哪几个文件(Adapter / Experiment / 评估用例各在哪)、`niceeval exp <实验路径>` 和 `niceeval view` 怎么跑、第一次运行的结果是什么样。不要在没被要求的情况下顺手重构用户已有代码,也不要在这几个文件之外新增抽象。
103
+ 跑通之后先总结,再谈下一步。总结要说清:接了什么被测对象、AdapterExperiment 与评估用例各在哪、`niceeval exp <实验路径>` 和 `niceeval view` 怎么跑、第一次运行的结果是什么样。不要在没被要求的情况下顺手重构用户已有代码,也不要在这几个文件之外新增抽象。
104
104
 
105
105
  ## 第 6 步:问用户要不要往深了接
106
106
 
@@ -10,6 +10,7 @@ import { Lifecycle } from '/snippets/widgets.jsx';
10
10
 
11
11
  ```ts
12
12
  import { defineEval, type JsonValue } from "niceeval";
13
+ import type { SandboxLayer } from "niceeval/sandbox";
13
14
 
14
15
  export default defineEval({
15
16
  description?: string;
@@ -17,34 +18,29 @@ export default defineEval({
17
18
  judge?: JudgeConfig;
18
19
  reporters?: Reporter[];
19
20
  timeoutMs?: number;
20
- environment?: string;
21
+ sandbox?: SandboxLayer;
21
22
  metadata?: Record<string, JsonValue>;
22
23
  async setup(sandbox, ctx) { /* task fixture + progress/diagnostic */ },
23
24
  async test(t) { /* interactions + assertions */ },
24
25
  });
25
26
  ```
26
27
 
27
- ## `tags` 与 `environment`
28
+ ## `tags` 与 `sandbox`
28
29
 
29
30
  ```ts
31
+ import { defineEval } from "niceeval";
32
+ import { dockerSandbox } from "niceeval/sandbox";
33
+
30
34
  // evals/coding/fix-button.eval.ts → id: coding/fix-button
31
35
  export default defineEval({
32
36
  description: "修复 Button 组件",
33
37
  tags: ["coding", "frontend"],
34
- environment: "node-22",
38
+ sandbox: dockerSandbox({ source: { type: "image", image: "node:22-slim" } }),
35
39
  async test(t) { /* coding task */ },
36
40
  });
37
-
38
- // evals/research/gpu-literature.eval.ts → id: research/gpu-literature
39
- export default defineEval({
40
- description: "在 GPU 环境检索论文",
41
- tags: ["research"],
42
- environment: "gpu",
43
- async test(t) { /* research task */ },
44
- });
45
41
  ```
46
42
 
47
- `tags` 可供 `--tag` 和 experiment 的 `evals` 谓词读取。`environment` 只声明环境 profile。具体 image / template experiment 使用的 Sandbox 配置映射。
43
+ `tags` 可供 `--tag` 和 Experiment 的 `evals` 谓词读取。任务本身拥有起始环境时,在评估用例上声明 `sandbox`;如果 template-bearing Sandbox layer Experiment 提供,这里就省略。每个实际评估用例 × Experiment 配对必须恰好有一方提供 template-bearing layer。
48
44
 
49
45
  ## 单轮评估
50
46
 
@@ -117,7 +113,7 @@ export default rows.map((row) =>
117
113
 
118
114
  ## Sandbox workspace
119
115
 
120
- Coding-agent 评估用例仍然是普通 `.eval.ts` 文件,只是 test 里会准备 Sandbox workspace、发送任务并检查文件结果:
116
+ Coding Agent 评估用例仍然是普通 `.eval.ts` 文件,只是 test 里会准备 Sandbox workspace、发送任务并检查文件结果:
121
117
 
122
118
  ```ts
123
119
  import { defineEval } from "niceeval";