You need to sign in before continuing.
-
system/templates/ 已随 28 号改造整体并入 system/agents/,目录在磁盘和 git 里都已不存在。 但引用还散在各处,其中几处是 agent 运行时真会照着读写的: 本体提示词(读不到就静默降级,不报错) workgraph-planning/agent.md system/templates/base/ ×3、模板库路径 ×1 orggraph-planning/agent.md 同上 ×1 orggraph-planning/tools.md ×1 org-innovator/agent.md 四条产出落点 system/templates/weibo-scraper/train/* skill 代码里的硬编码目标 evolver-youtube-crawler 的 refactor.js / mock_setup.js / evolve.js 共 4 处 innovator-hunt/collect_seed.js —— 这处是真 bug 且已发作过: 写的是裸相对路径 'system/templates/…',相对 cwd 解析,于是在 agent 自己目录下 造出一棵野生嵌套树 system/agents/innovator-hunt/system/templates/… 现在改成由 __dirname 推导,不再依赖 cwd(cwd 已经是深度 3 的任务态目录) 图模板契约(work-graph-templates / org-graph-templates 的 README) CI 防线的三条规则写的还是「在 system/templates/ 下必须有目录」「在 system/templates/_registry.json 里必须有条目」,与实际执行的检查已经对不上 DevLoop PRD(13 份 HTML + 重新生成的 52 份 _spec + build-manifest + search-index) 写的是 system/templates/devloop-pm.md(扁平 .md)。根和形状都错: loop-controller.js:166 实际读的是 system/agents/{agentName}/prompt.md。 按真实形状改,然后跑 spec:extract / extract-manifest / build-search-index 重新生成。 顺带订正两处早于本次改造就已过期的内容: - 「避开 6 个命名冲突 id」这条约束列的 digester / evolver / hunter / innovator 四个 id 根本不存在(早已改名),而它的理由(两个目录下各有一份、内容不同步) 也已随合并消失。约束保留(元 agent 本来就不该进执行流),理由与清单按实际本体重写。 - orggraph-planning/agent.md 里「真相源是 company.json.agents[]」—— 28 号起真相源是 company_agents 表,company.json.agents[] 仅作兼容保留。 刻意不动的三类(改了是净损失): 历史说明 server/ 下解释「原来指向 X、批次 1 并进了 Y」的注释、docs/done/、tasks/ 完成证明 server/tests/ 里断言该目录已不存在的守卫 运行态记录 未跟踪的 workspace/ conversations/ 与 train/ 下的历次训练报告 新增 server/tests/unit/no-stale-templates-path.test.js 守住活定义这一档: 扫 system/ 与 fixtures/ 下被 git 跟踪的文件(跟踪=人工维护的定义, 未跟踪=运行态产物),零例外。带「样本非空」前置断言防 git 失灵时退化成永远通过。 改坏一处实测能精确点名到文件行号。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> -
设计见 docs/done/system-design/28-agent-registry-unification.md。 改造前 Agent 本体散在三处(system/agents/ 11 个、system/templates/ 50 个、 data/companies/{id}/agents/ 17 个),同一个 AgentScaffold 被三个 baseDir 实例化。 后果是同一角色在 N 家公司下有 N 份互不相干的副本,模板更新不会同步; org-coder / org-planner 这类走 hireFromBaseMetaAgent 造出来的本体 legacy_path 指回自己公司目录,永远无法被第二家公司复用。 本次: - G1 单一注册表:system/templates/ 整体并入 system/agents/,base → _base。 7 个同名 id 逐个裁决,被丢弃的一份归档到 docs/_archive/ 而非删除。 source_kind(template/global_agent/company_hired) → origin(builtin/created)。 - G2 运行态下沉:CLI 的 cwd 从本体根改为 system/agents/{aid}/{cid}/{taskId}/。 memory / conversations 落公司态 {aid}/{cid}/,按公司隔离不串。 sessionPool 的 key 含 (companyId, taskId),两家公司调同一 agent 不复用会话。 - G2b 产物不下沉:交付物仍落 data/companies/{cid}/,system/agents/ 只留运行痕迹。 写入边界按链路分叉——graph 节点走节点私有目录(被 indexNodeOutputs 索引), chat 走公司 workspace,同一提示词里不再出现两条互斥指令。 - G3 公司只存引用:data/companies/{id}/agents/ 删除,新增 company_agents 关联表。 不复用 org_graph_nodes——后者是执行流图,work 层本体被雇时不写它,天生覆盖不全。 - G4 缺则创建:本体缺失时从 _base 复制骨架进 system/agents/{id}/, agent-creator 填 agent.md/soul.md 后才从 draft 转 active(哨兵判据, 骨架未填时哨兵仍在,不许被 hire)。产物即刻是全系统可复用的本体。 新增 server/services/agent-locator.js 收编原先散在 6 处的寻址逻辑。 边界守卫(graph-engine)的豁免从「本体根上五个文件名」放宽为整棵 system/agents/: 新本体的骨架本来就要进 git,gitignore 挡不住 ?? system/agents/{newId}/, 旧判据会把一个真正成功的招聘节点判成 boundary_escape fail。 存量迁移见 scripts/migrate-agent-registry.js(幂等,备份到 data/_migration-backup-*)。 真 Claude CLI E2E 已验证:新建公司 → orggraph-planning 自动规划 → 自动招聘 org-planner/org-coder/org-validator 三节点流水线; data/companies/{cid}/agents/ 不存在,company_agents 4 行, system_agents 56→56(零新建私有本体,纯复用),git status 零增量。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
■ 前端路由遮蔽(既有 bug,被 P2 的 T8 暴露) web/src/router/index.js: CompanyAgentChat 的 path 是 /:id/agents/:agentId? —— agentId 可选,导致它抢占 /:id/agents,而导航栏「Team」正是指向这个地址。 结果 CompanyDashboard 的团队 tab(连同 P2 新增的 Org Graph 区块)完全不可达, 点 Team 打开的一直是 AgentChat。改为 :agentId 必填。 ■ Org Graph 空边时凭空画出流程链(P2 T8 的 bug) 0 条 forward 边时所有节点入度都是 0,全部落进拓扑序且 degraded=false, 模板照常在节点间渲染 → 箭头,凭空捏造出一条并不存在的流转顺序。 P0 迁移进来的存量公司(有节点无边)全部中招。新增 orgGraphNoEdges 判定: 这种情况只平铺、不画箭头,并明确提示「尚未定义流转顺序」。 ■ create() 仍在建 goals/ 目录(我在 OKR 正名 74ea1ff 里的遗漏) company-service.js 的 subdirs 列表没跟着 goals→okr 一起改,新建公司仍然产出 goals/ 空目录。改为 okr/。 ■ test-company-e2e.js 从「第 4 个断言就崩」修到 114/114 全绿 该脚本长期整体失效,HEAD 版本同样全断言失败。四类问题: 1. 路径过期:data/{id}/ → data/companies/{id}/;data/templates/ → system/templates/;data/agents/master → system/agents/master 2. Phase 4 用 ceo 模板测「骨架是否完整复制」——但 system/templates/ceo/ 只有 plan.md + todo.md,没有 agent.md/soul.md/config.json,测不出东西,且缺 config.json 就没有 type='cxo',company.ceo 也标不上。改用同为 cxo 且文件 完整的 coo。(ceo 模板本身的残缺是另一个待补的问题) 3. 断言停留在 P1 之前:P1 虚拟引用(226489d)之后 agent.md 不再物理拷贝, 改为 config.json.systemAgentRef + company-context.md。按新模型改写 4. 断言停留在 T5b 之前:模板不存在时返回 hired_from_base 而非 training 顺带记录一个设计缺口(未改,仅在测试注释里说明):system/templates/base/ 目前只有 agent.md + config.json,所以 base 继承出的骨架不含 soul.md / identity.md / tools.md / todo.md,也不含 AgentScaffold 的标准子目录结构 (memory/short-term、knowledge、workspace 等)。这些依赖 agent-creator 填充。 另删除 OKR 迁移的 *.bak-goals 备份目录及其 .gitignore 规则。 验证:npm run test:unit 676 全绿;test-company-e2e 114/114;web:build 通过; Chrome 实机确认 Team tab 可达、空边提示正确。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
代码层: - server/services/goals.js → okr-service.js;GoalsService → OkrService · this.goalsDir → okrDir,目录 goals/ → okr/ · ID 前缀 G- → O-;落盘文件 goal.json → objective.json · updateGoal → updateObjective,_nextGoalId/_saveGoal 等同步改名 · parseNodeId 层级名 ['Goal','Objective','KeyResult','SubTask'] → ['Objective','KeyResult','SubTask','SubTask'](OKR 无 Goal 这一层) - server/routes/goals.js → okr.js;:goalId → :objectiveId - 7 处调用点同步:index.js / agent-server.js / agent-chat.js / company.js / company-heartbeat-service.js / prompt-builder.js / test-company-e2e.js - 前端 OkrDashboard.vue / CompanyDashboard.vue 切到 /api/okr(前后端命名终于一致) - bin/lemon.js 新增 okr create/add-node/list/status 向后兼容(不破坏任何现有调用方): - /api/goals/* 与 /api/company/:cid/goals/* 全部保留为别名,与新路径同时挂载 - task dispatch/report 同时接受 objectiveId(新) 与 goalId(旧),写入时两字段都留 - bin/lemon.js 保留 goal * 命令别名 迁移脚本 scripts/migrate-goals-to-okr.js(npm run okr:migrate): - 目录 data/{,companies/*/}goals/ → okr/;条目 G-xxx → O-xxx - 改写 objective.json 的 id / nodes 的 key / children 数组、_index.json、 progress.json 的 goalId、history.log 文本、system/tasklog/*.json 的 goalId+nodeId - --dry-run 预演;幂等;迁移前自动备份为 *.bak-goals(已加入 .gitignore) - 处理一个反直觉边界:OkrService 构造函数会自动 mkdir 目标目录,"okr/ 已存在" 不等于"已迁移过"——只要服务被 require 过一次就留下空壳。用 isEmptyOkrDir() 区分空壳与真实数据,空壳移除后继续迁移。这个 bug 是在 fixture 上验证时发现的。 - 同样在 fixture 上发现并修掉:nodeId 的值漏改写、tasklog 迁移不幂等 验证:新增 server/tests/unit/okr-service.test.js(7 例,覆盖新命名工作正常 + 迁移纯函数的 ID 改写);全量 npm run test:unit 652 例全绿。 范围说明:NAMING §五 的 benchmark 三分(skill-/agent-/goal-)本轮未动代码—— 该节自身的建议就是存量保持现状、只对新增代码强制前缀,因为 benchmark_runs 等表 服务于线上 Arena 排行榜,改表名/路由是另一次独立迁移。 §二-四 的新 agent id 尚不存在实体,待 P2/P3 实现时按规范创建。 已知遗留(非本次引入):server/scripts/test-company-e2e.js 早已失效——它按 data/{id}/ 找公司,而 company-service 用的是 data/companies/{id}/,在 HEAD 版本 同样全部断言失败。本次只同步了其中的 OKR 命名,未修这个路径问题。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
- CompanyHeartbeatService: company-level heartbeat with timer registration - Auto-trigger: cron-based pipeline scheduling (intervalHours) - Active run driving: dispatch tasks to agents, timeout detection - CEO heartbeat: periodic company status check - Pipeline cron field support in definitions - Registered in server startup alongside agent heartbeat - E2E test: 113/113 passed (all phases + autonomous loop)
-
- PipelineService: define pipelines with ordered agent-assigned steps - Run lifecycle: start → markStepStarted → advanceStep → complete - Step output automatically flows as next step input - Pipeline CRUD + Run management REST API routes - E2E test: 106/106 passed (Phase 1 + 2 + 3 + 4)
-
- GoalsService refactored: constructor accepts optional companyId - With companyId: goals stored in data/{companyId}/goals/ - Without: backward-compatible data/goals/ (global) - Company Goals REST API: full OKR CRUD under /api/company/:id/goals - OKR isolation verified: different companies have independent goal spaces - E2E test: 81/81 passed (Phase 1 + 2 + 3) -
- scaffoldNewAgent: create agent skeleton via AgentScaffold directly - depositTemplate: benchmark gating (≥95) + auto-deposit to templates/ - hireWithTraining: full flow (template lookup → scaffold fallback) - Company route: /hire uses hireWithTraining, new /deposit-template endpoint - E2E test: 69/69 passed (Phase 1 + Phase 2)
-
- CompanyService: CRUD (create/get/list/update/shutdown) - Agent Hiring Pipeline: template lookup → copy → context injection - Template registry (_registry.json) with CEO and qa-judge initial templates - resolveAgentDir(companyId, agentId) unified agent directory resolution - Company REST API routes (/api/company/*) - E2E test: 46/46 passed
-
…ze Chinese keyword extraction - Fix: The long trailing history in todo.md drowned out the actual current task keywords because English tokens (e.g. TASK, P2, from) padded the 30-keyword limit beforehand. - Updated extractKeywords: Process Chinese characters first as they carry more weight for NLP context intent. - Added userMessage prefix to searchText in buildSystemPrompt so newly dispatched tasks dominate keyword extraction. - End-to-end e2e test created and passed (27/27 asserts passed)
-
Phase 3 features: - autoReflect: auto-trigger on complex conversations (toolCount>=3 or duration>=60s) - Extracts patterns from successful conversations - Extracts lessons from failed conversations - Auto-solidifies cerebellum plans from 5+ tool-call successes - Writes reflection logs to memory/reflections/ - Updates memory.md 'verified patterns' and 'lessons learned' sections - consolidateMemory: merge short-term sessions older than 7 days into long-term/ - Extracts frequent keywords across merged sessions - Writes consolidated summary to long-term/consolidate-{date}.md - Updates long-term/patterns.md with high-frequency patterns - generateDailyReport: aggregate today's sessions and reflections into daily/{date}.md - API endpoints: POST /:agentId/memory/consolidate, POST /:agentId/memory/daily-report Test results: 16/16 passed (Phase 3 test suite) -
- Hippocampus keyword matching engine (extractKeywords + score) - Cerebellum plan storage (saveCerebellumPlan) - Auto-sync hippocampus-index.json + hippocampus.md - POST /:agentId/memory/cerebellum API endpoint - buildSystemPrompt injects matched plans from hippocampus - Use count & lastUsed tracking on plan access - Chinese n-gram + English word tokenizer with stop words - Fix: score formula uses entry keyword count as denominator - Fix: useCount updates original index entry not spread copy - Verified: OKR plan matched + injected into CEO prompt
-
- Agent as Micro-Container: each agent lives in data/agents/{id}/ with full encapsulation - Persona vs Capability split: agent.md (identity) + .claude/skills/main_skill/SKILL.md (workflow) - Conversations co-located: data/agents/{id}/conversations/ replaces global dir - Meta Skills renamed: meta_hunt, meta_digest, meta_creator, meta_evolving, meta_benchmark, meta_research - Dynamic Hot-Reload: AgentManager.getAgentConfig() falls back to filesystem scan - Parallel Sub-Agent orchestration via Promise.all with multi-terminal UI - Removed SQLite dependency, global skills/ directory, and legacy conversations/ - Full architecture docs: 18-local-filesystem-first-agent-encapsulation.md