From 1413dfbaf4fa409676281588a93bf3b0c390cd65 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 10:17:17 +0000 Subject: [PATCH 1/5] Record the task card for feature-prompt-library --- .task/feature-prompt-library.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .task/feature-prompt-library.md diff --git a/.task/feature-prompt-library.md b/.task/feature-prompt-library.md new file mode 100644 index 00000000..ec3b3cd8 --- /dev/null +++ b/.task/feature-prompt-library.md @@ -0,0 +1,25 @@ +# feature/prompt-library 任务卡 + +任务主记录:;状态:进行中;owner:weichen + +## 基线与授权 + +- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 45e6a07626bc1d709624d5e3e37ba7556198d509 +- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-prompt-library(worktree);分支:feature/prompt-library +- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> + +## 目标与非目标 + +<预期结果、受影响入口/模块/契约;明确不做什么。> + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | +|---|---|---|---| +| 启动 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | 2026-09-30T10:17:17Z | + +## 结果与验证(完成后填写) + +- 结果: +- 验证: +- 影响与剩余项: From ac391da34233b23cd5aeae3814c6e48dcb138076 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 10:34:59 +0000 Subject: [PATCH 2/5] Record the prompt-library task card results --- .task/feature-prompt-library.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.task/feature-prompt-library.md b/.task/feature-prompt-library.md index ec3b3cd8..31ccae53 100644 --- a/.task/feature-prompt-library.md +++ b/.task/feature-prompt-library.md @@ -1,25 +1,32 @@ # feature/prompt-library 任务卡 -任务主记录:;状态:进行中;owner:weichen +任务主记录:;状态:已完成;owner:weichen ## 基线与授权 - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 45e6a07626bc1d709624d5e3e37ba7556198d509 - 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-prompt-library(worktree);分支:feature/prompt-library -- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> +- 授权与交付终点:用户批准提示词体系方案并指示施工("充分纳入可纳入的;总结设计思路供扩展")→ 完成实现与验证,按自主闭环建 PR 合入 ## 目标与非目标 -<预期结果、受影响入口/模块/契约;明确不做什么。> +- 目标:① 提示词从代码移入数据(embed 库文件,frontmatter 格式);② 分层模型 base/env/task/agent/tool/aux/style 全部纳入(不止日常用到的);③ 触发匹配(intent/command/attachment/manual + 附件门槛 + 优先级让位);④ 覆盖链 builtin→user(DB v8 迁移 + API + drift 标记);⑤ 组装进 ctxasm(多段 system + 可观测);⑥ 子代理/小队角色/工具文案接线;⑦ 设计思路文档沉淀。 +- 非目标:提示词管理 UI(设置界面浏览/编辑——契约与 API 已就绪,UI 另行);会话压缩/标题生成的功能接线(模板已入库,随远期档)。 ## 同步记录 | 节点 | sync_base_sha | tested_head_sha | checked_at | |---|---|---|---| -| 启动 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | 2026-09-30T10:17:17Z | +| 启动 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | 2026-09-30T10:14:30Z | ## 结果与验证(完成后填写) - 结果: + - core 0cb0a40:PromptModule/PromptTrigger/PromptBlock/PromptHitRecord 契约 + AgentProfile.promptModules(引用有序;空=默认 base+env)+ ts/types.ts 镜像。 + - backend:internal/prompts 包(最小 frontmatter 解析器含块标量、embed 库、覆盖链服务、触发匹配、ResolveSystem 组装、占位符解析);**40 个内置模块**(base 5 + env 1 + task 12 + agent 10 + tool 7 + aux 3 + style 2);ctxasm 接收多段 system + prompt 观测条目;llm.go 组装接线 + 工具文案库覆盖;SubLLMRunner/squadadapter 角色接库(回退内联);server /api/prompts CRUD + 技能命令进 `/` 菜单 + postMessage 技能命令跳过命令路由走 run;store v8 迁移 prompt_modules 表;默认画像 SystemPrompt 清空(基座走库)。 + - frontend:contracts.ts 镜像(PromptModule + promptModules)+ api.listPromptModules。 + - documents:docs/guides/prompt-library-design.md(分层模型、模块设计八法、触发设计、格式命名、覆盖链、组装观测、扩展步骤、反模式)。 - 验证: -- 影响与剩余项: + - `make test` 组合全绿:core ok;backend 17 包 ok(新增 prompts 包 9 组测试:库完整性/默认组装/技能触发(命中·门槛·命令绕过)/优先级让位/画像引用/覆盖链 drift/命令匹配/agent+tool 取用/frontmatter 解析);frontend 9;ui 23;deps ok。 + - 运行时验证(mock 后端 8789):启动加载 40 模块;GET /api/prompts 层分布 5/1/12/10/7/3/2;覆盖保存→basedOnVersion=1→删除恢复内置往返;/api/commands 含 12 个 prompt-skill 命令;`/minutes 关于季度会` 消息起 run(不走命令总线)。 +- 影响与剩余项:提示词管理 UI 未做(API 就绪);aux 层三个模板未接线(随 SummarizeBeyond/会话管理远期档);真实模型下的技能注入效果需用户侧验收。 From ca2ff2d6a40d54f6d0d2cf73f2e9bd5c783f65e8 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 10:35:29 +0000 Subject: [PATCH 3/5] Pin the prompt-library combo across core, backend, frontend and documents Why: prompts move from hardcoded strings to a layered embed library with trigger-based assembly, user overrides and observability. Evidence: composite make test green over this combo; runtime check on a live mock server (40 modules, 7 layers, override round-trip, skill command routing); task card records results and remaining items. Impact: pins core 0cb0a40, backend 4938bd0 (with its vendored core gitlink), frontend 4abf13d, documents 2715ed6. Refs: feature/prompt-library task card; design guide in Documents. --- modules/backend | 2 +- modules/core | 2 +- modules/documents | 2 +- modules/frontend | 2 +- modules/ui | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/backend b/modules/backend index 10f400a2..4938bd09 160000 --- a/modules/backend +++ b/modules/backend @@ -1 +1 @@ -Subproject commit 10f400a2c0405c48019155df6db4313e789054eb +Subproject commit 4938bd095c7b18416ea658b345388c4d9a6f9986 diff --git a/modules/core b/modules/core index a2050d84..0cb0a40d 160000 --- a/modules/core +++ b/modules/core @@ -1 +1 @@ -Subproject commit a2050d848f645da565cbfb681e579b9902e9236d +Subproject commit 0cb0a40dc878f4a706412b7a8e20581684e03c9c diff --git a/modules/documents b/modules/documents index e601b253..2715ed61 160000 --- a/modules/documents +++ b/modules/documents @@ -1 +1 @@ -Subproject commit e601b253bc0d6a3fc762c7495d235b68f3910eb6 +Subproject commit 2715ed612c1c86579b7418882713355019ff9dd4 diff --git a/modules/frontend b/modules/frontend index 0eb90665..4abf13d3 160000 --- a/modules/frontend +++ b/modules/frontend @@ -1 +1 @@ -Subproject commit 0eb9066510b60dfad73de10887562080b0f46362 +Subproject commit 4abf13d33d156f908053dbda11db2c0d7c30520a diff --git a/modules/ui b/modules/ui index 6068f146..f2b08f10 160000 --- a/modules/ui +++ b/modules/ui @@ -1 +1 @@ -Subproject commit 6068f146cc643091c9fdd3d75bf4ef772f8ddc37 +Subproject commit f2b08f101e2be5322b3078035c7a211c7e68876a From 8f019384cfaaee5c7194f99c234bbed11877fb05 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 10:36:13 +0000 Subject: [PATCH 4/5] Record the sync checkpoint --- .task/feature-duplication-lesson-records.md | 1 + modules/documents | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.task/feature-duplication-lesson-records.md b/.task/feature-duplication-lesson-records.md index 2950cd47..8984b5c2 100644 --- a/.task/feature-duplication-lesson-records.md +++ b/.task/feature-duplication-lesson-records.md @@ -29,3 +29,4 @@ | 同步前验收 | fc5008aa134aa1bc75838ca3e5950fc08f84c552 | 688ee3539e75975526e05a2b2059373965da0d52 | 2026-09-30T08:09:25Z | | 同步前验收 | 91e616e03d59882917b79d5305b05db397c40095 | 592917024bea93599755f16404c16a2b5b6a220d | 2026-09-30T08:18:19Z | | 同步前验收 | 20675f7442fd0592d473b715812c50e8cdfeade7 | 8ce9ddb5f27d0dc549051848cd233106ed6d7a89 | 2026-09-30T10:02:23Z | +| 同步前验收 | 45e6a07626bc1d709624d5e3e37ba7556198d509 | ca2ff2d6a40d54f6d0d2cf73f2e9bd5c783f65e8 | 2026-09-30T10:36:13Z | diff --git a/modules/documents b/modules/documents index 2715ed61..02198f1c 160000 --- a/modules/documents +++ b/modules/documents @@ -1 +1 @@ -Subproject commit 2715ed612c1c86579b7418882713355019ff9dd4 +Subproject commit 02198f1ceb45f66a968b6e8ecc1de1770f4fd578 From faa343b07952a4cfc594a2f915132200bbda204e Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 30 Sep 2026 10:37:49 +0000 Subject: [PATCH 5/5] Close the prompt-library task card and archive it Why: merged combo card needs its main-record PR link backfilled and the card archived per the no-bookkeeping-debt rule. Evidence: Dev PR #34 merged as 5c95c5f; card carries test and runtime verification records. Impact: .task/feature-prompt-library.md moved to .task/archive/ with the PR link filled; no code change. --- .task/{ => archive}/feature-prompt-library.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .task/{ => archive}/feature-prompt-library.md (100%) diff --git a/.task/feature-prompt-library.md b/.task/archive/feature-prompt-library.md similarity index 100% rename from .task/feature-prompt-library.md rename to .task/archive/feature-prompt-library.md