niceeval 0.5.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/INDEX.md +55 -0
  2. package/dist/agents/types.d.ts +317 -0
  3. package/dist/context/types.d.ts +335 -0
  4. package/dist/i18n/core.d.ts +11 -0
  5. package/dist/i18n/en.d.ts +181 -0
  6. package/dist/i18n/index.d.ts +5 -0
  7. package/dist/i18n/zh-CN.d.ts +183 -0
  8. package/dist/o11y/execution-tree.d.ts +103 -0
  9. package/dist/o11y/otlp/parse.d.ts +3 -0
  10. package/dist/o11y/otlp/receiver.d.ts +21 -0
  11. package/dist/o11y/otlp/select.d.ts +22 -0
  12. package/dist/o11y/otlp/turn-otel.d.ts +43 -0
  13. package/dist/o11y/types.d.ts +190 -0
  14. package/dist/report/aggregate.d.ts +57 -0
  15. package/dist/report/aggregate.js +212 -0
  16. package/dist/report/built-ins/cost-pass-rate-comparison.d.ts +1 -0
  17. package/dist/report/built-ins/cost-pass-rate-comparison.js +17 -0
  18. package/dist/report/built-ins/index.d.ts +1 -0
  19. package/dist/report/built-ins/index.js +2 -0
  20. package/dist/report/components.d.ts +178 -0
  21. package/dist/report/components.js +132 -0
  22. package/dist/report/compute.d.ts +106 -0
  23. package/dist/report/compute.js +618 -0
  24. package/dist/report/flag.d.ts +6 -0
  25. package/dist/report/flag.js +8 -0
  26. package/dist/report/format.d.ts +32 -0
  27. package/dist/report/format.js +126 -0
  28. package/dist/report/index.d.ts +19 -0
  29. package/dist/report/index.js +30 -0
  30. package/dist/report/load.d.ts +12 -0
  31. package/dist/report/load.js +56 -0
  32. package/dist/report/locale.d.ts +83 -0
  33. package/dist/report/locale.js +160 -0
  34. package/dist/report/metrics.d.ts +21 -0
  35. package/dist/report/metrics.js +115 -0
  36. package/dist/report/primitives.d.ts +64 -0
  37. package/dist/report/primitives.js +113 -0
  38. package/dist/report/react/AttemptList.d.ts +23 -0
  39. package/dist/report/react/AttemptList.js +20 -0
  40. package/dist/report/react/DeltaTable.d.ts +8 -0
  41. package/dist/report/react/DeltaTable.js +24 -0
  42. package/dist/report/react/EvalList.d.ts +10 -0
  43. package/dist/report/react/EvalList.js +0 -0
  44. package/dist/report/react/ExperimentList.d.ts +10 -0
  45. package/dist/report/react/ExperimentList.js +15 -0
  46. package/dist/report/react/GroupSummary.d.ts +8 -0
  47. package/dist/report/react/GroupSummary.js +8 -0
  48. package/dist/report/react/MetricBars.d.ts +10 -0
  49. package/dist/report/react/MetricBars.js +48 -0
  50. package/dist/report/react/MetricLine.d.ts +9 -0
  51. package/dist/report/react/MetricLine.js +68 -0
  52. package/dist/report/react/MetricMatrix.d.ts +10 -0
  53. package/dist/report/react/MetricMatrix.js +23 -0
  54. package/dist/report/react/MetricScatter.d.ts +9 -0
  55. package/dist/report/react/MetricScatter.js +100 -0
  56. package/dist/report/react/MetricTable.d.ts +11 -0
  57. package/dist/report/react/MetricTable.js +26 -0
  58. package/dist/report/react/RunOverview.d.ts +8 -0
  59. package/dist/report/react/RunOverview.js +12 -0
  60. package/dist/report/react/Scoreboard.d.ts +8 -0
  61. package/dist/report/react/Scoreboard.js +26 -0
  62. package/dist/report/react/cell.d.ts +9 -0
  63. package/dist/report/react/cell.js +9 -0
  64. package/dist/report/react/chart-math.d.ts +14 -0
  65. package/dist/report/react/chart-math.js +68 -0
  66. package/dist/report/react/colors.d.ts +14 -0
  67. package/dist/report/react/colors.js +45 -0
  68. package/dist/report/react/fixtures.d.ts +19 -0
  69. package/dist/report/react/fixtures.js +393 -0
  70. package/dist/report/react/format.d.ts +3 -0
  71. package/dist/report/react/format.js +7 -0
  72. package/dist/report/react/index.d.ts +6 -0
  73. package/dist/report/react/index.js +14 -0
  74. package/dist/report/report.d.ts +24 -0
  75. package/dist/report/report.js +49 -0
  76. package/dist/report/text/faces.d.ts +29 -0
  77. package/dist/report/text/faces.js +503 -0
  78. package/dist/report/text/layout.d.ts +75 -0
  79. package/dist/report/text/layout.js +173 -0
  80. package/dist/report/text/plot.d.ts +37 -0
  81. package/dist/report/text/plot.js +81 -0
  82. package/dist/report/text/table.d.ts +8 -0
  83. package/dist/report/text/table.js +86 -0
  84. package/dist/report/tree.d.ts +99 -0
  85. package/dist/report/tree.js +228 -0
  86. package/dist/report/types.d.ts +420 -0
  87. package/dist/report/types.js +4 -0
  88. package/dist/report/web.d.ts +15 -0
  89. package/dist/report/web.js +37 -0
  90. package/dist/results/annotated-source.d.ts +61 -0
  91. package/dist/results/attempt-evidence.d.ts +69 -0
  92. package/dist/results/attempt-source.d.ts +15 -0
  93. package/dist/results/locator.d.ts +75 -0
  94. package/dist/results/locator.js +0 -0
  95. package/dist/results/select.d.ts +45 -0
  96. package/dist/results/select.js +230 -0
  97. package/dist/results/source-hash.d.ts +9 -0
  98. package/dist/results/types.d.ts +204 -0
  99. package/dist/runner/eval-source.d.ts +22 -0
  100. package/dist/runner/fingerprint.d.ts +23 -0
  101. package/dist/runner/types.d.ts +332 -0
  102. package/dist/sandbox/docker-stream.d.ts +24 -0
  103. package/dist/sandbox/docker.d.ts +84 -0
  104. package/dist/sandbox/e2b.d.ts +31 -0
  105. package/dist/sandbox/errors.d.ts +4 -0
  106. package/dist/sandbox/local-files.d.ts +6 -0
  107. package/dist/sandbox/paths.d.ts +4 -0
  108. package/dist/sandbox/registry.d.ts +13 -0
  109. package/dist/sandbox/resolve.d.ts +40 -0
  110. package/dist/sandbox/retry.d.ts +10 -0
  111. package/dist/sandbox/shell.d.ts +11 -0
  112. package/dist/sandbox/source-files.d.ts +13 -0
  113. package/dist/sandbox/types.d.ts +203 -0
  114. package/dist/sandbox/vercel.d.ts +37 -0
  115. package/dist/scoring/types.d.ts +70 -0
  116. package/dist/shared/aggregate.d.ts +29 -0
  117. package/dist/shared/aggregate.js +55 -0
  118. package/dist/shared/types.d.ts +27 -0
  119. package/dist/shared/verdict.d.ts +27 -0
  120. package/dist/shared/verdict.js +34 -0
  121. package/dist/tty-line.d.ts +6 -0
  122. package/dist/types.d.ts +7 -0
  123. package/dist/util.d.ts +22 -0
  124. package/docs-site/zh/concepts/adapter.mdx +5 -5
  125. package/docs-site/zh/concepts/assert.mdx +8 -8
  126. package/docs-site/zh/concepts/evals.mdx +5 -5
  127. package/docs-site/zh/concepts/experiment.mdx +2 -2
  128. package/docs-site/zh/concepts/judge.mdx +9 -9
  129. package/docs-site/zh/concepts/overview.mdx +2 -2
  130. package/docs-site/zh/concepts/tier.mdx +6 -6
  131. package/docs-site/zh/example/claude-code-codex-plugin.mdx +9 -5
  132. package/docs-site/zh/example/claude-code-codex-skill.mdx +12 -7
  133. package/docs-site/zh/guides/agent-feedback-loop.mdx +235 -78
  134. package/docs-site/zh/guides/connect-otel.mdx +3 -3
  135. package/docs-site/zh/guides/connect-your-agent.mdx +2 -2
  136. package/docs-site/zh/guides/custom-reports.mdx +196 -36
  137. package/docs-site/zh/guides/experiments.mdx +7 -1
  138. package/docs-site/zh/guides/fixtures.mdx +1 -1
  139. package/docs-site/zh/guides/official-adapters.mdx +31 -9
  140. package/docs-site/zh/guides/publish-report.mdx +3 -3
  141. package/docs-site/zh/guides/report-components.mdx +194 -55
  142. package/docs-site/zh/guides/reporters.mdx +2 -2
  143. package/docs-site/zh/guides/results-data.mdx +35 -34
  144. package/docs-site/zh/guides/runner.mdx +2 -2
  145. package/docs-site/zh/guides/sandbox-agent.mdx +2 -2
  146. package/docs-site/zh/guides/{sandbox-backends.mdx → sandbox-providers.mdx} +11 -11
  147. package/docs-site/zh/guides/viewing-results.mdx +199 -79
  148. package/docs-site/zh/guides/write-experiment.mdx +9 -1
  149. package/docs-site/zh/guides/write-send.mdx +2 -2
  150. package/docs-site/zh/index.mdx +4 -3
  151. package/docs-site/zh/introduction.mdx +2 -1
  152. package/docs-site/zh/quickstart.mdx +5 -3
  153. package/docs-site/zh/reference/builtin-agents.mdx +38 -13
  154. package/docs-site/zh/reference/capabilities.mdx +1 -1
  155. package/docs-site/zh/reference/cli.mdx +36 -13
  156. package/docs-site/zh/reference/define-agent.mdx +12 -12
  157. package/docs-site/zh/reference/define-config.mdx +1 -1
  158. package/docs-site/zh/reference/define-eval.mdx +3 -3
  159. package/docs-site/zh/reference/events.mdx +7 -1
  160. package/docs-site/zh/reference/expect.mdx +3 -3
  161. package/package.json +10 -6
  162. package/src/agents/bub.ts +129 -42
  163. package/src/agents/claude-code.test.ts +152 -0
  164. package/src/agents/claude-code.ts +127 -13
  165. package/src/agents/codex.test.ts +192 -0
  166. package/src/agents/codex.ts +151 -12
  167. package/src/agents/index.ts +9 -3
  168. package/src/agents/manifest.ts +41 -0
  169. package/src/agents/plugin-config.test.ts +94 -0
  170. package/src/agents/shared.ts +33 -2
  171. package/src/agents/skills.test.ts +214 -0
  172. package/src/agents/skills.ts +304 -0
  173. package/src/agents/streaming.ts +5 -5
  174. package/src/agents/types.ts +54 -2
  175. package/src/cli.ts +74 -47
  176. package/src/context/context.test.ts +20 -2
  177. package/src/context/control-flow.ts +1 -1
  178. package/src/context/session.test.ts +92 -1
  179. package/src/context/session.ts +23 -1
  180. package/src/context/types.ts +4 -4
  181. package/src/define.test.ts +8 -8
  182. package/src/define.ts +11 -11
  183. package/src/expect/index.ts +5 -5
  184. package/src/i18n/en.ts +34 -15
  185. package/src/i18n/zh-CN.ts +37 -21
  186. package/src/index.ts +1 -1
  187. package/src/o11y/execution-tree.test.ts +452 -0
  188. package/src/o11y/execution-tree.ts +367 -0
  189. package/src/o11y/otlp/receiver.ts +1 -1
  190. package/src/o11y/otlp/select.ts +7 -3
  191. package/src/o11y/parsers/claude-code.test.ts +175 -0
  192. package/src/o11y/parsers/claude-code.ts +32 -0
  193. package/src/o11y/types.ts +6 -1
  194. package/src/report/aggregate.ts +26 -20
  195. package/src/report/built-in-user-parity.test.tsx +643 -0
  196. package/src/report/built-ins/cost-pass-rate-comparison.tsx +23 -0
  197. package/src/report/built-ins/index.ts +2 -0
  198. package/src/report/components.tsx +223 -50
  199. package/src/report/compute.ts +358 -53
  200. package/src/report/dual-render.test.tsx +1125 -0
  201. package/src/report/flag.ts +1 -1
  202. package/src/report/format.ts +50 -2
  203. package/src/report/index.ts +48 -14
  204. package/src/report/load.ts +1 -1
  205. package/src/report/locale.ts +206 -0
  206. package/src/report/metrics.ts +39 -15
  207. package/src/report/primitives.tsx +100 -2
  208. package/src/report/react/AttemptList.tsx +115 -0
  209. package/src/report/react/DeltaTable.tsx +9 -6
  210. package/src/report/react/EvalList.tsx +0 -0
  211. package/src/report/react/ExperimentList.tsx +108 -0
  212. package/src/report/react/GroupSummary.tsx +66 -0
  213. package/src/report/react/MetricBars.tsx +24 -13
  214. package/src/report/react/MetricLine.tsx +21 -21
  215. package/src/report/react/MetricMatrix.tsx +8 -4
  216. package/src/report/react/MetricScatter.tsx +136 -96
  217. package/src/report/react/MetricTable.tsx +115 -15
  218. package/src/report/react/RunOverview.tsx +48 -26
  219. package/src/report/react/Scoreboard.tsx +15 -7
  220. package/src/report/react/cell.tsx +18 -9
  221. package/src/{view/app/lib/chart.ts → report/react/chart-math.ts} +2 -6
  222. package/src/report/react/colors.ts +24 -15
  223. package/src/report/react/enhance.js +129 -0
  224. package/src/report/react/fixtures.ts +163 -34
  225. package/src/report/react/format.ts +1 -1
  226. package/src/report/react/index.tsx +22 -6
  227. package/src/report/react/render.test.tsx +164 -31
  228. package/src/report/react/styles.css +405 -213
  229. package/src/report/report.test.ts +403 -94
  230. package/src/report/report.ts +29 -11
  231. package/src/report/text/faces.ts +303 -95
  232. package/src/report/text/layout.ts +76 -11
  233. package/src/report/text/table.ts +98 -0
  234. package/src/report/tree.ts +103 -20
  235. package/src/report/types.ts +196 -25
  236. package/src/report/web.ts +46 -19
  237. package/src/results/annotated-source.test.ts +146 -0
  238. package/src/results/annotated-source.ts +128 -0
  239. package/src/results/attempt-evidence.test.ts +158 -0
  240. package/src/results/attempt-evidence.ts +158 -0
  241. package/src/results/attempt-source.ts +48 -0
  242. package/src/results/copy.ts +154 -139
  243. package/src/results/format.ts +54 -47
  244. package/src/results/host-equivalence.test.ts +527 -0
  245. package/src/results/index.ts +56 -14
  246. package/src/results/locator.test.ts +198 -0
  247. package/src/results/locator.ts +0 -0
  248. package/src/results/open.ts +392 -175
  249. package/src/results/results.test.ts +943 -494
  250. package/src/results/select.ts +129 -23
  251. package/src/results/skipped-notice.ts +0 -0
  252. package/src/results/source-hash.ts +28 -0
  253. package/src/results/types.ts +98 -62
  254. package/src/results/writer.ts +304 -176
  255. package/src/runner/attempt.test.ts +170 -0
  256. package/src/runner/attempt.ts +48 -13
  257. package/src/runner/discover.test.ts +65 -0
  258. package/src/runner/discover.ts +6 -2
  259. package/src/runner/eval-source.test.ts +121 -0
  260. package/src/runner/eval-source.ts +45 -0
  261. package/src/runner/fingerprint.ts +54 -1
  262. package/src/runner/remote-sandbox.ts +1 -1
  263. package/src/runner/report.test.ts +6 -8
  264. package/src/runner/report.ts +5 -4
  265. package/src/runner/reporters/artifacts.ts +27 -41
  266. package/src/runner/reporters/braintrust.test.ts +3 -3
  267. package/src/runner/reporters/braintrust.ts +1 -1
  268. package/src/runner/reporters/console.ts +6 -6
  269. package/src/runner/reporters/json.ts +4 -4
  270. package/src/runner/reporters/live.test.ts +56 -0
  271. package/src/runner/reporters/live.ts +36 -10
  272. package/src/runner/reporters/quiet.test.ts +66 -0
  273. package/src/runner/reporters/quiet.ts +49 -0
  274. package/src/runner/reporters/shared.ts +5 -5
  275. package/src/runner/reporters/table.ts +17 -17
  276. package/src/runner/run.ts +61 -102
  277. package/src/runner/types.ts +43 -32
  278. package/src/sandbox/checkpoint.ts +1 -1
  279. package/src/sandbox/docker.ts +15 -2
  280. package/src/sandbox/e2b.ts +11 -5
  281. package/src/sandbox/errors.ts +13 -0
  282. package/src/sandbox/index.ts +3 -3
  283. package/src/sandbox/local-files.ts +1 -1
  284. package/src/sandbox/registry.ts +6 -5
  285. package/src/sandbox/resolve.ts +38 -23
  286. package/src/sandbox/retry.test.ts +68 -0
  287. package/src/sandbox/retry.ts +44 -0
  288. package/src/sandbox/types.ts +24 -24
  289. package/src/sandbox/vercel.ts +17 -3
  290. package/src/scoring/collector.ts +3 -3
  291. package/src/scoring/judge.ts +2 -2
  292. package/src/scoring/scoped.ts +13 -1
  293. package/src/scoring/types.ts +7 -7
  294. package/src/scoring/verdict.ts +4 -4
  295. package/src/shared/aggregate.ts +23 -3
  296. package/src/shared/types.ts +2 -2
  297. package/src/shared/{outcome.ts → verdict.ts} +15 -15
  298. package/src/show/compose.ts +12 -132
  299. package/src/show/index.ts +125 -94
  300. package/src/show/render.ts +660 -160
  301. package/src/show/show.test.ts +472 -253
  302. package/src/source-loc.ts +1 -1
  303. package/src/tty-line.ts +32 -0
  304. package/src/types.ts +2 -2
  305. package/src/util.test.ts +21 -1
  306. package/src/util.ts +5 -1
  307. package/src/view/app/App.tsx +33 -198
  308. package/src/view/app/components/AttemptModal.tsx +6 -6
  309. package/src/view/app/components/CodeView.tsx +2 -2
  310. package/src/view/app/components/CopyControls.tsx +32 -36
  311. package/src/view/app/components/SkippedRunsBanner.tsx +140 -0
  312. package/src/view/app/components/ui/badge.tsx +1 -1
  313. package/src/view/app/components/ui/dialog.tsx +2 -2
  314. package/src/view/app/i18n.ts +40 -31
  315. package/src/view/app/lib/artifact-url.ts +1 -1
  316. package/src/view/app/lib/attempt-route.test.ts +37 -47
  317. package/src/view/app/lib/attempt-route.ts +26 -26
  318. package/src/view/app/lib/rows.ts +9 -112
  319. package/src/view/app/lib/verdict.ts +25 -0
  320. package/src/view/app/main.tsx +9 -12
  321. package/src/view/app/pages/RunsPage.tsx +4 -4
  322. package/src/view/app/pages/TracesPage.tsx +3 -3
  323. package/src/view/app/shared.ts +0 -1
  324. package/src/view/app/types.ts +6 -51
  325. package/src/view/artifact-serving.test.ts +136 -0
  326. package/src/view/client-dist/app.css +1 -1
  327. package/src/view/client-dist/app.js +21 -21
  328. package/src/view/data.test.ts +214 -143
  329. package/src/view/data.ts +166 -120
  330. package/src/view/index.ts +23 -11
  331. package/src/view/server.ts +52 -17
  332. package/src/view/shared/types.ts +22 -31
  333. package/src/view/styles.css +117 -327
  334. package/src/view/view-report.test.ts +146 -98
  335. package/src/report/default-report.tsx +0 -222
  336. package/src/report/dual-face.test.tsx +0 -527
  337. package/src/report/react/CaseList.tsx +0 -70
  338. package/src/view/app/components/CostScoreChart.tsx +0 -147
  339. package/src/view/app/components/ExperimentTable.tsx +0 -284
  340. package/src/view/app/components/GroupSelector.tsx +0 -61
  341. package/src/view/app/components/primitives.tsx +0 -43
  342. package/src/view/app/lib/outcome.ts +0 -82
