python-yama 0.10.0__tar.gz → 0.10.2__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 (79) hide show
  1. {python_yama-0.10.0 → python_yama-0.10.2}/.gitignore +3 -0
  2. {python_yama-0.10.0 → python_yama-0.10.2}/PKG-INFO +16 -9
  3. {python_yama-0.10.0 → python_yama-0.10.2}/README.md +13 -7
  4. {python_yama-0.10.0 → python_yama-0.10.2}/README.zh-CN.md +13 -7
  5. {python_yama-0.10.0 → python_yama-0.10.2}/docs/agent-skill-test-framework-design.md +246 -103
  6. {python_yama-0.10.0 → python_yama-0.10.2}/docs/case-schema-reference.md +112 -30
  7. python_yama-0.10.2/docs/superpowers/plans/2026-08-07-judge-model-resolution.md +382 -0
  8. python_yama-0.10.2/docs/superpowers/plans/2026-08-07-local-judge-default-model-retry.md +348 -0
  9. python_yama-0.10.2/docs/superpowers/plans/2026-08-07-openai-timeout-retry-reporting.md +881 -0
  10. python_yama-0.10.2/docs/superpowers/specs/2026-08-04-judge-model-object-design.md +131 -0
  11. python_yama-0.10.2/docs/superpowers/specs/2026-08-04-openai-adapter-safety-design.md +108 -0
  12. python_yama-0.10.2/docs/superpowers/specs/2026-08-07-judge-model-resolution-design.md +143 -0
  13. python_yama-0.10.2/docs/superpowers/specs/2026-08-07-local-judge-default-model-retry-design.md +124 -0
  14. python_yama-0.10.2/docs/superpowers/specs/2026-08-07-openai-timeout-retry-reporting-design.md +260 -0
  15. {python_yama-0.10.0 → python_yama-0.10.2}/docs/yama-intro.html +1 -1
  16. {python_yama-0.10.0 → python_yama-0.10.2}/pyproject.toml +1 -0
  17. {python_yama-0.10.0 → python_yama-0.10.2}/skills/eval-plugin-with-yama/SKILL.md +23 -11
  18. {python_yama-0.10.0 → python_yama-0.10.2}/skills/eval-plugin-with-yama/references/case-schema.md +54 -10
  19. {python_yama-0.10.0 → python_yama-0.10.2}/skills/eval-plugin-with-yama/references/debugging.md +38 -4
  20. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_assertions.py +395 -27
  21. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_cli.py +202 -13
  22. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_framework.py +124 -8
  23. python_yama-0.10.2/tests/test_judge_llm.py +1330 -0
  24. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_llm.py +68 -1
  25. python_yama-0.10.2/tests/test_openai_llm.py +656 -0
  26. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_preview.py +43 -0
  27. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_report.py +100 -1
  28. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_run_plan.py +41 -1
  29. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_runner.py +524 -3
  30. python_yama-0.10.2/tests/test_skill_loader.py +401 -0
  31. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_skill_tool.py +57 -0
  32. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_thread_case.py +273 -7
  33. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_tool_loader.py +12 -0
  34. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_workspace.py +17 -2
  35. {python_yama-0.10.0 → python_yama-0.10.2}/uv.lock +2 -0
  36. {python_yama-0.10.0 → python_yama-0.10.2}/yama/assertions.py +187 -28
  37. {python_yama-0.10.0 → python_yama-0.10.2}/yama/cli.py +78 -15
  38. python_yama-0.10.2/yama/judge_llm.py +561 -0
  39. {python_yama-0.10.0 → python_yama-0.10.2}/yama/llm.py +41 -2
  40. {python_yama-0.10.0 → python_yama-0.10.2}/yama/loaders/case.py +7 -52
  41. python_yama-0.10.2/yama/loaders/skill_loader.py +190 -0
  42. {python_yama-0.10.0 → python_yama-0.10.2}/yama/loaders/tool_loader.py +6 -0
  43. {python_yama-0.10.0 → python_yama-0.10.2}/yama/models.py +3 -0
  44. python_yama-0.10.2/yama/openai_llm.py +287 -0
  45. {python_yama-0.10.0 → python_yama-0.10.2}/yama/preview.py +8 -5
  46. {python_yama-0.10.0 → python_yama-0.10.2}/yama/report.py +41 -9
  47. {python_yama-0.10.0 → python_yama-0.10.2}/yama/runner.py +207 -26
  48. {python_yama-0.10.0 → python_yama-0.10.2}/yama/thread_case.py +116 -1
  49. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/skill/skill.py +12 -1
  50. {python_yama-0.10.0 → python_yama-0.10.2}/yama/workspace.py +1 -1
  51. {python_yama-0.10.0 → python_yama-0.10.2}/.github/workflows/publish.yml +0 -0
  52. {python_yama-0.10.0 → python_yama-0.10.2}/CLAUDE.md +0 -0
  53. {python_yama-0.10.0 → python_yama-0.10.2}/LICENSE +0 -0
  54. {python_yama-0.10.0 → python_yama-0.10.2}/skills/eval-plugin-with-yama/references/install-upgrade.md +0 -0
  55. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_cli_shim.py +0 -0
  56. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_dashboard.py +0 -0
  57. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_main_entrypoint.py +0 -0
  58. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_mocks.py +0 -0
  59. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_pr.py +0 -0
  60. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_public_api.py +0 -0
  61. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_report_bundle.py +0 -0
  62. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_report_upload.py +0 -0
  63. {python_yama-0.10.0 → python_yama-0.10.2}/tests/test_usage.py +0 -0
  64. {python_yama-0.10.0 → python_yama-0.10.2}/yama/__init__.py +0 -0
  65. {python_yama-0.10.0 → python_yama-0.10.2}/yama/__main__.py +0 -0
  66. {python_yama-0.10.0 → python_yama-0.10.2}/yama/dashboard.py +0 -0
  67. {python_yama-0.10.0 → python_yama-0.10.2}/yama/loaders/__init__.py +0 -0
  68. {python_yama-0.10.0 → python_yama-0.10.2}/yama/loaders/common.py +0 -0
  69. {python_yama-0.10.0 → python_yama-0.10.2}/yama/mocks.py +0 -0
  70. {python_yama-0.10.0 → python_yama-0.10.2}/yama/pr.py +0 -0
  71. {python_yama-0.10.0 → python_yama-0.10.2}/yama/report_bundle.py +0 -0
  72. {python_yama-0.10.0 → python_yama-0.10.2}/yama/report_upload.py +0 -0
  73. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/__init__.py +0 -0
  74. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/base.py +0 -0
  75. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/bash/__init__.py +0 -0
  76. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/bash/_cli_shim.py +0 -0
  77. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/bash/bash.py +0 -0
  78. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/bash/fs.py +0 -0
  79. {python_yama-0.10.0 → python_yama-0.10.2}/yama/tools/skill/__init__.py +0 -0
