python-yama 0.10.6__tar.gz → 0.10.7__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 (76) hide show
  1. {python_yama-0.10.6 → python_yama-0.10.7}/PKG-INFO +1 -1
  2. {python_yama-0.10.6 → python_yama-0.10.7}/docs/agent-skill-test-framework-design.md +6 -4
  3. {python_yama-0.10.6 → python_yama-0.10.7}/skills/eval-plugin-with-yama/SKILL.md +11 -8
  4. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_cli.py +67 -4
  5. {python_yama-0.10.6 → python_yama-0.10.7}/yama/cli.py +20 -9
  6. {python_yama-0.10.6 → python_yama-0.10.7}/.github/workflows/publish.yml +0 -0
  7. {python_yama-0.10.6 → python_yama-0.10.7}/.gitignore +0 -0
  8. {python_yama-0.10.6 → python_yama-0.10.7}/CLAUDE.md +0 -0
  9. {python_yama-0.10.6 → python_yama-0.10.7}/LICENSE +0 -0
  10. {python_yama-0.10.6 → python_yama-0.10.7}/README.md +0 -0
  11. {python_yama-0.10.6 → python_yama-0.10.7}/README.zh-CN.md +0 -0
  12. {python_yama-0.10.6 → python_yama-0.10.7}/docs/case-schema-reference.md +0 -0
  13. {python_yama-0.10.6 → python_yama-0.10.7}/docs/superpowers/plans/2026-08-17-concurrency-defaults.md +0 -0
  14. {python_yama-0.10.6 → python_yama-0.10.7}/docs/superpowers/plans/2026-08-17-step-timeout-failure.md +0 -0
  15. {python_yama-0.10.6 → python_yama-0.10.7}/docs/superpowers/specs/2026-08-17-concurrency-defaults-design.md +0 -0
  16. {python_yama-0.10.6 → python_yama-0.10.7}/docs/superpowers/specs/2026-08-17-step-timeout-failure-design.md +0 -0
  17. {python_yama-0.10.6 → python_yama-0.10.7}/docs/yama-intro.html +0 -0
  18. {python_yama-0.10.6 → python_yama-0.10.7}/pyproject.toml +0 -0
  19. {python_yama-0.10.6 → python_yama-0.10.7}/skills/eval-plugin-with-yama/references/case-schema.md +0 -0
  20. {python_yama-0.10.6 → python_yama-0.10.7}/skills/eval-plugin-with-yama/references/debugging.md +0 -0
  21. {python_yama-0.10.6 → python_yama-0.10.7}/skills/eval-plugin-with-yama/references/install-upgrade.md +0 -0
  22. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_assertions.py +0 -0
  23. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_cli_shim.py +0 -0
  24. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_dashboard.py +0 -0
  25. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_framework.py +0 -0
  26. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_judge_llm.py +0 -0
  27. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_llm.py +0 -0
  28. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_main_entrypoint.py +0 -0
  29. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_mocks.py +0 -0
  30. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_openai_llm.py +0 -0
  31. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_pr.py +0 -0
  32. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_preview.py +0 -0
  33. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_public_api.py +0 -0
  34. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_report.py +0 -0
  35. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_report_bundle.py +0 -0
  36. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_report_upload.py +0 -0
  37. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_run_plan.py +0 -0
  38. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_runner.py +0 -0
  39. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_skill_loader.py +0 -0
  40. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_skill_tool.py +0 -0
  41. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_thread_case.py +0 -0
  42. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_tool_loader.py +0 -0
  43. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_usage.py +0 -0
  44. {python_yama-0.10.6 → python_yama-0.10.7}/tests/test_workspace.py +0 -0
  45. {python_yama-0.10.6 → python_yama-0.10.7}/uv.lock +0 -0
  46. {python_yama-0.10.6 → python_yama-0.10.7}/yama/__init__.py +0 -0
  47. {python_yama-0.10.6 → python_yama-0.10.7}/yama/__main__.py +0 -0
  48. {python_yama-0.10.6 → python_yama-0.10.7}/yama/assertions.py +0 -0
  49. {python_yama-0.10.6 → python_yama-0.10.7}/yama/dashboard.py +0 -0
  50. {python_yama-0.10.6 → python_yama-0.10.7}/yama/judge_llm.py +0 -0
  51. {python_yama-0.10.6 → python_yama-0.10.7}/yama/judge_routing.py +0 -0
  52. {python_yama-0.10.6 → python_yama-0.10.7}/yama/llm.py +0 -0
  53. {python_yama-0.10.6 → python_yama-0.10.7}/yama/loaders/__init__.py +0 -0
  54. {python_yama-0.10.6 → python_yama-0.10.7}/yama/loaders/case.py +0 -0
  55. {python_yama-0.10.6 → python_yama-0.10.7}/yama/loaders/common.py +0 -0
  56. {python_yama-0.10.6 → python_yama-0.10.7}/yama/loaders/skill_loader.py +0 -0
  57. {python_yama-0.10.6 → python_yama-0.10.7}/yama/loaders/tool_loader.py +0 -0
  58. {python_yama-0.10.6 → python_yama-0.10.7}/yama/mocks.py +0 -0
  59. {python_yama-0.10.6 → python_yama-0.10.7}/yama/models.py +0 -0
  60. {python_yama-0.10.6 → python_yama-0.10.7}/yama/openai_llm.py +0 -0
  61. {python_yama-0.10.6 → python_yama-0.10.7}/yama/pr.py +0 -0
  62. {python_yama-0.10.6 → python_yama-0.10.7}/yama/preview.py +0 -0
  63. {python_yama-0.10.6 → python_yama-0.10.7}/yama/report.py +0 -0
  64. {python_yama-0.10.6 → python_yama-0.10.7}/yama/report_bundle.py +0 -0
  65. {python_yama-0.10.6 → python_yama-0.10.7}/yama/report_upload.py +0 -0
  66. {python_yama-0.10.6 → python_yama-0.10.7}/yama/runner.py +0 -0
  67. {python_yama-0.10.6 → python_yama-0.10.7}/yama/thread_case.py +0 -0
  68. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/__init__.py +0 -0
  69. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/base.py +0 -0
  70. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/bash/__init__.py +0 -0
  71. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/bash/_cli_shim.py +0 -0
  72. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/bash/bash.py +0 -0
  73. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/bash/fs.py +0 -0
  74. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/skill/__init__.py +0 -0
  75. {python_yama-0.10.6 → python_yama-0.10.7}/yama/tools/skill/skill.py +0 -0
  76. {python_yama-0.10.6 → python_yama-0.10.7}/yama/workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: python-yama
