-
真 CLI 冒烟(worktree 隔离,PORT 3010)九轮来首次把 work 节点跑起来: orggraph-planning 真跑 3 分钟自主裁成单 org node 零边图 → workgraph-planning 第 1 轮产出合法图 → **自己按 Step 6 把 brd-planning / planner-validator 雇进公司** (W5/W6 核心验收成立,且 W7 判据生效、两者都没写进 org_graph_nodes)→ 第一个 work 节点 brd-planning 真起 CLI 子进程,产出 brd.md / contract.json / attempt-0.json 全部落在 run 目录内。图内预算仅 2 次调用 / 13998 tokens(上限 15)。 W5/W6 · workgraph-planning 自雇:撤掉「你不招人也不辞人」,Step 6 加招聘环节, 写死「先雇、再提交图」的顺序,给出失败分级与幂等要求 W7 · work 层招聘不写 org_graph_nodes:按 type 与 work graph 骨架点名两条判据区分层级, P2 「hire org 角色 → org graph 出现该节点」的语义保持不变 W8 · 控制台「规划组织结构」按钮(抽成 ReplanOrgGraphButton.vue,带过渡态与秒表), 接 POST /:companyId/org-graph/replan(该端点此前无任何前端调用方); 新增 fixtures/devloop-mock/orggraph-planning.json W12 · 节点失败留痕:node.output 带 output_excerpt、新增 node.error 事件。 真跑当场救场——守卫误判那条归因正是靠它才查得出来, 换成之前看到的只有「节点 fail、无原因、无痕迹」 测试 753/753 全绿(71 文件,起点 736/68)。 已知未修(下一轮):子 run 转终态不回写父 node_run 导致任务永久卡死; applyBoundaryGuard 用整仓 git diff 判归属会把并行 agent 的写算到当前节点头上; W12 的 fail_reason 未落库(概览 tab 仍为空);POST /:cid/tasks 无前端调用方。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
测试 736/736 全绿(68 文件,起点 719/66,净增 17 条,未改任何既有断言)。 W1 · seed 接进启动流程 + 悬空行回收 - server/index.js 与 agent-server.js 均在 listen() 前调 runStartupSeedSafely() (幂等、失败降级记日志、不挡服务启动) - seedTemplates() 此前**没有任何运行时调用方**,只有测试与手动脚本引用, 于是 system/templates/ 新增本体永远进不了 system_agents,而 work_graph_nodes.system_agent_id 是指向该表的外键 - 占位 id 回收:legacy_path 已失效的 company_hired 行改为可被 template 就地转正, 保留行 id 以保外键。此前 seedTemplates 遇占用即 skip,导致污染不可逆: lookupSharedAgentMd 恒 null → hire 静默退回全量拷贝 → 模板改动对已雇公司不生效 - 生产库实查:company_hired 0 行(原 10 条悬空全清)、template 45、 verifyCounts().ok=true、foreign_key_check 空 W2 · 项目根分配(四环闭合) - ensureProjectRoot 复用 path-resolver.allocateProjectRoot(sandbox 模式) - 分配 → 进 agent_call 与 planning 两处提示词 + callAgent metadata → 落 artifacts/project-root.json(wx 独占)→ readProjectRootRecord 读回 - 子 run 经 createRun 继承 root_run_id,跨层共享同一项目根 - 核实 data/companies/ 在 .gitignore 内,故项目根内的合法写入不会被 W3 守卫误报 W3 · 产出边界守卫(部分,文档如实标注) - 真 CLI 是子进程直接写盘,引擎拦不住,守卫只能拒收结果、不能回滚 - 7 条「拦不住」的情形逐条列明;文档自述「在 cwd 隔离做掉之前, 真跑仍应在可丢弃的工作副本里做」 W4 · 修验收 fail-open(性质严重) - benchmark-validator / testdata-validator 的 Step 表教 agent 写 verdict:"fail", 而引擎 FAILING_VERDICTS={attributed,inconclusive} 不含它 → 契约非法的产物 被判 success 放行。失效方向是放行不是拦截 - org-validator 的审计字段 verdict → audit_verdict:它与 work 层判词写同一路径 (nodes/<nodeRunId>/attempt-<n>.json),此前只靠「该节点恰好是 subgraph」 才没被 readNodeProduct 当判词读,属隐患藏在巧合里 - 新增防线 template-verdicts.test.js,从 graph-engine.js 源码取 FAILING_VERDICTS / ATTRIBUTION_REASONS 扫全部模板;经三次变异验证有效 (改回 "fail" / 改回 verdict / 造 "ok" 均变红并报精确行号) 真 CLI 冒烟未执行,两条理由(终验 agent 自行判断,符合任务给的门槛): ① W3 按其自身文档明确「不是沙箱」且要求真跑在可丢弃副本里做,而当前是主仓库、 持有未提交交付物、且有并行 agent 在写,W3 自述的误判项必然触发; ② 断点已零成本静态证明:getAgentConfig 解析裸名只查 system/agents/、 从不查 system/templates/,resolveAgentName 不做按需 hire,实测 prd-planning / sdd-planning / benchmark-validator / testdata-validator / validator-triager / org-validator 全部 throw「Agent not found」。花 $3-8 复现已知断点无意义。 故「做完这四件就能真跑」不成立,真跑挪到 W5/W6 之后。 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> -
按 27-p3-p4-work-graph-console.md v0.3 实现,三轮开发+校验后测试全绿 (693/693,P2 26/26、DevLoop 230/230 未被打破,web:build 干净)。 服务层 - work-graph-db.js 定义层(work_graph_*) + 运行时层(graph_runs/graph_run_nodes/ graph_run_loop_records) 五张表;状态转换表照 unit-registry 模式; 复用 org-graph-service 四项校验 + 新增第五项 fail-fallback-edge - graph-engine.js advanceOne 幂等原语;agent_call / subgraph 两种 executor; 手动与自动共用同一原语;双层熔断(单边 loop_count + 按 root_run_id 共池的 backward_count);任务级预算挂 root run;三层暂停/停止级联; 重试按 contract_hash unchanged 判据 - graph-run-sse.js 按 run_id 广播,状态转换+timeline+SSE 三者原子化 - goal-contract.js 验收契约格式与执行器(R-15.6 验收先行) 引擎泛化(R-15.4):org graph 与 work graph 走同一套 advanceOne, 定义层两套、运行时层一套,三层下钻用 parent_run_id 链。 R-16 失败归因:validator-reflection 专职归因节点;fail_reason 多边路由 (精确匹配→兜底边→死路);子 run 收敛透传 success/fail + fail_reason + remediation_note 三值;infra_flake 不烧任何计数。 路由 / 前端 / 模板 - routes/graph-run.js 八个端点;company.js 任务入口 - WorkGraphCanvas.vue 扩展 UnitsDAG(subgraph 角标、backward 虚线曲线、 N/3 循环徽标、异常流程视觉降权);GraphConsole.vue 三栏 + 四 tab 详情 - 五个新 agent 模板:validator-reflection / org-validator / planner-validator / coder-validator / workgraph-planning 命名统一(R-15.3 + NAMING §三):org 节点改为 org-{职能}, 三个 org-graph 模板末节点收敛到 org-validator;org_graph_edges 加 fail_reason 列并把唯一索引补上该列(避免精确边与兜底边互相吞掉)。 三轮校验修掉的主要缺陷:subgraph 重跑不起新子 run 导致永久死锁; SSE/timeline 零调用方;org 侧 fail_reason 写入被丢弃;fail-fallback-edge 只做了一层;backward_count 跨 run 树重置架空熔断外层; seedEntryNodes 误点亮只有 fail 入边的节点。 已知缺口见后续提交:remediation_note 仅在 backward 边落库、 total_tokens 预算维度无生产方。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
用 9 个并行 agent 按「文件独占」划分实现 P2 的 T1-T9(T0 已于 2255f09 完成)。 详见 docs/todo/system-design/27-p2-org-graph.md §五。 阶段 A · 数据层 - graph-db.js: org_graph_nodes 加 status/reports_to_node_id(PRAGMA 探测后 ALTER, 幂等);全量唯一索引换成 WHERE status='active' 的部分索引,使「fire 后重新 hire 同角色」可行;org_graph_edges 重建为执行流边(condition/edge_kind/status) - graph-service.js: ensureOrgGraphNodeIndex 同步改建部分索引,且 upsertOrgGraphNode 的 ON CONFLICT 必须写成 ON CONFLICT(company_id, role_name) WHERE status='active' —— SQLite 的冲突目标要与部分索引谓词逐字对应,否则整条 INSERT 直接失效 - org-graph-service.js(新): validateGraph 四项校验 + writeGraph/patchGraph/ getGraph/removeNode,事务化,节点软删除级联失效相关边 - routes/company.js: 四个端点 POST/PATCH/GET /org-graph + POST /org-graph/replan; /create 接入自动招聘 orggraph-planning + 异步触发(失败降级为空壳公司); /fire 接入节点软删除 阶段 B · 自动生成 - system/org-graph-templates/{dev,content,ops}.json + README:三张三段式骨架 (规划→执行→验收,验收失败回退到执行节点),角色名遵循 {domain}-{职能} - system/templates/orggraph-planning/:新 system agent(type='meta-bootstrap'), 含 §4.1 八步工作流 - company-service.js: 模板不存在时从 system/templates/base/ 元 agent 继承骨架 (自动带 RESEARCH→PLAN→EXECUTE→VERIFY 四段式)+ agent-creator 填充, 新建 agent scope='company'。这是 27-E2E §八bis 元 agent 继承的落地点 阶段 C · 展示 - CompanyDashboard.vue: 组织流程拓扑链渲染 + 空态降级 + 环深度保护 并行编排中发现并修复的三处(均不在原任务划分内): - AppNav.vue 建公司表单缺 goal 输入框 —— T0 只改了后端,前端表单没同步, company-goal 实际传不进来。这是上一轮 T0 的遗漏 - graph-seed-service.js 会把 type='meta-bootstrap' 的 orggraph-planning 塞回 org graph,与 hire() 的 guard 不一致 - graph-agent-p1-acceptance.test.js: hire 未知角色的返回从 needs_training 改为 hired_from_base(T5b 的行为变更),断言同步 验证(独立复核,非 agent 自述): - npm run test:unit 676 passed / 63 files(基线 652,+24 为新增的 org-graph 用例) - npm run web:build 通过 - 三个模板 JSON 实跑 validateGraph 全部通过;四类非法图各自被对应 rule 拒绝; writeGraph→getGraph→removeNode 级联验证通过(删中间节点后 3 条边全部失效) 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> -
hire() now checks system_agents (source_kind='template') before provisioning a new company agent: if the role has a shared template row, skip copying agent.md and instead let AgentManager.getAgentConfig()/PromptBuilder.build() resolve the prompt from the shared legacy_path at call time, with per-company context assembled from a new company-context.md. Roles without a template row (including the 6 ids that exist in both system/agents/ and system/templates/, e.g. evolver-youtube-crawler) fall back to the existing full-copy behavior unchanged. - server/services/graph-service.js (new): lookupSharedAgentMd(), upsertOrgGraphNode() - server/services/company-service.js: hire() reference-mode branch, _provisionReferenceAgent() - server/src/core/agent-manager.js: getAgentConfig() resolves prompt/companyContextPath - server/src/core/prompt-builder.js: build() concatenates company-context.md - unit + integration tests covering all 6 acceptance criteria from docs/todo/system-design/27-p1-virtual-reference.md §6, including a regression test against the real idearun:evolver-youtube-crawler naming-collision case Full regression suite (587 tests) passes; independent adversarial review found 0 blocking/major issues. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
-
Adds server/services/graph-db.js (new data/graph.sqlite: system_agents, org_graph_nodes, org_graph_edges) and graph-seed-service.js, which scans system/agents/, system/templates/, and data/companies/*/company.json into seed rows without touching company-service.js's existing hire/copy path. Real repo data diverged from the design doc's original estimates (8 not 10 global agents; 39 not 34 template dirs; system/agents/ and system/templates/ turn out to share 6 ids describing the "same" agent from two different files) — documented in docs/todo/system-design/27-graph-agent-architecture.md section 7 for P1/P2 to resolve. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
-
- 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