@@ -1,122 +1,279 @@
1
1
  ---
2
- title: "让 coding agent 读结果并自主迭代"
3
- sidebarTitle: "Agent 反馈闭环"
4
- description: "niceeval exp 跑完直接给出失败清单和下钻命令,agent niceeval show 在终端读断言、transcript、trace 与 diff,修完按前缀重跑——跑→读→修→再跑全程不出终端。"
2
+ title: "让 AI Eval 并自主优化"
3
+ sidebarTitle: "AI 反馈闭环"
4
+ description: " coding agent 读取随包文档,用 bash 运行实验、下钻结果、定位失败并持续迭代,最后用全量重跑确认收敛。"
5
5
  ---
6
6
 
7
- Eval 的价值在闭环:不只是人看报告,而是让 coding agent(Claude Code、Codex 等)自己跑 eval、自己读失败原因、自己改被测程序、再跑验证。这个循环成立的前提是信息对等:**人在 `niceeval view` 里能看到的证据,agent 都能用 `niceeval show` 在终端看到**(两扇门的完整用法见[查看结果](/zh/guides/viewing-results))。agent 不需要浏览器,不需要解析人类向的流式输出,也不需要一口气吞下可能上百 MB 的原始 JSON——CLI 输出是浓缩过的读法,原始工件永远在盘上,要多细读多细。
7
+ Coding agent 可以独立完成两类工作:根据需求编写 NiceEval 配置与 Eval,以及根据运行结果持续改进被测程序。整个过程只需要仓库文件和 bash,不依赖浏览器,也不需要额外安装 Skill。
8
8
 