3
- Version: 0.10.6
3
+ Version: 0.10.7
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
@@ -3145,10 +3145,12 @@ Case;`--preview` 在收集/解析之后、执行之前返回(LLM client 根
3145
3145
 
3146
3146
  `yama from-thread` 是 `cli.py:main` 里的独立子命令分支(和 `dashboard` 一样在主 parser
3147
3147
  之前按 `argv[:1]` 分发),用于把后台某条模型调用记录转换为 Case YAML 起点。它从选中
3148
- record 的 request 生成 `context.skills`/`context.tools`/`context.messages`;传入
3149
- `--commit-id` 时通过 SSH `git show <commit>:dsl.json` 取得 DSL 并写入
3150
- `mocks.state.dsl`。当 DSL workflow 和 request history 足够完整时,还会自动生成一条
3151
- `steps[]`:
3148
+ record 的 request 生成 `context.skills`/`context.tools`/`context.messages`。默认通过
3149
+ SSH `git show HEAD:dsl.json` 尝试读取目标 Thread 远端 workspace 当前检出提交的 DSL;
3150
+ 这里的 `HEAD` 不会触发 `git fetch`。读取成功时 DSL 写入 `mocks.state.dsl`;读取失败时
3151
+ stderr 打印 warning,并继续生成不含 DSL 的 Case 骨架。显式传入 `--commit-id <ref>`
3152
+ 则改为读取 `<ref>:dsl.json`,且读取失败保持 `ThreadCaseError`(退出码 2),不会降级。
3153
+ 当 DSL workflow 和 request history 足够完整时,还会自动生成一条 `steps[]`:
3152
3154
 
3153
3155
  模型记录的 HTTP transport 由 `YAMA_THREAD_HTTP_TRANSPORT` 控制,值会去除首尾空白并
3154
3156
  按大小写不敏感方式解析:
@@ -159,7 +159,8 @@ outcome:
159
159
 
160
160
  当用户说“把这次线上对话做成 eval”“复现这个 thread”“从 record 生成 case”时,先尝试从
161
161
  用户给出的 thread URL、record id、message id 或日志里提取 `--record-id` 所需的
162
- `thread_id, message_id`。缺 Bearer token、目标环境、具体 record 下标或是否抓 DSL 时再问。
162
+ `thread_id, message_id`。缺 Bearer token、目标环境、具体 record 下标,或需要历史 DSL
163
+ 但缺少对应 commit ref 时再问。
163
164
 
164
165
  不想手工誊抄某次真实对话的 System Prompt / Tool Schema / History 时,先把用户给出的
165
166
  thread URL、record id、message id、环境、record 下标、commit id 等信息转成对应的
@@ -178,20 +179,21 @@ yama from-thread \
178
179
  `<thread_id>-<message_id>.yaml`,便于从文件名反查来源对话。
179
180
  - `--token`(必填):调用 Admin API 的 Bearer Token。
180
181
  - `--env {dev,staging,prod}`(默认 `dev`;dev 和 staging 共用同一套 Base URL/SSH
181
- 配置):选择 Admin API Base URL;同时传了 `--commit-id` 时还决定 DSL 所在的
182
- SSH Host 与远端目录。
182
+ 配置):选择 Admin API Base URL,并决定 DSL 所在的 SSH Host 与远端目录。
183
183
  - `--thread-type {one_shot,interactive,streaming,adventurer,gamer,atelier}`:
184
184
  查询参数,不传就让服务端按 Thread 自身存的类型回退。
185
185
  - `--record-index`(默认 `-1`,即最后一条):一条 Message 可能挂了多条 Model
186
186
  Record,用它选具体第几条。
187
- - `--commit-id`:额外通过 SSH 执行 `git show <commit>:dsl.json` 抓取该 Thread
188
- 在某次提交时的 DSL,合并进生成的 `mocks.state.dsl`;不传就完全跳过 DSL 抓取。
187
+ - `--commit-id`:指定通过 SSH 执行 `git show <ref>:dsl.json` 所读取的 Git ref。
188
+ 不传时默认尝试 `HEAD:dsl.json`;这里的 `HEAD` 是远端 workspace 当前检出的提交,
189
+ 命令不会执行 `git fetch`。隐式 `HEAD` 读取失败时会在 stderr 警告并继续生成无 DSL
190
+ 骨架;显式 ref 读取失败则报 `ThreadCaseError` 并退出。
189
191
 
190
192
  stdout 只输出 Case YAML(可直接重定向进文件);stderr 打印选中 record 的定位信息
191
193
  (`provider_file`/`line_no`/`model`/`datetime`)和 response 预览,用来确认抓到的是不是
192
194
  想要的那次调用。生成的骨架里 `context.tools` 是把该次请求的 tools 逐个转成
193
195
  `inline` Schema,`context.skills` 是从 System Prompt 的 `<available_skills>` 块解出来的
194
- Skill 名列表;传了 `--commit-id` 时会把 DSL 放进 `mocks.state.dsl`。
196
+ Skill 名列表;DSL 获取成功时会把它放进 `mocks.state.dsl`。
195
197
 
196
198
  对 `from-thread` 生成的 Case,**除 `mocks.tools` 外,其它内容一律以 bash 命令输出为准**:
197
199
  不要用大模型改写 `context`、`steps`、`description`、`outcome`、自动生成的 hard checks 或
@@ -224,8 +226,9 @@ config/alias/版本路径和来源 record/commit 告诉用户。
224
226
  这类情况下先回到用户确认是否需要手写 Step,而不是直接用大模型猜写完整 Case。
225
227
 
