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/.task/feature-prompt-library.md b/.task/feature-prompt-library.md new file mode 100644 index 00000000..31ccae53 --- /dev/null +++ b/.task/feature-prompt-library.md @@ -0,0 +1,32 @@ +# 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 +- 授权与交付终点:用户批准提示词体系方案并指示施工("充分纳入可纳入的;总结设计思路供扩展")→ 完成实现与验证,按自主闭环建 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: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/会话管理远期档);真实模型下的技能注入效果需用户侧验收。 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..02198f1c 160000 --- a/modules/documents +++ b/modules/documents @@ -1 +1 @@ -Subproject commit e601b253bc0d6a3fc762c7495d235b68f3910eb6 +Subproject commit 02198f1ceb45f66a968b6e8ecc1de1770f4fd578 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