9
- ## 一次完整的循环
9
+ ## 先让 AI 读安装版本的文档
10
+
11
+ NiceEval 把中文文档发布在 npm 包的 `docs-site/zh/` 目录,并在包根提供只给 AI 使用的 `INDEX.md`。AI 应该先读取 `node_modules/niceeval/INDEX.md`,再由索引进入当前任务需要的页面,而不是依赖训练数据或网上另一个版本的示例。这样 API、CLI 和安装版本始终一致;文档重组时也只需要更新随包索引。
12
+
13
+ `npx niceeval init` 会初始化配置,并把一段托管指引写进项目的 `AGENTS.md`。如果项目只有 `CLAUDE.md`,则写入 `CLAUDE.md`;两份文件都不存在时,新建 `AGENTS.md`。升级 NiceEval 后再运行一次 `init`,即可刷新托管区块。
14
+
15
+ 给 AI 的起始任务可以直接写成:
16
+
17
+ ```text
18
+ 先读取 node_modules/niceeval/INDEX.md,再按索引读取当前任务需要的文档,
19
+ 再根据需求编写 niceeval.config.ts、experiment 和 eval。
20
+ 不要根据训练数据猜 NiceEval 的 API。
21
+ ```
22
+
23
+ AI 通常按任务选择这些入口:
24
+
25
+ | 任务 | 随包文档 |
26
+ | --- | --- |
27
+ | 初始化项目 | `docs-site/zh/quickstart.mdx` |
28
+ | 编写 Eval | `docs-site/zh/concepts/evals.mdx` |
29
+ | 定义实验 | `docs-site/zh/guides/write-experiment.mdx` |
30
+ | 连接被测 Agent | `docs-site/zh/concepts/adapter.mdx` |
31
+ | 配置 Sandbox | `docs-site/zh/guides/sandbox-agent.mdx` |
32
+ | 解释运行结果 | `docs-site/zh/guides/viewing-results.mdx` |
33
+
34
+ ## 用 bash 完成一次反馈闭环
35
+
36
+ 闭环的目标不是“把命令跑绿”,而是形成并验证一个假设:失败来自被测程序、Eval,还是运行环境。推荐按下面的顺序迭代。
10
37
 
