From 7f525afed4d986c78976d3edc999506193675f3f Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 06:17:08 +0000 Subject: [PATCH 1/5] Record the task card for feature-core-cards-commands-r1 --- .task/feature-core-cards-commands-r1.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .task/feature-core-cards-commands-r1.md diff --git a/.task/feature-core-cards-commands-r1.md b/.task/feature-core-cards-commands-r1.md new file mode 100644 index 00000000..2e46db06 --- /dev/null +++ b/.task/feature-core-cards-commands-r1.md @@ -0,0 +1,25 @@ +# feature/core-cards-commands-r1 任务卡 + +任务主记录:;状态:进行中;owner:weichen + +## 基线与授权 + +- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 69e9471dafd275f98928ff005732b94c4b18b638 +- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-core-cards-commands-r1(worktree);分支:feature/core-cards-commands-r1 +- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> + +## 目标与非目标 + +<预期结果、受影响入口/模块/契约;明确不做什么。> + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | +|---|---|---|---| +| 启动 | 69e9471dafd275f98928ff005732b94c4b18b638 | 69e9471dafd275f98928ff005732b94c4b18b638 | 2026-09-30T06:17:08Z | + +## 结果与验证(完成后填写) + +- 结果: +- 验证: +- 影响与剩余项: From 51543046e1aa726a35952e6905682cc73ed48f32 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 06:29:11 +0000 Subject: [PATCH 2/5] Pin T1 contracts combo and guard task-finish against wrong cwd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: Provider repos merged for T1 (core PR#2, agent-command PR#2, frontend PR#3, ui PR#3, documents PR#9); gitlinks pinned to those mains. The task-finish guard prevents a repeat of the T0 incident where running finish from the main checkout deleted it (scripts/task.sh treated $PWD as the worktree to remove). Evidence: make test green on the pinned combo — core, backend 13 pkgs, frontend 9, ui 6, agent-command (vet + tests incl. conformance); make build produces the binary; combo version string now includes agentcmd SHA. Impact: combo grows its version traceability; AGENTS.md documents the worktree-cwd requirement for finish. Refs: modules/documents docs/records/2026-09-30-t1-core-cards-commands-verification.md --- AGENTS.md | 5 +++-- Makefile | 9 ++++++--- deps/agent-command | 2 +- modules/core | 2 +- modules/documents | 2 +- modules/frontend | 2 +- modules/ui | 2 +- scripts/task.sh | 3 +++ 8 files changed, 17 insertions(+), 10 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b342beef..947074ea 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,8 +11,9 @@ feature 分支(自动记录 R0 与任务卡);任务中途不重复运行 precheck。 - **验收、请求审核、合入前**各运行一次 `make task-sync`;完成声明附 precheck、task-sync、 测试三段输出。 -- 合入后运行 `make task-finish` 回收 worktree 与分支;放弃未合入工作用 - `make task-finish ABANDON="--abandon <原因>"` 并记录原因。 +- 合入后**在 worktree 内**运行 `make task-finish` 回收 worktree 与分支(脚本会把 + 当前目录当 worktree 回收——在主检出运行会误删主检出,已加防护);放弃未合入 + 工作用 `make task-finish ABANDON="--abandon <原因>"` 并记录原因。 ## 提交与 PR diff --git a/Makefile b/Makefile index da54fac9..cbd8e6b2 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ BIN := bin/agent-system EMBED_DIR := $(BACKEND)/web/dist PLUGINS := plugins # 版本溯源(release-operations:运行制品须可对上固定组合)。无 tag 时 --always 给短 SHA。 -COMBO := core=$(shell git -C $(CORE) rev-parse --short HEAD 2>/dev/null)+backend=$(shell git -C $(BACKEND) rev-parse --short HEAD 2>/dev/null)+frontend=$(shell git -C $(FRONTEND) rev-parse --short HEAD 2>/dev/null)+ui=$(shell git -C $(UI) rev-parse --short HEAD 2>/dev/null)+documents=$(shell git -C modules/documents rev-parse --short HEAD 2>/dev/null) +COMBO := core=$(shell git -C $(CORE) rev-parse --short HEAD 2>/dev/null)+backend=$(shell git -C $(BACKEND) rev-parse --short HEAD 2>/dev/null)+frontend=$(shell git -C $(FRONTEND) rev-parse --short HEAD 2>/dev/null)+ui=$(shell git -C $(UI) rev-parse --short HEAD 2>/dev/null)+agentcmd=$(shell git -C deps/agent-command rev-parse --short HEAD 2>/dev/null)+documents=$(shell git -C modules/documents rev-parse --short HEAD 2>/dev/null) VERSION := $(shell git describe --tags --always --dirty 2>/dev/null)+$(COMBO) -.PHONY: help sync status build frontend test test-backend test-frontend test-ui test-core dev pin clean setup precheck task-start task-sync task-finish version +.PHONY: help sync status build frontend test test-backend test-frontend test-ui test-core test-agentcmd dev pin clean setup precheck task-start task-sync task-finish version version: @echo "agent-system $(VERSION)" @@ -82,7 +82,10 @@ test-frontend: contracts test-ui: contracts cd $(UI) && npm ci --no-fund --no-audit && npx tsc --noEmit && npx vitest run -test: test-core test-backend test-frontend test-ui +test-agentcmd: + cd deps/agent-command && go vet ./... && go test -count=1 ./... + +test: test-core test-backend test-frontend test-ui test-agentcmd # 运行演示(mock 模式):单二进制 + 示例插件 + 嵌入式存储,浏览器 http://127.0.0.1:8787 demo: build diff --git a/deps/agent-command b/deps/agent-command index 50f99d98..cc1ad774 160000 --- a/deps/agent-command +++ b/deps/agent-command @@ -1 +1 @@ -Subproject commit 50f99d989c0338c6f454f71ae1cc19a634913ed4 +Subproject commit cc1ad7749816afe129f81bcf0732d0ca7c789d10 diff --git a/modules/core b/modules/core index 4ee19795..a2050d84 160000 --- a/modules/core +++ b/modules/core @@ -1 +1 @@ -Subproject commit 4ee1979535cedce8ea0e6bc9044cbc09f8b5fb13 +Subproject commit a2050d848f645da565cbfb681e579b9902e9236d diff --git a/modules/documents b/modules/documents index 023daeff..210b492e 160000 --- a/modules/documents +++ b/modules/documents @@ -1 +1 @@ -Subproject commit 023daeffaa48aa50175a6242a9b592bac603f349 +Subproject commit 210b492e021d7da8b3cabbfdcdd0f5eb823e505b diff --git a/modules/frontend b/modules/frontend index ab387387..b020ab5d 160000 --- a/modules/frontend +++ b/modules/frontend @@ -1 +1 @@ -Subproject commit ab38738747d558592ce4570d33325e645e9d3165 +Subproject commit b020ab5dabe94b7e36002707fdef7d24f31feb72 diff --git a/modules/ui b/modules/ui index 77c4bacc..755de596 160000 --- a/modules/ui +++ b/modules/ui @@ -1 +1 @@ -Subproject commit 77c4baccce7bb57e872393c88b8e838b6079c692 +Subproject commit 755de596f731e3b3c6234410719757c9e4aa6446 diff --git a/scripts/task.sh b/scripts/task.sh index ada32dda..2e7a302b 100755 --- a/scripts/task.sh +++ b/scripts/task.sh @@ -118,6 +118,9 @@ cmd_finish() { head=$(git rev-parse HEAD) common=$(git rev-parse --git-common-dir); common=$(cd "$common" && pwd) mainrepo=$(dirname "$common") + # 防护(T0 事故教训):finish 必须在任务 worktree 内运行——本脚本把 $PWD 当 + # worktree 回收(rm -rf);从主检出运行会误删主检出。mainrepo==PWD 即主检出。 + [ "$(cd "$mainrepo" && pwd)" = "$PWD" ] && die "task-finish 须在任务 worktree 内运行(cd 到 worktree 再执行),防止误删主检出" git fetch -q origin "${TARGET_BRANCH}" 2>/dev/null || true if [ "$abandon" = "--abandon" ]; then local reason="${2:-}"; [ -n "$reason" ] || die "--abandon 需要原因:task.sh finish --abandon " From 24b45a26672015c84e6754f900ba2a6a3ede6f2c Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 06:30:07 +0000 Subject: [PATCH 3/5] Pin backend at nested-bump merge Why: Backend merged its consumer-adaptation PR (nested core/agent-command pins); the Dev combo must pin that merge so the tested combination is the publishable one. Evidence: full make test re-run at this exact combo (see task card evidence). Impact: gitlink only. Refs: modules/documents docs/records/2026-09-30-t1-core-cards-commands-verification.md --- modules/backend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend b/modules/backend index a72c45f6..02a7b4d7 160000 --- a/modules/backend +++ b/modules/backend @@ -1 +1 @@ -Subproject commit a72c45f68aefbd55d0560184be89cca185cf3cdd +Subproject commit 02a7b4d708722d65ddbe9f72efd50c09c3218f9c From 128fcfd069736b4b2d82742769856aa51b9ceb3c Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 06:30:25 +0000 Subject: [PATCH 4/5] 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 1e3edf07..ee0186a5 100644 --- a/.task/delivery-mechanism.md +++ b/.task/delivery-mechanism.md @@ -33,3 +33,4 @@ | 同步前验收 | dca932c6da3aea34af722f2a6772e621cf6143f5 | 6acda49e04eafc08fc12a9654d96b2512799cffa | 2026-09-30T04:20:54Z | | 同步前验收 | a58f85e0d0ade6e8b4da3afe9985985a38bae47a | 3e1cdbda1e7c7f218743132908dfdd2b39c71afc | 2026-09-30T04:44:49Z | | 同步前验收 | f20c634fea9e4316db664b4da7b4a6c772dd855e | 15f0da63742d68036accdf9a6a5fffd445eb63a3 | 2026-09-30T05:56:09Z | +| 同步前验收 | 69e9471dafd275f98928ff005732b94c4b18b638 | 24b45a26672015c84e6754f900ba2a6a3ede6f2c | 2026-09-30T06:30:25Z | From 3ca7f374e63748e41476fbf0244b06ef0711d6dc Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 06:30:45 +0000 Subject: [PATCH 5/5] Record verification evidence in the task card --- .task/feature-core-cards-commands-r1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.task/feature-core-cards-commands-r1.md b/.task/feature-core-cards-commands-r1.md index 2e46db06..40dc01dd 100644 --- a/.task/feature-core-cards-commands-r1.md +++ b/.task/feature-core-cards-commands-r1.md @@ -1,6 +1,6 @@ # feature/core-cards-commands-r1 任务卡 -任务主记录:;状态:进行中;owner:weichen +任务主记录:Dev PR(feature/core-cards-commands-r1);状态:待合入;owner:weichen ## 基线与授权 @@ -20,6 +20,6 @@ ## 结果与验证(完成后填写) -- 结果: -- 验证: -- 影响与剩余项: +- 结果:完成。Core 契约扩展(ActivityCard/card 事件/HITL 锚定阻断/UI 七词汇/manifest commands+workspaces/工作流 card 步骤)PR#2 合入;Agent-Command v0(spec/registry/四态回执/审计信封+conformance)PR#2 合入;frontend 与 ui contracts 再生成 PR#3 合入;backend 消费适配(嵌套 pin 升级)PR#7 合入;documents 验证记录 PR#9 合入;task.sh finish 增加 cwd 防护(T0 误删主检出事故的修复)。 +- 验证(synced head):PASS make test(core ok;backend 13 包 ok;frontend 9/9;ui tsc+6/6;agent-command vet+tests);PASS make build(版本串含 agentcmd);黄金样本逐字节一致(core 新增 5 份 + 扩展 1 份;agent-command 2 份);全变更为增量、既有样本不变。 +- 影响与剩余项:组合版本串纳入 agentcmd;task-finish 必须在 worktree 内运行(已写入 AGENTS.md + 脚本防护)。剩余:T2 收件箱(backend cardsvc + 卡片组件 + mock 演示)。