python-yama 0.10.1__tar.gz → 0.10.3__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.
Files changed (80) hide show
  1. {python_yama-0.10.1 → python_yama-0.10.3}/PKG-INFO +25 -4
  2. {python_yama-0.10.1 → python_yama-0.10.3}/README.md +23 -2
  3. {python_yama-0.10.1 → python_yama-0.10.3}/README.zh-CN.md +23 -2
  4. {python_yama-0.10.1 → python_yama-0.10.3}/docs/agent-skill-test-framework-design.md +133 -55
  5. {python_yama-0.10.1 → python_yama-0.10.3}/docs/case-schema-reference.md +64 -22
  6. {python_yama-0.10.1 → python_yama-0.10.3}/skills/eval-plugin-with-yama/SKILL.md +23 -8
  7. {python_yama-0.10.1 → python_yama-0.10.3}/skills/eval-plugin-with-yama/references/case-schema.md +40 -8
  8. {python_yama-0.10.1 → python_yama-0.10.3}/skills/eval-plugin-with-yama/references/debugging.md +37 -10
  9. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_cli.py +127 -8
  10. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_framework.py +137 -2
  11. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_judge_llm.py +721 -28
  12. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_llm.py +45 -1
  13. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_openai_llm.py +73 -4
  14. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_preview.py +7 -0
  15. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_report.py +115 -0
  16. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_run_plan.py +41 -1
  17. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_runner.py +393 -2
  18. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_thread_case.py +286 -59
  19. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_workspace.py +144 -0
  20. {python_yama-0.10.1 → python_yama-0.10.3}/yama/cli.py +73 -13
  21. {python_yama-0.10.1 → python_yama-0.10.3}/yama/judge_llm.py +434 -69
  22. python_yama-0.10.3/yama/judge_routing.py +112 -0
  23. {python_yama-0.10.1 → python_yama-0.10.3}/yama/llm.py +35 -2
  24. {python_yama-0.10.1 → python_yama-0.10.3}/yama/models.py +3 -0
  25. {python_yama-0.10.1 → python_yama-0.10.3}/yama/openai_llm.py +39 -13
  26. {python_yama-0.10.1 → python_yama-0.10.3}/yama/preview.py +8 -5
  27. {python_yama-0.10.1 → python_yama-0.10.3}/yama/report.py +129 -7
  28. {python_yama-0.10.1 → python_yama-0.10.3}/yama/runner.py +220 -29
  29. {python_yama-0.10.1 → python_yama-0.10.3}/yama/thread_case.py +117 -37
  30. {python_yama-0.10.1 → python_yama-0.10.3}/yama/workspace.py +51 -0
  31. python_yama-0.10.1/docs/superpowers/plans/2026-08-07-judge-model-resolution.md +0 -382
  32. python_yama-0.10.1/docs/superpowers/plans/2026-08-07-local-judge-default-model-retry.md +0 -348
  33. python_yama-0.10.1/docs/superpowers/plans/2026-08-07-openai-timeout-retry-reporting.md +0 -881
  34. python_yama-0.10.1/docs/superpowers/specs/2026-08-04-judge-model-object-design.md +0 -131
  35. python_yama-0.10.1/docs/superpowers/specs/2026-08-04-openai-adapter-safety-design.md +0 -108
  36. python_yama-0.10.1/docs/superpowers/specs/2026-08-07-judge-model-resolution-design.md +0 -143
  37. python_yama-0.10.1/docs/superpowers/specs/2026-08-07-local-judge-default-model-retry-design.md +0 -124
  38. python_yama-0.10.1/docs/superpowers/specs/2026-08-07-openai-timeout-retry-reporting-design.md +0 -260
  39. {python_yama-0.10.1 → python_yama-0.10.3}/.github/workflows/publish.yml +0 -0
  40. {python_yama-0.10.1 → python_yama-0.10.3}/.gitignore +0 -0
  41. {python_yama-0.10.1 → python_yama-0.10.3}/CLAUDE.md +0 -0
  42. {python_yama-0.10.1 → python_yama-0.10.3}/LICENSE +0 -0
  43. {python_yama-0.10.1 → python_yama-0.10.3}/docs/yama-intro.html +0 -0
  44. {python_yama-0.10.1 → python_yama-0.10.3}/pyproject.toml +0 -0
  45. {python_yama-0.10.1 → python_yama-0.10.3}/skills/eval-plugin-with-yama/references/install-upgrade.md +0 -0
  46. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_assertions.py +0 -0
  47. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_cli_shim.py +0 -0
  48. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_dashboard.py +0 -0
  49. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_main_entrypoint.py +0 -0
  50. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_mocks.py +0 -0
  51. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_pr.py +0 -0
  52. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_public_api.py +0 -0
  53. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_report_bundle.py +0 -0
  54. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_report_upload.py +0 -0
  55. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_skill_loader.py +0 -0
  56. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_skill_tool.py +0 -0
  57. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_tool_loader.py +0 -0
  58. {python_yama-0.10.1 → python_yama-0.10.3}/tests/test_usage.py +0 -0
  59. {python_yama-0.10.1 → python_yama-0.10.3}/uv.lock +0 -0
  60. {python_yama-0.10.1 → python_yama-0.10.3}/yama/__init__.py +0 -0
  61. {python_yama-0.10.1 → python_yama-0.10.3}/yama/__main__.py +0 -0
  62. {python_yama-0.10.1 → python_yama-0.10.3}/yama/assertions.py +0 -0
  63. {python_yama-0.10.1 → python_yama-0.10.3}/yama/dashboard.py +0 -0
  64. {python_yama-0.10.1 → python_yama-0.10.3}/yama/loaders/__init__.py +0 -0
  65. {python_yama-0.10.1 → python_yama-0.10.3}/yama/loaders/case.py +0 -0
  66. {python_yama-0.10.1 → python_yama-0.10.3}/yama/loaders/common.py +0 -0
  67. {python_yama-0.10.1 → python_yama-0.10.3}/yama/loaders/skill_loader.py +0 -0
  68. {python_yama-0.10.1 → python_yama-0.10.3}/yama/loaders/tool_loader.py +0 -0
  69. {python_yama-0.10.1 → python_yama-0.10.3}/yama/mocks.py +0 -0
  70. {python_yama-0.10.1 → python_yama-0.10.3}/yama/pr.py +0 -0
  71. {python_yama-0.10.1 → python_yama-0.10.3}/yama/report_bundle.py +0 -0
  72. {python_yama-0.10.1 → python_yama-0.10.3}/yama/report_upload.py +0 -0
  73. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/__init__.py +0 -0
  74. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/base.py +0 -0
  75. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/bash/__init__.py +0 -0
  76. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/bash/_cli_shim.py +0 -0
  77. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/bash/bash.py +0 -0
  78. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/bash/fs.py +0 -0
  79. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/skill/__init__.py +0 -0
  80. {python_yama-0.10.1 → python_yama-0.10.3}/yama/tools/skill/skill.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: python-yama