11
38
  <Steps>
12
- <Step title="">
39
+ <Step title="运行实验">
13
40
  ```bash
14
41
  npx niceeval exp local
15
42
  ```
43
+
44
+ 先读取退出码:`0` 表示所有 Eval 通过;`1` 表示至少一个 Eval 失败或出错;`2` 表示 NiceEval 自身未能完成运行。退出码决定是否继续,控制台文本用于定位原因。
16
45
  </Step>
17
- <Step title="">
18
- 运行中每个 eval 一条流式行即时反馈;运行结束时 CLI 打出收尾块——失败清单逐条带 eval id、失败断言和下钻命令,末尾是结构化结果入口。完整输出长这样:
46
+ <Step title="读取失败">
47
+ ```bash
48
+ npx niceeval show
49
+ npx niceeval show @1k2m9qtr
50
+ ```
51
+
52
+ 第一条命令显示当前各实验的通过率、成本、耗时,以及每个 Eval 的紧凑 Attempt locator。`[E]` / `[X]` / `[⏱]` / `[D]` 分别表示运行时 Eval 源码、执行步骤、OTel 时间和 diff 可用。第二条命令直接打开选中的 Attempt。
53
+ </Step>
54
+ <Step title="按问题读取证据">
55
+ ```bash
56
+ npx niceeval show @1k2m9qtr --execution
57
+ npx niceeval show @1c3h6tbn --diff
58
+ ```
59
+
60
+ `--execution` 合并 AI 输出与 trace:标准事件流提供消息、thinking、tool call/result 和 Skill load;OTel 在能够关联时给同一节点补开始时间、耗时、父子关系和错误状态。没有 OTel 时步骤仍完整,只不显示时间。
61
+
62
+ 不带证据 flag 时,`show @<id>` 是失败诊断首页。它先列出失败断言的 group、matcher、expected、received、原因和源码位置,再给执行与文件变化摘要。AI 应该先读这一页;只有需要回答“为什么产生这个值”时,才继续打开对应证据。
19
63
 
