python-yama 0.6.0__tar.gz → 0.8.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.6.0 → python_yama-0.8.0}/PKG-INFO +12 -4
- {python_yama-0.6.0 → python_yama-0.8.0}/README.md +11 -3
- {python_yama-0.6.0 → python_yama-0.8.0}/README.zh-CN.md +11 -3
- {python_yama-0.6.0 → python_yama-0.8.0}/docs/agent-skill-test-framework-design.md +171 -75
- {python_yama-0.6.0 → python_yama-0.8.0}/docs/case-schema-reference.md +43 -30
- {python_yama-0.6.0 → python_yama-0.8.0}/skills/eval-plugin-with-yama/SKILL.md +74 -92
- {python_yama-0.6.0 → python_yama-0.8.0}/skills/eval-plugin-with-yama/references/case-schema.md +51 -17
- {python_yama-0.6.0 → python_yama-0.8.0}/skills/eval-plugin-with-yama/references/debugging.md +53 -25
- python_yama-0.8.0/skills/eval-plugin-with-yama/references/install-upgrade.md +84 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_cli.py +418 -1
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_framework.py +264 -0
- python_yama-0.8.0/tests/test_pr.py +474 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_preview.py +1 -1
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_report.py +226 -28
- python_yama-0.8.0/tests/test_runner.py +618 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_thread_case.py +37 -6
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/cli.py +311 -21
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/loaders/case.py +46 -19
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/loaders/tool_loader.py +6 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/models.py +2 -0
- python_yama-0.8.0/yama/pr.py +350 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/report.py +192 -62
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/runner.py +159 -18
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/thread_case.py +3 -3
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/bash/bash.py +6 -1
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/bash/fs.py +58 -1
- python_yama-0.6.0/tests/test_runner.py +0 -325
- {python_yama-0.6.0 → python_yama-0.8.0}/.github/workflows/publish.yml +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/.gitignore +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/CLAUDE.md +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/LICENSE +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/docs/yama-intro.html +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/pyproject.toml +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_assertions.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_cli_shim.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_dashboard.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_llm.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_main_entrypoint.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_mocks.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_public_api.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_run_plan.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_skill_tool.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_tool_loader.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_usage.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/tests/test_workspace.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/uv.lock +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/__init__.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/__main__.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/assertions.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/dashboard.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/llm.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/loaders/__init__.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/loaders/common.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/mocks.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/preview.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/__init__.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/base.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/bash/__init__.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/bash/_cli_shim.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/skill/__init__.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.0}/yama/tools/skill/skill.py +0 -0
- {python_yama-0.6.0 → python_yama-0.8.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.8.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
|
|
@@ -72,15 +72,14 @@ steps:
|
|
|
72
72
|
- assistant_contains: creative direction
|
|
73
73
|
|
|
74
74
|
outcome:
|
|
75
|
-
require:
|
|
76
|
-
hard_checks: all_pass
|
|
75
|
+
require: {}
|
|
77
76
|
```
|
|
78
77
|
|
|
79
78
|
- `description` (optional) is a one-line summary of what the Case tests; it is shown in the CLI output and the HTML report.
|
|
80
79
|
- `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.
|
|
81
80
|
- 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?)`.
|
|
82
81
|
- To simulate command-line tools, declare `{builtin: bash}` and configure per-command output under `mocks.cli`.
|
|
83
|
-
- `steps[].assert.hard` are deterministic checks (nine types, including `tool_called`, `tool_arguments`, and `assistant_contains`);
|
|
82
|
+
- `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.
|
|
84
83
|
|
|
85
84
|
For the full schema (every Skill/tool/mock form, the `bash` sandbox, message injection, judge configuration, and more), see the [design doc](https://github.com/world-sim-dev/yama/blob/main/docs/agent-skill-test-framework-design.md) (Chinese).
|
|
86
85
|
|
|
@@ -115,6 +114,15 @@ uv run --project yama yama dashboard --plugin dingding-simple
|
|
|
115
114
|
|
|
116
115
|
`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
116
|
|
|
117
|
+
### PR evals
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
uv run --project yama yama pr-plan --base origin/main --json
|
|
121
|
+
OPENAI_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`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.
|
|
125
|
+
|
|
118
126
|
### Output
|
|
119
127
|
|
|
120
128
|
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.
|
|
@@ -46,15 +46,14 @@ steps:
|
|
|
46
46
|
- assistant_contains: creative direction
|
|
47
47
|
|
|
48
48
|
outcome:
|
|
49
|
-
require:
|
|
50
|
-
hard_checks: all_pass
|
|
49
|
+
require: {}
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
- `description` (optional) is a one-line summary of what the Case tests; it is shown in the CLI output and the HTML report.
|
|
54
53
|
- `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.
|
|
55
54
|
- 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?)`.
|
|
56
55
|
- To simulate command-line tools, declare `{builtin: bash}` and configure per-command output under `mocks.cli`.
|
|
57
|
-
- `steps[].assert.hard` are deterministic checks (nine types, including `tool_called`, `tool_arguments`, and `assistant_contains`);
|
|
56
|
+
- `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.
|
|
58
57
|
|
|
59
58
|
For the full schema (every Skill/tool/mock form, the `bash` sandbox, message injection, judge configuration, and more), see the [design doc](https://github.com/world-sim-dev/yama/blob/main/docs/agent-skill-test-framework-design.md) (Chinese).
|
|
60
59
|
|
|
@@ -89,6 +88,15 @@ uv run --project yama yama dashboard --plugin dingding-simple
|
|
|
89
88
|
|
|
90
89
|
`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
90
|
|
|
91
|
+
### PR evals
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
uv run --project yama yama pr-plan --base origin/main --json
|
|
95
|
+
OPENAI_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`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.
|
|
99
|
+
|
|
92
100
|
### Output
|
|
93
101
|
|
|
94
102
|
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.
|
|
@@ -46,15 +46,14 @@ steps:
|
|
|
46
46
|
- assistant_contains: 创意方向
|
|
47
47
|
|
|
48
48
|
outcome:
|
|
49
|
-
require:
|
|
50
|
-
hard_checks: all_pass
|
|
49
|
+
require: {}
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
- `description`(可选)是一句话说明当前 Case 测试什么;会展示在 CLI 输出和 HTML 报告中。
|
|
54
53
|
- `context.tools` 是发给模型的 Tool Schema,`mocks.tools` 是 Runner 收到 Tool Call 后如何返回结果;两者的 Tool 名字集合必须完全一致。
|
|
55
54
|
- 需要 Skill 时在 `context.skills` 中按名字声明,并在 `context.tools` 中同时声明 `{builtin: skill}`;模型通过 `skill(name, file?, call_reason?)` 读取正文。
|
|
56
55
|
- 需要模拟命令行工具时声明 `{builtin: bash}`,在 `mocks.cli` 中按命令配置输出。
|
|
57
|
-
- `steps[].assert.hard` 是确定性检查(`tool_called`、`tool_arguments`、`assistant_contains`
|
|
56
|
+
- `steps[].assert.hard` 是确定性检查(`tool_called`、`tool_arguments`、`assistant_contains` 等九种类型);未打 tag 的 hard check 默认必须全部通过。还可以加 `assert.judge` 做 LLM 打分。
|
|
58
57
|
|
|
59
58
|
完整 Schema(Skill/Tool/Mock 的全部写法、`bash` 沙箱、Message Injection、Judge 配置等)见[设计文档](docs/agent-skill-test-framework-design.md)。
|
|
60
59
|
|
|
@@ -89,6 +88,15 @@ uv run --project yama yama dashboard --plugin dingding-simple
|
|
|
89
88
|
|
|
90
89
|
`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
90
|
|
|
91
|
+
### PR eval
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
uv run --project yama yama pr-plan --base origin/main --json
|
|
95
|
+
OPENAI_API_KEY=... uv run --project yama yama pr-run --base origin/main --report --json-summary yama-pr-summary.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`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)。
|
|
99
|
+
|
|
92
100
|
### 输出
|
|
93
101
|
|
|
94
102
|
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。
|