• 用 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>
    yibo authored
     
    Browse Dir »
  • 四处写 _registry.json 的地方都用 JSON.stringify(registry, null, 2) 直接落盘,
    不带末尾换行。文件在仓库里是带换行的,导致任何一次 hire()/depositTemplate()/
    模板增删改之后,git diff 都会多出一行 "\ No newline at end of file" 的噪音,
    把真实的数据变更淹掉。
    
    写入点:
    - company-service.js:374  depositTemplate()
    - company-service.js:824  _updateTemplateUsedCount()
    - routes/company.js:86    PATCH /templates/:templateId
    - routes/company.js:120   DELETE /templates/:templateId
    
    同时提交一次真实的运行时数据变更:qa-judge usedCount 7 → 8。
    
    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    yibo authored
     
    Browse Dir »
  • …_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>
    yibo authored
     
    Browse Dir »

  • Final P0 deliverables to make the system bootable in mock mode and
    pass `scripts/phase0-verify.js` + `scripts/phase0-test-call.js` end-to-end.
    
    ClaudeCliProtocol (mock mode):
    - LEMONBOSS_CLAUDE_MODE=mock or { mock: true } in constructor enables
      mock mode. connect() becomes a no-op; sendPrompt reads fixtures from
      fixtures/devloop-mock/{agentName}.json and emits scripted session_update
      chunks + session/result(mock=true). Falls back to default.json.
    
    Agent registry:
    - 6 entries added to system/templates/_registry.json (devloop-pm,
      devloop-architect, devloop-coder, devloop-tester, devloop-integrator,
      devloop-triager).
    - Per-agent dirs system/templates/devloop-{role}/ with:
      * prompt.md   — auto-extracted from agents-{role}.html §2.2
      * config.json — cli.toolPolicy.allowedTools + sandbox.writeAllowList
    
    Tooling:
    - scripts/extract-agent-prompts.js  — regex-extracts §2.2 system prompts
      from 6 agent HTML pages to system/templates/devloop-{role}/prompt.md.
    - server/src/tools/devloop/index.js — central export (tools Map,
      bashHooks, dispatch).
    - server/src/core/devloop/loop-controller.js (P0 skeleton) — exposes
      createProject (sandbox alloc + git init + first commit + timeline) and
      commitAfterAgent (per-agent kind-routed git commit + timeline event).
    
    Mock fixtures:
    - fixtures/devloop-mock/default.json + devloop-pm.json
    
    Acceptance scripts:
    - scripts/phase0-verify.js   — 8 static checks (35 tools loadable,
      6 agents registered, prompt+config wired, bash guard exported, services
      require, fixtures present, git-vault interface, loop-controller).
    - scripts/phase0-test-call.js — 7 end-to-end steps under mock mode
      (createProject → CLI connect → sendPrompt chunks → no-op commit returns
      null → real write commits → git log ≥2 → timeline has both events).
    
    vitest.config.js: include packages/**/*.test.js so the mock smoke test
    runs in the suite.
    
    Results:
    - 162/162 devloop + acp-core tests pass (up from 159).
    - phase0-verify: 8/8.
    - phase0-test-call: 7/7.
    
    Specs: docs/prd/newfunction/_spec/plan-migration.md · Quick-Start step 7
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    yibo authored
     
    Browse Dir »


  • 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
    yibo authored
     
    Browse Dir »
  • 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
    yibo authored
     
    Browse Dir »
  • 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)
    yibo authored
     
    Browse Dir »