20
64
  ```text
21
- $ npx niceeval exp local
22
- Discovered 15 evals · experiment local
23
-
24
- classify (12ms)
25
- ✓ weather/tokyo (31s · $0.02)
26
- weather/brooklyn (41s · $0.04 · 3 attempts)
27
- fixtures/button (2m 10s · $0.11)
28
-
29
-
30
- Failing:
31
- weather/brooklyn
32
- gate calledTool("get_weather"): tool was never called
33
- soft judge("回答基于实时数据"): 0.2/1
34
- niceeval show weather/brooklyn
35
-
36
- Results: 14 passed, 1 failed, 0 errored, 0 skipped · $0.31 · 6m 02s
37
- Structured results: .niceeval/2026-07-09T10-00-00-000Z/summary.json
65
+ $ niceeval show @1k2m9qtr
66
+ @1k2m9qtr · weather/brooklyn · compare/codex-gpt-5.4 · failed
67
+ snapshot 2026-07-09T10-00-00-000Z-x1f2 · attempt 2 · 41.2s · 12.3k tokens · $0.04
68
+ eval source: evals/weather/brooklyn.eval.ts · sha256:8d47…
69
+
70
+ 8 export default defineEval({
71
+ 9 id: "weather/brooklyn",
72
+ 10 async test(t) {
73
+ 11 const turn = await t.send("布鲁克林今天天气怎么样?");
74
+ 12 ✗ turn.calledTool("get_weather");
75
+ gate · tool was never called
76
+ 13 ✓ turn.succeeded();
77
+ 14 ✗ t.check(turn.message, judge("回答基于实时数据"));
78
+ soft · 0.2/1 · reply invents a temperature without any tool call
79
+ 15 },
80
+ 16 });
81
+
82
+ assertions: 1 passed · 1 gate failed · 1 soft below target
83
+
84
+ failures:
85
+ gate · Issue 15193: selected proposal matches the one maintainers accepted
86
+ assertion: equals(4)
87
+ expected: 4
88
+ received: 1
89
+ source: evals/memory/swelancer-manager-proposals.eval.ts:40:11
90
+
91
+ execution [X,⏱]
92
+ agent run ▕████████████████████▏ 41.2s
93
+ ├─ inference ▕█████░░░░░░░░░░░░░░░▏ 10.1s · "布鲁克林今天大约 24°C,晴。"
94
+ ├─ inference ▕░░░░░█████████░░░░░░▏ 18.3s
95
+ └─ inference ▕░░░░░░░░░░░░░░██████▏ 12.4s
96
+ no tool calls
97
+
98
+ changes · diff unavailable
99
+ reason: this Attempt did not produce workspace file changes
100
+
101
+ evidence: Eval source [E] · execution [X] · OTel timing [⏱]
102
+ full eval source: …/weather/brooklyn/a2/eval-source.ts
103
+ next: niceeval show @1k2m9qtr [--eval|--execution|--diff]
38
104
  ```
39
105
 
40
- 流式行是给盯着终端的人看的,长运行会把它们刷出屏幕;收尾块专为「只看最后一屏」设计——失败集中重放一遍,每条自带 `niceeval show <eval id>`,agent 不用回滚历史输出就能开始下钻。跑多 experiment 的组(如 `exp compare`)时,收尾块还会多一张 per-experiment 汇总表,与 `niceeval show` 榜单是同一份渲染。
106
+ `--execution` AI 消息、Skill load、工具调用和工具结果排成一棵执行树。它只展示 Agent 可理解的事件;没有关联到这些事件的 SDK / runtime span 不逐行输出,只报告省略数量并保留 `trace.json` 路径。下面的 Attempt 有 OTel,所以能关联的节点同时带相对时间与耗时:
107
+
108
+ ```text
109
+ $ niceeval show @1k2m9qtr --execution
110
+ @1k2m9qtr · weather/brooklyn · compare/codex-gpt-5.4 · failed · OTel timing
111
+
112
+ USER
113
+ 布鲁克林今天天气怎么样?
41
114
 
42
- 退出码是给循环用的判决,不用解析任何文本:全绿退 `0`;有失败或错误退 `1`(按 eval 级折叠——`runs` 重试吸收掉的单次抖动不算红);框架自身崩溃退 `2`。agent 或脚本判断「还要不要再来一轮」,看退出码就够。
115
+ ASSISTANT
116
+ 我先读取天气工具的使用说明。
43
117
 
44
- `summary.json` attempt 级工件是结构化事实源,字段说明见[查看结果](/zh/guides/viewing-results);`niceeval show` 是对同一份工件的终端读法,逐级下钻见下一节。
118
+ TOOL · get_weather 0.8s · 1.8s
119
+ input
120
+ {"location":"Brooklyn"}
121
+ result · completed
122
+ {"temperatureC":18,"condition":"rain"}
123
+
124
+ ASSISTANT 2.8s · 1.2s
125
+ 布鲁克林当前约 18°C,有雨。
126
+
127
+ total 4.0s · 1 skill load · 1 tool call · 2 AI messages
128
+ full events: …/weather/brooklyn/a2/events.json
129
+ 69 unlinked telemetry spans omitted; inspect the OTel trace for framework timing.
130
+ full OTel trace: …/weather/brooklyn/a2/trace.json
131
+ ```
132
+
133
+ 没有 OTel 时仍用标准事件流展示相同的步骤,只去掉时间列和瀑布关系,不把“缺时间”误写成“没有执行”:
134
+
135
+ ```text
136
+ $ niceeval show @1nx4dpwq --execution
137
+ @1nx4dpwq · weather/brooklyn · compare/bub-gpt-5.4 · failed
138
+
139
+ USER
140
+ 布鲁克林今天天气怎么样?
141
+
142
+ ASSISTANT
143
+ 我先读取天气工具的使用说明。
144
+
145
+ TOOL · get_weather
146
+ input
147
+ {"location":"Brooklyn"}
148
+ result · completed
149
+ {"temperatureC":18,"condition":"rain"}
150
+
151
+ ASSISTANT
152
+ 布鲁克林当前约 18°C,有雨。
153
+
154
+ timing unavailable · OTel trace was not collected
155
+ full events: …/weather/brooklyn/a2/events.json
156
+ ```
157
+
158
+ diff 是被测 Agent 在 Sandbox 工作区造成的文件变化,不是 Eval 源码的新旧差异。它只会出现在带 `[D]` 的 locator 上。默认先给文件级摘要,避免把大段补丁塞进 Agent 上下文;`--diff=<文件>` 再展开单个文件,原始 artifact 路径始终保留:
159
+
160
+ ```text
161
+ $ niceeval show @1c3h6tbn --diff
162
+ @1c3h6tbn · fixtures/button · compare/bub-gpt-5.4 · errored
163
+
164
+ M src/components/Button.tsx +42 −3
165
+ A src/components/Button.css +18
166
+
167
+ 2 files changed · +60 −3
168
+ full diff: …/fixtures/button/a1/diff.json
169
+ next: niceeval show @1c3h6tbn --diff=src/components/Button.tsx
170
+ ```
171
+
172
+ 用这组输出检查信息是否足够:
173
+
174
+ | 要回答的问题 | 入口 | 输出必须包含 |
175
+ | --- | --- | --- |
176
+ | 快速判断一次 Attempt 发生了什么 | `niceeval show @<id>` | Eval 断言、执行步骤、可选 OTel 时间、diff 摘要及各块可用性 |
177
+ | Eval 实际检查了什么,哪条 gate / soft 为什么通过或失败 | `niceeval show @<id> --eval` | 运行时 Eval 源码、源码哈希、断言所在行、严重度、分数与原因 |
178
+ | AI 做了什么、调用了什么、时间花在哪里 | `niceeval show @<id> --execution` | 消息、thinking、Skill load、工具调用与结果;有 OTel 时在同一节点显示时间、父子关系和错误状态 |
179
+ | Sandbox 工作区文件变成什么 | `niceeval show @<id> --diff` | 文件摘要、增删行数、具体补丁和原始 diff 路径;无文件工作区时明确 unavailable |
180
+ </Step>
181
+ <Step title="提出假设并修改">
182
+ 根据证据只修改最可能出错的一侧:
183
+
184
+ | 看到的现象 | 优先检查 |
185
+ | --- | --- |
186
+ | 回复或工具调用不符合需求 | 被测程序、Prompt、工具定义 |
187
+ | `diff` 与任务要求不符 | 被测 Agent 的实现策略或运行环境 |
188
+ | 正确行为被 gate 拒绝 | Eval 断言、fixture、setup |
189
+ | timeout、鉴权或 Sandbox 错误 | 实验配置、Adapter、Sandbox |
190
+ | 同一 Eval 时好时坏 | `--history`、`runs` 和稳定性问题 |
191
+
192
+ 不要为了变绿而放宽一个本来正确的断言。先写清楚“哪条证据支持什么判断”,再修改代码。
45
193
  </Step>
