Files
Agent-System-Dev/policy/tool-adaptation-zcode.md
weichen 8af945a1d5 Make development gates preserve work and verifiable evidence
Why: cleanup, component synchronization, receipt recording and credential handling could contradict the documented development boundaries.

Evidence: SELF 75 isolated governance tests and source checks are captured in .task/feature-governance-reliability.md; combination and CI verification follow.

Impact: hardens local task and CI tooling, aligns policy and component documentation, and adds continuous regression tests without changing product behavior.

Refs: .task/feature-governance-reliability.md; policy/governance.md; policy/platform-admission.md
2026-10-05 12:36:02 +00:00

23 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# zcode 写路径门禁能力矩阵
适配对象:`.zcode/config.json` 登记的 Edit/Write/ApplyPatch PreToolUse 钩子。
要求来自 Development-Guidelines `standards/tool-adaptation.md` 与根 AGENTS.md;
实现为 `scripts/zcode/write-guard.sh` 及其 Python 解析器。
| 要求 | 范围与等级 | 验证与限制 |
|---|---|---|
| A1/A3 写入前检查 | 脚本对 main/master、detached HEAD、非法任务分支拒绝 | `tests/test_write_guard.py` 覆盖现有/新目录、相对路径、软链接、多文件补丁与移动目标 |
| A1 启动检查 | manual | 写路径判断不证明 precheck 已执行,仍须首次收据 |
| A2/A4/A5/A6/A7 | 复用 CLI/git 对应机制 | 见 [CLI/git 矩阵](tool-adaptation-matrix.md),不另行声明接线 |
写请求输入无法解析、匹配工具缺少可识别路径、必要解释器缺失时显式拒绝并给出原因。
仓内新目录从最近已存在祖先定位,软链接按实际目标判断;补丁逐个检查全部目标。
识别为仓外路径时显式报告该钩子不管辖;该结果不授予仓外写权限,仍由工具授权策略决定。
## 客户端接线状态
脚本级正负例与客户端实际拦截分开。原记录中的客户端状态为 pending-live;
本次本地测试不替代真实 zcode 会话中 hook 加载及拒绝路径证据。
在客户端实测前,端到端能力仍标未验证,不能仅凭脚本 exit 2 登记客户端 enforced。
已有 git 提交钩子和平台准入分别承担各自范围,不能证明落笔前检查已生效。