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.
- package/INDEX.md +55 -0
- package/dist/agents/types.d.ts +317 -0
- package/dist/context/types.d.ts +335 -0
- package/dist/i18n/core.d.ts +11 -0
- package/dist/i18n/en.d.ts +181 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/zh-CN.d.ts +183 -0
- package/dist/o11y/execution-tree.d.ts +103 -0
- package/dist/o11y/otlp/parse.d.ts +3 -0
- package/dist/o11y/otlp/receiver.d.ts +21 -0
- package/dist/o11y/otlp/select.d.ts +22 -0
- package/dist/o11y/otlp/turn-otel.d.ts +43 -0
- package/dist/o11y/types.d.ts +190 -0
- package/dist/report/aggregate.d.ts +57 -0
- package/dist/report/aggregate.js +212 -0
- package/dist/report/built-ins/cost-pass-rate-comparison.d.ts +1 -0
- package/dist/report/built-ins/cost-pass-rate-comparison.js +17 -0
- package/dist/report/built-ins/index.d.ts +1 -0
- package/dist/report/built-ins/index.js +2 -0
- package/dist/report/components.d.ts +178 -0
- package/dist/report/components.js +132 -0
- package/dist/report/compute.d.ts +106 -0
- package/dist/report/compute.js +618 -0
- package/dist/report/flag.d.ts +6 -0
- package/dist/report/flag.js +8 -0
- package/dist/report/format.d.ts +32 -0
- package/dist/report/format.js +126 -0
- package/dist/report/index.d.ts +19 -0
- package/dist/report/index.js +30 -0
- package/dist/report/load.d.ts +12 -0
- package/dist/report/load.js +56 -0
- package/dist/report/locale.d.ts +83 -0
- package/dist/report/locale.js +160 -0
- package/dist/report/metrics.d.ts +21 -0
- package/dist/report/metrics.js +115 -0
- package/dist/report/primitives.d.ts +64 -0
- package/dist/report/primitives.js +113 -0
- package/dist/report/react/AttemptList.d.ts +23 -0
- package/dist/report/react/AttemptList.js +20 -0
- package/dist/report/react/DeltaTable.d.ts +8 -0
- package/dist/report/react/DeltaTable.js +24 -0
- package/dist/report/react/EvalList.d.ts +10 -0
- package/dist/report/react/EvalList.js +0 -0
- package/dist/report/react/ExperimentList.d.ts +10 -0
- package/dist/report/react/ExperimentList.js +15 -0
- package/dist/report/react/GroupSummary.d.ts +8 -0
- package/dist/report/react/GroupSummary.js +8 -0
- package/dist/report/react/MetricBars.d.ts +10 -0
- package/dist/report/react/MetricBars.js +48 -0
- package/dist/report/react/MetricLine.d.ts +9 -0
- package/dist/report/react/MetricLine.js +68 -0
- package/dist/report/react/MetricMatrix.d.ts +10 -0
- package/dist/report/react/MetricMatrix.js +23 -0
- package/dist/report/react/MetricScatter.d.ts +9 -0
- package/dist/report/react/MetricScatter.js +100 -0
- package/dist/report/react/MetricTable.d.ts +11 -0
- package/dist/report/react/MetricTable.js +26 -0
- package/dist/report/react/RunOverview.d.ts +8 -0
- package/dist/report/react/RunOverview.js +12 -0
- package/dist/report/react/Scoreboard.d.ts +8 -0
- package/dist/report/react/Scoreboard.js +26 -0
- package/dist/report/react/cell.d.ts +9 -0
- package/dist/report/react/cell.js +9 -0
- package/dist/report/react/chart-math.d.ts +14 -0
- package/dist/report/react/chart-math.js +68 -0
- package/dist/report/react/colors.d.ts +14 -0
- package/dist/report/react/colors.js +45 -0
- package/dist/report/react/fixtures.d.ts +19 -0
- package/dist/report/react/fixtures.js +393 -0
- package/dist/report/react/format.d.ts +3 -0
- package/dist/report/react/format.js +7 -0
- package/dist/report/react/index.d.ts +6 -0
- package/dist/report/react/index.js +14 -0
- package/dist/report/report.d.ts +24 -0
- package/dist/report/report.js +49 -0
- package/dist/report/text/faces.d.ts +29 -0
- package/dist/report/text/faces.js +503 -0
- package/dist/report/text/layout.d.ts +75 -0
- package/dist/report/text/layout.js +173 -0
- package/dist/report/text/plot.d.ts +37 -0
- package/dist/report/text/plot.js +81 -0
- package/dist/report/text/table.d.ts +8 -0
- package/dist/report/text/table.js +86 -0
- package/dist/report/tree.d.ts +99 -0
- package/dist/report/tree.js +228 -0
- package/dist/report/types.d.ts +420 -0
- package/dist/report/types.js +4 -0
- package/dist/report/web.d.ts +15 -0
- package/dist/report/web.js +37 -0
- package/dist/results/annotated-source.d.ts +61 -0
- package/dist/results/attempt-evidence.d.ts +69 -0
- package/dist/results/attempt-source.d.ts +15 -0
- package/dist/results/locator.d.ts +75 -0
- package/dist/results/locator.js +0 -0
- package/dist/results/select.d.ts +45 -0
- package/dist/results/select.js +230 -0
- package/dist/results/source-hash.d.ts +9 -0
- package/dist/results/types.d.ts +204 -0
- package/dist/runner/eval-source.d.ts +22 -0
- package/dist/runner/fingerprint.d.ts +23 -0
- package/dist/runner/types.d.ts +332 -0
- package/dist/sandbox/docker-stream.d.ts +24 -0
- package/dist/sandbox/docker.d.ts +84 -0
- package/dist/sandbox/e2b.d.ts +31 -0
- package/dist/sandbox/errors.d.ts +4 -0
- package/dist/sandbox/local-files.d.ts +6 -0
- package/dist/sandbox/paths.d.ts +4 -0
- package/dist/sandbox/registry.d.ts +13 -0
- package/dist/sandbox/resolve.d.ts +40 -0
- package/dist/sandbox/retry.d.ts +10 -0
- package/dist/sandbox/shell.d.ts +11 -0
- package/dist/sandbox/source-files.d.ts +13 -0
- package/dist/sandbox/types.d.ts +203 -0
- package/dist/sandbox/vercel.d.ts +37 -0
- package/dist/scoring/types.d.ts +70 -0
- package/dist/shared/aggregate.d.ts +29 -0
- package/dist/shared/aggregate.js +55 -0
- package/dist/shared/types.d.ts +27 -0
- package/dist/shared/verdict.d.ts +27 -0
- package/dist/shared/verdict.js +34 -0
- package/dist/tty-line.d.ts +6 -0
- package/dist/types.d.ts +7 -0
- package/dist/util.d.ts +22 -0
- package/docs-site/zh/concepts/adapter.mdx +5 -5
- package/docs-site/zh/concepts/assert.mdx +8 -8
- package/docs-site/zh/concepts/evals.mdx +5 -5
- package/docs-site/zh/concepts/experiment.mdx +2 -2
- package/docs-site/zh/concepts/judge.mdx +9 -9
- package/docs-site/zh/concepts/overview.mdx +2 -2
- package/docs-site/zh/concepts/tier.mdx +6 -6
- package/docs-site/zh/example/claude-code-codex-plugin.mdx +9 -5
- package/docs-site/zh/example/claude-code-codex-skill.mdx +12 -7
- package/docs-site/zh/guides/agent-feedback-loop.mdx +235 -78
- package/docs-site/zh/guides/connect-otel.mdx +3 -3
- package/docs-site/zh/guides/connect-your-agent.mdx +2 -2
- package/docs-site/zh/guides/custom-reports.mdx +196 -36
- package/docs-site/zh/guides/experiments.mdx +7 -1
- package/docs-site/zh/guides/fixtures.mdx +1 -1
- package/docs-site/zh/guides/official-adapters.mdx +31 -9
- package/docs-site/zh/guides/publish-report.mdx +3 -3
- package/docs-site/zh/guides/report-components.mdx +194 -55
- package/docs-site/zh/guides/reporters.mdx +2 -2
- package/docs-site/zh/guides/results-data.mdx +35 -34
- package/docs-site/zh/guides/runner.mdx +2 -2
- package/docs-site/zh/guides/sandbox-agent.mdx +2 -2
- package/docs-site/zh/guides/{sandbox-backends.mdx → sandbox-providers.mdx} +11 -11
- package/docs-site/zh/guides/viewing-results.mdx +199 -79
- package/docs-site/zh/guides/write-experiment.mdx +9 -1
- package/docs-site/zh/guides/write-send.mdx +2 -2
- package/docs-site/zh/index.mdx +4 -3
- package/docs-site/zh/introduction.mdx +2 -1
- package/docs-site/zh/quickstart.mdx +5 -3
- package/docs-site/zh/reference/builtin-agents.mdx +38 -13
- package/docs-site/zh/reference/capabilities.mdx +1 -1
- package/docs-site/zh/reference/cli.mdx +36 -13
- package/docs-site/zh/reference/define-agent.mdx +12 -12
- package/docs-site/zh/reference/define-config.mdx +1 -1
- package/docs-site/zh/reference/define-eval.mdx +3 -3
- package/docs-site/zh/reference/events.mdx +7 -1
- package/docs-site/zh/reference/expect.mdx +3 -3
- package/package.json +10 -6
- package/src/agents/bub.ts +129 -42
- package/src/agents/claude-code.test.ts +152 -0
- package/src/agents/claude-code.ts +127 -13
- package/src/agents/codex.test.ts +192 -0
- package/src/agents/codex.ts +151 -12
- package/src/agents/index.ts +9 -3
- package/src/agents/manifest.ts +41 -0
- package/src/agents/plugin-config.test.ts +94 -0
- package/src/agents/shared.ts +33 -2
- package/src/agents/skills.test.ts +214 -0
- package/src/agents/skills.ts +304 -0
- package/src/agents/streaming.ts +5 -5
- package/src/agents/types.ts +54 -2
- package/src/cli.ts +74 -47
- package/src/context/context.test.ts +20 -2
- package/src/context/control-flow.ts +1 -1
- package/src/context/session.test.ts +92 -1
- package/src/context/session.ts +23 -1
- package/src/context/types.ts +4 -4
- package/src/define.test.ts +8 -8
- package/src/define.ts +11 -11
- package/src/expect/index.ts +5 -5
- package/src/i18n/en.ts +34 -15
- package/src/i18n/zh-CN.ts +37 -21
- package/src/index.ts +1 -1
- package/src/o11y/execution-tree.test.ts +452 -0
- package/src/o11y/execution-tree.ts +367 -0
- package/src/o11y/otlp/receiver.ts +1 -1
- package/src/o11y/otlp/select.ts +7 -3
- package/src/o11y/parsers/claude-code.test.ts +175 -0
- package/src/o11y/parsers/claude-code.ts +32 -0
- package/src/o11y/types.ts +6 -1
- package/src/report/aggregate.ts +26 -20
- package/src/report/built-in-user-parity.test.tsx +643 -0
- package/src/report/built-ins/cost-pass-rate-comparison.tsx +23 -0
- package/src/report/built-ins/index.ts +2 -0
- package/src/report/components.tsx +223 -50
- package/src/report/compute.ts +358 -53
- package/src/report/dual-render.test.tsx +1125 -0
- package/src/report/flag.ts +1 -1
- package/src/report/format.ts +50 -2
- package/src/report/index.ts +48 -14
- package/src/report/load.ts +1 -1
- package/src/report/locale.ts +206 -0
- package/src/report/metrics.ts +39 -15
- package/src/report/primitives.tsx +100 -2
- package/src/report/react/AttemptList.tsx +115 -0
- package/src/report/react/DeltaTable.tsx +9 -6
- package/src/report/react/EvalList.tsx +0 -0
- package/src/report/react/ExperimentList.tsx +108 -0
- package/src/report/react/GroupSummary.tsx +66 -0
- package/src/report/react/MetricBars.tsx +24 -13
- package/src/report/react/MetricLine.tsx +21 -21
- package/src/report/react/MetricMatrix.tsx +8 -4
- package/src/report/react/MetricScatter.tsx +136 -96
- package/src/report/react/MetricTable.tsx +115 -15
- package/src/report/react/RunOverview.tsx +48 -26
- package/src/report/react/Scoreboard.tsx +15 -7
- package/src/report/react/cell.tsx +18 -9
- package/src/{view/app/lib/chart.ts → report/react/chart-math.ts} +2 -6
- package/src/report/react/colors.ts +24 -15
- package/src/report/react/enhance.js +129 -0
- package/src/report/react/fixtures.ts +163 -34
- package/src/report/react/format.ts +1 -1
- package/src/report/react/index.tsx +22 -6
- package/src/report/react/render.test.tsx +164 -31
- package/src/report/react/styles.css +405 -213
- package/src/report/report.test.ts +403 -94
- package/src/report/report.ts +29 -11
- package/src/report/text/faces.ts +303 -95
- package/src/report/text/layout.ts +76 -11
- package/src/report/text/table.ts +98 -0
- package/src/report/tree.ts +103 -20
- package/src/report/types.ts +196 -25
- package/src/report/web.ts +46 -19
- package/src/results/annotated-source.test.ts +146 -0
- package/src/results/annotated-source.ts +128 -0
- package/src/results/attempt-evidence.test.ts +158 -0
- package/src/results/attempt-evidence.ts +158 -0
- package/src/results/attempt-source.ts +48 -0
- package/src/results/copy.ts +154 -139
- package/src/results/format.ts +54 -47
- package/src/results/host-equivalence.test.ts +527 -0
- package/src/results/index.ts +56 -14
- package/src/results/locator.test.ts +198 -0
- package/src/results/locator.ts +0 -0
- package/src/results/open.ts +392 -175
- package/src/results/results.test.ts +943 -494
- package/src/results/select.ts +129 -23
- package/src/results/skipped-notice.ts +0 -0
- package/src/results/source-hash.ts +28 -0
- package/src/results/types.ts +98 -62
- package/src/results/writer.ts +304 -176
- package/src/runner/attempt.test.ts +170 -0
- package/src/runner/attempt.ts +48 -13
- package/src/runner/discover.test.ts +65 -0
- package/src/runner/discover.ts +6 -2
- package/src/runner/eval-source.test.ts +121 -0
- package/src/runner/eval-source.ts +45 -0
- package/src/runner/fingerprint.ts +54 -1
- package/src/runner/remote-sandbox.ts +1 -1
- package/src/runner/report.test.ts +6 -8
- package/src/runner/report.ts +5 -4
- package/src/runner/reporters/artifacts.ts +27 -41
- package/src/runner/reporters/braintrust.test.ts +3 -3
- package/src/runner/reporters/braintrust.ts +1 -1
- package/src/runner/reporters/console.ts +6 -6
- package/src/runner/reporters/json.ts +4 -4
- package/src/runner/reporters/live.test.ts +56 -0
- package/src/runner/reporters/live.ts +36 -10
- package/src/runner/reporters/quiet.test.ts +66 -0
- package/src/runner/reporters/quiet.ts +49 -0
- package/src/runner/reporters/shared.ts +5 -5
- package/src/runner/reporters/table.ts +17 -17
- package/src/runner/run.ts +61 -102
- package/src/runner/types.ts +43 -32
- package/src/sandbox/checkpoint.ts +1 -1
- package/src/sandbox/docker.ts +15 -2
- package/src/sandbox/e2b.ts +11 -5
- package/src/sandbox/errors.ts +13 -0
- package/src/sandbox/index.ts +3 -3
- package/src/sandbox/local-files.ts +1 -1
- package/src/sandbox/registry.ts +6 -5
- package/src/sandbox/resolve.ts +38 -23
- package/src/sandbox/retry.test.ts +68 -0
- package/src/sandbox/retry.ts +44 -0
- package/src/sandbox/types.ts +24 -24
- package/src/sandbox/vercel.ts +17 -3
- package/src/scoring/collector.ts +3 -3
- package/src/scoring/judge.ts +2 -2
- package/src/scoring/scoped.ts +13 -1
- package/src/scoring/types.ts +7 -7
- package/src/scoring/verdict.ts +4 -4
- package/src/shared/aggregate.ts +23 -3
- package/src/shared/types.ts +2 -2
- package/src/shared/{outcome.ts → verdict.ts} +15 -15
- package/src/show/compose.ts +12 -132
- package/src/show/index.ts +125 -94
- package/src/show/render.ts +660 -160
- package/src/show/show.test.ts +472 -253
- package/src/source-loc.ts +1 -1
- package/src/tty-line.ts +32 -0
- package/src/types.ts +2 -2
- package/src/util.test.ts +21 -1
- package/src/util.ts +5 -1
- package/src/view/app/App.tsx +33 -198
- package/src/view/app/components/AttemptModal.tsx +6 -6
- package/src/view/app/components/CodeView.tsx +2 -2
- package/src/view/app/components/CopyControls.tsx +32 -36
- package/src/view/app/components/SkippedRunsBanner.tsx +140 -0
- package/src/view/app/components/ui/badge.tsx +1 -1
- package/src/view/app/components/ui/dialog.tsx +2 -2
- package/src/view/app/i18n.ts +40 -31
- package/src/view/app/lib/artifact-url.ts +1 -1
- package/src/view/app/lib/attempt-route.test.ts +37 -47
- package/src/view/app/lib/attempt-route.ts +26 -26
- package/src/view/app/lib/rows.ts +9 -112
- package/src/view/app/lib/verdict.ts +25 -0
- package/src/view/app/main.tsx +9 -12
- package/src/view/app/pages/RunsPage.tsx +4 -4
- package/src/view/app/pages/TracesPage.tsx +3 -3
- package/src/view/app/shared.ts +0 -1
- package/src/view/app/types.ts +6 -51
- package/src/view/artifact-serving.test.ts +136 -0
- package/src/view/client-dist/app.css +1 -1
- package/src/view/client-dist/app.js +21 -21
- package/src/view/data.test.ts +214 -143
- package/src/view/data.ts +166 -120
- package/src/view/index.ts +23 -11
- package/src/view/server.ts +52 -17
- package/src/view/shared/types.ts +22 -31
- package/src/view/styles.css +117 -327
- package/src/view/view-report.test.ts +146 -98
- package/src/report/default-report.tsx +0 -222
- package/src/report/dual-face.test.tsx +0 -527
- package/src/report/react/CaseList.tsx +0 -70
- package/src/view/app/components/CostScoreChart.tsx +0 -147
- package/src/view/app/components/ExperimentTable.tsx +0 -284
- package/src/view/app/components/GroupSelector.tsx +0 -61
- package/src/view/app/components/primitives.tsx +0 -43
- package/src/view/app/lib/outcome.ts +0 -82
|
@@ -1,122 +1,279 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "让
|
|
3
|
-
sidebarTitle: "
|
|
4
|
-
description: "
|
|
2
|
+
title: "让 AI 写 Eval 并自主优化"
|
|
3
|
+
sidebarTitle: "AI 反馈闭环"
|
|
4
|
+
description: "让 coding agent 读取随包文档,用 bash 运行实验、下钻结果、定位失败并持续迭代,最后用全量重跑确认收敛。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
$
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
+
ASSISTANT
|
|
116
|
+
我先读取天气工具的使用说明。
|
|
43
117
|
|
|
44
|
-
|
|
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
|
-
|
|
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
|
|
204
|
+
npx niceeval exp local --force
|
|
205
|
+
npx niceeval show
|
|
52
206
|
```
|
|
53
207
|
|
|
54
|
-
|
|
208
|
+
局部结果变绿只证明当前假设成立。收工前必须强制全量重跑;只有命令退出码为 `0`,且 `show` 没有新的失败或错误,才算完成。
|
|
55
209
|
</Step>
|
|
56
210
|
</Steps>
|
|
57
211
|
|
|
58
|
-
|
|
212
|
+
## AI 应该从输出里读什么
|
|
59
213
|
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
226
|
+
AI 应先从失败项选中 Attempt locator,再按证据位执行 `niceeval show @<id>` 或对应证据 flag,不要从头解析运行期间不断刷新的进度行。需要机器读取时,结果快照是事实来源:
|
|
72
227
|
|
|
73
|
-
```
|
|
74
|
-
niceeval
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
238
|
+
- `snapshot.json` 记录实验身份、运行配置、格式版本和时间。
|
|
239
|
+
- `result.json` 记录该 Attempt 的判定、断言、错误和用量。
|
|
240
|
+
- `events.json` 是对话与工具调用事件,`trace.json` 是调用链,`diff.json` 是 Sandbox 文件变化。
|
|
241
|
+
- 某类证据不存在时,对应文件不会生成。先以 `show` 的提示为准,不要假设每个目录都有全部文件。
|
|
82
242
|
|
|
83
|
-
|
|
243
|
+
`show` 的默认结果可能合成自多次运行:每个 experiment × eval 选择最新判定,因此局部重跑后仍能看到其它 Eval 的旧结果。它适合回答“现在已知的水位是什么”;一次 `--force` 全量运行才适合回答“同一版代码是否整体通过”。
|
|
84
244
|
|
|
85
|
-
##
|
|
245
|
+
## 什么时候会复用结果
|
|
86
246
|
|
|
87
|
-
|
|
247
|
+
不传 `--force` 时,NiceEval 会比较当前指纹与最近结果。指纹由 Eval 源码和运行配置组成,包括实验 ID、Agent、model、flags、Sandbox、timeout 与 strict 等设置。
|
|
88
248
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
249
|
+
| 最近结果与当前输入 | 本次行为 |
|
|
250
|
+
| --- | --- |
|
|
251
|
+
| 指纹相同,判定为 `passed` 或 `failed` | 携入旧结果,不重新执行 |
|
|
252
|
+
| 指纹不同 | 重新执行 |
|
|
253
|
+
| 最近结果为 `errored` 或 `skipped` | 重新执行 |
|
|
254
|
+
| 使用 `--force` | 忽略旧结果,重新执行 |
|
|
92
255
|
|
|
93
|
-
|
|
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
|
-
|
|
258
|
+
- 只想重看已有结果:运行 `niceeval show`,不产生新费用。
|
|
259
|
+
- 修改了 Eval 或实验配置:直接重跑;指纹变化会触发对应任务。
|
|
260
|
+
- 修改了被测程序:对受影响的 Eval 使用 `--force`。
|
|
261
|
+
- 准备结束本轮工作:对整个实验使用 `--force`,排除其它 Eval 的回归。
|
|
104
262
|
|
|
105
|
-
##
|
|
263
|
+
## 让 AI 自己收敛
|
|
106
264
|
|
|
107
|
-
|
|
265
|
+
可以把下面的协议放进任务描述。它既适合优化被测实现,也适合调试 Eval:
|
|
108
266
|
|
|
109
267
|
```text
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
`niceeval show` 和 `niceeval view` 读的是同一批落盘工件,人和 agent 随时可以互相接手:
|
|
277
|
+
真实 Agent 的运行可能产生费用。实验阶段可以加 `--budget <美元>` 限制本轮累计成本;预算只能限制单次命令,不能替代上面的停止条件。
|
|
120
278
|
|
|
121
|
-
|
|
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
|
|
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
|
|
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
|
|
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()`
|
|
109
|
+
- **`t.succeeded()` 没过、本轮判定是 failed**:请求发出去了但应用回了非 2xx。在 `send` 里用 `ctx.log()` 打印响应体,`niceeval view` 的本轮日志里能看到。
|
|
110
110
|
- **只有内容断言没过**:接入本身已经通了——在 `view` 里对照 `t.reply` 的实际值,调断言或调应用。
|
|
111
111
|
|
|
112
112
|
到这里接入已经完成:文本断言和 judge 评分都能用了。想要更多断言(工具、多轮、审批流),见文末的增量地图。
|