python-yama 0.2.0__tar.gz → 0.4.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.2.0 → python_yama-0.4.0}/PKG-INFO +9 -2
- {python_yama-0.2.0 → python_yama-0.4.0}/README.md +8 -1
- {python_yama-0.2.0 → python_yama-0.4.0}/README.zh-CN.md +8 -1
- {python_yama-0.2.0 → python_yama-0.4.0}/docs/agent-skill-test-framework-design.md +285 -60
- {python_yama-0.2.0 → python_yama-0.4.0}/skills/eval-plugin-with-yama/SKILL.md +20 -5
- {python_yama-0.2.0 → python_yama-0.4.0}/skills/eval-plugin-with-yama/references/case-schema.md +41 -5
- {python_yama-0.2.0 → python_yama-0.4.0}/skills/eval-plugin-with-yama/references/debugging.md +10 -4
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_assertions.py +23 -2
- python_yama-0.4.0/tests/test_cli.py +821 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_framework.py +306 -0
- python_yama-0.4.0/tests/test_report.py +220 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_skill_tool.py +18 -2
- python_yama-0.4.0/tests/test_tool_loader.py +343 -0
- python_yama-0.4.0/tests/test_usage.py +224 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_workspace.py +69 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/assertions.py +4 -0
- python_yama-0.4.0/yama/cli.py +672 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/llm.py +31 -1
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/loaders/case.py +19 -33
- python_yama-0.4.0/yama/loaders/tool_loader.py +324 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/models.py +2 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/report.py +80 -9
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/runner.py +99 -3
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/bash/fs.py +13 -2
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/skill/skill.py +8 -2
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/workspace.py +29 -0
- python_yama-0.2.0/tests/test_cli.py +0 -291
- python_yama-0.2.0/tests/test_report.py +0 -101
- python_yama-0.2.0/yama/cli.py +0 -317
- python_yama-0.2.0/yama/loaders/tool_loader.py +0 -173
- {python_yama-0.2.0 → python_yama-0.4.0}/.github/workflows/publish.yml +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/.gitignore +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/CLAUDE.md +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/LICENSE +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/pyproject.toml +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_cli_shim.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_main_entrypoint.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_mocks.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/tests/test_public_api.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/uv.lock +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/__init__.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/__main__.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/loaders/__init__.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/loaders/common.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/mocks.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/__init__.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/base.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/bash/__init__.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/bash/_cli_shim.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/bash/bash.py +0 -0
- {python_yama-0.2.0 → python_yama-0.4.0}/yama/tools/skill/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-yama
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.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
|
|
@@ -45,6 +45,8 @@ OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
|
45
45
|
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):
|
|
46
46
|
|
|
47
47
|
```yaml
|
|
48
|
+
description: The model reads the DSL before proposing creative directions
|
|
49
|
+
|
|
48
50
|
context:
|
|
49
51
|
system_prompt: { default: true } # use SYSTEM.md from the plugin root
|
|
50
52
|
|
|
@@ -71,8 +73,9 @@ outcome:
|
|
|
71
73
|
hard_checks: all_pass
|
|
72
74
|
```
|
|
73
75
|
|
|
76
|
+
- `description` (optional) is a one-line summary of what the Case tests; it is shown in the CLI output and the HTML report.
|
|
74
77
|
- `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.
|
|
75
|
-
- 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?)`.
|
|
78
|
+
- 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?)`.
|
|
76
79
|
- To simulate command-line tools, declare `{builtin: bash}` and configure per-command output under `mocks.cli`.
|
|
77
80
|
- `steps[].assert.hard` are deterministic checks (nine types, including `tool_called`, `tool_arguments`, and `assistant_contains`); add `assert.judge` for LLM scoring.
|
|
78
81
|
|
|
@@ -90,10 +93,14 @@ uv run --project yama yama --plugin dingding-simple --report
|
|
|
90
93
|
| `--plugin-root PATH` | Use the given path as the single plugin root |
|
|
91
94
|
| `--plugin NAME` (repeatable) | Select plugins by name from `yama.toml` |
|
|
92
95
|
| `--all-plugins` | Run every plugin configured in `yama.toml` |
|
|
96
|
+
| `-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 |
|
|
93
97
|
| `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
|
|
98
|
+
| `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
|
|
94
99
|
| `--report [PATH]` | Also generate a single-file HTML report (default `.yama/reports/latest.html`) |
|
|
95
100
|
| `--list` | Only print the collected Cases, without running them |
|
|
96
101
|
| `--no-artifacts` | Write no artifact files at all |
|
|
97
102
|
| `--json` | Emit machine-readable JSON instead of Rich tables |
|
|
98
103
|
|
|
99
104
|
`--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
|
+
|
|
106
|
+
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.
|
|
@@ -20,6 +20,8 @@ OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
|
20
20
|
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):
|
|
21
21
|
|
|
22
22
|
```yaml
|
|
23
|
+
description: The model reads the DSL before proposing creative directions
|
|
24
|
+
|
|
23
25
|
context:
|
|
24
26
|
system_prompt: { default: true } # use SYSTEM.md from the plugin root
|
|
25
27
|
|
|
@@ -46,8 +48,9 @@ outcome:
|
|
|
46
48
|
hard_checks: all_pass
|
|
47
49
|
```
|
|
48
50
|
|
|
51
|
+
- `description` (optional) is a one-line summary of what the Case tests; it is shown in the CLI output and the HTML report.
|
|
49
52
|
- `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.
|
|
50
|
-
- 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?)`.
|
|
53
|
+
- 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?)`.
|
|
51
54
|
- To simulate command-line tools, declare `{builtin: bash}` and configure per-command output under `mocks.cli`.
|
|
52
55
|
- `steps[].assert.hard` are deterministic checks (nine types, including `tool_called`, `tool_arguments`, and `assistant_contains`); add `assert.judge` for LLM scoring.
|
|
53
56
|
|
|
@@ -65,10 +68,14 @@ uv run --project yama yama --plugin dingding-simple --report
|
|
|
65
68
|
| `--plugin-root PATH` | Use the given path as the single plugin root |
|
|
66
69
|
| `--plugin NAME` (repeatable) | Select plugins by name from `yama.toml` |
|
|
67
70
|
| `--all-plugins` | Run every plugin configured in `yama.toml` |
|
|
71
|
+
| `-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 |
|
|
68
72
|
| `--result-dir PATH` | Override the artifact root (default `<plugin_root>/.yama/runs`) |
|
|
73
|
+
| `--concurrency N` | Maximum number of cases running in parallel (default 10; `1` runs cases one at a time) |
|
|
69
74
|
| `--report [PATH]` | Also generate a single-file HTML report (default `.yama/reports/latest.html`) |
|
|
70
75
|
| `--list` | Only print the collected Cases, without running them |
|
|
71
76
|
| `--no-artifacts` | Write no artifact files at all |
|
|
72
77
|
| `--json` | Emit machine-readable JSON instead of Rich tables |
|
|
73
78
|
|
|
74
79
|
`--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
|
+
|
|
81
|
+
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.
|
|
@@ -20,6 +20,8 @@ OPENAI_API_KEY=... uv run --project yama yama --plugin dingding-simple
|
|
|
20
20
|
一个 Case 是一份 YAML 文件,按 `context`(模型看到什么)→ `mocks`(Tool 怎么被执行)→ `steps`(依次发送的用户回合与断言)→ `outcome`(整个 Case 的通过门槛)的结构组织:
|
|
21
21
|
|
|
22
22
|
```yaml
|
|
23
|
+
description: 模型应先读取 DSL 再给出创意方向
|
|
24
|
+
|
|
23
25
|
context:
|
|
24
26
|
system_prompt: { default: true } # 使用 Plugin 根目录下的 SYSTEM.md
|
|
25
27
|
|
|
@@ -46,8 +48,9 @@ outcome:
|
|
|
46
48
|
hard_checks: all_pass
|
|
47
49
|
```
|
|
48
50
|
|
|
51
|
+
- `description`(可选)是一句话说明当前 Case 测试什么;会展示在 CLI 输出和 HTML 报告中。
|
|
49
52
|
- `context.tools` 是发给模型的 Tool Schema,`mocks.tools` 是 Runner 收到 Tool Call 后如何返回结果;两者的 Tool 名字集合必须完全一致。
|
|
50
|
-
- 需要 Skill 时在 `context.skills` 中按名字声明,并在 `context.tools` 中同时声明 `{builtin: skill}`;模型通过 `skill(name, file?)` 读取正文。
|
|
53
|
+
- 需要 Skill 时在 `context.skills` 中按名字声明,并在 `context.tools` 中同时声明 `{builtin: skill}`;模型通过 `skill(name, file?, call_reason?)` 读取正文。
|
|
51
54
|
- 需要模拟命令行工具时声明 `{builtin: bash}`,在 `mocks.cli` 中按命令配置输出。
|
|
52
55
|
- `steps[].assert.hard` 是确定性检查(`tool_called`、`tool_arguments`、`assistant_contains` 等九种类型);还可以加 `assert.judge` 做 LLM 打分。
|
|
53
56
|
|
|
@@ -65,10 +68,14 @@ uv run --project yama yama --plugin dingding-simple --report
|
|
|
65
68
|
| `--plugin-root PATH` | 以指定路径作为单一 Plugin Root |
|
|
66
69
|
| `--plugin NAME`(可重复) | 按 `yama.toml` 中的 Plugin 名字选择 |
|
|
67
70
|
| `--all-plugins` | 运行 `yama.toml` 中配置的全部 Plugin |
|
|
71
|
+
| `-k, --filter PATTERN`(可重复) | 只运行 case key(相对 Plugin Root 的路径)匹配 PATTERN 的 Case——默认子串匹配,PATTERN 含 `*` `?` `[` 时按 fnmatch 通配符匹配;传多个时命中任意一个即运行 |
|
|
68
72
|
| `--result-dir PATH` | 覆盖产物根目录(默认 `<plugin_root>/.yama/runs`) |
|
|
73
|
+
| `--concurrency N` | 同时运行的 Case 数上限(默认 10;`1` 表示逐个顺序执行) |
|
|
69
74
|
| `--report [PATH]` | 额外生成单文件 HTML 报告(默认 `.yama/reports/latest.html`) |
|
|
70
75
|
| `--list` | 只打印匹配到的 Case,不运行 |
|
|
71
76
|
| `--no-artifacts` | 不写任何产物文件 |
|
|
72
77
|
| `--json` | 输出机器可读 JSON 而不是 Rich 表格 |
|
|
73
78
|
|
|
74
79
|
`--plugin`/`--all-plugins`/`--plugin-root` 三者互斥;都不提供时默认用当前目录向上搜索到的 `yama.toml` 所在目录作为 Workspace Root(找不到则用 cwd),把该目录当作单一 Plugin Root 运行。
|
|
80
|
+
|
|
81
|
+
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。
|