3
- Version: 0.10.1
3
+ Version: 0.10.3
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
@@ -46,7 +46,27 @@ Instead of prefixing every command, you can put credentials in a `.env` file: on
46
46
 
47
47
  ### Judge routing
48
48
 
49
- Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run, an LLM Judge instead prefers a local agent selected from its resolved `judge.model.name`: OpenAI/GPT/o-family names use Codex, and Claude/Anthropic names use Claude Code; all other names use the API. Any local failure (including a missing command) emits one sanitized warning on stderr so `--json` stdout remains valid JSON and retries the API with the original, complete model object. CI and `pr-run` are API-only. Local agents receive the model name and a compatible `reasoning_effort`, but never temperature, credentials, or endpoint settings.
49
+ Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run, Judge routing recognizes OpenAI/GPT/o-family names as Codex, Claude/Anthropic names as Claude Code, and Grok/xAI names as Cursor. An exact per-agent map may translate an API model name to a local CLI model slug; without a mapping, a recognized family uses that Agent's default model. Other families become local-first only through an exact mapping. A local-first chain is always `primary Agent -> original Judge API -> end` and never enters the fallback Agent.
50
+
51
+ ```toml
52
+ [defaults.judge.local.models.codex]
53
+ "openai/gpt-5.4" = "gpt-5.4-high"
54
+
55
+ [defaults.judge.local.models.claude]
56
+ "anthropic/claude-opus-4.1" = "claude-opus-4-1"
57
+
58
+ [defaults.judge.local.models.cursor]
59
+ "x-ai/grok-4" = "grok-4-fast"
60
+ "kimi.k3" = "kimi-k3"
61
+
62
+ [defaults.judge.local.agent]
63
+ name = "claude" # "claude", "codex", or "cursor"
64
+ model = "claude-sonnet-4-5"
65
+ ```
66
+
67
+ An unmapped, unrecognized model is API-first. Only after its original API exhausts retryable failures may `[defaults.judge.local.agent]` run as the terminal fallback: configured local model, then the same Agent's default only when that model slug is explicitly rejected, then end. There is no fallback-model API call. The HTML report shows the complete Judge attempt chain, including mapped/default/fallback source, retries, failures, and the effective local model when the Agent reports it.
68
+
69
+ CI and `pr-run` are API-only. Local agents receive the mapped model slug when present and a compatible `reasoning_effort`, but never temperature, credentials, or endpoint settings. Cursor Judge passes `--trust` only for its per-attempt empty temporary workspace so non-interactive execution cannot stop at Workspace Trust; it still omits `--force`/`--yolo`, and Yama does not edit Cursor's global trust configuration. Evaluated Agent API attempts default to a 180-second transport timeout; Judge API attempts and local Judge processes default to 120 seconds. The whole-Step timeout remains independently configured by `execution.timeout_seconds_per_step` (default 300 seconds).
50
70
 
51
71
  ## Writing a Case
52
72
 
@@ -104,6 +124,7 @@ uv run --project yama yama --plugin dingding-simple --report
104
124
  | `-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 |
105
125
  | `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
106
126
  | `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
127
+ | `--run-concurrency N` | Maximum number of runs active across all cases (default 32) |
107
128
  | `--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 |
108
129
  | `--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` |
109
130
  | `--list` | Only print the collected Cases, without running them |
@@ -138,4 +159,4 @@ the just-run cases into the previous remote Plugin report.
138
159
 
139
160
  ### Output
140
161
 
141
- 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.
162
+ Cases run in parallel, up to 10 at a time by default (`--concurrency` changes the cap). Runs produced by one Case's `execution.repeat` also run in parallel: omitted `execution.repeat_concurrency` means all expanded runs, subject to the command-wide `--run-concurrency` cap (default 32); set it to `1` to restore serial runs for that Case. Case results keep collection order and run results keep `run_index` order regardless of completion order. Whenever Cases or runs overlap, a transient dashboard at the bottom of the terminal shows one row per Case and each completed Case's full run/step detail is printed above it as one block, so concurrent output never interleaves. Fully serial execution streams each Case, run, and assertion as 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.
@@ -19,7 +19,27 @@ Instead of prefixing every command, you can put credentials in a `.env` file: on
19
19
 
20
20
  ### Judge routing
21
21
 
22
- Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run, an LLM Judge instead prefers a local agent selected from its resolved `judge.model.name`: OpenAI/GPT/o-family names use Codex, and Claude/Anthropic names use Claude Code; all other names use the API. Any local failure (including a missing command) emits one sanitized warning on stderr so `--json` stdout remains valid JSON and retries the API with the original, complete model object. CI and `pr-run` are API-only. Local agents receive the model name and a compatible `reasoning_effort`, but never temperature, credentials, or endpoint settings.
22
+ Evaluated Agent calls always use the configured OpenAI-compatible API. In an ordinary non-CI run, Judge routing recognizes OpenAI/GPT/o-family names as Codex, Claude/Anthropic names as Claude Code, and Grok/xAI names as Cursor. An exact per-agent map may translate an API model name to a local CLI model slug; without a mapping, a recognized family uses that Agent's default model. Other families become local-first only through an exact mapping. A local-first chain is always `primary Agent -> original Judge API -> end` and never enters the fallback Agent.
23
+
24
+ ```toml
25
+ [defaults.judge.local.models.codex]
26
+ "openai/gpt-5.4" = "gpt-5.4-high"
27
+
28
+ [defaults.judge.local.models.claude]
29
+ "anthropic/claude-opus-4.1" = "claude-opus-4-1"
30
+
31
+ [defaults.judge.local.models.cursor]
32
+ "x-ai/grok-4" = "grok-4-fast"
33
+ "kimi.k3" = "kimi-k3"
34
+
35
+ [defaults.judge.local.agent]
36
+ name = "claude" # "claude", "codex", or "cursor"
37
+ model = "claude-sonnet-4-5"
38
+ ```
39
+
40
+ An unmapped, unrecognized model is API-first. Only after its original API exhausts retryable failures may `[defaults.judge.local.agent]` run as the terminal fallback: configured local model, then the same Agent's default only when that model slug is explicitly rejected, then end. There is no fallback-model API call. The HTML report shows the complete Judge attempt chain, including mapped/default/fallback source, retries, failures, and the effective local model when the Agent reports it.
41
+
42
+ CI and `pr-run` are API-only. Local agents receive the mapped model slug when present and a compatible `reasoning_effort`, but never temperature, credentials, or endpoint settings. Cursor Judge passes `--trust` only for its per-attempt empty temporary workspace so non-interactive execution cannot stop at Workspace Trust; it still omits `--force`/`--yolo`, and Yama does not edit Cursor's global trust configuration. Evaluated Agent API attempts default to a 180-second transport timeout; Judge API attempts and local Judge processes default to 120 seconds. The whole-Step timeout remains independently configured by `execution.timeout_seconds_per_step` (default 300 seconds).
23
43
 
24
44
  ## Writing a Case
25
45
 
