From e7eb18dacb702849308aaca9a12d72e49065e999 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 03:34:16 +0000 Subject: [PATCH 1/4] Record the task card for feature-tool-adaptation-standard --- .task/feature-tool-adaptation-standard.md | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .task/feature-tool-adaptation-standard.md diff --git a/.task/feature-tool-adaptation-standard.md b/.task/feature-tool-adaptation-standard.md new file mode 100644 index 00000000..4a61cc9b --- /dev/null +++ b/.task/feature-tool-adaptation-standard.md @@ -0,0 +1,25 @@ +# feature/tool-adaptation-standard 任务卡 + +任务主记录:;状态:进行中;owner:weichen + +## 基线与授权 + +- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 428628ffe2a1b73a86299716853f52abdbd16291 +- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-tool-adaptation-standard(worktree);分支:feature/tool-adaptation-standard +- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> + +## 目标与非目标 + +<预期结果、受影响入口/模块/契约;明确不做什么。> + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | +|---|---|---|---| +| 启动 | 428628ffe2a1b73a86299716853f52abdbd16291 | 428628ffe2a1b73a86299716853f52abdbd16291 | 2026-09-30T03:34:16Z | + +## 结果与验证(完成后填写) + +- 结果: +- 验证: +- 影响与剩余项: From a6201700d668b0571b32f0f9d54ad4a2368cb910 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 03:33:32 +0000 Subject: [PATCH 2/4] Ignore runtime data written by local serve instances Why: a running serve instance writes data/ into the working tree, which trips the precheck SHARED_WORKSPACE_BUSY verdict for every later task. Evidence: git status showed only untracked data/; runtime state is covered by make clean and never meant for version control. Impact: entry-doc only change; no tracked content altered. Refs: task feature/tool-adaptation-standard --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fb82a665..6e6b1172 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /bin/ node_modules/ +/data/ From 6fa07f3d15ad4a59f11a53cabc39c5edf3bba2bf Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 03:35:07 +0000 Subject: [PATCH 3/4] Adopt the tool adaptation standard and register the first instance matrix Why: the library now defines requirement-level conformance for tool rules and hooks (draft.8); the composition's existing gate mechanisms should be honestly graded against A1-A7 rather than implicitly assumed compliant. Evidence: matrix rows cite the 19/19 scratch suite negatives, the live data/ dirty-tree interception, and PR records; commit-msg python3 dependency verified fail-closed by reading the hook's test path. Impact: docs-only; guidelines gitlink advances to c9ab623 (draft.8); no workflow or code change. Refs: Development-Guidelines PR#2 (c9ab623); policy/adoption.md --- deps/development-guidelines | 2 +- policy/adoption.md | 1 + policy/tool-adaptation-matrix.md | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 policy/tool-adaptation-matrix.md diff --git a/deps/development-guidelines b/deps/development-guidelines index d9576ed4..c9ab6230 160000 --- a/deps/development-guidelines +++ b/deps/development-guidelines @@ -1 +1 @@ -Subproject commit d9576ed4d560764c8faddf218122f44b076eec23 +Subproject commit c9ab6230e8fce083c42db703c2e3fcfa94d79caf diff --git a/policy/adoption.md b/policy/adoption.md index b96ca7a8..e9cb0bc4 100644 --- a/policy/adoption.md +++ b/policy/adoption.md @@ -16,6 +16,7 @@ | standards/verification.md | 验收 | manual:make test(12 ok 行)+ scratch 19/19 为证 | | standards/multi-repo.md | 跨仓/gitlink | manual;受控历史迁移通道已于 2026-09-30 行使一次(documents/records/2026-09-30-history-migration.md) | | 工作区回收 | 交付终点 | advisory(task-finish);负例:合入前 finish 拒绝输出 | +| standards/tool-adaptation.md(draft.8) | 为工具创建规则/钩子实例 | 本组合 CLI/git 级实例已登记:policy/tool-adaptation-matrix.md(A1–A7 逐行定级+正负例证据) | ## 项目差异 diff --git a/policy/tool-adaptation-matrix.md b/policy/tool-adaptation-matrix.md new file mode 100644 index 00000000..88055779 --- /dev/null +++ b/policy/tool-adaptation-matrix.md @@ -0,0 +1,33 @@ +# CLI/git 级门禁机制实例——能力矩阵 + +- 适配对象:任何经终端操作本仓的执行者(CLI Agent、IDE 内嵌终端);机制为工具无关的 shell + git hooks +- 依据:Development-Guidelines 0.1.0-draft.8(c9ab623)standards/tool-adaptation.md + policy/adoption.md +- 状态:verified(正负例见下);owner:weichen +- 实例位置:scripts/task.sh(precheck/start/sync/finish)、scripts/hooks/pre-commit、scripts/hooks/commit-msg、Makefile 目标、AGENTS.md 常驻条文 +- 单一权威声明:本实例是上述规范的机制实现,语义以库与项目入口为准 + +## 能力矩阵 + +| 要求 | 等级 | 机制(执行时机) | 正例证据 | 负例证据 | 备注 | +|---|---|---|---|---|---| +| A1 启动门禁 | advisory(verdict 纪律)+ enforced(start 拒绝) | make precheck 任务首次写前;task-start 拒绝脏树(脚本退出码) | Dev PR#1 验证记录 case1 READY | 同套件 case2/4:BUSY exit 3、start-dirty exit 1;2026-09-30 实战拦截 data/ 脏树 | 「不得编辑」属执行者纪律,如实记 advisory | +| A2 节点同步 | advisory | make task-sync(验收/审核/合入前),落卡三字段 | PR#1/2/3 均经 sync | 实战两次拒绝脏树 sync(exit 1,不隐式 stash) | MUST 属流程义务,机制为建议级 | +| A3 集成分支保护 | enforced(local)+manual(平台) | pre-commit 拒绝 main 直提;Gitea 分支保护未配置 | 12 个 PR 全部经平台合入 | 套件 hook-main-refused exit 1 | 平台层待配置后升级本行 | +| A4 提交与任务记录格式 | enforced(local)(主题行)+manual(body 四段) | commit-msg 钩子查宽度/句点 | 本批提交全部通过 | 套件 hook-longsubject-refused exit 1 | body 四段结构无机器校验,如实 manual | +| A5 工作区回收 | advisory + enforced(未合入拒绝) | task-finish(合入核对→deinit→回收);abandon 双确认 | PR#3 后 worktree/分支回收 | 套件 finish-before-merge exit 1、abandon 需 FORCE_ABANDON | | +| A6 秘密边界 | manual | Gitea token 从 ~/.secrets/gitea 读取;会话/日志无明文 | 全程 API 自动化无泄漏 | 无构造负例(纪律项) | 凭证文件模式已验证 | +| A7 证据落盘 | manual | 完成声明附 precheck/sync/测试三段输出 | 各 PR body 携带 | 无构造负例 | | + +## 降级与失败行为 + +| 机制 | 依赖缺失时行为 | 对应等级调整 | 解锁路径 | +|---|---|---|---| +| task.sh(bash+python3) | 脚本报错退出(fail-closed) | 不变 | 修复解释器后重跑 | +| commit-msg 宽度计算(python3) | 缺 python3 时宽度为空使比较失败→拒绝(fail-closed,报错信息可读性差) | 不变 | 安装 python3;改进报错文案待办 | +| Gitea API(网络/凭证) | 拒绝并打印 http 码(fail-closed) | 合入退化为人工网页操作 | 修凭证/网络 | + +## 验证记录 + +- 正负例:2026-09-30 临时真实仓套件 19/19 PASS(precheck 三态、start/hook/sync/finish/abandon 拒绝与放行);执行者 weichen;证据摘录见 Dev PR#1 描述与 .task 卡 +- 实战补充:data/ 脏树拦截、task-finish 子模块回收缺陷(PR#4 修复后重验) +- 证据复用:guidelines 升级到 draft.8 仅新增专题,A 表未变,本矩阵行级证据沿用(verification.md 证据复用条款) From 407f2dd4dfc52aba032413eb2e6067fdd8ca3715 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 03:35:08 +0000 Subject: [PATCH 4/4] Record the sync checkpoint --- .task/delivery-mechanism.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.task/delivery-mechanism.md b/.task/delivery-mechanism.md index bb02a572..74fcc226 100644 --- a/.task/delivery-mechanism.md +++ b/.task/delivery-mechanism.md @@ -24,3 +24,4 @@ - 验证:临时真实仓库正负例 19/19 PASS(precheck 三态/start 拒绝与建立/hook 三类拒绝与放行/sync/finish 回收与 abandon 双确认);完整输出见任务执行记录。 | 同步前验收 | 3092715bf68bc4cefb6515c157cd90cf9b5cba2e | f31fd5f62d3dd09780689e53f16c7da94215cbd1 | 2026-09-30T03:12:18Z | | 同步前验收 | 923591feda367bc8ceaf809ed7c294e5245a3a3a | 3366148dcf660148c58dff8ec56e02d80604c7a0 | 2026-09-30T03:23:31Z | +| 同步前验收 | 428628ffe2a1b73a86299716853f52abdbd16291 | 6fa07f3d15ad4a59f11a53cabc39c5edf3bba2bf | 2026-09-30T03:35:08Z |