46
- <Step title="">
47
- 先判断缺陷在哪一侧:被测程序,还是 eval 本身(断言过紧、fixture 错误、setup 缺失)。修对应的一侧,不要为了变绿而放宽断言。
194
+ <Step title="局部重跑并验证假设">
195
+ ```bash
196
+ npx niceeval exp local weather/brooklyn --force
197
+ npx niceeval show weather/brooklyn
198
+ ```
199
+
200
+ 位置参数按 Eval ID 前缀缩小实验范围。调试同一个失败时加 `--force`,确保刚才的修改真的触发一次新运行。然后用 `show` 验证判定、断言和证据是否按预期变化。
48
201
  </Step>
49
- <Step title="再跑">
202
+ <Step title="全量确认没有回归">
50
203
  ```bash
51
- npx niceeval exp local weather
204
+ npx niceeval exp local --force
205
+ npx niceeval show
52
206
  ```
53
207
 
54
- 位置参数按 eval id 前缀只重跑失败的部分,已通过的 eval 会被指纹缓存跳过。注意缓存的边界:指纹只看 eval 源码和运行配置,**看不到被测程序**——修完被测程序后,旧的「通过」仍是对旧代码的判定,这次修复若引入回归,缓存不会替你发现。所以迭代中按前缀快速重跑,等失败清零后再用 `--force` 全量跑一遍,确认没把别的 eval 修坏,才算真正收工。
208
+ 局部结果变绿只证明当前假设成立。收工前必须强制全量重跑;只有命令退出码为 `0`,且 `show` 没有新的失败或错误,才算完成。
55
209
  </Step>
56
210
  </Steps>
57
211
 
58
- agent 的提示词可以直接这样写:
212
+ ## AI 应该从输出里读什么
59
213
 
60
- ```text
61
- 跑 npx niceeval exp local。对每个失败的 eval 用 niceeval show <eval id> 看失败断言,
62
- 需要证据时加 --transcript / --trace / --diff。判断缺陷在被测程序还是 eval 本身,
63
- 修掉后重跑对应前缀。失败清零后用 --force 全量重跑一次确认没有回归,退出码 0 才算完成。
64
- 连续三轮同一个 eval 没有进展就停下来汇报,不要为了变绿放宽断言。
65
- ```
214
+ `exp` 运行结束后会给出三类信息:失败摘要、结果统计和结果快照目录。典型输出如下:
66
215
 
67
- 跑真实 agent 的 eval 每轮都花钱;不放心 agent 的循环成本时,给 `exp` 加 `--budget <美元>`——累计花费到顶后剩余 attempt 直接跳过,agent 循环再失控也有硬上限。
216
+ ```text
217
+ Failing:
218
+ ✗ weather/brooklyn · @1k2m9qtr[E,X,⏱]
219
+ gate calledTool("get_weather"): tool was never called
68
220
 
69
- ## 在终端下钻
221
+ Results: 14 passed, 1 failed, 0 errored, 0 skipped
222
+ Structured results: .niceeval/local/2026-07-09T10-00-00-000Z-x1f2/
223
+ (snapshot.json + 每 attempt 的 result.json / events.json / trace.json / diff.json)
224
+ ```
70
225
 
71
- `niceeval show` 的位置参数与 `exp` 同一语义——eval id 前缀选「看哪些 eval」;flag 选「看哪个切面」:
226
+ AI 应先从失败项选中 Attempt locator,再按证据位执行 `niceeval show @<id>` 或对应证据 flag,不要从头解析运行期间不断刷新的进度行。需要机器读取时,结果快照是事实来源:
72
227
 