@@ -77,6 +97,7 @@ uv run --project yama yama --plugin dingding-simple --report
77
97
  | `-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 |
78
98
  | `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
79
99
  | `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
100
+ | `--run-concurrency N` | Maximum number of runs active across all cases (default 32) |
80
101
  | `--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 |
81
102
  | `--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` |
82
103
  | `--list` | Only print the collected Cases, without running them |
@@ -111,4 +132,4 @@ the just-run cases into the previous remote Plugin report.
111
132
 
112
133
  ### Output
113
134
 
114
- 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.
135
+ Cases run in parallel, up to 10 at a time by default (`--concurrency` changes the cap). Runs produced by one Case's `execution.repeat` also run in parallel: omitted `execution.repeat_concurrency` means all expanded runs, subject to the command-wide `--run-concurrency` cap (default 32); set it to `1` to restore serial runs for that Case. Case results keep collection order and run results keep `run_index` order regardless of completion order. Whenever Cases or runs overlap, a transient dashboard at the bottom of the terminal shows one row per Case and each completed Case's full run/step detail is printed above it as one block, so concurrent output never interleaves. Fully serial execution streams each Case, run, and assertion as 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.
@@ -19,7 +19,27 @@ YAMA_LLM_API_KEY=... uv run --project yama yama --plugin dingding-simple
19
19
 
20
20
  ### Judge 路由
21
21
 
22
- 被评测 Agent 的调用始终使用配置好的 OpenAI-compatible API。普通非 CI 运行中,LLM Judge 会按解析后的 `judge.model.name` 优先选择本地 Agent:OpenAI/GPT/o 系列使用 Codex,Claude/Anthropic 系列使用 Claude Code,其他模型仍走 API。任何本地失败(包括找不到命令)都会在 stderr 输出一行脱敏警告,再携带原始、完整的 model 对象重试 API,因此 `--json` 的 stdout 始终保持合法 JSON。CI 和 `pr-run` 均只走 API。本地 Agent 只接收模型名和兼容的 `reasoning_effort`,不会接收 temperature、凭据或 endpoint 设置。
22
+ 被评测 Agent 的调用始终使用配置好的 OpenAI-compatible API。普通非 CI 运行中,Judge 路由把 OpenAI/GPT/o 系列交给 Codex、Claude/Anthropic 系列交给 Claude Code、Grok/xAI 系列交给 Cursor。每个 Agent 都可用精确映射把 API 模型名翻译成本地 CLI 模型 slug;已识别系列未配置映射时直接使用对应 Agent 的默认模型。其他系列只有精确映射命中后才会变为 local-first。local-first 链固定为“主 Agent → 原始 Judge API → 结束”,不会再进入 fallback Agent。
23
+
24
+ ```toml
25
+ [defaults.judge.local.models.codex]
26
+ "openai/gpt-5.4" = "gpt-5.4-high"
27
+
28
+ [defaults.judge.local.models.claude]
29
+ "anthropic/claude-opus-4.1" = "claude-opus-4-1"
30
+
31
+ [defaults.judge.local.models.cursor]
32
+ "x-ai/grok-4" = "grok-4-fast"
33
+ "kimi.k3" = "kimi-k3"
34
+
35
+ [defaults.judge.local.agent]
36
+ name = "claude" # 支持 "claude"、"codex" 或 "cursor"
37
+ model = "claude-sonnet-4-5"
38
+ ```
39
+
40
+ 未映射且未识别的模型走 API-first。只有原始 API 的可重试错误耗尽后,才会启用 `[defaults.judge.local.agent]` 作为终止型兜底:“配置的本地模型 → 仅在该 slug 被明确拒绝时使用同一 Agent 默认模型 → 结束”。不再调用 fallback-model API。HTML 报告会展示完整 Judge 尝试链,包括映射/默认/兜底来源、重试、失败原因,以及本地 Agent 能上报时的实际模型。
41
+
42
+ CI 和 `pr-run` 均只走 API。本地 Agent 只接收命中的本地模型 slug 和兼容的 `reasoning_effort`,不会接收 temperature、凭据或 endpoint 设置。Cursor Judge 只为当前单次调用的空临时 Workspace 传入 `--trust`,避免非交互执行停在 Workspace Trust;仍不使用 `--force`/`--yolo`,Yama 也不会修改 Cursor 的全局信任配置。被评测 Agent 的 API 单次请求默认超时为 180 秒;Judge API 单次请求和本地 Judge 进程默认超时均为 120 秒。整条 Step 的超时仍由 `execution.timeout_seconds_per_step` 独立控制,默认 300 秒。
23
43
 
24
44
  ## 编写一个 Case
25
45
 
@@ -77,6 +97,7 @@ uv run --project yama yama --plugin dingding-simple --report
77
97
  | `-k, --filter PATTERN`(可重复) | 只运行 case key(相对 Plugin Root 的路径)匹配 PATTERN 的 Case——默认子串匹配,PATTERN 含 `*` `?` `[` 时按 fnmatch 通配符匹配;传多个时命中任意一个即运行 |
78
98
  | `--result-dir PATH` | 覆盖产物根目录(默认 `<plugin_root>/.yama/runs`) |
79
99
  | `--concurrency N` | 同时运行的 Case 数上限(默认 10;`1` 表示逐个顺序执行) |
100
+ | `--run-concurrency N` | 所有 Case 的活跃 run 总上限(默认 32) |
80
101
  | `--report [PATH]` | 额外生成单文件 HTML 报告。省略 PATH 时写带时间戳的 `.yama/reports/report-<ts>.html`(历史累积),并把 `.yama/reports/latest.html` 维护成指向最新报告的软链;显式给 PATH 时精确写到该文件 |
81
102
  | `--preview` | 不运行、不发起任何 LLM 调用:解析收集到的 Case 后生成用例预览 HTML(默认 `.yama/reports/preview.html`,`--report PATH` 可覆盖);与 `--json` 组合时改为向 stdout 打印 JSON 预览 |
82
103
  | `--list` | 只打印匹配到的 Case,不运行 |
@@ -110,4 +131,4 @@ CI 需要把报告发布到 Yama Eval Report 服务时,在 `--report` 之外
110
131
 
111
132
  ### 输出
112
133
 
113
- 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。
134
+ Case 之间并行执行,默认最多同时 10 个(用 `--concurrency` 调整上限)。同一 Case 的 `execution.repeat` 展开的 run 也会并行:未设置 `execution.repeat_concurrency` 时自动使用展开后的总 run 数,但受命令级 `--run-concurrency`(默认 32)限制;设为 `1` 可恢复该 Case 的串行 run。Case 结果保持收集顺序,run 结果保持 `run_index` 顺序,与完成先后无关。只要 Case 或 run 存在重叠执行,终端底部就会显示逐 Case 状态面板,每个 Case 完成后把完整 Run/Step 明细作为一个整块打印到面板上方,避免并发输出交错;完全串行时则逐 Case、Run、断言实时流式打印。两种模式最后都以逐 Case 的汇总表格收尾;使用 `--json` 时进度流打印到 stderr,stdout 保持为纯 JSON。
@@ -81,12 +81,12 @@ SYSTEM.md Skill Catalog Extra Messages
81
81
  | `tools/bash/fs.py` | `bash` 工具真正的沙箱执行引擎:校验 `mocks.fs`、物化沙箱工作目录、生成 macOS sandbox-exec profile、管理贯穿一次 run 的持久 shell 会话;同时把 `mocks.cli` 编译成同一套引擎能吃的合成 fs 配置 | `normalize_fs_config`、`materialize_workspace`、`workspace_dir`、`ShellSession`、`compile_cli_config`、`cleanup_session` |