@@ -49,3 +49,6 @@ Thumbs.db
49
49
  # Claude Code local state (settings.json itself is shared/committed)
50
50
  .claude/settings.local.json
51
51
  .claude/worktrees/
52
+
53
+ # Local isolated worktrees used by agentic development workflows
54
+ .worktrees/
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: python-yama
3
- Version: 0.10.0
3
+ Version: 0.10.2
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
@@ -18,6 +18,7 @@ Requires-Python: >=3.12
18
18
  Requires-Dist: fastapi>=0.139.0
19
19
  Requires-Dist: jinja2>=3.1
20
20
  Requires-Dist: litellm<2.0,>=1.80
21
+ Requires-Dist: openai<3.0,>=2.0
21
22
  Requires-Dist: orjson>=3.11.9
22
23
  Requires-Dist: python-dotenv>=1.0
23
24
  Requires-Dist: pyyaml>=6.0
@@ -28,20 +29,24 @@ Description-Content-Type: text/markdown
28
29
 
29
30
  English | [简体中文](https://github.com/world-sim-dev/yama/blob/main/README.zh-CN.md)
30
31
 
31
- `yama` is a reproducible evaluation framework for tool-using Agent Skills: a declarative YAML Case describes what the model sees — the system prompt, Skill metadata, tool schemas, and multi-turn user messages — then yama calls the LLM through LiteLLM, drives the tool loop, and scores the transcript with deterministic hard checks or an LLM judge. See the [design doc](https://github.com/world-sim-dev/yama/blob/main/docs/agent-skill-test-framework-design.md) (Chinese) for the full Case schema and execution contract.
32
+ `yama` is a reproducible evaluation framework for tool-using Agent Skills: a declarative YAML Case describes what the model sees — the system prompt, Skill metadata, tool schemas, and multi-turn user messages — then yama calls an OpenAI-compatible chat completions endpoint, drives the tool loop, and scores the transcript with deterministic hard checks or an LLM judge. See the [design doc](https://github.com/world-sim-dev/yama/blob/main/docs/agent-skill-test-framework-design.md) (Chinese) for the full Case schema and execution contract.
32
33
 
33
34
  ## Quick start
34
35
 
35
36
  ```bash
36
37
  # Run from a plugin root; collects __evals__/cases/**/*.yaml by default
37
38
  cd dingding-simple
38
- OPENAI_API_KEY=... uv run --project yama yama
39
+ YAMA_LLM_API_KEY=... uv run --project yama yama
39
40
 
40
41
  # Or, from a workspace root (a directory with yama.toml), pick a plugin by name
41
- OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
42
+ YAMA_LLM_API_KEY=... uv run --project yama yama --plugin dingding-simple
42
43
  ```
43
44
 
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
+ 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). The default endpoint can be overridden with `YAMA_LLM_BASE_URL`.
46
+
47
+ ### Judge routing
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.
45
50
 
46
51
  ## Writing a Case
47
52
 
@@ -78,6 +83,7 @@ outcome:
78
83
  - `description` (optional) is a one-line summary of what the Case tests; it is shown in the CLI output and the HTML report.
79
84
  - `context.tools` is the tool schema sent to the model; `mocks.tools` is how the runner responds when a tool call arrives. The two sets of tool names must match exactly.
80
85
  - To use a Skill, declare it by name under `context.skills` and also declare `{builtin: skill}` under `context.tools`; the model reads the Skill body via `skill(name, file?, call_reason?)`.
86
+ - Skills resolve from `<plugin-root>/skills/<name>/SKILL.md` first. If that local Skill is absent, Yama uses the sibling `.common-skills/<name>/versions/...` tree only when `<plugin-root>/config.json` explicitly declares the name in `skill_refs`; an undeclared missing Skill is a collection error.
81
87
  - To simulate command-line tools, declare `{builtin: bash}` and configure per-command output under `mocks.cli`.
82
88
  - `steps[].assert.hard` are deterministic checks (nine types, including `tool_called`, `tool_arguments`, and `assistant_contains`); untagged hard checks must all pass by default. Add `assert.judge` for LLM scoring.
83
89
 
@@ -98,6 +104,7 @@ uv run --project yama yama --plugin dingding-simple --report
98
104
  | `-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 |
99
105
  | `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
100
106
  | `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
107
+ | `--run-concurrency N` | Maximum number of runs active across all cases (default 32) |
101
108
  | `--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 |
102
109
  | `--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` |
103
110
  | `--list` | Only print the collected Cases, without running them |
@@ -119,10 +126,10 @@ uv run --project yama yama dashboard --plugin dingding-simple
119
126
 
120
127
  ```bash
121
128
  uv run --project yama yama pr-plan --base origin/main --json
122
- OPENAI_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
129
+ YAMA_LLM_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
123
130
  ```
124
131
 
125
- `yama pr-plan` selects PR-scoped eval cases without model calls. `yama pr-run` executes the same selection and writes a JSON summary for external CI jobs to render or upload; credentials stay in environment variables or `.env`, not CLI flags. `pr-run` always forces builtin bash execution to the Linux `linux-bubblewrap` sandbox, regardless of Case backend settings, so the runner must be Linux with `bwrap`/`bubblewrap` installed. See the [CI integration guide](https://github.com/world-sim-dev/yama/blob/main/docs/pr-evals-ci-integration.zh-CN.md) for workflow examples and the summary JSON contract.
132
+ `yama pr-plan` selects PR-scoped eval cases without model calls. `yama pr-run` executes the same selection and writes a JSON summary for external CI jobs to render or upload; both evaluated-Agent and Judge calls are API-only, and credentials stay in environment variables or `.env`, not CLI flags. `pr-run` always forces builtin bash execution to the Linux `linux-bubblewrap` sandbox, regardless of Case backend settings, so the runner must be Linux with `bwrap`/`bubblewrap` installed. See the [CI integration guide](https://github.com/world-sim-dev/yama/blob/main/docs/pr-evals-ci-integration.zh-CN.md) for workflow examples and the summary JSON contract.
126
133
 
127
134
  For CI environments that publish reports to the Yama Eval Report service, add
128
135
  `--upload-report --commit-id <sha>` together with `--report`. The command reads
@@ -132,4 +139,4 @@ the just-run cases into the previous remote Plugin report.
132
139
 
133
140
  ### Output
134
141
 
135
- 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.
142
+ 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.
@@ -2,20 +2,24 @@
2
2
 
3
3
  English | [简体中文](https://github.com/world-sim-dev/yama/blob/main/README.zh-CN.md)
4
4
 
5
- `yama` is a reproducible evaluation framework for tool-using Agent Skills: a declarative YAML Case describes what the model sees — the system prompt, Skill metadata, tool schemas, and multi-turn user messages — then yama calls the LLM through LiteLLM, drives the tool loop, and scores the transcript with deterministic hard checks or an LLM judge. See the [design doc](https://github.com/world-sim-dev/yama/blob/main/docs/agent-skill-test-framework-design.md) (Chinese) for the full Case schema and execution contract.
5
+ `yama` is a reproducible evaluation framework for tool-using Agent Skills: a declarative YAML Case describes what the model sees — the system prompt, Skill metadata, tool schemas, and multi-turn user messages — then yama calls an OpenAI-compatible chat completions endpoint, drives the tool loop, and scores the transcript with deterministic hard checks or an LLM judge. See the [design doc](https://github.com/world-sim-dev/yama/blob/main/docs/agent-skill-test-framework-design.md) (Chinese) for the full Case schema and execution contract.
6
6
 
7
7
  ## Quick start
8
8
 
9
9
  ```bash
10
10
  # Run from a plugin root; collects __evals__/cases/**/*.yaml by default
11
11
  cd dingding-simple
12
- OPENAI_API_KEY=... uv run --project yama yama
12
+ YAMA_LLM_API_KEY=... uv run --project yama yama
13
13
 
14
14
  # Or, from a workspace root (a directory with yama.toml), pick a plugin by name
15
- OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
15
+ YAMA_LLM_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).
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). The default endpoint can be overridden with `YAMA_LLM_BASE_URL`.
19
+
20
+ ### Judge routing
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.
19
23
 
20
24
  ## Writing a Case
21
25
 
@@ -52,6 +56,7 @@ outcome:
52
56
  - `description` (optional) is a one-line summary of what the Case tests; it is shown in the CLI output and the HTML report.
53
57
  - `context.tools` is the tool schema sent to the model; `mocks.tools` is how the runner responds when a tool call arrives. The two sets of tool names must match exactly.
54
58
  - To use a Skill, declare it by name under `context.skills` and also declare `{builtin: skill}` under `context.tools`; the model reads the Skill body via `skill(name, file?, call_reason?)`.
59
+ - Skills resolve from `<plugin-root>/skills/<name>/SKILL.md` first. If that local Skill is absent, Yama uses the sibling `.common-skills/<name>/versions/...` tree only when `<plugin-root>/config.json` explicitly declares the name in `skill_refs`; an undeclared missing Skill is a collection error.
55
60
  - To simulate command-line tools, declare `{builtin: bash}` and configure per-command output under `mocks.cli`.
56
61
  - `steps[].assert.hard` are deterministic checks (nine types, including `tool_called`, `tool_arguments`, and `assistant_contains`); untagged hard checks must all pass by default. Add `assert.judge` for LLM scoring.
57
62
 
@@ -72,6 +77,7 @@ uv run --project yama yama --plugin dingding-simple --report
72
77
  | `-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 |
73
78
  | `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
74
79
  | `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
80
+ | `--run-concurrency N` | Maximum number of runs active across all cases (default 32) |
75
81
  | `--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 |
76
82
  | `--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` |
77
83
  | `--list` | Only print the collected Cases, without running them |
@@ -93,10 +99,10 @@ uv run --project yama yama dashboard --plugin dingding-simple
93
99
 
94
100
  ```bash
95
101
  uv run --project yama yama pr-plan --base origin/main --json
96
- OPENAI_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
102
+ YAMA_LLM_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
97
103
  ```
98
104
 
99
- `yama pr-plan` selects PR-scoped eval cases without model calls. `yama pr-run` executes the same selection and writes a JSON summary for external CI jobs to render or upload; credentials stay in environment variables or `.env`, not CLI flags. `pr-run` always forces builtin bash execution to the Linux `linux-bubblewrap` sandbox, regardless of Case backend settings, so the runner must be Linux with `bwrap`/`bubblewrap` installed. See the [CI integration guide](https://github.com/world-sim-dev/yama/blob/main/docs/pr-evals-ci-integration.zh-CN.md) for workflow examples and the summary JSON contract.
105
+ `yama pr-plan` selects PR-scoped eval cases without model calls. `yama pr-run` executes the same selection and writes a JSON summary for external CI jobs to render or upload; both evaluated-Agent and Judge calls are API-only, and credentials stay in environment variables or `.env`, not CLI flags. `pr-run` always forces builtin bash execution to the Linux `linux-bubblewrap` sandbox, regardless of Case backend settings, so the runner must be Linux with `bwrap`/`bubblewrap` installed. See the [CI integration guide](https://github.com/world-sim-dev/yama/blob/main/docs/pr-evals-ci-integration.zh-CN.md) for workflow examples and the summary JSON contract.
100
106
 
101
107
  For CI environments that publish reports to the Yama Eval Report service, add
102
108
  `--upload-report --commit-id <sha>` together with `--report`. The command reads
@@ -106,4 +112,4 @@ the just-run cases into the previous remote Plugin report.
106
112
 
107
113
  ### Output
108
114
 
109
- 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.
115
+ 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.
@@ -2,20 +2,24 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- `yama` 是一个可复现的 Agent Skill 评测框架:用声明式 YAML Case 描述模型看到的 System Prompt、Skill metadata、Tool Schema 与多轮 User Message,通过 LiteLLM 统一调用 LLM 并驱动 Tool Loop,再对 Transcript 做确定性 Hard Check 或 LLM Judge 评分。完整 Case Schema 与执行契约见[设计文档](docs/agent-skill-test-framework-design.md)。
5
+ `yama` 是一个可复现的 Agent Skill 评测框架:用声明式 YAML Case 描述模型看到的 System Prompt、Skill metadata、Tool Schema 与多轮 User Message,通过 OpenAI-compatible chat completions endpoint 调用 LLM 并驱动 Tool Loop,再对 Transcript 做确定性 Hard Check 或 LLM Judge 评分。完整 Case Schema 与执行契约见[设计文档](docs/agent-skill-test-framework-design.md)。
6
6
 
7
7
  ## 快速开始
8
8
 
9
9
  ```bash
10
10
  # 在 Plugin 根目录下直接运行,默认收集 __evals__/cases/**/*.yaml
11
11
  cd dingding-simple
12
- OPENAI_API_KEY=... uv run --project yama yama
12
+ YAMA_LLM_API_KEY=... uv run --project yama yama
13
13
 
14
14
  # 在 Workspace 根目录(存在 yama.toml)按名字指定 Plugin
15
- OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
15
+ YAMA_LLM_API_KEY=... uv run --project yama yama --plugin dingding-simple
16
16
  ```
17
17
 
18
- 也可以把凭据写进 `.env` 文件,省去每次命令前缀:CLI 启动时会从当前目录向上查找并加载最近的 `.env`(已在环境中设置的变量不会被覆盖)。
18
+ 也可以把凭据写进 `.env` 文件,省去每次命令前缀:CLI 启动时会从当前目录向上查找并加载最近的 `.env`(已在环境中设置的变量不会被覆盖)。默认 endpoint 可用 `YAMA_LLM_BASE_URL` 覆盖。
19
+
20
+ ### Judge 路由
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 设置。
19
23
 
20
24
  ## 编写一个 Case
21
25
 
@@ -52,6 +56,7 @@ outcome:
52
56
  - `description`(可选)是一句话说明当前 Case 测试什么;会展示在 CLI 输出和 HTML 报告中。
53
57
  - `context.tools` 是发给模型的 Tool Schema,`mocks.tools` 是 Runner 收到 Tool Call 后如何返回结果;两者的 Tool 名字集合必须完全一致。
54
58
  - 需要 Skill 时在 `context.skills` 中按名字声明,并在 `context.tools` 中同时声明 `{builtin: skill}`;模型通过 `skill(name, file?, call_reason?)` 读取正文。
59
+ - Skill 优先解析 `<plugin-root>/skills/<name>/SKILL.md`。本地不存在时,只有 `<plugin-root>/config.json` 的 `skill_refs` 显式声明了该名字,Yama 才会从同级 `.common-skills/<name>/versions/...` 加载;缺失且未声明会在 collection 阶段报错。
55
60
  - 需要模拟命令行工具时声明 `{builtin: bash}`,在 `mocks.cli` 中按命令配置输出。
56
61
  - `steps[].assert.hard` 是确定性检查(`tool_called`、`tool_arguments`、`assistant_contains` 等九种类型);未打 tag 的 hard check 默认必须全部通过。还可以加 `assert.judge` 做 LLM 打分。
57
62
 
@@ -72,6 +77,7 @@ uv run --project yama yama --plugin dingding-simple --report
72
77
  | `-k, --filter PATTERN`(可重复) | 只运行 case key(相对 Plugin Root 的路径)匹配 PATTERN 的 Case——默认子串匹配,PATTERN 含 `*` `?` `[` 时按 fnmatch 通配符匹配;传多个时命中任意一个即运行 |
73
78
  | `--result-dir PATH` | 覆盖产物根目录(默认 `<plugin_root>/.yama/runs`) |
74
79
  | `--concurrency N` | 同时运行的 Case 数上限(默认 10;`1` 表示逐个顺序执行) |
80
+ | `--run-concurrency N` | 所有 Case 的活跃 run 总上限(默认 32) |
75
81
  | `--report [PATH]` | 额外生成单文件 HTML 报告。省略 PATH 时写带时间戳的 `.yama/reports/report-<ts>.html`(历史累积),并把 `.yama/reports/latest.html` 维护成指向最新报告的软链;显式给 PATH 时精确写到该文件 |
76
82
  | `--preview` | 不运行、不发起任何 LLM 调用:解析收集到的 Case 后生成用例预览 HTML(默认 `.yama/reports/preview.html`,`--report PATH` 可覆盖);与 `--json` 组合时改为向 stdout 打印 JSON 预览 |
77
83
  | `--list` | 只打印匹配到的 Case,不运行 |
@@ -93,10 +99,10 @@ uv run --project yama yama dashboard --plugin dingding-simple
93
99
 
94
100
  ```bash
95
101
  uv run --project yama yama pr-plan --base origin/main --json
96
- OPENAI_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
102
+ YAMA_LLM_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
97
103
  ```
98
104
 
99
- `yama pr-plan` 只计算 PR 范围内要跑的 eval,不发起模型调用。`yama pr-run` 执行同一套选择逻辑,并写出供外部 CI 渲染或上传的 JSON summary;凭据继续通过环境变量或 `.env` 提供,不增加 CLI 参数。`pr-run` 会忽略 Case 里的 backend 设置,固定把内置 bash 执行强制为 Linux `linux-bubblewrap` 沙箱,因此 runner 必须是 Linux 且安装 `bwrap`/`bubblewrap`。CI workflow 示例和 summary JSON 契约见 [CI 接入指南](docs/pr-evals-ci-integration.zh-CN.md)。
105
+ `yama pr-plan` 只计算 PR 范围内要跑的 eval,不发起模型调用。`yama pr-run` 执行同一套选择逻辑,并写出供外部 CI 渲染或上传的 JSON summary;被评测 Agent 和 Judge 的调用都只走 API,凭据继续通过环境变量或 `.env` 提供,不增加 CLI 参数。`pr-run` 会忽略 Case 里的 backend 设置,固定把内置 bash 执行强制为 Linux `linux-bubblewrap` 沙箱,因此 runner 必须是 Linux 且安装 `bwrap`/`bubblewrap`。CI workflow 示例和 summary JSON 契约见 [CI 接入指南](docs/pr-evals-ci-integration.zh-CN.md)。
100
106
 
101
107
  CI 需要把报告发布到 Yama Eval Report 服务时,在 `--report` 之外加
102
108
  `--upload-report --commit-id <sha>`。命令从环境变量读取 `ADMIN_HOST` 和
@@ -105,4 +111,4 @@ CI 需要把报告发布到 Yama Eval Report 服务时,在 `--report` 之外
105
111
 
106
112
  ### 输出
107
113
 
108
- 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。
114
+ 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。