226
228
  失败会在 stderr 打印 `Thread case error: ...`,退出码 2(Admin API 请求失败、
227
- `--record-id` 格式不对、record index 越界、SSH/`git show` 失败等都算这一类,和
228
- Collection error / LLM error 分属不同层级)。
229
+ `--record-id` 格式不对、record index 越界、显式 commit 的 SSH/`git show` 失败等都算
230
+ 这一类,和 Collection error / LLM error 分属不同层级)。默认隐式读取 `HEAD` 的
231
+ SSH/`git show` 失败是例外:它只打印 warning,然后返回无 DSL 骨架和退出码 0。
229
232
 
230
233
  ## 安装与升级
231
234
 
@@ -1618,6 +1618,8 @@ class FromThreadCommandTests(unittest.TestCase):
1618
1618
  stderr = io.StringIO()
1619
1619
  with patch(
1620
1620
  "yama.cli.fetch_model_records", return_value=self._fake_payload()
1621
+ ), patch(
1622
+ "yama.cli.fetch_dsl_at_commit", return_value={}
1621
1623
  ), contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(stderr):
1622
1624
  code = main(
1623
1625
  [
@@ -1659,6 +1661,8 @@ class FromThreadCommandTests(unittest.TestCase):
1659
1661
  def test_passes_record_id_to_case_builder(self) -> None:
1660
1662
  with patch(
1661
1663
  "yama.cli.fetch_model_records", return_value=self._fake_payload()
1664
+ ), patch(
1665
+ "yama.cli.fetch_dsl_at_commit", return_value={}
1662
1666
  ), patch(
1663
1667
  "yama.cli.build_case_dict", return_value={"context": {}, "steps": []}
1664
1668
  ) as build:
@@ -1758,13 +1762,46 @@ class FromThreadCommandTests(unittest.TestCase):
1758
1762
  self.assertEqual(code, 2)
1759
1763
  self.assertIn("Thread case error", stderr.getvalue())
1760
1764
 
1761
- def test_omitting_commit_id_never_calls_fetch_dsl_at_commit(self) -> None:
1765
+ def test_omitting_commit_id_fetches_dsl_from_head(self) -> None:
1766
+ stdout = io.StringIO()
1767
+ stderr = io.StringIO()
1768
+ dsl = {"workflow": {"steps": []}}
1769
+ with patch(
1770
+ "yama.cli.fetch_model_records", return_value=self._fake_payload()
1771
+ ), patch(
1772
+ "yama.cli.fetch_dsl_at_commit", return_value=dsl
1773
+ ) as fetch_dsl, contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(
1774
+ stderr
1775
+ ):
1776
+ code = main(
1777
+ [
1778
+ "from-thread",
1779
+ "--record-id", "th_1, msg_1",
1780
+ "--token", "tok",
1781
+ ]
1782
+ )
1783
+
1784
+ self.assertEqual(code, 0)
1785
+ fetch_dsl.assert_called_once_with(
1786
+ "th_1", "HEAD", "root@8.219.55.193", "/work/aion-runtime-v2-dev"
1787
+ )
1788
+ self.assertEqual(
1789
+ yaml.safe_load(stdout.getvalue())["mocks"],
1790
+ {"state": {"dsl": dsl}},
1791
+ )
1792
+ self.assertIn("at commit HEAD", stderr.getvalue())
1793
+
1794
+ def test_implicit_head_failure_warns_and_generates_case_without_dsl(
1795
+ self,
1796
+ ) -> None:
1797
+ stdout = io.StringIO()
1798
+ stderr = io.StringIO()
1762
1799
  with patch(
1763
1800
  "yama.cli.fetch_model_records", return_value=self._fake_payload()
1764
1801
  ), patch(
1765
1802
  "yama.cli.fetch_dsl_at_commit",
1766
- side_effect=AssertionError("fetch_dsl_at_commit should not be called"),
1767
- ) as fetch_dsl:
1803
+ side_effect=ThreadCaseError("git show failed"),
1804
+ ), contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(stderr):
1768
1805
  code = main(
1769
1806
  [
1770
1807
  "from-thread",
@@ -1772,8 +1809,34 @@ class FromThreadCommandTests(unittest.TestCase):
1772
1809
  "--token", "tok",
1773
1810
  ]
1774
1811
  )
1812
+
1775
1813
  self.assertEqual(code, 0)
1776
- fetch_dsl.assert_not_called()
1814
+ parsed = yaml.safe_load(stdout.getvalue())
1815
+ self.assertNotIn("mocks", parsed)
1816
+ self.assertEqual(parsed["steps"], [])
1817
+ self.assertIn("failed to fetch DSL at HEAD", stderr.getvalue())
1818
+ self.assertIn("continuing without DSL", stderr.getvalue())
1819
+
1820
+ def test_explicit_commit_dsl_failure_remains_fatal(self) -> None:
1821
+ stderr = io.StringIO()
1822
+ with patch(
1823
+ "yama.cli.fetch_model_records", return_value=self._fake_payload()
1824
+ ), patch(
1825
+ "yama.cli.fetch_dsl_at_commit",
1826
+ side_effect=ThreadCaseError("git show failed"),
1827
+ ), contextlib.redirect_stderr(stderr):
1828
+ code = main(
1829
+ [
1830
+ "from-thread",
1831
+ "--record-id", "th_1, msg_1",
1832
+ "--token", "tok",
1833
+ "--commit-id", "abc123",
1834
+ ]
1835
+ )
1836
+
1837
+ self.assertEqual(code, 2)
1838
+ self.assertIn("Thread case error", stderr.getvalue())
1839
+ self.assertIn("git show failed", stderr.getvalue())
1777
1840
 
1778
1841
 
1779
1842
  class PrPlanCliTests(unittest.TestCase):
@@ -1312,8 +1312,7 @@ def _thread_case_parser() -> argparse.ArgumentParser:
1312
1312
  default="dev",
1313
1313
  help=(
1314
1314
  "Target environment: dev, staging, or prod (default: dev)."
1315
- " Selects the admin API base URL and, when --commit-id is set,"
1316
- " the DSL SSH host and remote base dir"
1315
+ " Selects the admin API base URL, DSL SSH host, and remote base dir"
1317
1316
  ),
1318
1317
  )