82
82
  | `tools/bash/_cli_shim.py` | 独立子进程入口,被编译出的 `.mockbin/<cmd>` 脚本调用,复用 `mocks.py` 的 `_matches` 语义在规则树里做匹配 | `main`、`_resolve` |
83
83
  | `tools/skill/skill.py` | `{builtin: skill}` 默认 Handler:按 Skill 目录 + 文件名读取 Skill 正文/子文件 | `SkillTool`、`read_skill`(`= SkillTool().run`) |
84
- | `llm.py` | LLM 抽象、消息/附件转换 helper、usage 规范化 helper;保留 LiteLLM legacy adapter 与可脚本化的确定性 Client 供测试/回放用 | `LLMClient`(抽象)、`LiteLLMClient`、`ScriptedLLMClient`、`delivered_content` |
84
+ | `llm.py` | LLM 抽象、并发 run 的 Client wrapper fork、消息/附件转换 helper、usage 规范化 helper;保留 LiteLLM legacy adapter 与可脚本化的确定性 Client 供测试/回放用 | `LLMClient`(抽象)、`LiteLLMClient`、`ScriptedLLMClient`、`delivered_content` |
85
85
  | `openai_llm.py` | 默认真实 LLM adapter,通过 OpenAI SDK 调 OpenAI-compatible chat completions endpoint | `OpenAICompatibleLLMClient` |
86
- | `runner.py` | 核心编排:按 run/step/request 三层驱动一次 Case 执行,并通过 `on_event` 回调对外发布进度事件(见第 13 节) | `YamaRunner`、`RunResult`、`CaseResult`、`RunnerEventCallback`、`MaxToolRoundsExceeded` |
86
+ | `runner.py` | 核心编排:展开并并行调度 run,按 step/request 驱动每条 run,并通过 `on_event` 回调对外发布进度事件(见第 13 节) | `YamaRunner`、`RunConcurrencyLimiter`、`RunResult`、`CaseResult`、`RunnerEventCallback`、`MaxToolRoundsExceeded` |
87
87
  | `assertions.py` | 硬断言(tool_called / assistant_matches / jsonpath 等)与 LLM-as-Judge 的实现 | `run_hard_assertions`、`run_judge` |
88
88
  | `report.py` | 把执行结果渲染成单个自包含 HTML 报告 | `write_html_report` |
89
- | `cli.py` | 命令行入口:串联 config → loaders → runner → report;按 `--concurrency` 并行调度多个 Case(asyncio),执行中流式打印进度,收尾打印汇总表格 | `main`、`ProgressPrinter`、`ParallelProgressPrinter`、`build_case_tree`、`build_summary_table`、`build_results_renderable` |
89
+ | `cli.py` | 命令行入口:串联 config → loaders → runner → report;用 `--concurrency` 限制 Case、用 `--run-concurrency` 限制全局活跃 run,执行中打印进度,收尾打印汇总表格 | `main`、`ProgressPrinter`、`ParallelProgressPrinter`、`build_case_tree`、`build_summary_table`、`build_results_renderable` |
90
90
 
91
91
  ### 3.2 一次 Case 执行的数据流
92
92
 
@@ -104,7 +104,7 @@ cli.main
104
104
  │ 接到 tools/skill/skill.py:read_skill(派生 enabled/skills_dir)
105
105
  └─ 解析 context.messages / steps[].user 里的 fixture 引用
106
106
  └─ YamaRunner.run_case(case)
107
- └─ 按 execution.repeat 跑 N 次 _run_once
107
+ └─ 展开 execution.repeat,按 repeat_concurrency 并行跑 N 次 _run_once
108
108
  ├─ 建 MockToolRegistry(校验 mocks.tools 与 exposed_tools 完全相等)
109
109
  ├─ 按 step 顺序:
110
110
  │ before_user_message message_inject → 发一条 user 消息
@@ -227,6 +227,7 @@ yama --plugin-root ./dingding-simple
227
227
  | `-k, --filter PATTERN`(可重复) | Case 筛选:只保留 case key 匹配 PATTERN 的 Case(见下) |
228
228
  | `--result-dir PATH` | 覆盖产物根目录(默认每个 Case 写到其所属 `plugin_root/.yama/runs`) |
229
229
  | `--concurrency N` | 同时运行的 Case 数上限(必须 ≥ 1,默认 10);`1` 表示按收集顺序逐个执行 |
230
+ | `--run-concurrency N` | 所有 Case 的活跃 run 总上限(必须 ≥ 1,默认 32) |
230
231
  | `--report [PATH]` | 额外写一份单文件 HTML 报告;省略路径时写到 `<第一个 result_root 的上级>/reports/report-<时间戳>.html`(历史累积),并把同目录的 `latest.html` 维护成指向最新报告的软链;显式给 PATH 时精确写到该文件、不建软链 |
231
232
  | `--preview` | 不运行任何 Case、不发起任何 LLM 调用:解析收集到的 Case 后输出**用例预览**。默认写一张与报告同风格的 HTML(`<第一个 result_root 的上级>/reports/preview.html`,`--report PATH` 可覆盖目标路径);与 `--json` 组合时改为向 stdout 打印逐 Case 的 JSON 预览数组(见第 13 节) |
232
233
  | `--list` | 只收集并打印 `case_key` 列表,不运行 |
@@ -304,26 +305,31 @@ PATTERN 含 `*`/`?`/`[` 任一字符时按 `fnmatch` 通配符(大小写敏感
304
305
  筛选后一个 Case 都不剩时报 `No eval cases matched the case filter.` 并以退出码 2
305
306
  结束(与"根本没收集到 Case"同级别,但错误信息区分两种情况)。
306
307
 
307
- **Case 级并发调度(`--concurrency`,`cli.py:_run`)。** 收集到的多个 Case 用
308
- `asyncio.Semaphore(concurrency)` + `asyncio.gather` 在同一事件循环里并发执行
309
- (执行链路本就是全异步:`AsyncOpenAI` 请求被直接 await,bash 沙箱使用 asyncio
310
- 子进程,工作负载是 I/O 密集的 LLM 请求)。
308
+ **Case/run 两级并发调度(`--concurrency` / `--run-concurrency`,`cli.py:_run`)。**
309
+ 收集到的多个 Case 先用 `asyncio.Semaphore(concurrency)` + `asyncio.gather` 在同一事件
310
+ 循环里并发执行;所有 Runner 再共享一个 `RunConcurrencyLimiter(run_concurrency)`。
311
+ 每个 Case 内部把 `execution.repeat` 展开的 `RunSpec` 建成异步任务,用自己的
312
+ `repeat_concurrency` semaphore 和共享 limiter 双重限流。
311
313
  语义边界:
312
314
 
313
- - 并发单位是 **Case**;同一 Case 内 `execution.repeat` 的多个 run 仍严格顺序执行。
314
- - 每个 Case 用独立的 `YamaRunner` + 独立的 `OpenAICompatibleLLMClient`——runner 在每次
315
- `complete()` 后回读 client 的 `last_request`/`last_provider` 写入请求记录,
316
- 共享 client 会被并发 Case 互相覆盖。
315
+ - `--concurrency` 只限制活跃 **Case**,默认 10;`--run-concurrency` 限制本次命令的
316
+ 活跃 **run 总数**,默认 32。二者都必须是正整数。
317
+ - Case 未声明 `execution.repeat_concurrency` 时按展开后的总 run 数自动并行;显式值必须
318
+ 是正整数,`1` 恢复串行。实际 Case 上限会先被总 run 数和全局 run 上限钳制。
319
+ - 每个并行 run 使用 `LLMClient.fork()` 得到独立 adapter wrapper;Agent/Judge 本来是同一
320
+ Client 时只 fork 一次并在该 run 内共享。这样 `last_request`/`last_provider`/
321
+ `last_retry_count` 不会跨 run 串扰;自定义有状态 Client 可覆盖默认浅拷贝 `fork()`。
317
322
  - 结果数组保持**收集顺序**(`gather` 保序),与完成先后无关;汇总表格、`--json`
318
- 输出、HTML 报告的 Case 顺序因此在任何并发度下都稳定。
323
+ 输出、HTML 报告的 Case 顺序因此稳定;Case 内第二层 `gather` 同样让 `runs` 始终按
324
+ `run_index` 排列。
319
325
  - 某个 Case 抛出异常(罕见:run 内的错误都会被 `_run_once` 捕获进
320
326
  `RunResult.error`)时,其余 Case 仍会跑完并写完产物(`gather`
321
327
  `return_exceptions=True`),随后第一个异常按原有 `main()` 错误出口重新抛出。
322
- - Case 间的隔离不依赖新机制:bash 沙箱工作目录/产物目录本就按 `case_key` 分目录,
323
- 持久 shell 会话按每 run 的 `state` 身份键控(见 8.4.3 与第 12 节)。
324
- - 进度输出按并发模式切换(见第 13 节):并发 >1 且收集到多个 Case 时使用
325
- `ParallelProgressPrinter`(终端底部一张原地刷新的逐 Case 状态面板 + 完成时
326
- 整 Case 成块打印),否则保持逐 Step 流式的 `ProgressPrinter`。
328
+ - run 间的 Mock state、bash 沙箱工作目录、持久 shell 会话和产物目录都已按
329
+ `run_index` 隔离;Case 级旧目录清理只在并发任务启动前执行一次。
330
+ - 进度输出按实际并发模式切换(见第 13 节):多个 Case 可重叠或任一 Case 的有效 run
331
+ 并发大于 1 时使用 `ParallelProgressPrinter`,完全串行时才使用逐 Step 流式的
332
+ `ProgressPrinter`。
327
333
 
328
334
  ## 5. 全局配置
329
335
 
@@ -343,6 +349,22 @@ timeout_seconds_per_step = 300
343
349
  max_tool_rounds_per_step = 10
344
350
  repeat = 1
345
351
 
352
+ # 可选:API 模型名到本地 Agent 模型 slug 的精确映射
353
+ [defaults.judge.local.models.codex]
354
+ "openai/gpt-5.4" = "gpt-5.4-high"
355
+
356
+ [defaults.judge.local.models.claude]
357
+ "anthropic/claude-opus-4.1" = "claude-opus-4-1"
358
+
359
+ [defaults.judge.local.models.cursor]
360
+ "x-ai/grok-4" = "grok-4-fast"
361
+ "kimi.k3" = "kimi-k3"
362
+
363
+ # 可选:仅用于 API-first Judge 重试耗尽后的终止型本地兜底
364
+ [defaults.judge.local.agent]
365
+ name = "claude" # "claude"、"codex" 或 "cursor"
366
+ model = "claude-sonnet-4-5"
367
+
346
368
  [plugins."dingding-simple"]
347
369
  path = "dingding-simple"
348
370
 
@@ -394,9 +416,16 @@ timeout_seconds_per_step = 60
394
416
  < Case 自己顶层的 model: / execution: 字段
395
417
  ```
396
418
 
419
+ `defaults.judge.local` 不参与 Case 的 `model`/`execution` 合并。`models` 是独立的精确、
420
+ 大小写敏感 API→本地模型映射;一个 API 名只能属于一个 Agent,内置系列不能跨 Agent
421
+ 映射。`agent` 是 API-first 重试耗尽后的可选终止型本地兜底;`name` 只能是 `claude`、
422
+ `codex` 或 `cursor`,`model` 必须是非空本地模型 slug。字段层级、冲突或取值不合法会在
423
+ 加载 `yama.toml` 时直接报 `ConfigurationError`。具体触发条件与调用顺序见 12.2 节。
424
+
397
425
  **不存在** CLI 对 `model`/`execution`/超时参数的覆盖层——CLI 能覆盖的运行期配置只有
398
- `--result-dir`(产物根目录)和 `--concurrency`(Case 级并发上限,纯调度参数,
399
- 不影响任何 Case 语义)。也**不存在** `[conventions]`、`[templates]` 两个配置表,
426
+ `--result-dir`(产物根目录)、`--concurrency`(Case 级并发上限)和
427
+ `--run-concurrency`(命令级 run 总上限);后两者都是纯调度参数,不改变 Case 文件。
428
+ 也**不存在** `[conventions]`、`[templates]` 两个配置表,
400
429
  也没有 `baseline_dir` 字段:
401
430
 
402
431
  - `[conventions]`:System Prompt/Skill 目录/入口文件名等约定只能在 **Plugin 级别**
@@ -1181,7 +1210,7 @@ Runner 把例如 `__evals__/cases/image-led-mv.yaml` 的相对路径规范化为
1181
1210
  ```yaml
1182
1211
  model:
1183
1212
  name: grok.4.5
1184
- timeout: 60
1213
+ timeout: 180
1185
1214
  max_retries: 2
1186
1215
  ```
1187
1216
 
@@ -1190,15 +1219,16 @@ model:
1190
1219
  ```yaml
1191
1220
  model:
1192
1221
  name: grok.4.5 # 必填,原样传给 chat.completions.create(model=...)
1193
- timeout: 60 # 有效 SDK transport timeout(秒)
1222
+ timeout: 180 # 被测 Agent 的有效 SDK transport timeout(秒)
1194
1223
  ```
1195
1224
 
1196
1225
  `stream` 固定传 `False`,因为 runner 以一次完整 assistant message 驱动 Tool Loop,
1197
1226
  没有流式增量解析链路。`provider` 字段和 `YAMA_MODEL_PROVIDER` 不再参与默认真实调用;
1198
1227
  若仍直接实例化 legacy `LiteLLMClient`,它保留旧的 LiteLLM 路由行为,但 CLI 不再使用它。
1199
1228
  默认 OpenAI-compatible Client 由 Yama 管理 timeout 与 retry:`model.timeout` 是正数
1200
- (默认 60 秒,boolean 非法)的 SDK transport timeout;每个 Provider attempt 还由
1201
- `asyncio.wait_for(..., timeout=timeout + 10)` 施加绝对 deadline。`model.max_retries`
1229
+ (被测 Agent 默认 180 秒、Judge API 默认 120 秒,boolean 非法)的 SDK transport
1230
+ timeout;每个 Provider attempt 还由
1231
+ `asyncio.wait_for(..., timeout=timeout + 5)` 施加绝对 deadline。`model.max_retries`
1202
1232
  是初始 attempt 之后的非负整数重试数(默认 2,boolean 非法),由 Yama 消费并从
1203
1233
  `chat.completions.create` 参数中移除。Yama 创建的 `AsyncOpenAI` 始终使用
1204
1234
  `max_retries=0`,避免 SDK retry 与 Yama retry 叠加。
@@ -1232,7 +1262,7 @@ Yama 重试自己的 deadline `TimeoutError`、SDK timeout/connection error、HT
1232
1262
  "messages": [],
1233
1263
  "tools": [],
1234
1264
  "stream": false,
1235
- "timeout": 60.0
1265
+ "timeout": 180.0
1236
1266
  }
1237
1267
  },
1238
1268
  "resolved_provider": { "name": "openai-compatible", "model": "grok.4.5" },
@@ -1668,6 +1698,7 @@ execution:
1668
1698
  timeout_seconds_per_step: 300
1669
1699
  max_tool_rounds_per_step: 10
1670
1700
  repeat: 3
1701
+ repeat_concurrency: 2
1671
1702
  ```
1672
1703
 
1673
1704
  `repeat` 也可以写成**运行矩阵**,用不同模型配置执行同一 Case 并在报告中对比:
@@ -1690,9 +1721,11 @@ execution:
1690
1721
  (`RunResult.status = "error"`,`RunResult.passed = False`,`RunResult.error`
1691
1722
  记录异常信息),run 直接终止,不会再跑后续 Step。这个 300 秒总预算覆盖该 Step 的
1692
1723
  全部 Provider attempts、retry delay、Tool 执行与后续 Tool Loop 请求,不会按 attempt
1693
- 或 Tool round 重置。在默认 60 秒 transport timeout 与两次 retry 下,单次一直不返回的
1694
- completion chain 最多为 `70 * 3 + 1 + 2 = 213` 秒,仍给同一个 Step 的其他工作留下
1695
- 87 秒;Judge 调用仍在这个 candidate-Step `wait_for` 之外。`LLMError`(Provider
1724
+ 或 Tool round 重置。被测 Agent 的默认 transport timeout 是 180 秒,每个 attempt 的
1725
+ 绝对 deadline 是 185 秒;若包含 retry 的完整 completion chain 超过 300 秒,整 Step
1726
+ deadline 会先
1727
+ 取消当前请求,而不是为所有 attempts 额外扩张总预算。Judge 调用仍在这个
1728
+ candidate-Step `wait_for` 之外。`LLMError`(Provider
1696
1729
  请求失败、接口异常、脚本回放耗尽等)同样归为 run/case 的 `error` 状态,而不是
1697
1730
  hard check/Judge 失败。
1698
1731
  这与下面 `max_tool_rounds_per_step` 超限的处理方式(仅本 Step 记为失败、run 继续
@@ -1721,6 +1754,9 @@ execution:
1721
1754
  评分口径一致、可对比。
1722
1755
  - `repeat` 在 defaults / plugin / Case 三层间按整值替换(`dict.update`),
1723
1756
  不做逐条目合并:Case 写 `repeat: 3` 会整体覆盖全局矩阵,反之亦然。
1757
+ - `repeat_concurrency`:同一 Case 的活跃 run 上限。显式值必须是正整数;`1` 表示串行。
1758
+ 省略时为 **auto**,即展开后的总 run 数;CLI 再用 `--run-concurrency`(默认 32)限制
1759
+ 所有 Case 的总活跃 run。显式值超过总 run 数或全局上限时按较小值分批执行,不报错。
1724
1760
 
1725
1761
  ### 8.6 `steps[]`:确定性推进的用户回合
1726
1762
 
@@ -2587,14 +2623,28 @@ def check(
2587
2623
 
2588
2624
  Judge 只评价无法可靠写成确定性规则的质量维度。执行逻辑固定如下:
2589
2625
 
2590
- 调用路径与被测 Agent 相互独立:被测 Agent 始终走 API。普通非 CI 运行的 Judge
2591
- 本地优先——解析后的 OpenAI/GPT/o 系列名交给 Codex,Claude/Anthropic 系列名交给
2592
- Claude Code,未匹配模型直接走 API。若本地进程明确报告指定模型不存在或不可用,
2593
- Yama 会警告并省略 `--model`,使用该 Agent 配置的默认模型重试一次;其他本地错误或
2594
- 这次重试失败时,再用原始完整 model 对象回退 API。CI 和 `yama pr-run` 的 Judge 只走
2595
- API。本地 Agent 两次尝试只接收兼容的 `reasoning_effort`,不接收 `temperature`。
2596
- Agent 默认模型可能因机器或时间而变化,所以 `temperature: 0` 只对 API Judge 提供
2597
- 稳定作用,不能保证本地 Judge 可复现。
2626
+ 调用路径与被测 Agent 相互独立:被测 Agent 始终走 API。普通非 CI 运行的 Judge 按
2627
+ 解析后的模型分两条互斥路径:
2628
+
2629
+ 1. `judge.model.name` 可路由到本地 Agent 时,OpenAI/GPT/o 系列交给 Codex,
2630
+ Claude/Anthropic 系列交给 Claude Code,Grok/xAI 系列交给 Cursor。精确映射命中时把
2631
+ 映射值作为本地 `--model`;内置系列未映射时直接使用 Agent 默认模型。其他系列只有
2632
+ 精确映射命中后才成为 local-first。映射 slug 被明确拒绝时省略 `--model` 重试同一
2633
+ Agent 默认模型;其他本地错误或默认模型失败时,使用原始完整 Judge model 对象回退
2634
+ API。链固定为“主 Agent → 原始 API → 结束”,不进入 `defaults.judge.local.agent`。
2635
+ 2. `judge.model.name` 未命中内置系列或映射时,先用原始完整 Judge model 对象调用 API。
2636
+ 只有可重试错误在 `max_retries` 后仍失败,且 Workspace 显式配置了
2637
+ `defaults.judge.local.agent`,才继续尝试配置的本地 Agent 与模型。仅当该模型名被本地
2638
+ Agent 明确拒绝时,省略 `--model` 使用该 Agent 默认模型重试;本地执行、输出协议校验
2639
+ 或默认模型仍失败时直接结束,不再调用 fallback-model API。不可重试的原始 API 错误
2640
+ 直接抛出;未配置 `defaults.judge.local.agent` 时不启用这条链。
2641
+
2642
+ CI 和 `yama pr-run` 的 Judge 只走 API。本地 Agent 尝试只接收兼容的
2643
+ `reasoning_effort`,不接收 `temperature`。Agent 默认模型可能因机器或时间而变化,所以
2644
+ `temperature: 0` 只对 API Judge 提供稳定作用,不能保证本地 Judge 可复现。被测 Agent
2645
+ 的 API 单次 attempt 默认 transport timeout 为 180 秒;Judge API 单次 attempt 与本地
2646
+ Judge 进程默认 timeout 均为 120 秒;`execution.timeout_seconds_per_step` 仍是独立的整
2647
+ Step deadline,默认 300 秒。
2598
2648
 
2599
2649
  本地 Codex/Claude 适配器不会直接发送 API 使用的 tuple Judge Schema,而是深拷贝后
2600
2650
  转换为两者严格模式都接受的子集:`dimensions` 使用对象型 `items`,`name` 使用字符串
@@ -2604,6 +2654,11 @@ Agent 默认模型可能因机器或时间而变化,所以 `temperature: 0`
2604
2654
  `sqlite_home` 覆盖隔离 SQLite 运行状态;`CODEX_HOME`、认证和默认模型选择不变,临时
2605
2655
  目录在调用结束后删除。非零进程退出同时保留带标签的 stdout 与 stderr,再经过既有的
2606
2656
  单行、长度限制和敏感信息脱敏后打印,避免 stderr warning 隐藏 stdout 的真实错误。
2657
+ Cursor 适配器使用 `agent --trust -p --output-format stream-json`(兼容旧命令名
2658
+ `cursor-agent`);`--trust` 只跳过本次隔离空临时目录的 Workspace Trust 交互,不带
2659
+ `--force`/`--yolo`,也不修改 Cursor 全局信任配置。每个 local/API 逻辑尝试都会写入
2660
+ `StepResult.judge_execution`;HTML 按序显示模型来源、重试、失败和 Agent 上报的实际模型。
2661
+ Claude Code/Cursor 可从 init 事件显示默认实际模型;Codex 默认模型未上报时明确标注。
2607
2662
 
2608
2663
  在调用前,`_resolve_judge_model()` 按三条互斥分支选择模型:省略 `judge.model` 时,
2609
2664
  深拷贝完整的 Case `model`(包括每个已配置请求选项);字符串 `judge.model` 是独立的、
@@ -2958,7 +3013,8 @@ Step 内的 Resolved transcript 和 run 底部的 `LLM requests (N)` / `Mock eve
2958
3013
 
2959
3014
  `--preview --json` 打印的预览 payload(`preview.py:preview_payload`)是逐 Case 的
2960
3015
  JSON 对象数组:`case_key`/`description`/`path`/`plugin_root`/`evals_root`/
2961
- `model`/`execution`/`run_plan`(展开后的计划 run 列表,非法 repeat 时为
3016
+ `model`/`execution`/`run_plan`(展开后的计划 run 列表,非法 repeat 或
3017
+ `repeat_concurrency` 时为
2962
3018
  `{"error": ...}`)/`context`/`mocks`/`steps`(解析后的 Step,含 fixture 展开)/
2963
3019
  `outcome`/`system_prompt`(渲染后的最终文本)/`skills`/`tools`(provider 形态
2964
3020
  schema)/`initial_messages`/`fixtures`。
@@ -2970,10 +3026,10 @@ schema)/`initial_messages`/`fixtures`。
2970
3026
  `/preview` 页的页眉标注 "refresh to re-resolve"(区别于 `--preview` 写盘的
2971
3027
  static snapshot 措辞)。
2972
3028
 
2973
- 终端输出(不用 `--json` 时)在执行过程中**实时流式打印进度**,形态取决于并发模式
2974
- (见 4.3 节的 `--concurrency`);两种模式最后都以逐 Case 的汇总表格收尾。
3029
+ 终端输出(不用 `--json` 时)在执行过程中打印进度,形态取决于 Case/run 是否会重叠
3030
+ (见 4.3 节的两个并发上限);两种模式最后都以逐 Case 的汇总表格收尾。
2975
3031
 
2976
- **顺序模式**(`--concurrency 1`,或只收集到一个 Case):每个 Case、Run、Step
3032
+ **顺序模式**(Case 逐个执行,且每个 Case 的有效 run 并发均为 1):每个 Case、Run、Step
2977
3033
  一完成就立即打印结果(含每条 hard check 的通过情况与失败详情、Judge 结论):
2978
3034
 
2979
3035
  ```text
@@ -3001,8 +3057,8 @@ Yama Eval Results
3001
3057
  表格单元格显示 `–`,caption 也不带 tokens 段。`✓`/`✗`/`!` 分别对应
3002
3058
  `status=pass`/`fail`/`error`;ERROR 行不会计入 cases/runs passed 的分母。
3003
3059
 
3004
- **并发模式**(并发 >1 且收集到多个 Case,默认即是):不同 Case 的 Step 结果会
3005
- 乱序到达,逐 Step 流式打印会把不相关 Case 的行交错在错误的 Case 标题下,因此改为
3060
+ **并发模式**(多个 Case 或同一 Case 的多个 run 会重叠):Step 结果会乱序到达,
3061
+ 逐 Step 流式打印会把不相关运行的行交错在错误的标题下,因此改为
3006
3062
  在终端底部维护一张**原地刷新的逐 Case 状态面板**(transient `rich Live`):每个
3007
3063
  收集到的 Case 固定占一行、按收集顺序排列,状态原地更新——`waiting`(排队等并发
3008
3064
  槽位)→ spinner + 当前 `Run k/n · <step_id>` → `✓/✗` 加简要结果。任何一个 Case
@@ -3025,9 +3081,9 @@ Yama Eval Results
3025
3081
  ```
3026
3082
 
3027
3083
  流式进度由 `YamaRunner` 的进度回调驱动(`runner.py:RunnerEventCallback`,
3028
- 构造参数 `on_event`)。每个 Case 的事件顺序固定为:`case_start`
3084
+ 构造参数 `on_event`)。每个 Case 先发 `case_start`
3029
3085
  `{case_key, description, repeat}`(`repeat` 是展开后的**总 run 数**,运行矩阵下
3030
- = Σ times)→ 每个 run:`run_start` `{case_key, run_index, repeat, label}`
3086
+ = Σ times);随后每个并行 run 独立发送 `run_start` `{case_key, run_index, repeat, label}`
3031
3087
  (`label` 是该 run 的变体标签,整数 `repeat` 时为 None;CLI 的顺序模式
3032
3088
  `Run i/N` 行、并发面板行与 `build_case_tree` 的 Run 节点都会把非空 label 显示为
3033
3089
  `Run i/N · <label>`)→ 每个 Step:`step_start` `{case_key, run_index, step_id}`、`step_end`
@@ -3035,9 +3091,10 @@ Yama Eval Results
3035
3091
  RunResult}` → `case_end` `{result: CaseResult}`。`step_end` 在该 Step 的 hard
3036
3092
  check 与 Judge 都结算完之后才触发(含 max-tool-rounds 失败的 Step),payload
3037
3093
  携带的是最终判定;run 在 Step 中途死掉(超时、Handler 异常)时该 Step 没有
3038
- `step_end`,但 `run_end` 仍会触发(在产物写盘之后)。并发执行时多个 Case 的事件
3039
- 流会在时间上交错,但单个 Case 内部的事件顺序不变(每个事件 payload 都带
3040
- `case_key` 可供归属)。
3094
+ `step_end`,但 `run_end` 仍会触发(在产物写盘之后)。并发执行时不同 Case 或 run 的
3095
+ 事件会在时间上交错;只有**单条 run 内部**保持 step/request 顺序。每个事件 payload
3096
+ 都带 `case_key`,run/step 事件还带 `run_index`,可准确归属。`case_end` 一定在全部
3097
+ `run_end` 之后发出。
3041
3098
 
3042
3099
  CLI 侧按并发模式挑选回调实现,两者的**已完成结果**都只做顺序追加打印(不回改
3043
3100
  已输出内容),管道/CI 日志中同样可读;动态元素(spinner/面板)都是 transient
@@ -3075,14 +3132,35 @@ record 的 request 生成 `context.skills`/`context.tools`/`context.messages`;
3075
3132
  `mocks.state.dsl`。当 DSL workflow 和 request history 足够完整时,还会自动生成一条
3076
3133
  `steps[]`:
3077
3134
 
3135
+ 模型记录的 HTTP transport 由 `YAMA_THREAD_HTTP_TRANSPORT` 控制,值会去除首尾空白并
3136
+ 按大小写不敏感方式解析:
3137
+
3138
+ | 配置值 | prod | dev/staging |
3139
+ | --- | --- | --- |
3140
+ | 未设置或 `auto` | curl | urllib |
3141
+ | `curl` | curl | curl |
3142
+ | `urllib` | urllib | urllib |
3143
+
3144
+ 其他值在发出网络请求前报 `ThreadCaseError`。`auto` 每次只选一个 transport,不会在
3145
+ 失败后 fallback:prod 直接用 curl,避免先等待已知会触发 CAPTCHA 的 urllib 请求;
3146
+ dev/staging 保持原 urllib 行为。curl 调用首先用 `--disable` 忽略用户 `.curlrc`,只跟随
3147
+ 最多 5 次 HTTPS 跳转,并同时设置 30 秒传输超时和 35 秒子进程超时。Bearer token 与
3148
+ `Accept: application/json` 通过 `--header @-` 从 stdin 传入,不进入 curl 子进程 argv;
3149
+ `--write-out` 在正文后追加最终 HTTP 状态和 content type,由 Python 统一解释,因此不
3150
+ 依赖 `--fail-with-body`。
3151
+
3152
+ prod curl 遇到 `text/html`,或遇到包含 `captcha` 且不是正常 `records` 载荷的响应时,
3153
+ 直接报 `prod edge returned CAPTCHA`;正常 model-records JSON 内的历史消息即使提到
3154
+ CAPTCHA 也不会误报。其他非 2xx、curl 非零退出、curl 不存在、超时、响应元数据缺失和
3155
+ 非 JSON 响应都包装为 `ThreadCaseError`,错误正文有长度上限且会去除 bearer token。
3156
+
3078
3157
  - 当前 step id 来自 `dsl.workflow.steps`,优先第一条 `status == "in_progress"`,否则取
3079
3158
  第一条非 `completed`/`skipped`;若全部完成/跳过、没有 DSL、或步骤缺少 id,则不填充
3080
3159
  step。
3081
- - 最近一条非纯 `<system-reminder>...</system-reminder>` 的用户消息成为
3082
- `steps[0].user`,`context.messages` 截断到这条消息之前,避免运行 Case 时重复发送同一
3083
- 用户回合。
3084
- - 如果该用户消息下一条就是纯 `<system-reminder>` 用户消息,则写入
3085
- `steps[0].message_inject`,`position: after_user_message`。
3160
+ - request 中最后一条 `role == "user"` 的消息成为 `steps[0].user`,即使它是纯
3161
+ `<system-reminder>...</system-reminder>`;`context.messages` 截断到这条消息之前,
3162
+ 避免运行 Case 时重复发送同一用户回合。`from-thread` 不为这次切分自动生成
3163
+ `message_inject`。
3086
3164
  - 从该用户消息之后的 assistant tool calls 和选中 record 的 response message 中收集
3087
3165
  Tool 名,按首次出现顺序聚合调用次数,生成带 `times: <count>` 和 `tag: must_pass`
3088
3166
  的 `tool_called` hard checks。
@@ -3186,8 +3264,8 @@ stdout 仍只输出 YAML,stderr 只输出 record/response/DSL 抓取诊断信
3186
3264
  `model`,没有对 Step 输入、Mock 配置等任意参数做笛卡尔展开的通用参数矩阵。
3187
3265
  - **HTML Transcript Viewer 的进一步能力**、**人工评分与 Judge 校准**、**远程
3188
3266
  执行**:`report.py` 目前只产出一个静态汇总 HTML,没有专门的单 Case 交互式
3189
- Transcript Viewer;Case 级的本地并发调度已实现(CLI `--concurrency`,默认 10,
3190
- 见 4.3 节),但仍没有把执行分发到远程机器的能力。
3267
+ Transcript Viewer;Case/run 两级的本地并发调度已实现(CLI `--concurrency` 默认 10、
3268
+ `--run-concurrency` 默认 32,见 4.3 节),但仍没有把执行分发到远程机器的能力。
3191
3269
 
3192
3270
  已经完成、且与原设计基本对齐或已按上文修正描述的能力(供快速核对现状):
3193
3271
 
@@ -3205,7 +3283,7 @@ stdout 仍只输出 YAML,stderr 只输出 record/response/DSL 抓取诊断信
3205
3283
  严格校验,见 7.6 节)。
3206
3284
  - 纯文本与多模态 Message Part、fixture manifest。
3207
3285
  - 9 种硬检查、多维 LLM Judge、`execution.repeat` 稳定通过率统计(含多模型
3208
- 运行矩阵与报告中的分组对比)。
3286
+ 运行矩阵、Case 内并行 run 与报告中的分组对比)。
3209
3287
  - JSON 产物(逐 Case/逐 run)与单文件 HTML 汇总报告。
3210
3288
  - LLM token 用量统计:逐请求采集、run/Case 级聚合、CLI 与 HTML 报告展示
3211
3289
  (见第 11 节与第 13 节)。