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
1.5 KiB
1.5 KiB
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 矩阵,不另行声明接线 |
写请求输入无法解析、匹配工具缺少可识别路径、必要解释器缺失时显式拒绝并给出原因。 仓内新目录从最近已存在祖先定位,软链接按实际目标判断;补丁逐个检查全部目标。 识别为仓外路径时显式报告该钩子不管辖;该结果不授予仓外写权限,仍由工具授权策略决定。
客户端接线状态
脚本级正负例与客户端实际拦截分开。原记录中的客户端状态为 pending-live; 本次本地测试不替代真实 zcode 会话中 hook 加载及拒绝路径证据。 在客户端实测前,端到端能力仍标未验证,不能仅凭脚本 exit 2 登记客户端 enforced。 已有 git 提交钩子和平台准入分别承担各自范围,不能证明落笔前检查已生效。