python-yama 0.5.0__tar.gz → 0.6.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.5.0 → python_yama-0.6.0}/PKG-INFO +1 -1
- {python_yama-0.5.0 → python_yama-0.6.0}/docs/agent-skill-test-framework-design.md +72 -18
- python_yama-0.6.0/docs/case-schema-reference.md +976 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/skills/eval-plugin-with-yama/SKILL.md +108 -4
- {python_yama-0.5.0 → python_yama-0.6.0}/skills/eval-plugin-with-yama/references/case-schema.md +18 -3
- {python_yama-0.5.0 → python_yama-0.6.0}/skills/eval-plugin-with-yama/references/debugging.md +16 -1
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_assertions.py +68 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_cli.py +238 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_framework.py +1 -1
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_report.py +135 -0
- python_yama-0.6.0/tests/test_runner.py +325 -0
- python_yama-0.6.0/tests/test_thread_case.py +807 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/assertions.py +32 -3
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/cli.py +121 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/report.py +71 -2
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/runner.py +114 -4
- python_yama-0.6.0/yama/thread_case.py +401 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/.github/workflows/publish.yml +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/.gitignore +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/CLAUDE.md +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/LICENSE +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/README.md +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/README.zh-CN.md +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/docs/yama-intro.html +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/pyproject.toml +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_cli_shim.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_dashboard.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_llm.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_main_entrypoint.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_mocks.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_preview.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_public_api.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_run_plan.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_skill_tool.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_tool_loader.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_usage.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/tests/test_workspace.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/uv.lock +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/__init__.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/__main__.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/dashboard.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/llm.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/loaders/__init__.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/loaders/case.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/loaders/common.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/loaders/tool_loader.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/mocks.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/models.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/preview.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/__init__.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/base.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/bash/__init__.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/bash/_cli_shim.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/bash/bash.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/bash/fs.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/skill/__init__.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.0}/yama/tools/skill/skill.py +0 -0
- {python_yama-0.5.0 → python_yama-0.6.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.6.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
|
|
@@ -1155,11 +1155,12 @@ Provider 凭据由 LiteLLM 从其标准环境变量或运行环境读取,不
|
|
|
1155
1155
|
}
|
|
1156
1156
|
},
|
|
1157
1157
|
"resolved_provider": { "name": "openrouter", "model": "openrouter/anthropic/claude-sonnet-4.6" },
|
|
1158
|
-
"response": { "role": "assistant", "content": "..." }
|
|
1158
|
+
"response": { "role": "assistant", "content": "..." },
|
|
1159
|
+
"duration_ms": 842.317
|
|
1159
1160
|
}
|
|
1160
1161
|
```
|
|
1161
1162
|
|
|
1162
|
-
`resolved_provider` 是原设计未提及的额外字段(来自 `LLMClient.last_provider`);请求失败时该记录会多一个 `"error": "<ExceptionType>: <message>"` 字段,而不是 `response
|
|
1163
|
+
`resolved_provider` 是原设计未提及的额外字段(来自 `LLMClient.last_provider`);请求失败时该记录会多一个 `"error": "<ExceptionType>: <message>"` 字段,而不是 `response`。`duration_ms` 由 `runner.py:_run_step` 用 `time.perf_counter()` 环绕 `self.llm.complete` 调用测得(四舍五入到 3 位小数),记录这一轮从发起调用到拿到返回(或抛出异常)的耗时,成功、失败都会写入。执行时间线里每次 assistant 响应的摘要行、以及 run 底部 `LLM requests (N)` 里每条 Request 的摘要行,都会在 token 用量后追加这个耗时(`N ms`,`report.py:_duration_inline`)。时间线里嵌套的 `LLM request` 折叠卡仍然只渲染 `invocation.method` 和 `invocation.arguments`(响应已经在上方的 Assistant text content 里展示,不重复);run 底部 `LLM requests (N)` 列表里的每条 Request 除了同样的 Method / Arguments,还会追加一个 Response 区块——成功时是这一轮模型返回的完整 assistant message(含 `tool_calls`),失败时是报错文本(`report.py:_render_llm_response_details`)。`step_id`、`request_index`、`resolved_provider` 均不伪装成模型调用参数。
|
|
1163
1164
|
|
|
1164
1165
|
Judge 使用的模型写在 `steps[].assert.judge.model` 或全局 Judge 配置中(省略时回退到当前 Case 的 `model`,见 12.2 节)。
|
|
1165
1166
|
|
|
@@ -1702,23 +1703,33 @@ assert:
|
|
|
1702
1703
|
|
|
1703
1704
|
断言默认只作用于当前 Step;需要检查最终跨 Step 状态时,使用 Python Checker 或 `outcome` 中的 Case 级要求。`assistant_semantic_count` 的实际语义见 12.1 节——它并非真正的语义理解,而是大小写不敏感的字面子串计数,命名有历史包袱。
|
|
1704
1705
|
|
|
1706
|
+
`assert.hard` 每条断言还可以带一个可选的 `tag` 平级字段(断言类型 key 之外的
|
|
1707
|
+
另一个 key,同一条断言最多一个 tag),用于在 8.8 节的 `outcome.require.tags`
|
|
1708
|
+
里按 tag 设置不同的通过率容忍度;不打 tag 的断言默认归入 `must_pass`。允许的 tag
|
|
1709
|
+
固定为 `must_pass` / `high_confidence` / `tolerant` / `informational` 四种,写其它
|
|
1710
|
+
值会在运行时报 `AssertionConfigurationError`。
|
|
1711
|
+
|
|
1705
1712
|
### 8.8 `outcome`:整个 Case 的最终门槛
|
|
1706
1713
|
|
|
1707
1714
|
```yaml
|
|
1708
1715
|
outcome:
|
|
1709
1716
|
require:
|
|
1710
|
-
|
|
1717
|
+
tags:
|
|
1718
|
+
high_confidence: 0.9
|
|
1719
|
+
tolerant: 0.8
|
|
1720
|
+
informational: 0.0
|
|
1711
1721
|
judge:
|
|
1712
1722
|
overall_gte: 0.8
|
|
1713
1723
|
each_dimension_gte: 0.6
|
|
1714
1724
|
```
|
|
1715
1725
|
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
`
|
|
1721
|
-
|
|
1726
|
+
判定逻辑由 `runner.py` 里的共享函数 `tag_pass_summary(steps, outcome)` 计算:按每条
|
|
1727
|
+
hard check 的固定 tag 分组(未打 tag 的默认归入 `must_pass`),每组算
|
|
1728
|
+
`rate = passed / total`,阈值取 `outcome.require.tags` 里对应 tag 的配置值或固定默认
|
|
1729
|
+
值。默认阈值为:`must_pass: 1.0`(固定,不可降低)、`high_confidence: 0.9`、
|
|
1730
|
+
`tolerant: 0.8`、`informational: 0.0`。这就是"所有未标注断言都必须通过"这条旧规则
|
|
1731
|
+
的等价表述(详见 12.3 节)。`judge.overall_gte`/`judge.each_dimension_gte` 仍是真实
|
|
1732
|
+
读取的配置键。Judge 门槛只决定质量是否达标,不会把协议错误变成通过。
|
|
1722
1733
|
|
|
1723
1734
|
### 8.9 完整示例:用人物图片与歌曲规划 MV 风格
|
|
1724
1735
|
|
|
@@ -1791,7 +1802,6 @@ steps:
|
|
|
1791
1802
|
|
|
1792
1803
|
outcome:
|
|
1793
1804
|
require:
|
|
1794
|
-
hard_checks: all_pass
|
|
1795
1805
|
judge: { overall_gte: 0.8 }
|
|
1796
1806
|
```
|
|
1797
1807
|
|
|
@@ -2533,16 +2543,27 @@ Judge 实际返回的结构化结果(`run_judge` 在 Judge LLM 的原始输出
|
|
|
2533
2543
|
```yaml
|
|
2534
2544
|
outcome:
|
|
2535
2545
|
require:
|
|
2536
|
-
|
|
2546
|
+
tags:
|
|
2547
|
+
high_confidence: 0.9
|
|
2548
|
+
tolerant: 0.8
|
|
2549
|
+
informational: 0.0
|
|
2537
2550
|
judge:
|
|
2538
2551
|
overall_gte: 0.8
|
|
2539
2552
|
each_dimension_gte: 0.6
|
|
2540
2553
|
```
|
|
2541
2554
|
|
|
2542
2555
|
`judge.overall_gte`/`judge.each_dimension_gte` 是真实生效的配置键(对所有跑过 Judge
|
|
2543
|
-
的 Step 的 `overall
|
|
2544
|
-
|
|
2545
|
-
|
|
2556
|
+
的 Step 的 `overall`/各维度分别取阈值)。`outcome.require.tags` 按固定 tag 设置
|
|
2557
|
+
hard check 的通过率阈值(`[0, 1]` 区间的数字):`runner.py:tag_pass_summary`
|
|
2558
|
+
按这次 run 里每条 hard check 的 tag 分组,算出 `rate = passed / total`,与该 tag
|
|
2559
|
+
的阈值比较。允许的 tag 固定为 `must_pass` / `high_confidence` / `tolerant` /
|
|
2560
|
+
`informational` 四种;断言未写 tag 时归入 `must_pass`。默认阈值分别是
|
|
2561
|
+
`1.0` / `0.9` / `0.8` / `0.0`,其中 `must_pass` 固定为 `1.0` 不可降低。完全不使用
|
|
2562
|
+
这个字段的 Case 行为不变:所有断言都落进 `must_pass`,等价于旧版"所有 Step 必须
|
|
2563
|
+
hard_pass"这条规则。未知 tag/key、阈值不是 `[0, 1]` 区间内的数字、或试图降低
|
|
2564
|
+
`must_pass`,都会在运行时抛 `AssertionConfigurationError`,体现为这次 run 的
|
|
2565
|
+
`error`。`_case_passed` 的判定顺序是:先看 `tag_pass_summary` 的每个分组是否都
|
|
2566
|
+
`ok`,任一不 `ok` 直接判失败;再走 Judge 门槛。
|
|
2546
2567
|
|
|
2547
2568
|
实际的最终结果结构是 `CaseResult`(`runner.py`),**不存在**原设计设想的
|
|
2548
2569
|
`{"passed", "hard_pass", "judge_pass", "quality_score", "reason"}` 这种顶层扁平
|
|
@@ -2555,6 +2576,9 @@ outcome:
|
|
|
2555
2576
|
"passed": true,
|
|
2556
2577
|
"pass_rate": 1.0,
|
|
2557
2578
|
"usage": { "prompt_tokens": 2000, "completion_tokens": 460, "total_tokens": 2460 },
|
|
2579
|
+
"tag_summary": {
|
|
2580
|
+
"must_pass": { "passed": 4, "total": 4, "rate": 1.0, "threshold": 1.0, "ok": true }
|
|
2581
|
+
},
|
|
2558
2582
|
"runs": [
|
|
2559
2583
|
{
|
|
2560
2584
|
"run_index": 1,
|
|
@@ -2565,7 +2589,10 @@ outcome:
|
|
|
2565
2589
|
"mock_events": [ "..." ],
|
|
2566
2590
|
"mock_state": { "...": "..." },
|
|
2567
2591
|
"requests": [ "..." ],
|
|
2568
|
-
"artifact_dir": ".yama/runs/.../run-001"
|
|
2592
|
+
"artifact_dir": ".yama/runs/.../run-001",
|
|
2593
|
+
"tag_summary": {
|
|
2594
|
+
"must_pass": { "passed": 4, "total": 4, "rate": 1.0, "threshold": 1.0, "ok": true }
|
|
2595
|
+
}
|
|
2569
2596
|
}
|
|
2570
2597
|
]
|
|
2571
2598
|
}
|
|
@@ -2573,8 +2600,8 @@ outcome:
|
|
|
2573
2600
|
|
|
2574
2601
|
(Case/run 级的 `usage` 是第 11 节所述的聚合结果;无任何用量数据时为 `null`。)
|
|
2575
2602
|
|
|
2576
|
-
质量分不能抵消硬检查失败:`_case_passed`
|
|
2577
|
-
|
|
2603
|
+
质量分不能抵消硬检查失败:`_case_passed` 先算 `tag_pass_summary`(见 12.3 节),
|
|
2604
|
+
任一分组不达标就直接返回 `False`,Judge 相关逻辑不会再被求值。
|
|
2578
2605
|
|
|
2579
2606
|
## 13. 多 Plugin 隔离与报告
|
|
2580
2607
|
|
|
@@ -2611,7 +2638,10 @@ Step——不是按 Plugin 拆开的多个文件,也没有 JSON 版的 `summar
|
|
|
2611
2638
|
用量(第 11 节的聚合链)在报告的每一层都有展示:顶部摘要多一张「LLM tokens」
|
|
2612
2639
|
卡片(总量 + in/out 拆分),Case 头部 metadata 多一格逐 Case 汇总,Run/Step 的
|
|
2613
2640
|
summary 行、执行时间线里的每次 assistant 响应、LLM requests 诊断列表和 Judge
|
|
2614
|
-
小节各自带本层级的 token 数;没有用量数据的层级显示 `–` 或不显示。
|
|
2641
|
+
小节各自带本层级的 token 数;没有用量数据的层级显示 `–` 或不显示。Case 头部还会
|
|
2642
|
+
展示 **Case tag summary**:如果只跑一次,它等于唯一 run 的 tag 结果;如果跑多次,
|
|
2643
|
+
按同名 tag 汇总所有 run 的 `passed/total` 后重新计算整体 `rate` 和 `ok`。每个 run
|
|
2644
|
+
明细内部仍保留 **Pass rate by tag** 折叠表,展示该 run 自己的 tag 通过率。
|
|
2615
2645
|
|
|
2616
2646
|
跑了多个 run 的 Case(`len(runs) > 1`)在 metadata 与 Planned runs 折叠卡之间
|
|
2617
2647
|
多一节 **Run comparison**(`report.py:_render_run_comparison`):
|
|
@@ -2813,6 +2843,30 @@ stderr,保证 stdout 是纯 JSON);`--list` 只打印 `case_key` 列表,
|
|
|
2813
2843
|
Case;`--preview` 在收集/解析之后、执行之前返回(LLM client 根本不会被构造),
|
|
2814
2844
|
`--list` 与 `--preview` 同时给出时 `--list` 优先。
|
|
2815
2845
|
|
|
2846
|
+
`yama from-thread` 是 `cli.py:main` 里的独立子命令分支(和 `dashboard` 一样在主 parser
|
|
2847
|
+
之前按 `argv[:1]` 分发),用于把后台某条模型调用记录转换为 Case YAML 起点。它从选中
|
|
2848
|
+
record 的 request 生成 `context.skills`/`context.tools`/`context.messages`;传入
|
|
2849
|
+
`--commit-id` 时通过 SSH `git show <commit>:dsl.json` 取得 DSL 并写入
|
|
2850
|
+
`mocks.state.dsl`。当 DSL workflow 和 request history 足够完整时,还会自动生成一条
|
|
2851
|
+
`steps[]`:
|
|
2852
|
+
|
|
2853
|
+
- 当前 step id 来自 `dsl.workflow.steps`,优先第一条 `status == "in_progress"`,否则取
|
|
2854
|
+
第一条非 `completed`/`skipped`;若全部完成/跳过、没有 DSL、或步骤缺少 id,则不填充
|
|
2855
|
+
step。
|
|
2856
|
+
- 最近一条非纯 `<system-reminder>...</system-reminder>` 的用户消息成为
|
|
2857
|
+
`steps[0].user`,`context.messages` 截断到这条消息之前,避免运行 Case 时重复发送同一
|
|
2858
|
+
用户回合。
|
|
2859
|
+
- 如果该用户消息下一条就是纯 `<system-reminder>` 用户消息,则写入
|
|
2860
|
+
`steps[0].message_inject`,`position: after_user_message`。
|
|
2861
|
+
- 从该用户消息之后的 assistant tool calls 和选中 record 的 response message 中收集
|
|
2862
|
+
Tool 名,按首次出现顺序聚合调用次数,生成带 `times: <count>` 和 `tag: must_pass`
|
|
2863
|
+
的 `tool_called` hard checks。
|
|
2864
|
+
|
|
2865
|
+
自动 step 只表达“复现这一轮输入并期待相同 Tool 类型被调用”。它不生成 `mocks.tools`、
|
|
2866
|
+
更精细的参数断言或 Judge;这些仍由 Case 作者按评测目标补齐。生成的 Case 会固定写入
|
|
2867
|
+
`outcome.require.hard_checks: all_pass`。若无法推导当前 workflow step 或真实用户输入,
|
|
2868
|
+
则保留 `steps: []`,stdout 仍只输出 YAML,stderr 只输出 record/response/DSL 抓取诊断信息。
|
|
2869
|
+
|
|
2816
2870
|
`cli.py:main` 的错误出口按层归类(退出码都是 2):`ConfigurationError`/
|
|
2817
2871
|
`CollectionError`/`ValueError` 打印 `Collection error: ...`(Case 还没跑起来,
|
|
2818
2872
|
问题出在工作区配置或 Case 收集/解析);`LLMError` 单独打印 `LLM error: ...`——
|