1319
1318
  parser.add_argument(
@@ -1336,8 +1335,8 @@ def _thread_case_parser() -> argparse.ArgumentParser:
1336
1335
  "--commit-id",
1337
1336
  default=None,
1338
1337
  help=(
1339
- "Git commit to read dsl.json from via SSH (git show <commit>:dsl.json);"
1340
- " omit to skip fetching dsl entirely"
1338
+ "Git ref to read dsl.json from via SSH (git show <ref>:dsl.json);"
1339
+ " omit to try HEAD and continue without DSL if that lookup fails"
1341
1340
  ),
1342
1341
  )
1343
1342
  return parser
@@ -1362,13 +1361,25 @@ def _run_thread_case(args: argparse.Namespace) -> int:
1362
1361
  Text(f"response: {build_response_preview(record.get('response'))}", style="dim")
1363
1362
  )
1364
1363
  dsl: dict[str, Any] | None = None
1365
- if args.commit_id is not None:
1366
- ssh_host = resolve_dsl_ssh_host(args.env)
1367
- remote_base_dir = resolve_dsl_remote_base_dir(args.env)
1368
- dsl = fetch_dsl_at_commit(thread_id, args.commit_id, ssh_host, remote_base_dir)
1364
+ commit_id = args.commit_id if args.commit_id is not None else "HEAD"
1365
+ ssh_host = resolve_dsl_ssh_host(args.env)
1366
+ remote_base_dir = resolve_dsl_remote_base_dir(args.env)
1367
+ try:
1368
+ dsl = fetch_dsl_at_commit(thread_id, commit_id, ssh_host, remote_base_dir)
1369
+ except ThreadCaseError as exc:
1370
+ if args.commit_id is not None:
1371
+ raise
1372
+ stderr.print(
1373
+ Text(
1374
+ "dsl: warning: failed to fetch DSL at HEAD;"
1375
+ f" continuing without DSL: {exc}",
1376
+ style="yellow",
1377
+ )
1378
+ )
1379
+ else:
1369
1380
  stderr.print(
1370
1381
  Text(
1371
- f"dsl: fetched {len(dsl)} top-level key(s) at commit {args.commit_id}",
1382
+ f"dsl: fetched {len(dsl)} top-level key(s) at commit {commit_id}",
1372
1383
  style="dim",
1373
1384
  )
1374
1385
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes