feat(agent): L2/L4 记忆注入——项目规范 + 全局规范文件喂进 4 处 prompt

- L2 projects.agent_rules 列(schema+迁移+类型+mapper+patchProject+API 透传)
- L4 protocol.readGlobalAgentRules():worker 直接读 <data>/agent-global.md(非DB,
  不读用户 ~/.claude/CLAUDE.md,避免个人习惯与受控执行冲突)
- runner.rulesHeaderLines 注入 executor/planner/conflict;reviewer 同注入
- 顺序:全局规范(L4)→项目规范(L2)→任务内容→上次失败(L1)→执行约束

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-24 22:29:29 +08:00
parent ff2d7c22e7
commit fe7923a618
10 changed files with 81 additions and 13 deletions
+2
View File
@@ -37,6 +37,8 @@ export interface Project {
/** 项目级成本预算(按模型×token 折算累计;超额自动暂停)*/
budgetUsd?: number | null; // 当期预算上限 USDnull=不限)
budgetPeriod?: 'day' | 'month'; // 预算周期(默认 month
/** L2 项目级 agent 执行规范(注入 executor/planner/reviewer/conflict 的 prompt 头部)*/
agentRules?: string | null;
}
export interface ApprovalRecord {