73
- ```bash
74
- niceeval show # 榜单:每个 experiment 的通过率、成本、耗时与失败清单
75
- niceeval show weather/brooklyn # 单个 eval:attempt、断言明细、错误与用量
76
- niceeval show weather/brooklyn --transcript # agent 的完整对话与工具调用
77
- niceeval show weather/brooklyn --trace # trace 瀑布的文本版
78
- niceeval show fixtures/button --diff # sandbox 里的文件改动
228
+ ```text
229
+ .niceeval/<experiment>/<快照>/
230
+ ├── snapshot.json
231
+ └── <eval-id>/a<attempt>/
232
+ ├── result.json
233
+ ├── events.json
234
+ ├── trace.json
235
+ └── diff.json
79
236
  ```
80
237
 
81
- 默认永远对准闭环要的东西:判决取每个 eval 跨 run 合成的最新一份,证据切面挑最新一次失败的 attempt。三个切面对长内容都会截断,但截断永远如实标注剩余数量和原始工件路径——输出对上下文窗口友好,事实源一字不少地留在盘上。
238
+ - `snapshot.json` 记录实验身份、运行配置、格式版本和时间。
239
+ - `result.json` 记录该 Attempt 的判定、断言、错误和用量。
240
+ - `events.json` 是对话与工具调用事件,`trace.json` 是调用链,`diff.json` 是 Sandbox 文件变化。
241
+ - 某类证据不存在时,对应文件不会生成。先以 `show` 的提示为准,不要假设每个目录都有全部文件。
82
242
 
83
- 榜单、单个 eval 与各证据切面的输出长什么样、历史与抖动怎么看(`--history`)、多次 run 的合成口径,都在[查看结果](/zh/guides/viewing-results);要项目自己的口径(考试成绩单、代码行数榜),写一个打到 stdout 的报告脚本,见[自定义报告](/zh/guides/custom-reports)——给 agent 的指引只多一行:跑 `npx tsx scripts/report.ts`,读 stdout。
243
+ `show` 的默认结果可能合成自多次运行:每个 experiment × eval 选择最新判定,因此局部重跑后仍能看到其它 Eval 的旧结果。它适合回答“现在已知的水位是什么”;一次 `--force` 全量运行才适合回答“同一版代码是否整体通过”。
84
244
 
85
- ## AGENTS.md / CLAUDE.md 指引区块
245
+ ## 什么时候会复用结果
86
246
 
87
- 模型的训练数据里没有 NiceEval。`npx niceeval init` 会写入一个托管区块,告诉 agent 先读随包文档再动手:项目已有 `AGENTS.md` 就写那份;只有 `CLAUDE.md`(没有 `AGENTS.md`)就直接写进 `CLAUDE.md`,不另建重复文件;两者都没有则新建 `AGENTS.md`。`CLAUDE.md` 是指向 `AGENTS.md` 的符号链接时,写入自动落到链接目标,不会分裂成两份内容。
247
+ 不传 `--force` 时,NiceEval 会比较当前指纹与最近结果。指纹由 Eval 源码和运行配置组成,包括实验 ID、Agent、model、flags、Sandbox、timeout strict 等设置。
88
248
 
89
- ```md
90
- <!-- BEGIN:niceeval-agent-rules -->
91
- # niceeval is NOT in your training data
249
+ | 最近结果与当前输入 | 本次行为 |
250
+ | --- | --- |
251
+ | 指纹相同,判定为 `passed` `failed` | 携入旧结果,不重新执行 |
252
+ | 指纹不同 | 重新执行 |
253
+ | 最近结果为 `errored` 或 `skipped` | 重新执行 |
254
+ | 使用 `--force` | 忽略旧结果,重新执行 |
92
255
 
93
- Its APIs and conventions may differ from anything you have seen. Read the relevant
94
- guide in `node_modules/niceeval/docs-site/zh/` before writing any eval, experiment,
95
- adapter, or niceeval config. The bundled docs are Chinese-only — that is the single
96
- authoritative, always-current version; read it regardless of your working language.
97
- After a run, drill into failures with `niceeval show <eval id>` (add `--transcript` /
98
- `--trace` / `--diff` for evidence); the `summary.json` path the CLI prints and the
99
- artifact files it references are the structured source of truth.
100
- <!-- END:niceeval-agent-rules -->
101
- ```
256
+ 被测程序的源码不在指纹里。修改实现后,即使行为已经变化,旧的 `passed` `failed` 仍可能被复用。因此可以这样选择:
102
257
 
103
- 标记之外的内容不会被改动;升级 NiceEval 后重跑 `npx niceeval init` 会刷新标记之内的指引,且每次都会重新按上述规则判断该写哪份文件。npm 包只随包发布中文文档(`node_modules/niceeval/docs-site/zh/`)——中文是唯一始终与代码同步的准绳版本,agent 读中文没有障碍,读到的永远是和安装版本一致的行为,而不是训练数据里的旧记忆。
258
+ - 只想重看已有结果:运行 `niceeval show`,不产生新费用。
259
+ - 修改了 Eval 或实验配置:直接重跑;指纹变化会触发对应任务。
260
+ - 修改了被测程序:对受影响的 Eval 使用 `--force`。
261
+ - 准备结束本轮工作:对整个实验使用 `--force`,排除其它 Eval 的回归。
104
262
 
105
- ## 报错自带修法
263
+ ## 让 AI 自己收敛
106
264
 
107
- 配置和运行期错误直接给出修法与随包文档路径,agent 读到报错就能自修,不必先搜索:
265
+ 可以把下面的协议放进任务描述。它既适合优化被测实现,也适合调试 Eval:
108
266
 
109
267
  ```text
