-
goal 从「人写一句话」变成「agent 拆成一张 task DAG、人确认后下达」, 收敛时由 org-validator 在 goal 层再验一次。 ## 交付 - task-planning 本体(毕业判据实测通过:agent.md + soul.md 一次写完、 不带 _base 哨兵、路径按 cwd 深度 3 实算核对) - 拆分链路:3 轮 errors 原样回喂 → 不过就降级成 1 条同描述 task, goal 绝不卡在 planning;token 记 goals.planning_tokens - goal 级 org-validator 验收:≥2 条 task 全 completed 才调,单 task 跳过, 有 failed 直接 failed 不调(省一次真花钱的调用) - 控制台四栏 + GoalTaskPane 两级树 + 两步表单(拆分中给逃生口) - 中断恢复:启动时补跑验收与汇报 ## 三条跨进程竞态,全部用真探针实跑复现后才判定修好 1. runGoalSplit 无条件把 goal 写回 draft,抹掉逃生口刚下达的 active —— 而触发它的正是表单自己推荐的那个逃生口。后果是一个正在烧钱的 goal 显示成「草稿」,且从此永不收敛(OKR 不写、上级不唤醒、无日志) 2. CAS 把最终态提前写进库,验收窗口内重启即丢,且 verdict=NULL 与 「单 task 合法跳过」形态相同,查不出来 → 占位判词 + 启动重推 3. 认领语句 SET verdict=RESUMING WHERE verdict IN (PENDING, RESUMING) —— 写进去的值就在 WHERE 里,changes 恒为 1。而函数注释白纸黑字 写着「认领写的是另一个占位值」。注释是对的,代码没兑现。 实测:org-validator 调 2 次 / OKR 写 2 条 / token 双记 → claim 带唯一 token + 时间戳租约,回写条件更新决胜,主路径同闸门 ## 与设计正文的偏离(已记进文档 §十四) 拆分后 goal 落 draft 而非 active(active 的语义已被 markGoalDispatched 钉死为「已下达」);mode 三级继承对显式 tasks[] 同样生效;占位判词不出 API;新增 planning_error / reported_at 两列,后者迁移带回填(否则升级后 第一次启动会把历史终态 goal 全部重报一遍)。 ## 过程 四轮 26 个 agent,复核报出 22 条缺陷,其中 6 条是修复自己引入的。 第四轮修完挂了 3 条测试,全是测试在钉住缺陷本身 —— 其中一条的注释 写着「模拟进程死后重启」,构造的却是新鲜占位值:注释描述 A 场景、 代码构造 B 场景、断言按 A 场景写。 全量:118 文件 / 1112 测试全绿,web:build 通过。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
sessions 里存的是**常驻**的 claude CLI 子进程(stream-json 模式,不是一次性的 `claude -p`),此前只有四条回收路径:协议 error / 子进程 disconnected / 手动删对话 / 手动 stop —— 「正常跑完的对话」不在其中。 而两路心跳都用一次性 convId 打进 /api/agent/:id/chat: - heartbeat-service:`heartbeat-${Date.now()}`,cto / coo 各 5 分钟一次 - company-heartbeat-service:_sendAgentChat 的五个调用点(CEO 巡检 / Pipeline 步骤 / 日程 / 告警 / 日报)convId 也全是一次性的,且无差别带 isHeartbeat:true 于是每次心跳新起一个进程且永不释放。实测单次运行 2h43m 攒到 82 个进程 / 17.5 GB RSS。 改法: - 心跳会话跑完立刻 closeSession(一次性 convId,会话复用对它零价值) - 普通对话上空闲 TTL(默认 30 分钟,AGENT_SESSION_IDLE_MS 可覆盖),复用 engine/idle-timer - 计时器只在「没有在途请求」的间隙走:getOrCreateProtocol 命中复用时 cancel,请求结束时 重新上弦。所以再长的单次生成也不会被 TTL 打断,比在流式回调里 touch() 少一个调用点 - 删对话 / stop 两处手抄的 disconnect+delete 收敛到 closeSession,否则它们不停表 守卫:agent-chat-session-reclaim.test.js 用现成的 /chat/:convId/stop 当黑盒探针 (查得到会话才返回 success:true),不为测试加导出口。对 HEAD 版本跑过:2 红 1 绿 —— 两条回收断言修前失败,「普通对话保留会话」修前修后都绿,证明复用能力没被顺手砍掉。 线上验证:重启后第一轮心跳 2 触发 / 2 回收,server 名下 claude 子进程数 0。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> -
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>
-
测试 786/786 全绿(76 文件,起点 760/72),未改任何既有断言。 ## 本轮三件新东西,全部经真 CLI 验证 W12 补完 · 失败原因四环打通 - 引擎自判的失败(executor 抛异常、边界越界、子 run 无归因)现在也落 graph_run_nodes.fail_reason,不再只有 agent 归因产出的才有值 - 概览 tab 展示「[引擎判定] boundary_escape」+ 终端样式 excerpt, 取不到 fail_reason 时回落 output_excerpt,并标明来源 - 真跑实查:两行 fail_reason='boundary_escape' 都在库里, 产生→传递→落库→读回四环在真 CLI 下走通 W13 · 运行态文件根治(守卫误判的根因) - 17 个 todo.md / plan.md / scheduled_tasks.json git rm --cached + gitignore; 源码(agent.md/config.json/soul.md/tools.md)一个未碰,模板本体仍跟踪 - _registry.json 的 usedCount 挪进已忽略的 data/template-usage.json - 真跑验收:整轮(agent-creator、Master 各一次真 CLI、3 次 hire)结束时 worktree git status 与基线逐字相同,_registry.json 零 diff 单步进度感 · 真 CLI 一个节点 3-7 分钟 - 画布卡片秒表 + 详情面板常驻条「运行中 2m40s · 最近事件 …(2m40s 前)」 - 不做假进度条:引擎不知道 agent 还要多久 - 顺手修 NodeDetailPanel 不跟 SSE 走(否则秒表也不会动) W9 失败上下文进提示词、W10 跨层地址两半、W11 Hot Swap 显式告警同批完成。 ## 真跑结论:链路更长,但「work 节点 → success」仍未跑到 走到:orggraph-planning 落图自雇 → agent-creator 补定义 → workgraph-planning 真跑规划 + **先雇后提交**(W5/W6 再次成立)→ 子 run 起来 → work 节点 RUNNING → 7m19s 后 fail。两层原因叠加,都与 W1-W14 无关: 1. **新缺陷**:agent-manager.js:324 把 idleTimeoutMs 硬编码 120s, readme-writer 通读源码静默超 2 分钟被掐死(动笔前就死了)。 同进程 ClaudeCliProtocol 早把自己的 idle 上限放到 24h, stream-executor 的 JSDoc 默认值写的是 30 分钟 —— 这里把两者都压掉一个数量级; 且 ...options 透传的 idleTimeoutMs 会被下一行覆盖,调用方无法覆写。 2. **并行 agent 污染**:retrain-watchdog 每 5 分钟唤起的 Master 在同一工作树里 改了两个源文件,被守卫 git status 差集算到该节点头上 → 额外署 boundary_escape。 这是 W3「拦不住」第 5 条第一次真实发生。 顺带记一笔:这一轮任务是 **LemonBoss 自己的 Master 自主下的单**, 走的正是 POST /api/company/:id/tasks,它还自行诊断出了上面那个 idle timeout 并动手改(引用了未定义的常量,是坏的)。 ## 已知未修(下一轮) - idleTimeoutMs 硬编码 120s —— 「work 节点 → success」跑不通的唯一技术原因 - W7 在**零边最小图**上失效:判据③要求存在 active org_graph_edges, 零边图上三条判据全落空,work 层本体被写进 org_graph_nodes。 服务层那 9 例测试造的都是有边的成型图,正好绕开这个形状 - 前端 ACTIVE_RUN 含 blocked、后端 ACTIVE_ROOT_RUN_STATUS 不含: 一家公司只要失败过一次,控制台上就再也下不了第二个任务(后端其实放行) - 真跑期间工作树里不能有第二个 agent 活动,否则守卫判罚不可信 —— 应写进真跑规程 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
界面走查(真 server + HTTP + 真 AgentManager,底层 mock 协议)已把 manual 模式全流程点通:org 节点起子图 → 下钻 work graph → 单步 → 第 3 步触发回退(徽标 0/3→1/3、run 级 1/5 双层计数同时可见)→ 归因记录与 remediation_note 完整送达 → 收敛后父节点结算、左栏前移。 mock 侧补两处缺失接线(都是「四环漏一环」,非新功能) - ClaudeCliProtocol._sendMockPrompt 按 agent 类型查 fixture:图执行侧的 agent 名带公司前缀(resolveAgentName 返回 {cid}:{id}),fixture 不该 按公司复制一份。DevLoop 侧名字不含冒号,行为不变 - graph-engine.defaultAgentExecutor 接住 mock/files 事件:此前只有 DevLoop 的 loop-controller 接,图执行侧没接,于是 mock 下 readNodeProduct 永远找不到 attempt-{n}.json,validator 系节点恒 blocked。 写入限制在节点产物目录内,越界丢弃并留痕 新增 5 份 P3 fixture(workgraph-planning / prd-planning / sdd-planning / coder-validator / validator-triager),coder-validator 用 sequence 演示 一次回退。图必须放 chunks 不能只放 result——callAgent 的 output 来自 流式 chunks,session/result 的文本不进 output。 控制台入口:CompanyDashboard 加「🕸️ 执行控制台」按钮(路由早已注册, 此前无任何入口,只能手敲 URL)。 scripts/p3-demo-setup.js:手工测试准备脚本(雇人+写图+起 run),头部 写明它是两个已知缺口的绕行,缺口修好后第 1 步即可删。 _registry.json 补齐 6 条本体登记(brd/prd/sdd-planning、goal-benchmark、 benchmark/testdata-validator)——同轮新增的 template-refs 防线测试正是 因为缺这 6 条而变红,防线抓到了「交付与报告不符」。 文档 - 27-REQ R-18:招聘归 workgraph-planning(方案 a)、停用 mock 改真 CLI - 27-P3B 真实运行前置(新增):11 个工作项分三批,含现状核实 10 条证据 (seedTemplates 无运行时调用方、10 条悬空 company_hired 行、 FAILING_VERDICTS 不含 "fail" 导致验收假放行等) 测试 719/719 全绿(66 文件)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> -
命名轴是「节点在哪一层图里」,把散落的老 agent 归到它实际所处的层级: innovator → org-innovator type='cxo',是 org graph 层的节点 hunter → innovator-hunt innovator work graph 第 1 阶段 digester → innovator-digest 第 2 阶段(输入是 hunt 产出) evolver → innovator-evolver 第 3 阶段 依据:retrain-pipeline.js 的 stepConfigs 就是按 hunter → digester → evolver 顺序 跑的,行 231 明写 steps: ['re_hunt','re_digest','evolve'] —— 这三个本来就是 innovator 的 work graph 三阶段,只是名字没体现出来。 ■ 迁移(scripts/migrate-agent-naming.js,--dry-run + 幂等可重跑) - 8 个目录(system/agents/ + system/templates/),用 git mv 保留历史 - system_agents 表 4 行的 id 与 legacy_path - 公司实例目录与 company.json.agents[](本次无公司雇过这四个,实际 0 条) ■ 代码引用点(5 处,手工改) - retrain-pipeline.js: stepConfigs 的 agent 字段 ×3、agentToStep 映射的 key ×3、 call_sub_agent 的 evolver 判断 - agent-chat.js: agent 列表过滤里的 innovator - company.js: 模板训练触发的 agentId ■ 刻意不动的三类同形异义(改了会坏) 1. skill 内部子目录名 {skillDir}/hunter/knowhow.md —— 那是 hunt/digest/evolve 三阶段的产物目录约定,与 agent 名同形但不同义。涉及 open-api.js:402、 retrain-pipeline.js:148/374、evolution-loop.js:178、sync-skills.js 的 INTERNAL_DIRS 2. skill 命名空间白名单 —— skill-dir-manager.js 的 CORE_SKILLS、 migrate-trained-skills.js 的 SYSTEM_SKILLS,那里的 'innovator' 指同名 skill 3. conversations/ 与 system/tasklog/ 下的历史记录 —— 运行态数据,不改写历史 evolver-youtube-crawler 按 §3.4 列为待定,迁移脚本按精确目录名匹配,未误伤。 这四个重命名顺带解决了 27 号文档 §七 挂了很久的 6 个命名冲突 id —— 重命名后 system/agents/ 与 system/templates/ 下不再有同名目录(只剩 agent-creator 与 evolver-youtube-crawler 两个,前者是基础设施角色按规则不改名)。 验证:npm run test:unit 693 全绿(64 files);test-company-e2e 114/114; 迁移脚本二次执行 dirs=0 dbRows=0 skipped=8(幂等)。 未触碰另一进程正在进行的 P3 文件(graph-engine.js / graph-run-sse.js / work-graph-db.js / 27-p3-p4-work-graph-console.md / 27-requirement.md)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
…_DIR move, stray files - CLAUDE.md: document DevLoop subsystem (spec-first workflow, project root/git-vault, mock mode, L1 loop, unit layout, audit trail) and add missing test commands - server/routes/agent-chat.js, server/services/task-service.js: TASK_META_DIR moved from system/agents/.tasks to system/tasklog - system/agents/master/.claude/scheduled_tasks.json: scheduled task state update - remove stray memory/daily/2026-04-02.md and a garbled-filename artifact left under system/agents/digester-youtube-crawler/ Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
-
- Updated plan.md/todo.md for master, innovator, evolver, hunter, digester - Updated template configs and training data for multiple scrapers - Added new SKILL.md, evolve reports, and training artifacts - Cleaned up idearuncreate skill directory structure
-
1. Evolver agent.md: Added token budget rules - No re-reading unchanged files between iterations - Use head/grep instead of cat for large files - Concise output only (scores + diff summary, no full SKILL.md) - Cap at 5 iterations per session (was 10) - Early stop if score change < 2 points for 2 consecutive rounds 2. agent-chat.js: System prompt size guards - MAX_PROMPT_FILE_SIZE = 15KB per file (auto-truncate with warning) - MAX_TOTAL_PROMPT_SIZE = 100KB total (safety net) - Prevents runaway files from inflating context ever again
-
Root cause: heartbeat.md instructed Master to append inspection logs to plan.md on every heartbeat, causing plan.md to grow to 209KB (2922 lines of repeated 'status stable' logs). Changes: 1. Truncated master/plan.md from 209KB to 7KB (kept pipeline records, removed 2800+ lines of repeated heartbeat logs) 2. Updated heartbeat.md rules: - Banned appending inspection logs to plan.md - Added token budget awareness (10KB file read limit, prefer grep/find) - Normal heartbeats should reply '[心跳正常]' without using tools
-
Templates with new train data (hunt/digest/evolve): - agent-creator, auto-publisher, clickbait-copywriter - community-manager, competitor-spy, data-harvester - digester, weibo-scraper, interactive-video-selector - lemonv_drama, reddit-scraper, story-architect Updated configs & plans for all active templates. Updated agent states (master, innovator, hunter, evolver, digester). Added CLAUDE_EFFORT=low to .env (global disable thinking). Updated bin/lemon.js CLI tool. .gitignore: exclude evolve intermediate artifacts (FRAUDULENT, batch/eval scripts, iteration logs/scores, scorer versions, SKILL versions, .env)
-
- New template: content-selector with skills, train data (hunt/digest/evolve) - youtube-crawler: add workspace archive, digest_v2, evolve_v2, mock data - Update agent todo/plan/SKILL files for digester, evolver, hunter, innovator, master - Update server/routes/agent-chat.js - Update .gitignore: exclude runtime data (memory, sqlite, __pycache__, temp files)
-
- Add YouTube Data API v3 key to .env - Update start.sh to auto-load .env file on startup - Add youtube-crawler Skill template with full lifecycle - Add digester/evolver agents for YouTube crawler - Update scheduled tasks and master plan logs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-
- Moved data/system/ → system/ (agents, templates, skills, data, workspace) - Updated all server route/service path references - Updated all script path references - Updated all documentation references - Restructured .gitignore for cleaner system/ vs data/ boundary system/ = platform-shared assets (system agents, template library) data/ = tenant-specific company instance data