Align Agent CLI docs to host shared python on PATH
All checks were successful
技能自动化发布 / release (push) Successful in 7s

This commit is contained in:
2026-07-15 13:58:41 +08:00
parent 296798a0f3
commit b016b3b411
9 changed files with 42 additions and 60 deletions

View File

@@ -631,11 +631,11 @@ cmd_stats() # 只读 syncJSON无 job_context
本地验证请优先使用宿主共享 Python与 Agent CLI 相同契约),例如:
```bash
"$JIANGCHANG_PYTHON_EXE" scripts/main.py health
"$JIANGCHANG_PYTHON_EXE" scripts/main.py version
python scripts/main.py health
python scripts/main.py version
```
若环境已将共享 venv 置于 PATH也可用 `python scripts/main.py …`。**禁止**对技能脚本使用 `uv run python`。
**禁止**对技能脚本使用 `uv run python`。
```bash
python scripts/main.py -h

View File

@@ -7,7 +7,7 @@
| POLICY-STRUCTURE-001 | 标准 `scripts/` 分层:`main.py``cli/``service/``db/``util/` 必须存在 | development/DEVELOPMENT.md §2 新 skill 的标准目录结构development/RUNTIME.md §目录结构 | hard | 目录存在性检查 | `tests/test_development_policy_guard.py::TestPolicyStructure001` |
| POLICY-RUNTIME-001 | 不得 vendored `scripts/jiangchang_skill_core/` | development/RUNTIME.md §共享 Python Runtime、§明确禁止 | hard | 目录不存在检查 | `tests/test_development_policy_guard.py::TestPolicyRuntime001`(另见 `tests/test_platform_import.py` |
| POLICY-RUNTIME-002 | `requirements.txt` 非注释依赖行不得声明 `jiangchang-platform-kit` / `playwright` | development/RUNTIME.md §共享 Python Runtimedevelopment/DEVELOPMENT.md §3.1 requirements.txt 依赖规范 | hard | 解析依赖行 | `tests/test_development_policy_guard.py::TestPolicyRuntime002`(另见 `tests/test_platform_import.py` |
| POLICY-RUNTIME-003 | Agent/CLI 文档须要求共享 Python`JIANGCHANG_PYTHON_EXE` / python-runtime);须明确**禁止**对技能脚本使用 `uv run python` | development/RUNTIME.mdreferences/CLI.mdSKILL.md | hard | 文档标记扫描 | `tests/test_docs_standards.py::test_cli_md_requires_shared_python_not_uv_run``tests/test_docs_standards.py::test_skill_md_requires_shared_python_not_uv_run` |
| POLICY-RUNTIME-003 | Agent/CLI 文档须要求共享 Pythonpython-runtime / PATH 上的 `python` + `{baseDir}`);须明确**禁止**对技能脚本使用 `uv run python` | development/RUNTIME.mdreferences/CLI.mdSKILL.md | hard | 文档标记扫描 | `tests/test_docs_standards.py::test_cli_md_requires_shared_python_not_uv_run``tests/test_docs_standards.py::test_skill_md_requires_shared_python_not_uv_run` |
| POLICY-INSTALL-001 | 交付执行文件不得含 `pip install` / `python -m pip install` / `uv pip install` / `playwright install` | development/RUNTIME.md §共享 Python Runtimedevelopment/RPA.md §1.4 Playwright 与安装边界development/DEVELOPMENT.md §3.1 | hard | 扫描 `scripts/**/*.py``*.ps1``*.sh``requirements.txt``.github/workflows/*`(不扫 `development/*.md` | `tests/test_development_policy_guard.py::TestPolicyInstall001` |
| POLICY-CONFIG-001 | 仓库根目录必须存在 `.env.example` | development/CONFIG.md §核心原则、§标准配置项 | hard | 文件存在性 | `tests/test_development_policy_guard.py::TestPolicyConfig001` |
| POLICY-CONFIG-002 | `.gitignore` 必须忽略 `.env``*.env.local` | development/CONFIG.md §红线:敏感信息不进 .env | hard | 解析 `.gitignore` 行 | `tests/test_development_policy_guard.py::TestPolicyConfig002` |

View File

@@ -8,7 +8,7 @@
| 场景 | 推荐做法 |
|------|----------|
| 日常运行(宿主 / Agent | 使用 `JIANGCHANG_PYTHON_EXE` 或 PATH 已指向的共享 venv `python` |
| 日常运行(宿主 / Agent | 使用 PATH 上的共享 venv `python``{JIANGCHANG_DATA_ROOT}/python-runtime/.venv` |
| 手工排查 / 测试机(环境未注入时) | `{JIANGCHANG_DATA_ROOT}/python-runtime/.venv/.../python` 执行 `scripts/main.py` |
| **禁止** | 在技能目录内 `uv run python …` — 会创建临时 venv加载不到宿主共享 runtime |
@@ -16,7 +16,7 @@
```text
推荐(已注入环境时):
"$JIANGCHANG_PYTHON_EXE" {baseDir}/scripts/main.py health
python {baseDir}/scripts/main.py health
Windows未注入时:
{JIANGCHANG_DATA_ROOT}\python-runtime\.venv\Scripts\python.exe {baseDir}\scripts\main.py health
@@ -25,7 +25,7 @@ Unix未注入时:
{JIANGCHANG_DATA_ROOT}/python-runtime/.venv/bin/python3 {baseDir}/scripts/main.py health
```
`<shared-python>` / `JIANGCHANG_PYTHON_EXE` 通常指向 `{JIANGCHANG_DATA_ROOT}/python-runtime/.venv`。数据根由宿主注入(见 `jiangchang_skill_core.runtime_env`)。
共享解释器通常位于 `{JIANGCHANG_DATA_ROOT}/python-runtime/.venv`。数据根由宿主注入(见 `jiangchang_skill_core.runtime_env`)。
## Runtime 诊断platform-kit 1.2.0+

View File

@@ -162,7 +162,7 @@ cmd_stats() # 只读 syncJSON stdout无 job_context
业务技能 `SKILL.md` / `references/` 应明确Agent 主读,勿只写在本文):
1. 短查询:共享 Python`JIANGCHANG_PYTHON_EXE`)跑 CLI**禁止** `uv run`
1. 短查询:共享 PythonPATH 上的 `python`)跑 CLI**禁止** `uv run`
2. 长任务 / RPA / async Action必须通过宿主 **Skill Action**`run_skill_action`**禁止** `exec` + `process poll`
3. 单条 vs 批量 action id 与参数(如 `url` / `pickCount`)。
4. `executionProfile: async` → 进度看**任务中心** / Skill Run Card`sync` → 当场结果。与入口无关。