110
- Could not find niceeval.config.ts.
111
- Ways to fix:
112
- - [init] Run `npx niceeval init` to scaffold niceeval.config.ts and evals/
113
- - [cd] Run from the project root that contains niceeval.config.ts
114
- Docs: node_modules/niceeval/docs-site/zh/quickstart.mdx
268
+ 读取 node_modules/niceeval/INDEX.md,再按索引读取与任务有关的文档。
269
+ 运行 npx niceeval exp local,并根据退出码和失败摘要决定下一步。
270
+ 对每个失败的 Eval,从报告选择一个 Attempt locator;再运行 niceeval show @<id>
271
+ 并按问题选择默认 Eval 源码面、--execution --diff。写出失败原因的假设,并判断应该修改被测程序、
272
+ Eval,还是实验环境。修改后用 --force 重跑对应 Eval,比较新的判定和证据。
273
+ 同一问题连续三轮没有新证据或改善时停止并汇报,不要靠放宽断言碰绿。
274
+ 全部局部失败清零后,用 npx niceeval exp local --force 全量验证;退出码 0 才完成。
115
275
  ```
116
276
 
117
- ## 人与 agent 看同一份工件
118
-
119
- `niceeval show` 和 `niceeval view` 读的是同一批落盘工件,人和 agent 随时可以互相接手:
277
+ 真实 Agent 的运行可能产生费用。实验阶段可以加 `--budget <美元>` 限制本轮累计成本;预算只能限制单次命令,不能替代上面的停止条件。
120
278
 
121
- - 人在 `npx niceeval view` 里看到失败时,榜单右上角的 **Copy fix prompt** 把全部失败打包成一段可直接粘给 agent 的修复 prompt——失败清单、artifacts 路径、判断与重跑步骤都在里面,教的读法与本页同一套:`niceeval show` 下钻、判断缺陷在哪一侧、重跑前缀、`--force` 收尾。打开单个 attempt 的弹窗,同名按钮只打包这一条失败,适合逐条转交。
122
- - 反过来,agent 修完之后人想核对现场,`npx niceeval view` 打开的就是 agent 刚刚在终端里读过的那份结果。
279
+ 人与 AI 随时可以接手同一轮工作。AI 用 `niceeval show` 读取的结果,也能由人运行 `npx niceeval view` 在网页中查看。两者读取同一批 artifact;完整的输出格式、历史选择和网页操作见[查看结果](/zh/guides/viewing-results)。
@@ -4,7 +4,7 @@ sidebarTitle: "OTel 接入"
4
4
  description: "把应用已经在发的 OTel span 也发给 NiceEval 一份,niceeval view 里就有每轮的调用瀑布图。断言不从这里来——接好 send 那一刻断言就齐了。"
5
5
  ---
6
6
 
7
- 先说清这条接入**不**改变什么:断言。`t.calledTool`、`t.maxTokens`、耗时这些判决的依据,全部来自你的 adapter 在 `send` 里返回的 `Turn`(`events` + `usage`)——接好 send 的那一刻,全套断言就齐了,和 OTel 没有关系(见[接入你的 agent](/zh/guides/connect-your-agent))。
7
+ 先说清这条接入**不**改变什么:断言。`t.calledTool`、`t.maxTokens`、耗时这些判定的依据,全部来自你的 adapter 在 `send` 里返回的 `Turn`(`events` + `usage`)——接好 send 的那一刻,全套断言就齐了,和 OTel 没有关系(见[接入你的 agent](/zh/guides/connect-your-agent))。
8
8
 
9
9
  OTel 接入买到的是另一样东西:**`niceeval view` 里的调用瀑布图**。应用内部每次模型调用、每次工具执行、各自的耗时和 token,按轮铺开成一条时间线——失败的 eval 为什么失败、慢的轮次慢在哪一步,经常一眼就在瀑布图里。
10
10
 
@@ -12,7 +12,7 @@ OTel 接入买到的是另一样东西:**`niceeval view` 里的调用瀑布图
12
12
 
13
13
  ## 原理(一段话)
14
14
 
15
- [NiceEval](https://niceeval.com/) 运行时起一个本机 OTLP 接收器,应用把 span 发过来;每轮 `send` 收到的 span 归属到那一轮,归一成 GenAI 语义后写进 `EvalResult.trace`,跑完 `npx niceeval view` 就是瀑布图。**span 只进瀑布图,不进事件流、不喂断言**——埋点缺一块、span 迟到或丢批,只影响瀑布图的完整性,不影响任何判决。
15
+ [NiceEval](https://niceeval.com/) 运行时起一个本机 OTLP 接收器,应用把 span 发过来;每轮 `send` 收到的 span 归属到那一轮,归一成 GenAI 语义后写进 `EvalResult.trace`,跑完 `npx niceeval view` 就是瀑布图。**span 只进瀑布图,不进事件流、不喂断言**——埋点缺一块、span 迟到或丢批,只影响瀑布图的完整性,不影响任何判定。
16
16
 
17
17
  ## 接法
18
18
 
@@ -199,7 +199,7 @@ export default defineAgent({
199
199
 
200
200
  - **断言相关的一切都在 send**。想断工具调用,把它映射进 `events`(官方转换器或手写映射,见[写 send](/zh/guides/write-send));想断 usage,`send` 返回里带上。不存在"span 里有、events 里没有,于是断言看 span"的路径。
201
201
  - **多轮会话、HITL 不归 span 管**。span 没有"等人输入"语义,会话续接也是应用协议的事——这两样照常在 `send` 里做(会话续接见[写 send](/zh/guides/write-send),HITL 概念见 [HITL](/zh/concepts/hitl))。
202
- - **收不到 span 会有提示**。整轮 0 span 通常是端点没接上(env 没注入、服务没重启),[NiceEval](https://niceeval.com/) 会在日志里提示;瀑布图为空,断言照常判。
202
+ - **收不到 span 会有提示**。整个 run 0 span 通常是端点没接上(env 没注入、服务没重启),[NiceEval](https://niceeval.com/) 会在日志里提示;瀑布图为空,断言照常判。
203
203
 
204
204
  ## 相关阅读
205
205
 
@@ -101,12 +101,12 @@ npx niceeval exp my-bot refund # 只跑 ID 以 refund 开头的
101
101
  npx niceeval view # 本地查看器里看结果
102
102
  ```
103
103
 
104
- **跑通的样子**:终端里每条 eval 一行判决,末尾汇总 `N passed, N failed`;`npx niceeval view` 里能看到每条 eval 逐轮的输入、事件和评分明细。
104
+ **跑通的样子**:终端里每条 eval 一行判定,末尾汇总 `N passed, N failed`;`npx niceeval view` 里能看到每条 eval 逐轮的输入、事件和评分明细。
105
105
 
106
106
  没跑通时,按报错的位置分三类排查:
107
107
 
108
108
  - **`fetch` 直接抛错**(连接被拒等):应用没起来,或 `send` 里的 URL 不对——先用 `curl` 对那个接口发一次同样的请求确认。
109
- - **`t.succeeded()` 没过、本轮判决是 failed**:请求发出去了但应用回了非 2xx。在 `send` 里用 `ctx.log()` 打印响应体,`niceeval view` 的本轮日志里能看到。
109
+ - **`t.succeeded()` 没过、本轮判定是 failed**:请求发出去了但应用回了非 2xx。在 `send` 里用 `ctx.log()` 打印响应体,`niceeval view` 的本轮日志里能看到。
110
110
  - **只有内容断言没过**:接入本身已经通了——在 `view` 里对照 `t.reply` 的实际值,调断言或调应用。
111
111
 
112
112
  到这里接入已经完成:文本断言和 judge 评分都能用了。想要更多断言(工具、多轮、审批流),见文末的增量地图。