From 22f89d8e2cff96001d2980d4913df6ee4bc7cff8 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:06:10 +0000 Subject: [PATCH 1/8] Record the task card for feature-context-engineering --- .task/feature-context-engineering.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .task/feature-context-engineering.md diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md new file mode 100644 index 00000000..043dd899 --- /dev/null +++ b/.task/feature-context-engineering.md @@ -0,0 +1,25 @@ +# feature/context-engineering 任务卡 + +任务主记录:;状态:进行中;owner:weichen + +## 基线与授权 + +- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 02b5cb82866daf6ec489d87bf8717cab584ae99f +- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-context-engineering(worktree);分支:feature/context-engineering +- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> + +## 目标与非目标 + +<预期结果、受影响入口/模块/契约;明确不做什么。> + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | +|---|---|---|---| +| 启动 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 2026-10-03T16:06:10Z | + +## 结果与验证(完成后填写) + +- 结果: +- 验证: +- 影响与剩余项: -- 2.54.0 From 658c2fa713307266d9450fa8363a270dee424cb2 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:23:01 +0000 Subject: [PATCH 2/8] Pin context engineering across native, squad, and backend Why: Tool-result clearing, folded reminders, and character truncation land in the native loop and the product path together. Evidence: agent-native 6fd1d44, agent-squad 4d53450, backend b2dc9a7. Impact: Default context window stays 32000 characters. Empty tool selection still exposes the profile's tools. Refs: feature/context-engineering Co-authored-by: Cursor --- .task/feature-context-engineering.md | 5 +++-- deps/agent-native | 2 +- deps/agent-squad | 2 +- modules/backend | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index 043dd899..ccf12251 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -6,11 +6,12 @@ - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 02b5cb82866daf6ec489d87bf8717cab584ae99f - 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-context-engineering(worktree);分支:feature/context-engineering -- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> +- 授权与交付终点:改 agent-native 与 backend,钉 squad 与 Dev 的 gitlink,经 PR 合入 main 后在本 worktree 运行 task-finish。未授权:core 契约、frontend、发版、改写历史、分支保护、把 pi-durable 或 Chord 引入为依赖。 ## 目标与非目标 -<预期结果、受影响入口/模块/契约;明确不做什么。> +- 目标:运行内清理旧工具结果(保留最近 5 条);压缩按工具组裁剪、冲突重试、连续 3 次失败熔断;改写已存在文件前必须本轮读过且 mtime 与大小未变;提醒并入最后一条工具结果或用户消息;子代理回传默认 32000 字,超出写工件;工具选择支持 +name/-name;RPC 回执 started/queued/handled;后端按字符截断。 +- 非目标:权限模式、文件回滚、代码编排、产品壳运行态、流式回归修复。 ## 同步记录 diff --git a/deps/agent-native b/deps/agent-native index 9f5751c2..6fd1d441 160000 --- a/deps/agent-native +++ b/deps/agent-native @@ -1 +1 @@ -Subproject commit 9f5751c20527ae223323650ab8da877fc7b89601 +Subproject commit 6fd1d441a95423e27be6f6159207d5d0821bec4d diff --git a/deps/agent-squad b/deps/agent-squad index 9efce79b..4d534508 160000 --- a/deps/agent-squad +++ b/deps/agent-squad @@ -1 +1 @@ -Subproject commit 9efce79b86044db0594f8761cd01c42677a90931 +Subproject commit 4d534508a94c59cf865549125a9cdf1303271a22 diff --git a/modules/backend b/modules/backend index 93adb93b..b2dc9a7e 160000 --- a/modules/backend +++ b/modules/backend @@ -1 +1 @@ -Subproject commit 93adb93b9d6fa4d8e5d279e68bbdbcd31b8b44ab +Subproject commit b2dc9a7e0bde2bb8b3cf530ad9f1458e4c5936d2 -- 2.54.0 From b6dba58b4dc2eed8e0dfcd90ca905d7bc58ce5a5 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:24:21 +0000 Subject: [PATCH 3/8] Record context-engineering verification on the task card Why: Acceptance needs the pin SHAs and the test evidence on the same card that will be archived. Evidence: make test and make build passed on 658c2fa. Impact: No code change. Refs: feature/context-engineering Co-authored-by: Cursor --- .task/feature-context-engineering.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index ccf12251..ffc3f3af 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -21,6 +21,6 @@ ## 结果与验证(完成后填写) -- 结果: -- 验证: -- 影响与剩余项: +- 结果:agent-native 6fd1d44,agent-squad 4d53450,backend b2dc9a7。旧工具结果清理保留最近 5 条;压缩冲突会重试,连续 3 次失败熔断;提醒并入最后一条工具结果;已存在文件未读或读后变化时拒绝改写;子代理回传超过 32000 字写工件;RPC 回执 started/queued/handled;截断按字符。 +- 验证:native 相关包测试通过;backend internal/runmgr、internal/tools、internal/runtime 通过;Dev `make test` 与 `make build` 通过(版本串含 native=6fd1d44、squad=4d53450、backend=b2dc9a7)。 +- 影响与剩余项:默认窗口 32000 字符,工具选择为空时行为不变。权限、回滚、代码编排不在本批。 -- 2.54.0 From 235645434dbf0ab9884be9b47ebc5006c3879a35 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:24:22 +0000 Subject: [PATCH 4/8] Record the sync checkpoint --- .task/feature-context-engineering.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index ffc3f3af..1cdefa76 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -24,3 +24,4 @@ - 结果:agent-native 6fd1d44,agent-squad 4d53450,backend b2dc9a7。旧工具结果清理保留最近 5 条;压缩冲突会重试,连续 3 次失败熔断;提醒并入最后一条工具结果;已存在文件未读或读后变化时拒绝改写;子代理回传超过 32000 字写工件;RPC 回执 started/queued/handled;截断按字符。 - 验证:native 相关包测试通过;backend internal/runmgr、internal/tools、internal/runtime 通过;Dev `make test` 与 `make build` 通过(版本串含 native=6fd1d44、squad=4d53450、backend=b2dc9a7)。 - 影响与剩余项:默认窗口 32000 字符,工具选择为空时行为不变。权限、回滚、代码编排不在本批。 +| 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | b6dba58b4dc2eed8e0dfcd90ca905d7bc58ce5a5 | 2026-10-03T16:24:22Z | -- 2.54.0 From 656016a78350e86de0a7ac00b2b1c973aac4ac88 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:24:43 +0000 Subject: [PATCH 5/8] Fold the acceptance sync row into the task card table Why: task-sync appends the checkpoint after the card body, where it is not part of the table. Evidence: The row records sync_base 02b5cb8286 and tested_head b6dba58. Impact: No code change. Refs: feature/context-engineering Co-authored-by: Cursor --- .task/feature-context-engineering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index 1cdefa76..83899eb6 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -18,10 +18,10 @@ | 节点 | sync_base_sha | tested_head_sha | checked_at | |---|---|---|---| | 启动 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 2026-10-03T16:06:10Z | +| 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | b6dba58b4dc2eed8e0dfcd90ca905d7bc58ce5a5 | 2026-10-03T16:24:22Z | ## 结果与验证(完成后填写) - 结果:agent-native 6fd1d44,agent-squad 4d53450,backend b2dc9a7。旧工具结果清理保留最近 5 条;压缩冲突会重试,连续 3 次失败熔断;提醒并入最后一条工具结果;已存在文件未读或读后变化时拒绝改写;子代理回传超过 32000 字写工件;RPC 回执 started/queued/handled;截断按字符。 - 验证:native 相关包测试通过;backend internal/runmgr、internal/tools、internal/runtime 通过;Dev `make test` 与 `make build` 通过(版本串含 native=6fd1d44、squad=4d53450、backend=b2dc9a7)。 - 影响与剩余项:默认窗口 32000 字符,工具选择为空时行为不变。权限、回滚、代码编排不在本批。 -| 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | b6dba58b4dc2eed8e0dfcd90ca905d7bc58ce5a5 | 2026-10-03T16:24:22Z | -- 2.54.0 From 21eabcfddf36a23110c5af904b2b1eb8348b44b5 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:25:02 +0000 Subject: [PATCH 6/8] Record the sync checkpoint --- .task/feature-context-engineering.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index 83899eb6..e48c5b16 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -25,3 +25,4 @@ - 结果:agent-native 6fd1d44,agent-squad 4d53450,backend b2dc9a7。旧工具结果清理保留最近 5 条;压缩冲突会重试,连续 3 次失败熔断;提醒并入最后一条工具结果;已存在文件未读或读后变化时拒绝改写;子代理回传超过 32000 字写工件;RPC 回执 started/queued/handled;截断按字符。 - 验证:native 相关包测试通过;backend internal/runmgr、internal/tools、internal/runtime 通过;Dev `make test` 与 `make build` 通过(版本串含 native=6fd1d44、squad=4d53450、backend=b2dc9a7)。 - 影响与剩余项:默认窗口 32000 字符,工具选择为空时行为不变。权限、回滚、代码编排不在本批。 +| 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 656016a78350e86de0a7ac00b2b1c973aac4ac88 | 2026-10-03T16:25:02Z | -- 2.54.0 From 8a04b019d0fd4738dec894d6204c9263ad76b74e Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:25:27 +0000 Subject: [PATCH 7/8] Fold the review sync row into the task card table Why: The review checkpoint should sit in the sync table with the acceptance row. Evidence: tested_head 656016a at 2026-10-03T16:25:02Z. Impact: No code change. Refs: feature/context-engineering Co-authored-by: Cursor --- .task/feature-context-engineering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index e48c5b16..128e4e83 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -19,10 +19,10 @@ |---|---|---|---| | 启动 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 2026-10-03T16:06:10Z | | 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | b6dba58b4dc2eed8e0dfcd90ca905d7bc58ce5a5 | 2026-10-03T16:24:22Z | +| 请求审核 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 656016a78350e86de0a7ac00b2b1c973aac4ac88 | 2026-10-03T16:25:02Z | ## 结果与验证(完成后填写) - 结果:agent-native 6fd1d44,agent-squad 4d53450,backend b2dc9a7。旧工具结果清理保留最近 5 条;压缩冲突会重试,连续 3 次失败熔断;提醒并入最后一条工具结果;已存在文件未读或读后变化时拒绝改写;子代理回传超过 32000 字写工件;RPC 回执 started/queued/handled;截断按字符。 - 验证:native 相关包测试通过;backend internal/runmgr、internal/tools、internal/runtime 通过;Dev `make test` 与 `make build` 通过(版本串含 native=6fd1d44、squad=4d53450、backend=b2dc9a7)。 - 影响与剩余项:默认窗口 32000 字符,工具选择为空时行为不变。权限、回滚、代码编排不在本批。 -| 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 656016a78350e86de0a7ac00b2b1c973aac4ac88 | 2026-10-03T16:25:02Z | -- 2.54.0 From 61d2ff7180a47712375b224e1b51a93cde3b28a4 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 3 Oct 2026 16:25:28 +0000 Subject: [PATCH 8/8] Record the sync checkpoint --- .task/feature-context-engineering.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.task/feature-context-engineering.md b/.task/feature-context-engineering.md index 128e4e83..e49cac17 100644 --- a/.task/feature-context-engineering.md +++ b/.task/feature-context-engineering.md @@ -26,3 +26,4 @@ - 结果:agent-native 6fd1d44,agent-squad 4d53450,backend b2dc9a7。旧工具结果清理保留最近 5 条;压缩冲突会重试,连续 3 次失败熔断;提醒并入最后一条工具结果;已存在文件未读或读后变化时拒绝改写;子代理回传超过 32000 字写工件;RPC 回执 started/queued/handled;截断按字符。 - 验证:native 相关包测试通过;backend internal/runmgr、internal/tools、internal/runtime 通过;Dev `make test` 与 `make build` 通过(版本串含 native=6fd1d44、squad=4d53450、backend=b2dc9a7)。 - 影响与剩余项:默认窗口 32000 字符,工具选择为空时行为不变。权限、回滚、代码编排不在本批。 +| 同步前验收 | 02b5cb82866daf6ec489d87bf8717cab584ae99f | 8a04b019d0fd4738dec894d6204c9263ad76b74e | 2026-10-03T16:25:28Z | -- 2.54.0