Commit c8853d8cab1996c91705dd802ad9f830fbc61097
1 parent
95ef7825
fix(paths): system/templates/ 已并入 system/agents/,修两处静默失效的活路径
用户授权清理 system/templates/ 的过期引用。全仓库核了 34 处,
结论与预期相反:没有该删的死代码,但有两处正在静默失效。
真正坏掉的(demo-harness-company.js):
path.join(ROOT, 'system/templates/base/agent.md') → system/agents/_base/
path.join(ROOT, 'system/templates/base/config.json') → system/agents/_base/
两处都包在 fs.existsSync() 里,所以目录消失后**不报错**,只是
静默跳过 base 本体的挂载 —— demo 跑出来的 agent 没有四段式骨架,
但脚本照常打印成功。又一个静默降级。
顺带:real-pm-smoke.js 的提示文案、migrate-agent-naming.js 里
已失效的遍历项、docs/README.md 的 qa-judge 落点。
CLAUDE.md 目录速查表原来只有 `system/templates/devloop-*/` 一行,
连 system/agents/ 都没列。换成两行并写清三个容易踩的点:目录才是
数据源头(seedAgents 直接扫目录)、_registry.json 只补
benchmark_score、_ 前缀是保留 id 会被跳过。
**刻意不动的**:server/tests/ 下 30 处引用。它们分两类,都得留 ——
① 记录迁移过程的注释;② 断言目录已不存在的守卫
(`expect(git(['ls-files','--','system/templates'])).toBe('')`、
`expect(fs.existsSync(...)).toBe(false)`)。删掉后者等于删掉
「迁移已完成」的证明。legacy_path 那几个测试夹具同理,是历史数据形态。
验证:三个脚本 node --check 通过;改后的四个路径实测存在。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Showing
5 changed files
with
7 additions
and
6 deletions
CLAUDE.md
| @@ -87,7 +87,8 @@ auto-dev "<task>" # bin 入口 → server/src/cli/auto-dev.js | @@ -87,7 +87,8 @@ auto-dev "<task>" # bin 入口 → server/src/cli/auto-dev.js | ||
| 87 | | `server/services/devloop/` | DevLoop 支撑服务:path-resolver, git-vault, unit-registry(FSM), timeline-logger, bug-tracker, doc-store, changelog-writer, sse-broker | | 87 | | `server/services/devloop/` | DevLoop 支撑服务:path-resolver, git-vault, unit-registry(FSM), timeline-logger, bug-tracker, doc-store, changelog-writer, sse-broker | |
| 88 | | `server/src/tools/devloop/` | DevLoop Agent 可调用工具(coder/tester/integrator/triager/doc/persistence-tools + tool-registry + sandbox) | | 88 | | `server/src/tools/devloop/` | DevLoop Agent 可调用工具(coder/tester/integrator/triager/doc/persistence-tools + tool-registry + sandbox) | |
| 89 | | `server/routes/devloop.js` | DevLoop REST:`/api/devloop/projects` | | 89 | | `server/routes/devloop.js` | DevLoop REST:`/api/devloop/projects` | |
| 90 | -| `system/templates/devloop-*/` | 六个 DevLoop Agent 的 prompt 模板(pm, architect, coder, tester, integrator, triager) | | 90 | +| `system/agents/` | **全部 Agent 本体的唯一目录**(75 个)。`_base/` 是元 Agent 骨架,`_registry.json` 只用于按 id 补 `benchmark_score`(**目录才是数据源头**,`graph-seed-service.seedAgents()` 直接扫目录)。`_` 前缀为保留 id,扫描时跳过 | |
| 91 | +| `system/agents/devloop-*/` | 六个 DevLoop Agent(pm, architect, coder, tester, integrator, triager),每个含 `config.json` + `prompt.md` + 一份指路用的薄 `agent.md` | | ||
| 91 | | `server/src/tools/` | Master Agent 可调用的工具(call-agent, marketplace, orchestrate, train-skill, …) | | 92 | | `server/src/tools/` | Master Agent 可调用的工具(call-agent, marketplace, orchestrate, train-skill, …) | |
| 92 | | `web/src/views/` | 10 个页面:AgentChat, AgentList, CompanyDashboard, JobsPanel, OkrDashboard, PipelineEditor, QuotaMonitor, SkillsMarket, TaskTimeline, TemplateAgents | | 93 | | `web/src/views/` | 10 个页面:AgentChat, AgentList, CompanyDashboard, JobsPanel, OkrDashboard, PipelineEditor, QuotaMonitor, SkillsMarket, TaskTimeline, TemplateAgents | |
| 93 | | `packages/` | `acp-core`, `agent-core`, `evolution`, `plugin-bootstrap` | | 94 | | `packages/` | `acp-core`, `agent-core`, `evolution`, `plugin-bootstrap` | |
docs/README.md
| @@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
| 18 | | [architecture-v5.md](./done/architecture-v5.md) | v5.3 架构方案,Phase 1-6 已完成(Phase 7 认知架构条目单独见 todo/) | | 18 | | [architecture-v5.md](./done/architecture-v5.md) | v5.3 架构方案,Phase 1-6 已完成(Phase 7 认知架构条目单独见 todo/) | |
| 19 | | [claude-code-cron.md](./done/claude-code-cron.md) | Claude Code 原生 Cron 调度功能参考手册 | | 19 | | [claude-code-cron.md](./done/claude-code-cron.md) | Claude Code 原生 Cron 调度功能参考手册 | |
| 20 | | [open-api-manual.md](./done/open-api-manual.md) | ArenaSK Open API 外部调用手册 | | 20 | | [open-api-manual.md](./done/open-api-manual.md) | ArenaSK Open API 外部调用手册 | |
| 21 | -| [qa_judge_req.md](./done/qa_judge_req.md) | QA Judge Agent 需求文档 — 已在 `system/templates/qa-judge/` 落地 | | 21 | +| [qa_judge_req.md](./done/qa_judge_req.md) | QA Judge Agent 需求文档 — 已在 `system/agents/qa-judge/` 落地 | |
| 22 | | [task_timeline_design.md](./done/task_timeline_design.md) | Task Timeline View 设计文档 — 已实现(`server/routes/tasks.js`、`server/services/task-service.js`、`web/src/views/TaskTimeline.vue`) | | 22 | | [task_timeline_design.md](./done/task_timeline_design.md) | Task Timeline View 设计文档 — 已实现(`server/routes/tasks.js`、`server/services/task-service.js`、`web/src/views/TaskTimeline.vue`) | |
| 23 | | [user-guides/08-base-agent-4-phase-guide.md](./done/user-guides/08-base-agent-4-phase-guide.md) | Base Agent 四阶段使用指南 | | 23 | | [user-guides/08-base-agent-4-phase-guide.md](./done/user-guides/08-base-agent-4-phase-guide.md) | Base Agent 四阶段使用指南 | |
| 24 | | [system-design/27-p1-virtual-reference.md](./done/system-design/27-p1-virtual-reference.md) | P1 虚拟引用寻址 — ✅ 已实现(commit `226489d`,`server/services/graph-service.js`):`agent.md` 不再逐公司拷贝,改为 `config.json.systemAgentRef` 引用 + `company-context.md` 承载公司语境 | | 24 | | [system-design/27-p1-virtual-reference.md](./done/system-design/27-p1-virtual-reference.md) | P1 虚拟引用寻址 — ✅ 已实现(commit `226489d`,`server/services/graph-service.js`):`agent.md` 不再逐公司拷贝,改为 `config.json.systemAgentRef` 引用 + `company-context.md` 承载公司语境 | |
scripts/demo-harness-company.js
| @@ -117,7 +117,7 @@ async function main() { | @@ -117,7 +117,7 @@ async function main() { | ||
| 117 | const agentDir = path.join(ROOT, 'data/companies', COMPANY_ID, 'agents', WORKER_ROLE); | 117 | const agentDir = path.join(ROOT, 'data/companies', COMPANY_ID, 'agents', WORKER_ROLE); |
| 118 | 118 | ||
| 119 | // 3a: 手动复制 base template 到这个 agent(模拟四阶段范式挂载) | 119 | // 3a: 手动复制 base template 到这个 agent(模拟四阶段范式挂载) |
| 120 | - const baseAgentMd = path.join(ROOT, 'system/templates/base/agent.md'); | 120 | + const baseAgentMd = path.join(ROOT, 'system/agents/_base/agent.md'); |
| 121 | const targetAgentMd = path.join(agentDir, 'agent.md'); | 121 | const targetAgentMd = path.join(agentDir, 'agent.md'); |
| 122 | if (fs.existsSync(baseAgentMd) && fs.existsSync(agentDir)) { | 122 | if (fs.existsSync(baseAgentMd) && fs.existsSync(agentDir)) { |
| 123 | const currentContent = fs.existsSync(targetAgentMd) ? fs.readFileSync(targetAgentMd, 'utf-8') : ''; | 123 | const currentContent = fs.existsSync(targetAgentMd) ? fs.readFileSync(targetAgentMd, 'utf-8') : ''; |
| @@ -140,7 +140,7 @@ async function main() { | @@ -140,7 +140,7 @@ async function main() { | ||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | // 3c: 复制 base config.json (restricted 工具策略) | 142 | // 3c: 复制 base config.json (restricted 工具策略) |
| 143 | - const baseConfig = path.join(ROOT, 'system/templates/base/config.json'); | 143 | + const baseConfig = path.join(ROOT, 'system/agents/_base/config.json'); |
| 144 | const agentConfig = path.join(agentDir, 'config.json'); | 144 | const agentConfig = path.join(agentDir, 'config.json'); |
| 145 | if (fs.existsSync(baseConfig) && fs.existsSync(agentDir)) { | 145 | if (fs.existsSync(baseConfig) && fs.existsSync(agentDir)) { |
| 146 | const existingConfig = fs.existsSync(agentConfig) ? JSON.parse(fs.readFileSync(agentConfig, 'utf-8')) : {}; | 146 | const existingConfig = fs.existsSync(agentConfig) ? JSON.parse(fs.readFileSync(agentConfig, 'utf-8')) : {}; |
scripts/migrate-agent-naming.js
| @@ -62,7 +62,7 @@ function moveDir(from, to) { | @@ -62,7 +62,7 @@ function moveDir(from, to) { | ||
| 62 | 62 | ||
| 63 | function migrateDirs() { | 63 | function migrateDirs() { |
| 64 | for (const [oldName, newName] of Object.entries(RENAMES)) { | 64 | for (const [oldName, newName] of Object.entries(RENAMES)) { |
| 65 | - for (const base of ['system/agents', 'system/templates']) { | 65 | + for (const base of ['system/agents']) { // 28 批次 1:system/templates/ 已并入 system/agents/ |
| 66 | const from = `${base}/${oldName}`; | 66 | const from = `${base}/${oldName}`; |
| 67 | const to = `${base}/${newName}`; | 67 | const to = `${base}/${newName}`; |
| 68 | const fromAbs = path.join(ROOT, from); | 68 | const fromAbs = path.join(ROOT, from); |
scripts/real-pm-smoke.js
| @@ -64,7 +64,7 @@ async function main() { | @@ -64,7 +64,7 @@ async function main() { | ||
| 64 | ].join('\n'); | 64 | ].join('\n'); |
| 65 | 65 | ||
| 66 | console.log('▸ calling devloop-pm via real claude CLI...'); | 66 | console.log('▸ calling devloop-pm via real claude CLI...'); |
| 67 | - console.log(` (system prompt: system/templates/devloop-pm/prompt.md, ~3KB)\n`); | 67 | + console.log(` (system prompt: system/agents/devloop-pm/prompt.md, ~3KB)\n`); |
| 68 | 68 | ||
| 69 | const startMs = Date.now(); | 69 | const startMs = Date.now(); |
| 70 | let chunkCount = 0; | 70 | let chunkCount = 0; |