python-yama 0.4.0__tar.gz → 0.5.0__tar.gz
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.
- {python_yama-0.4.0 → python_yama-0.5.0}/PKG-INFO +16 -2
- {python_yama-0.4.0 → python_yama-0.5.0}/README.md +14 -1
- {python_yama-0.4.0 → python_yama-0.5.0}/README.zh-CN.md +14 -1
- {python_yama-0.4.0 → python_yama-0.5.0}/docs/agent-skill-test-framework-design.md +205 -19
- python_yama-0.5.0/docs/yama-intro.html +815 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/pyproject.toml +1 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/skills/eval-plugin-with-yama/SKILL.md +14 -2
- {python_yama-0.4.0 → python_yama-0.5.0}/skills/eval-plugin-with-yama/references/case-schema.md +23 -1
- {python_yama-0.4.0 → python_yama-0.5.0}/skills/eval-plugin-with-yama/references/debugging.md +11 -3
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_cli.py +259 -15
- python_yama-0.5.0/tests/test_dashboard.py +263 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_framework.py +192 -0
- python_yama-0.5.0/tests/test_llm.py +183 -0
- python_yama-0.5.0/tests/test_preview.py +337 -0
- python_yama-0.5.0/tests/test_report.py +563 -0
- python_yama-0.5.0/tests/test_run_plan.py +150 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_workspace.py +33 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/uv.lock +2 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/cli.py +177 -27
- python_yama-0.5.0/yama/dashboard.py +320 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/llm.py +52 -18
- python_yama-0.5.0/yama/preview.py +384 -0
- python_yama-0.5.0/yama/report.py +1354 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/runner.py +107 -14
- python_yama-0.4.0/tests/test_report.py +0 -220
- python_yama-0.4.0/yama/report.py +0 -925
- {python_yama-0.4.0 → python_yama-0.5.0}/.github/workflows/publish.yml +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/.gitignore +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/CLAUDE.md +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/LICENSE +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_assertions.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_cli_shim.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_main_entrypoint.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_mocks.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_public_api.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_skill_tool.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_tool_loader.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/tests/test_usage.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/__init__.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/__main__.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/assertions.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/loaders/__init__.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/loaders/case.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/loaders/common.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/loaders/tool_loader.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/mocks.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/models.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/__init__.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/base.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/bash/__init__.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/bash/_cli_shim.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/bash/bash.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/bash/fs.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/skill/__init__.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/tools/skill/skill.py +0 -0
- {python_yama-0.4.0 → python_yama-0.5.0}/yama/workspace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-yama
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: A reproducible evaluation runner for tool-using Agent skills
|
|
5
5
|
Project-URL: Repository, https://github.com/world-sim-dev/yama
|
|
6
6
|
Project-URL: Issues, https://github.com/world-sim-dev/yama/issues
|
|
@@ -19,6 +19,7 @@ Requires-Dist: fastapi>=0.139.0
|
|
|
19
19
|
Requires-Dist: jinja2>=3.1
|
|
20
20
|
Requires-Dist: litellm<2.0,>=1.80
|
|
21
21
|
Requires-Dist: orjson>=3.11.9
|
|
22
|
+
Requires-Dist: python-dotenv>=1.0
|
|
22
23
|
Requires-Dist: pyyaml>=6.0
|
|
23
24
|
Requires-Dist: rich<15.0,>=14.1
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
@@ -40,6 +41,8 @@ OPENAI_API_KEY=... uv run --project yama yama
|
|
|
40
41
|
OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
Instead of prefixing every command, you can put credentials in a `.env` file: on startup the CLI loads the nearest `.env` found from the working directory upward (variables already set in the environment are not overridden).
|
|
45
|
+
|
|
43
46
|
## Writing a Case
|
|
44
47
|
|
|
45
48
|
A Case is a YAML file organized as `context` (what the model sees) → `mocks` (how tool calls get executed) → `steps` (user turns sent in order, each with assertions) → `outcome` (the pass bar for the whole Case):
|
|
@@ -96,11 +99,22 @@ uv run --project yama yama --plugin dingding-simple --report
|
|
|
96
99
|
| `-k, --filter PATTERN` (repeatable) | Only run cases whose case key (path relative to the plugin root) matches — a substring, or an fnmatch glob when the pattern contains `*` `?` `[`; with several patterns a case runs if any matches |
|
|
97
100
|
| `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
|
|
98
101
|
| `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
|
|
99
|
-
| `--report [PATH]` | Also generate a single-file HTML report (
|
|
102
|
+
| `--report [PATH]` | Also generate a single-file HTML report. Without PATH it writes a timestamped `.yama/reports/report-<ts>.html` (history accumulates) and keeps `.yama/reports/latest.html` as a symlink to the newest one; an explicit PATH writes exactly that file |
|
|
103
|
+
| `--preview` | Don't run anything (no LLM calls): resolve the collected Cases and write an HTML case preview (default `.yama/reports/preview.html`; `--report PATH` overrides), or print a JSON preview to stdout when combined with `--json` |
|
|
100
104
|
| `--list` | Only print the collected Cases, without running them |
|
|
101
105
|
| `--no-artifacts` | Write no artifact files at all |
|
|
102
106
|
| `--json` | Emit machine-readable JSON instead of Rich tables |
|
|
103
107
|
|
|
104
108
|
`--plugin`, `--all-plugins`, and `--plugin-root` are mutually exclusive. When none of them is given, yama walks up from the current directory to the nearest directory containing `yama.toml` and uses it as the workspace root (falling back to the cwd), running it as a single plugin root.
|
|
105
109
|
|
|
110
|
+
### Dashboard
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
uv run --project yama yama dashboard --plugin dingding-simple
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`yama dashboard` starts a local HTTP server (default `http://127.0.0.1:8765/`, change with `--host`/`--port`; it also accepts the same plugin selection flags as the main command plus `-k/--filter` and `--result-dir`). The index page lists the historical HTML reports accumulated under `.yama/reports/` (newest first, with the `latest` one flagged), `/reports/<name>` serves each report, and `/preview` renders the same case preview as `--preview` — re-collecting and re-resolving the case files on every refresh (collection errors render as an error page), so you can edit a Case YAML and just reload the browser. No LLM calls are ever made by the dashboard.
|
|
117
|
+
|
|
118
|
+
### Output
|
|
119
|
+
|
|
106
120
|
Cases run in parallel, up to 10 at a time by default (`--concurrency` changes the cap); runs within one case stay sequential, and results keep collection order regardless of completion order. While several cases run concurrently, a transient dashboard at the bottom of the terminal shows one row per case, updated in place — waiting, then a spinner with the run/step currently executing, then its ✓/✗ verdict — and each case's full run/step detail is printed above the dashboard as one block the moment it finishes, so blocks of different cases never interleave. With `--concurrency 1` (or a single collected case) it streams instead — a spinner marks the step currently executing (on a terminal), and each case, run, and assertion result is printed the moment it completes. Either way a per-case summary table closes the output, and with `--json` the progress stream goes to stderr so stdout stays valid JSON.
|
|
@@ -15,6 +15,8 @@ OPENAI_API_KEY=... uv run --project yama yama
|
|
|
15
15
|
OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
Instead of prefixing every command, you can put credentials in a `.env` file: on startup the CLI loads the nearest `.env` found from the working directory upward (variables already set in the environment are not overridden).
|
|
19
|
+
|
|
18
20
|
## Writing a Case
|
|
19
21
|
|
|
20
22
|
A Case is a YAML file organized as `context` (what the model sees) → `mocks` (how tool calls get executed) → `steps` (user turns sent in order, each with assertions) → `outcome` (the pass bar for the whole Case):
|
|
@@ -71,11 +73,22 @@ uv run --project yama yama --plugin dingding-simple --report
|
|
|
71
73
|
| `-k, --filter PATTERN` (repeatable) | Only run cases whose case key (path relative to the plugin root) matches — a substring, or an fnmatch glob when the pattern contains `*` `?` `[`; with several patterns a case runs if any matches |
|
|
72
74
|
| `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
|
|
73
75
|
| `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
|
|
74
|
-
| `--report [PATH]` | Also generate a single-file HTML report (
|
|
76
|
+
| `--report [PATH]` | Also generate a single-file HTML report. Without PATH it writes a timestamped `.yama/reports/report-<ts>.html` (history accumulates) and keeps `.yama/reports/latest.html` as a symlink to the newest one; an explicit PATH writes exactly that file |
|
|
77
|
+
| `--preview` | Don't run anything (no LLM calls): resolve the collected Cases and write an HTML case preview (default `.yama/reports/preview.html`; `--report PATH` overrides), or print a JSON preview to stdout when combined with `--json` |
|
|
75
78
|
| `--list` | Only print the collected Cases, without running them |
|
|
76
79
|
| `--no-artifacts` | Write no artifact files at all |
|
|
77
80
|
| `--json` | Emit machine-readable JSON instead of Rich tables |
|
|
78
81
|
|
|
79
82
|
`--plugin`, `--all-plugins`, and `--plugin-root` are mutually exclusive. When none of them is given, yama walks up from the current directory to the nearest directory containing `yama.toml` and uses it as the workspace root (falling back to the cwd), running it as a single plugin root.
|
|
80
83
|
|
|
84
|
+
### Dashboard
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uv run --project yama yama dashboard --plugin dingding-simple
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`yama dashboard` starts a local HTTP server (default `http://127.0.0.1:8765/`, change with `--host`/`--port`; it also accepts the same plugin selection flags as the main command plus `-k/--filter` and `--result-dir`). The index page lists the historical HTML reports accumulated under `.yama/reports/` (newest first, with the `latest` one flagged), `/reports/<name>` serves each report, and `/preview` renders the same case preview as `--preview` — re-collecting and re-resolving the case files on every refresh (collection errors render as an error page), so you can edit a Case YAML and just reload the browser. No LLM calls are ever made by the dashboard.
|
|
91
|
+
|
|
92
|
+
### Output
|
|
93
|
+
|
|
81
94
|
Cases run in parallel, up to 10 at a time by default (`--concurrency` changes the cap); runs within one case stay sequential, and results keep collection order regardless of completion order. While several cases run concurrently, a transient dashboard at the bottom of the terminal shows one row per case, updated in place — waiting, then a spinner with the run/step currently executing, then its ✓/✗ verdict — and each case's full run/step detail is printed above the dashboard as one block the moment it finishes, so blocks of different cases never interleave. With `--concurrency 1` (or a single collected case) it streams instead — a spinner marks the step currently executing (on a terminal), and each case, run, and assertion result is printed the moment it completes. Either way a per-case summary table closes the output, and with `--json` the progress stream goes to stderr so stdout stays valid JSON.
|
|
@@ -15,6 +15,8 @@ OPENAI_API_KEY=... uv run --project yama yama
|
|
|
15
15
|
OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
也可以把凭据写进 `.env` 文件,省去每次命令前缀:CLI 启动时会从当前目录向上查找并加载最近的 `.env`(已在环境中设置的变量不会被覆盖)。
|
|
19
|
+
|
|
18
20
|
## 编写一个 Case
|
|
19
21
|
|
|
20
22
|
一个 Case 是一份 YAML 文件,按 `context`(模型看到什么)→ `mocks`(Tool 怎么被执行)→ `steps`(依次发送的用户回合与断言)→ `outcome`(整个 Case 的通过门槛)的结构组织:
|
|
@@ -71,11 +73,22 @@ uv run --project yama yama --plugin dingding-simple --report
|
|
|
71
73
|
| `-k, --filter PATTERN`(可重复) | 只运行 case key(相对 Plugin Root 的路径)匹配 PATTERN 的 Case——默认子串匹配,PATTERN 含 `*` `?` `[` 时按 fnmatch 通配符匹配;传多个时命中任意一个即运行 |
|
|
72
74
|
| `--result-dir PATH` | 覆盖产物根目录(默认 `<plugin_root>/.yama/runs`) |
|
|
73
75
|
| `--concurrency N` | 同时运行的 Case 数上限(默认 10;`1` 表示逐个顺序执行) |
|
|
74
|
-
| `--report [PATH]` | 额外生成单文件 HTML
|
|
76
|
+
| `--report [PATH]` | 额外生成单文件 HTML 报告。省略 PATH 时写带时间戳的 `.yama/reports/report-<ts>.html`(历史累积),并把 `.yama/reports/latest.html` 维护成指向最新报告的软链;显式给 PATH 时精确写到该文件 |
|
|
77
|
+
| `--preview` | 不运行、不发起任何 LLM 调用:解析收集到的 Case 后生成用例预览 HTML(默认 `.yama/reports/preview.html`,`--report PATH` 可覆盖);与 `--json` 组合时改为向 stdout 打印 JSON 预览 |
|
|
75
78
|
| `--list` | 只打印匹配到的 Case,不运行 |
|
|
76
79
|
| `--no-artifacts` | 不写任何产物文件 |
|
|
77
80
|
| `--json` | 输出机器可读 JSON 而不是 Rich 表格 |
|
|
78
81
|
|
|
79
82
|
`--plugin`/`--all-plugins`/`--plugin-root` 三者互斥;都不提供时默认用当前目录向上搜索到的 `yama.toml` 所在目录作为 Workspace Root(找不到则用 cwd),把该目录当作单一 Plugin Root 运行。
|
|
80
83
|
|
|
84
|
+
### Dashboard
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uv run --project yama yama dashboard --plugin dingding-simple
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`yama dashboard` 启动一个本地 HTTP 服务(默认 `http://127.0.0.1:8765/`,可用 `--host`/`--port` 调整;同样接受主命令的 Plugin 选择参数以及 `-k/--filter`、`--result-dir`)。首页列出 `.yama/reports/` 下累积的历史 HTML 报告(时间倒序,标注 `latest` 指向的那份),`/reports/<name>` 提供各报告文件,`/preview` 渲染与 `--preview` 相同的用例预览页——每次刷新都重新收集、重新解析 Case 文件(收集失败会渲染成错误页),改完 Case YAML 刷新浏览器即可看到效果。dashboard 不会发起任何 LLM 调用。
|
|
91
|
+
|
|
92
|
+
### 输出
|
|
93
|
+
|
|
81
94
|
Case 之间并行执行,默认最多同时 10 个(用 `--concurrency` 调整上限);同一 Case 内的多个 run 仍顺序执行,结果始终保持收集顺序,与完成先后无关。多个 Case 并发运行时,终端底部会有一张原地刷新的状态面板,每个 Case 固定占一行——排队等待、转圈显示当前执行到的 Run/Step、完成后原地翻成 ✓/✗——任何一个 Case 一完成,它的完整 Run/Step 明细就作为一个整块打印到面板上方,不同 Case 的块不会交错。使用 `--concurrency 1`(或只收集到一个 Case)时则实时流式输出——正在执行的 Step 会显示转圈的 loading 状态(终端下),每个 Case、Run、断言一完成就立即打印结果。两种模式最后都以逐 Case 的汇总表格收尾;使用 `--json` 时进度流打印到 stderr,stdout 保持为纯 JSON。
|
|
@@ -224,15 +224,46 @@ yama --plugin-root ./dingding-simple
|
|
|
224
224
|
| `-k, --filter PATTERN`(可重复) | Case 筛选:只保留 case key 匹配 PATTERN 的 Case(见下) |
|
|
225
225
|
| `--result-dir PATH` | 覆盖产物根目录(默认每个 Case 写到其所属 `plugin_root/.yama/runs`) |
|
|
226
226
|
| `--concurrency N` | 同时运行的 Case 数上限(必须 ≥ 1,默认 10);`1` 表示按收集顺序逐个执行 |
|
|
227
|
-
| `--report [PATH]` | 额外写一份单文件 HTML
|
|
227
|
+
| `--report [PATH]` | 额外写一份单文件 HTML 报告;省略路径时写到 `<第一个 result_root 的上级>/reports/report-<时间戳>.html`(历史累积),并把同目录的 `latest.html` 维护成指向最新报告的软链;显式给 PATH 时精确写到该文件、不建软链 |
|
|
228
|
+
| `--preview` | 不运行任何 Case、不发起任何 LLM 调用:解析收集到的 Case 后输出**用例预览**。默认写一张与报告同风格的 HTML(`<第一个 result_root 的上级>/reports/preview.html`,`--report PATH` 可覆盖目标路径);与 `--json` 组合时改为向 stdout 打印逐 Case 的 JSON 预览数组(见第 13 节) |
|
|
228
229
|
| `--list` | 只收集并打印 `case_key` 列表,不运行 |
|
|
229
230
|
| `--no-artifacts` | 不写任何产物文件 |
|
|
230
|
-
| `--json` | 以机器可读 JSON 数组打印结果(进度流转到 stderr,stdout 保持纯 JSON
|
|
231
|
+
| `--json` | 以机器可读 JSON 数组打印结果(进度流转到 stderr,stdout 保持纯 JSON);与 `--preview` 组合时打印的是预览 payload |
|
|
231
232
|
|
|
232
233
|
`--plugin`/`--all-plugins`/`--plugin-root` 三者互斥,都不提供时默认用 cwd 向上搜索到的
|
|
233
234
|
Workspace Root(或 cwd 本身)作为单一 Plugin Root——这正是 `cd dingding-simple && yama`
|
|
234
235
|
可行的原因。
|
|
235
236
|
|
|
237
|
+
**`yama dashboard` 子命令(`cli.py:_run_dashboard` + `dashboard.py`)。** 主命令之外
|
|
238
|
+
唯一的子命令(`main()` 在 argv 首位是 `dashboard` 时分发到独立的
|
|
239
|
+
`_dashboard_parser`),启动一个本地 HTTP 服务(标准库 `ThreadingHTTPServer`,
|
|
240
|
+
无新增依赖):
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
yama dashboard # 默认 http://127.0.0.1:8765/
|
|
244
|
+
yama dashboard --plugin dingding-simple --port 9000
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| 参数 | 含义 |
|
|
248
|
+
| --- | --- |
|
|
249
|
+
| `--plugin-root PATH` / `--plugin NAME`(可重复) / `--all-plugins` | 与主命令相同的 Plugin 选择语义(同一 `_resolve_targets`) |
|
|
250
|
+
| `-k, --filter PATTERN`(可重复) | 只把匹配的 Case 纳入 `/preview` 页面 |
|
|
251
|
+
| `--result-dir PATH` | 覆盖产物根目录;报告从其**同级** `reports/` 目录读取 |
|
|
252
|
+
| `--host` | 绑定地址,默认 `127.0.0.1` |
|
|
253
|
+
| `--port` | 端口,默认 `8765`;`0` 表示随机可用端口 |
|
|
254
|
+
|
|
255
|
+
路由共三个(见第 13 节的页面内容说明):
|
|
256
|
+
|
|
257
|
+
- `/`:报告索引页,列出 reports 目录下的历史报告(时间倒序、标注 `latest`
|
|
258
|
+
指向的那份、逐份展示通过状态 / Case 与 Run 通过数 / tokens——这些数据来自
|
|
259
|
+
报告 HTML `<head>` 里内嵌的 meta JSON,见下);
|
|
260
|
+
- `/reports/<name>`:提供报告文件本身(含 `latest.html`;文件名做了路径穿越
|
|
261
|
+
校验,符号链接解析后必须仍落在 reports 目录内);
|
|
262
|
+
- `/preview`:**每次请求都从头重新收集并解析** Case(`yama.toml` 与 YAML 的
|
|
263
|
+
修改无需重启即可生效),渲染与 `--preview` 相同的用例预览页——这就是编写
|
|
264
|
+
Case 的人工预览回路:改 YAML → 刷新浏览器。收集/解析失败(YAML 损坏、
|
|
265
|
+
fixture 缺失等)时渲染成带完整错误信息的错误页(HTTP 500),服务本身不退出。
|
|
266
|
+
|
|
236
267
|
**Case 筛选(`-k/--filter`,`workspace.py:matches_case_filter`)。** 收集阶段
|
|
237
268
|
(`collect_case_paths`)在 glob/显式路径展开之后、YAML 解析之前,用 case key
|
|
238
269
|
(`case_key_for_path`:Case 路径相对 Plugin Root 的 POSIX 形式,Plugin Root 之外
|
|
@@ -289,6 +320,22 @@ path = "dingding-simple"
|
|
|
289
320
|
path = "another-plugin"
|
|
290
321
|
```
|
|
291
322
|
|
|
323
|
+
`repeat` 除了整数还接受**运行矩阵**(TOML 表数组):每个条目声明一份模型配置
|
|
324
|
+
(与解析后的 Case `model` 浅合并)和可选的重复次数 `times`(默认 1),同一个
|
|
325
|
+
Case 会依次用每份配置各跑 `times` 次,报告按条目的 `label`(默认取该条目的
|
|
326
|
+
模型名)分组对比(完整语义见 8.5 节):
|
|
327
|
+
|
|
328
|
+
```toml
|
|
329
|
+
[[defaults.execution.repeat]]
|
|
330
|
+
model = { name = "gpt-5" }
|
|
331
|
+
times = 2
|
|
332
|
+
|
|
333
|
+
[[defaults.execution.repeat]]
|
|
334
|
+
label = "sonnet"
|
|
335
|
+
model = { name = "anthropic/claude-sonnet-5" }
|
|
336
|
+
times = 2
|
|
337
|
+
```
|
|
338
|
+
|
|
292
339
|
Plugin 可以覆盖约定;`[plugins."<name>"]` 支持的扁平字段是 `path`(必填)、
|
|
293
340
|
`system_prompt`、`skills_dir`、`skill_entry`、`case_patterns`、`model`(dict,覆盖
|
|
294
341
|
`defaults.model`)、`execution`(dict,覆盖 `defaults.execution`):
|
|
@@ -1006,7 +1053,7 @@ transcript,不提供"只影响这一次请求"的临时选项,也不支持 `
|
|
|
1006
1053
|
|
|
1007
1054
|
## 8. Case Schema
|
|
1008
1055
|
|
|
1009
|
-
Case Schema 按"模型与 Context → Tool 执行 → 对话 Step → Step 断言 → Case 结果门槛"的层级组织。Case 相对 Plugin Root 的文件路径就是唯一身份(`case_key`),不再重复声明 `id` 或 `tags`;可选的顶层 `description` 只是给人看的一句话说明(这个 Case 测试什么),不参与身份判定,会展示在 CLI
|
|
1056
|
+
Case Schema 按"模型与 Context → Tool 执行 → 对话 Step → Step 断言 → Case 结果门槛"的层级组织。Case 相对 Plugin Root 的文件路径就是唯一身份(`case_key`),不再重复声明 `id` 或 `tags`;可选的顶层 `description` 只是给人看的一句话说明(这个 Case 测试什么),不参与身份判定,会展示在 CLI 进度/汇总输出,并作为 HTML 报告 Case 头部的标题(没有 `description` 时标题回退为 `case_key`;文件路径始终显示在标题下方)(`loaders/case.py` 解析时校验必须是字符串并 strip 首尾空白)。
|
|
1010
1057
|
|
|
1011
1058
|
```text
|
|
1012
1059
|
Case
|
|
@@ -1052,7 +1099,7 @@ Runner 把例如 `__evals__/cases/image-led-mv.yaml` 的相对路径规范化为
|
|
|
1052
1099
|
|
|
1053
1100
|
### 8.2 `model`:本 Case 的模型覆盖
|
|
1054
1101
|
|
|
1055
|
-
`model` 描述当前 Case 使用的被测模型。未声明字段继承 Plugin / Workspace 默认值。框架通过 `litellm.acompletion()` 执行完整 History + Tool Loop,模型名使用 LiteLLM 的 `provider/model`
|
|
1102
|
+
`model` 描述当前 Case 使用的被测模型。未声明字段继承 Plugin / Workspace 默认值。框架通过 `litellm.acompletion()` 执行完整 History + Tool Loop,模型名使用 LiteLLM 的 `provider/model` 路由格式。调用前框架会设置 `litellm.suppress_debug_info = True`,屏蔽 litellm 解析不认识的厂商前缀时(如 OpenRouter 模型 `openrouter/moonshotai/...` 被内部去前缀后再解析)向终端打印的红色 `Provider List:` 噪音;真实错误仍正常抛出。
|
|
1056
1103
|
|
|
1057
1104
|
```yaml
|
|
1058
1105
|
model:
|
|
@@ -1091,7 +1138,7 @@ model:
|
|
|
1091
1138
|
name: anthropic/claude-sonnet-4-6
|
|
1092
1139
|
```
|
|
1093
1140
|
|
|
1094
|
-
Provider 凭据由 LiteLLM 从其标准环境变量或运行环境读取,不属于 Message,也不写入 Case
|
|
1141
|
+
Provider 凭据由 LiteLLM 从其标准环境变量或运行环境读取,不属于 Message,也不写入 Case。为方便本地配置,CLI 入口(`cli.py:main`)在解析参数前会通过 python-dotenv 加载 `.env` 文件:从当前工作目录向上查找最近的一个 `.env`(与 `yama.toml` 的查找方式一致),且不覆盖真实环境中已设置的变量(真实环境优先)。Case 可用 `model.api_base` / `model.base_url` 覆盖地址(二选一,`llm.py:_litellm_call_arguments` 统一弹出并合并为 LiteLLM 的 `api_base` 实参)。
|
|
1095
1142
|
|
|
1096
1143
|
每个 request artifact 由 `runner.py:_run_step` 构造,把执行定位信息放在顶层,真实模型调用单独保存在 `invocation`(其中 `method`/`arguments` 来自 `LLMClient.last_request`):
|
|
1097
1144
|
|
|
@@ -1531,6 +1578,19 @@ execution:
|
|
|
1531
1578
|
repeat: 3
|
|
1532
1579
|
```
|
|
1533
1580
|
|
|
1581
|
+
`repeat` 也可以写成**运行矩阵**,用不同模型配置执行同一 Case 并在报告中对比:
|
|
1582
|
+
|
|
1583
|
+
```yaml
|
|
1584
|
+
execution:
|
|
1585
|
+
repeat:
|
|
1586
|
+
- model: { name: gpt-5 }
|
|
1587
|
+
times: 2 # 该配置跑几次,默认 1
|
|
1588
|
+
- label: sonnet # 报告/CLI 的分组标签,默认取模型名
|
|
1589
|
+
model: { name: anthropic/claude-sonnet-5 }
|
|
1590
|
+
times: 2
|
|
1591
|
+
- claude-haiku-4-5 # 字符串条目 ≡ {model: {name: ...}}
|
|
1592
|
+
```
|
|
1593
|
+
|
|
1534
1594
|
- `timeout_seconds_per_step`:单个 Step 的总时限,默认 **120**。通过
|
|
1535
1595
|
`asyncio.wait_for` 真实生效(`runner.py:_run_once`),但需要注意:超时触发的是
|
|
1536
1596
|
`asyncio.TimeoutError`,**没有**被单独捕获转换成"仅本 Step 失败、run 继续"——它
|
|
@@ -1542,6 +1602,24 @@ execution:
|
|
|
1542
1602
|
超出时该 Step 会被标记为一条硬失败(`type: max_tool_rounds_exceeded`),
|
|
1543
1603
|
Transcript 回滚到该 Step 开始前的状态,run 继续执行后续 Step(见第 10 节)。
|
|
1544
1604
|
- `repeat`:同一 Case 重复运行次数,用于统计稳定通过率,默认 **1**,必须 ≥ 1;每次运行使用全新构造、独立深拷贝的 Mock Tool state(`MockToolRegistry` 每次重新实例化)。
|
|
1605
|
+
也接受上面的运行矩阵列表(`runner.py:resolve_run_plan` 在 `run_case` 开头展开与校验,
|
|
1606
|
+
校验失败与 `repeat < 1` 一样以 `ValueError` 走 CLI 的 Collection error 出口):
|
|
1607
|
+
- 条目字段只有 `model`(dict)、`times`(int ≥ 1,默认 1)、`label`(str);
|
|
1608
|
+
字符串条目是 `{model: {name: <字符串>}}` 的简写;未知字段、空列表、非法
|
|
1609
|
+
`times` 都直接报错。
|
|
1610
|
+
- 条目 `model` 与 Case 解析后的 `model` **浅合并**(与 defaults → plugin →
|
|
1611
|
+
Case 的合并规则一致):未覆盖的键(如 `temperature`/`provider`/`api_base`)
|
|
1612
|
+
原样继承,跨供应商切换时如需避免继承需在条目里显式覆盖。
|
|
1613
|
+
- `label` 缺省取合并后的模型名;label 是报告/CLI 的分组维度,条目之间必须
|
|
1614
|
+
唯一(两个条目共用同一模型名时必须显式给 `label`),否则报错。
|
|
1615
|
+
- 总 run 数 = Σ times,`run_index` 跨条目连续递增;`passed`/`pass_rate`
|
|
1616
|
+
语义不变(所有 run 都通过 Case 才算过)。每个 `RunResult` 记录本 run 的
|
|
1617
|
+
`label` 与生效 `model`(进 `result.json` 与 `--json` 输出)。
|
|
1618
|
+
- 变体模型只作用于被测 Agent 的 Tool Loop;**Judge 的 `default_model`
|
|
1619
|
+
固定为 Case 级 `model`**(`judge.model` 仍可显式覆盖),保证不同变体的
|
|
1620
|
+
评分口径一致、可对比。
|
|
1621
|
+
- `repeat` 在 defaults / plugin / Case 三层间按整值替换(`dict.update`),
|
|
1622
|
+
不做逐条目合并:Case 写 `repeat: 3` 会整体覆盖全局矩阵,反之亦然。
|
|
1545
1623
|
|
|
1546
1624
|
### 8.6 `steps[]`:确定性推进的用户回合
|
|
1547
1625
|
|
|
@@ -1583,7 +1661,7 @@ steps:
|
|
|
1583
1661
|
- Part 顺序原样保留并写入 resolved Case。
|
|
1584
1662
|
- `filename` 和 `media_type` 可显式覆盖;未写时从 fixture 推导。
|
|
1585
1663
|
- `input_image.delivery` 与 `input_file.delivery` 支持 `file_path_inline` 和 `file_content`,均默认为 `file_path_inline`。
|
|
1586
|
-
- `file_path_inline` 不上传附件内容,而是把当前 User Message 中所有采用该方式的附件绝对路径追加到同一条 text content:`<text content>\nFiles:\n- <file_path_1>\n- <file_path_2
|
|
1664
|
+
- `file_path_inline` 不上传附件内容,而是把当前 User Message 中所有采用该方式的附件绝对路径追加到同一条 text content:`<text content>\nFiles:\n- <file_path_1>\n- <file_path_2>`(消息没有 text part 时,`Files:` 块在第一个该方式附件的位置自成一条 text part)。这适合"模型选择工具、专用工具读取图片、音频或视频内容"的生产契约。这层合并抽在 `llm.delivered_content`(合并后 path-inline 附件 part 即被丢弃——交付的只有路径):`_litellm_content` 基于它产出 provider payload,预览页复用同一函数渲染 user/注入/history 消息,保证预览展示的内容与模型实际收到的一致。
|
|
1587
1665
|
- `file_content` 在调用前转换为 LiteLLM Chat Completion 的 `image_url` 或 `file` part,由 LiteLLM 再适配目标 Provider。
|
|
1588
1666
|
- 旧值 `metadata` 与 `content` 仍分别兼容并规范化为 `file_path_inline` 与 `file_content`(这层归一化在 `loaders/case.py` 与 `llm.py` 中各自实现了一份,两处逻辑一致但确实有重复)。
|
|
1589
1667
|
- 每个 fixture 记录物化解析后的绝对路径(`fixture`)、字节数(`bytes`)、media type 与 SHA-256(`sha256`),使报告可重放;不单独保留"原始相对路径"字段。
|
|
@@ -2255,7 +2333,7 @@ class ToolCallRecord:
|
|
|
2255
2333
|
├── mock-state.json
|
|
2256
2334
|
├── hard-checks.json # {step_id: hard_checks}
|
|
2257
2335
|
├── judge-result.json # {step_id: judge_result}(只含有 Judge 结果的 Step;含 Judge 调用的 usage)
|
|
2258
|
-
└── result.json # RunResult.to_dict()(含 run 级 usage
|
|
2336
|
+
└── result.json # RunResult.to_dict()(含 run 级 usage 汇总、本 run 的 label 与生效 model)+ generated_at + traceback?
|
|
2259
2337
|
```
|
|
2260
2338
|
|
|
2261
2339
|
写产物前,`YamaRunner.run_case` 会先整体删除该 Case 的产物目录
|
|
@@ -2265,9 +2343,11 @@ class ToolCallRecord:
|
|
|
2265
2343
|
扫描 `.yama/runs` 时会把旧执行误当成本次结果。`--no-artifacts` 时不写也不删任何
|
|
2266
2344
|
产物目录(用户显式选择不落盘,不应顺带删掉历史产物),但 fs-runs 工作目录照常清理。
|
|
2267
2345
|
|
|
2268
|
-
`--report` 触发的单文件 HTML 报告(`report.py:write_html_report
|
|
2269
|
-
|
|
2270
|
-
|
|
2346
|
+
`--report` 触发的单文件 HTML 报告(`report.py:write_html_report` /
|
|
2347
|
+
`write_timestamped_report`)是 CLI 层面单独生成的汇总产物,**不属于**上面这份逐
|
|
2348
|
+
Case/逐 run 的产物列表,也不是按 Plugin 拆分的多个文件——一次 CLI 调用只写一个
|
|
2349
|
+
HTML 文件,汇总本次涉及的所有 Case;默认位置下按时间戳累积历史、不参与
|
|
2350
|
+
`_clean_case_dirs` 的清理(见第 13 节)。
|
|
2271
2351
|
|
|
2272
2352
|
## 12. 断言与评分
|
|
2273
2353
|
|
|
@@ -2531,11 +2611,111 @@ Step——不是按 Plugin 拆开的多个文件,也没有 JSON 版的 `summar
|
|
|
2531
2611
|
用量(第 11 节的聚合链)在报告的每一层都有展示:顶部摘要多一张「LLM tokens」
|
|
2532
2612
|
卡片(总量 + in/out 拆分),Case 头部 metadata 多一格逐 Case 汇总,Run/Step 的
|
|
2533
2613
|
summary 行、执行时间线里的每次 assistant 响应、LLM requests 诊断列表和 Judge
|
|
2534
|
-
小节各自带本层级的 token 数;没有用量数据的层级显示 `–`
|
|
2614
|
+
小节各自带本层级的 token 数;没有用量数据的层级显示 `–` 或不显示。
|
|
2615
|
+
|
|
2616
|
+
跑了多个 run 的 Case(`len(runs) > 1`)在 metadata 与 Planned runs 折叠卡之间
|
|
2617
|
+
多一节 **Run comparison**(`report.py:_render_run_comparison`):
|
|
2618
|
+
|
|
2619
|
+
- 每个 run 一行对比(结果、Steps 通过数、hard check 通过数、Judge overall
|
|
2620
|
+
均值、tokens);run 因异常中断时在 Steps 列标注 `(run error)`。
|
|
2621
|
+
- **唯一最优的 run 标一枚冠军奖杯 🏆**(`_champion_run_index`)。排序依据依次
|
|
2622
|
+
为:是否通过 → Steps 通过数 → hard check 通过数 → Judge overall(无 Judge
|
|
2623
|
+
结果排最后)→ token 消耗(更少者优,无用量数据排最后)。最优 run 在所有
|
|
2624
|
+
维度上与他人打平时不发奖杯(含糊的冠军不如没有)。
|
|
2625
|
+
- `execution.repeat` 声明了模型变体时,按每个变体的 run 数分两种形态:
|
|
2626
|
+
- **每个变体恰好跑一次**(运行矩阵的常见用法):只渲染**一张合并表**
|
|
2627
|
+
(`_render_merged_variant_comparison`),每个变体一行,直接携带其唯一
|
|
2628
|
+
run 的明细列(Steps、hard checks、Judge、tokens)——不再额外渲染逐 run
|
|
2629
|
+
表,也没有"通过 run 数 / 通过率"这类对单次运行冗余的聚合列。
|
|
2630
|
+
- **任一变体跑了多次**:先渲染按 label 分组的变体聚合表(变体、通过 run
|
|
2631
|
+
数、通过率、Judge overall 均值、tokens),再渲染逐 run 表(多一列
|
|
2632
|
+
Variant),奖杯标在逐 run 表的最优 run 上。
|
|
2633
|
+
- 两种形态都**没有独立的 Model 列**:label 默认就是模型名,仅当 label 与
|
|
2634
|
+
实际模型名不同时才在 label 下方以浅色附注显示模型名
|
|
2635
|
+
(`_variant_name_cell`)。Run summary 行仍带 label 徽标,Case metadata
|
|
2636
|
+
的 Model 格显示各 run 实际使用的模型集合(无变体时保持原样:单模型名、
|
|
2637
|
+
无 Variant 列、无聚合表)。
|
|
2638
|
+
- Judge overall 均值只对有 Judge 结果的 run 计算,没有任何 Judge 结果时显示
|
|
2639
|
+
`–`(不能把"无数据"渲染成 0%)。
|
|
2640
|
+
|
|
2641
|
+
`--report` 省略路径时报告写到默认位置(`report.py:write_timestamped_report`):
|
|
2535
2642
|
|
|
2536
2643
|
```text
|
|
2537
|
-
<result_root 的上级>/reports/
|
|
2538
|
-
|
|
2644
|
+
<result_root 的上级>/reports/report-<YYYYMMDD-HHMMSS>.html # 每次执行新增一份,历史累积
|
|
2645
|
+
<result_root 的上级>/reports/latest.html # 指向最新一份的软链
|
|
2646
|
+
```
|
|
2647
|
+
|
|
2648
|
+
- 同一秒内的第二次写入追加 `-2`、`-3` 序号后缀,绝不覆盖已有历史。
|
|
2649
|
+
- `latest.html` 每次重指向最新文件(相对路径软链,目录整体移动仍有效);平台
|
|
2650
|
+
不支持软链(如无权限的 Windows)时退化为复制一份文件内容。
|
|
2651
|
+
- 显式 `--report PATH` 保持旧语义:精确写到该文件,不加时间戳、不动 `latest.html`。
|
|
2652
|
+
|
|
2653
|
+
报告 `<head>` 里内嵌一段惰性的 meta JSON(`render_page` 的 `meta` 参数,
|
|
2654
|
+
`<script type="application/json" id="yama-report-meta">`),携带 `kind`/
|
|
2655
|
+
`generated_at`/`passed`/Case-Run-check 通过数/总 tokens——dashboard 索引页靠它
|
|
2656
|
+
列出每份历史报告的统计,而不必解析报告正文标记。
|
|
2657
|
+
|
|
2658
|
+
**用例预览页(`preview.py`,`--preview` 与 dashboard `/preview` 共用)。**
|
|
2659
|
+
`render_preview_html` 复用报告的页面外壳与版式(`report.py:render_page` +
|
|
2660
|
+
`_PAGE_CSS`),渲染"这个 Case 将发送什么、期望什么",但不含任何执行数据——
|
|
2661
|
+
verdict 图章一律是中性的 `PREVIEW`(没有 PASS/FAIL),对话里的 assistant 位置
|
|
2662
|
+
是一张虚线占位卡("Not executed yet",工具调用与 mock 结果同样缺席)。
|
|
2663
|
+
|
|
2664
|
+
每个 Case 是一个**默认折叠**的 `<details class="case">`,收起时只显示 Case 头
|
|
2665
|
+
(description 标题 + 文件路径 + PREVIEW 图章 + Step 数);展开后 Case 内所有
|
|
2666
|
+
可折叠 section 使用**同一种折叠卡样式**(`report.py:_fold` 生成的
|
|
2667
|
+
`details.fold`:与报告 Run/Step 摘要条同款的标题条 + 右侧 meta,嵌套的二级、
|
|
2668
|
+
三级折叠卡持续同款;报告侧的 Execution timeline / Planned runs,以及
|
|
2669
|
+
Step 内的 Resolved transcript 和 run 底部的 `LLM requests (N)` / `Mock events
|
|
2670
|
+
(N)` / `Final mock state` 也都渲染成同一种折叠卡——`LLM requests (N)` 等计数
|
|
2671
|
+
保留在标题文本里,是外部工具按字面切分的稳定标记——保证两页公共部分一致)。
|
|
2672
|
+
展开后的内容顺序:
|
|
2673
|
+
|
|
2674
|
+
- metadata 格(Model / Tools / Skills / **Planned runs**——用
|
|
2675
|
+
`resolve_run_plan` 展开 `execution.repeat` 后的 run 数与变体 label 摘要;
|
|
2676
|
+
repeat 配置非法时这里直接显示错误,这是收集期不校验 repeat 的第一道可见
|
|
2677
|
+
反馈);
|
|
2678
|
+
- **Planned runs** 折叠卡(`report.py:_render_planned_runs`,与报告共用——
|
|
2679
|
+
报告侧放在 Run comparison 之后、runs 之前):`resolve_run_plan` 展开后的
|
|
2680
|
+
逐 run 计划表。运行矩阵显示 Variant 列,单元格与 Run comparison 表同款
|
|
2681
|
+
(label 加粗,模型名仅在与 label 不同时以浅色附注出现,
|
|
2682
|
+
`_variant_name_cell` 共用);普通整数 repeat 则显示 Model 列。
|
|
2683
|
+
execution/model JSON 收在嵌套的 raw disclosure(Execution & model
|
|
2684
|
+
config)里;repeat 非法时表格位置显示错误全文。没有单独的
|
|
2685
|
+
fixtures/System prompt 展示——fixture 细节看 `--json` payload 的
|
|
2686
|
+
`fixtures` 与各消息的附件卡片,System Prompt 在下方 Conversation
|
|
2687
|
+
history(报告侧在执行时间线首条消息);
|
|
2688
|
+
- **Conversation history**(默认展开):第一条事件即渲染后的 System Prompt,
|
|
2689
|
+
其后是 `context.messages` 注入的初始对话;
|
|
2690
|
+
- 每个 Step 一张折叠卡(默认展开),摘要为 **`Step N` 前缀 + step id 徽标**
|
|
2691
|
+
(报告的 Step 摘要同样是 `Step N` + id 徽标,两页一致);卡内是同款二级
|
|
2692
|
+
折叠卡:**Planned conversation**(`message_inject` 按 position 就位、user
|
|
2693
|
+
消息、assistant 占位卡)、**Hard checks (configured)** 表(逐条断言类型 +
|
|
2694
|
+
配置 JSON)、**Judge (configured)**(维度卡片:name/criteria/min_score/
|
|
2695
|
+
weight,其余 judge 设置是嵌套的 Judge settings 折叠卡)、Raw step config;
|
|
2696
|
+
- 预览页渲染的 user / 注入 / history 消息一律先过 `llm.delivered_content`,
|
|
2697
|
+
只显示模型真实收到的内容:`file_path_inline` 附件的绝对路径以 `Files:` 块
|
|
2698
|
+
合并进 text part(与模型实际收到的文本一字不差),该附件不再单独渲染
|
|
2699
|
+
卡片;`file_content` 附件内容真的会上传,保留附件卡片并带
|
|
2700
|
+
`file content — uploaded as base64 content` 标注
|
|
2701
|
+
(`report.py:_render_content` 对带 `delivery` 字段的 part 通用);
|
|
2702
|
+
- Mock configuration(`mocks` 全文 JSON,标题列出 mock 的 tool 名)、
|
|
2703
|
+
Available tools(与报告相同的 schema 卡片网格,`_tool_defs` 共用)、
|
|
2704
|
+
Outcome requirements——均为同款折叠卡,默认收起。
|
|
2705
|
+
|
|
2706
|
+
`--preview --json` 打印的预览 payload(`preview.py:preview_payload`)是逐 Case 的
|
|
2707
|
+
JSON 对象数组:`case_key`/`description`/`path`/`plugin_root`/`evals_root`/
|
|
2708
|
+
`model`/`execution`/`run_plan`(展开后的计划 run 列表,非法 repeat 时为
|
|
2709
|
+
`{"error": ...}`)/`context`/`mocks`/`steps`(解析后的 Step,含 fixture 展开)/
|
|
2710
|
+
`outcome`/`system_prompt`(渲染后的最终文本)/`skills`/`tools`(provider 形态
|
|
2711
|
+
schema)/`initial_messages`/`fixtures`。
|
|
2712
|
+
|
|
2713
|
+
**dashboard 页面(`dashboard.py`)。** 索引页 `/` 复用同一页面外壳:顶部摘要卡
|
|
2714
|
+
(报告数、最新 verdict、最新生成时间、`/preview` 入口),下方是历史报告表
|
|
2715
|
+
(`scan_reports`:时间倒序;`latest.html` 与 `preview.html` 本身是别名/静态快照、
|
|
2716
|
+
不作为历史列出;`latest` 指向的那份带徽标;meta 缺失的旧文件各统计列显示 `–`)。
|
|
2717
|
+
`/preview` 页的页眉标注 "refresh to re-resolve"(区别于 `--preview` 写盘的
|
|
2718
|
+
static snapshot 措辞)。
|
|
2539
2719
|
|
|
2540
2720
|
终端输出(不用 `--json` 时)在执行过程中**实时流式打印进度**,形态取决于并发模式
|
|
2541
2721
|
(见 4.3 节的 `--concurrency`);两种模式最后都以逐 Case 的汇总表格收尾。
|
|
@@ -2591,8 +2771,11 @@ Yama Eval Results
|
|
|
2591
2771
|
|
|
2592
2772
|
流式进度由 `YamaRunner` 的进度回调驱动(`runner.py:RunnerEventCallback`,
|
|
2593
2773
|
构造参数 `on_event`)。每个 Case 的事件顺序固定为:`case_start`
|
|
2594
|
-
`{case_key, description, repeat}`
|
|
2595
|
-
|
|
2774
|
+
`{case_key, description, repeat}`(`repeat` 是展开后的**总 run 数**,运行矩阵下
|
|
2775
|
+
= Σ times)→ 每个 run:`run_start` `{case_key, run_index, repeat, label}`
|
|
2776
|
+
(`label` 是该 run 的变体标签,整数 `repeat` 时为 None;CLI 的顺序模式
|
|
2777
|
+
`Run i/N` 行、并发面板行与 `build_case_tree` 的 Run 节点都会把非空 label 显示为
|
|
2778
|
+
`Run i/N · <label>`)→ 每个 Step:`step_start` `{case_key, run_index, step_id}`、`step_end`
|
|
2596
2779
|
`{case_key, run_index, step: StepResult}` → `run_end` `{case_key, run:
|
|
2597
2780
|
RunResult}` → `case_end` `{result: CaseResult}`。`step_end` 在该 Step 的 hard
|
|
2598
2781
|
check 与 Judge 都结算完之后才触发(含 max-tool-rounds 失败的 Step),payload
|
|
@@ -2627,7 +2810,8 @@ CLI 侧按并发模式挑选回调实现,两者的**已完成结果**都只做
|
|
|
2627
2810
|
|
|
2628
2811
|
`--json` 输出机器可读的 `[CaseResult.to_dict(), ...]` 数组(此时进度流打印到
|
|
2629
2812
|
stderr,保证 stdout 是纯 JSON);`--list` 只打印 `case_key` 列表,不运行任何
|
|
2630
|
-
Case
|
|
2813
|
+
Case;`--preview` 在收集/解析之后、执行之前返回(LLM client 根本不会被构造),
|
|
2814
|
+
`--list` 与 `--preview` 同时给出时 `--list` 优先。
|
|
2631
2815
|
|
|
2632
2816
|
`cli.py:main` 的错误出口按层归类(退出码都是 2):`ConfigurationError`/
|
|
2633
2817
|
`CollectionError`/`ValueError` 打印 `Collection error: ...`(Case 还没跑起来,
|
|
@@ -2715,8 +2899,9 @@ Case。
|
|
|
2715
2899
|
的 `.j2` 渲染模板——当前渲染是硬编码 Python 字符串拼接,`jinja2` 依赖未被使用。
|
|
2716
2900
|
- **Tool Call 录制/回放**:把真实 Tool 调用录制下来供之后回放——当前只有
|
|
2717
2901
|
`ScriptedLLMClient` 能回放 **LLM 响应**,没有对应的 Tool Call 录制/回放机制。
|
|
2718
|
-
-
|
|
2719
|
-
|
|
2902
|
+
- **参数矩阵**:**模型维度已实现**——`execution.repeat` 接受运行矩阵列表,同一
|
|
2903
|
+
Case 用多份模型配置展开执行并在报告中分组对比(见 8.5 节);但矩阵维度仅限
|
|
2904
|
+
`model`,没有对 Step 输入、Mock 配置等任意参数做笛卡尔展开的通用参数矩阵。
|
|
2720
2905
|
- **HTML Transcript Viewer 的进一步能力**、**人工评分与 Judge 校准**、**远程
|
|
2721
2906
|
执行**:`report.py` 目前只产出一个静态汇总 HTML,没有专门的单 Case 交互式
|
|
2722
2907
|
Transcript Viewer;Case 级的本地并发调度已实现(CLI `--concurrency`,默认 10,
|
|
@@ -2737,7 +2922,8 @@ Case。
|
|
|
2737
2922
|
(`steps[].message_inject`,4 个插入位置 + Tool Call matcher,collection 期
|
|
2738
2923
|
严格校验,见 7.6 节)。
|
|
2739
2924
|
- 纯文本与多模态 Message Part、fixture manifest。
|
|
2740
|
-
- 9 种硬检查、多维 LLM Judge、`execution.repeat`
|
|
2925
|
+
- 9 种硬检查、多维 LLM Judge、`execution.repeat` 稳定通过率统计(含多模型
|
|
2926
|
+
运行矩阵与报告中的分组对比)。
|
|
2741
2927
|
- JSON 产物(逐 Case/逐 run)与单文件 HTML 汇总报告。
|
|
2742
2928
|
- LLM token 用量统计:逐请求采集、run/Case 级聚合、CLI 与 HTML 报告展示
|
|
2743
2929
|
(见第 11 节与第 13 节)。
|