• 按 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>
    yibo authored
     
    Browse File »

  • ■ 前端路由遮蔽(既有 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>
    yibo authored
     
    Browse File »

  • First successful real-CLI agent invocation. After REAL.1 (system-prompt
    injection) + REAL.2 (mtime-diff file detection) wired, the only remaining
    gate was Claude auth. Once CLAUDE_CODE_OAUTH_TOKEN was added to the
    project .env, scripts/real-pm-smoke.js completed cleanly:
    
      Wire-up status:
        ✓ process spawn
        ✓ stream chunks       (3)
        ✓ result text          (Claude returned "DONE")
        ✓ files written        (6: prd/index, feature-tree, user-flows,
                                  product/overview, assets/shell.{css,js})
        ✓ git commit           (8cb0493)
      5/5 checks passed · elapsed 163s
    
    PM output quality (real Claude, not mock):
    - valid <article data-doc="prd" data-rev="1"> + <section data-rev="1">
      structure per system prompt
    - nav links use correct relative paths across 4 chapters
    - pid (p-7gwlbl) embedded in HTML metadata
    - 中文 prose in the requested 克制 voice
    
    Spec-deviation confirmed (no MCP tool gateway yet — Claude only has
    built-in Read/Write/Bash):
    - ✗ agent-state/pm.json (no update_runtime_state tool)
    - ✗ agent-state/pm-todo.json (no write_todolist tool)
    - ✗ history/prd-rev-001.html (no archive_doc tool)
    - ✗ timeline.ndjson 'prd_drafted' event (no timeline_append tool)
    - ✓ core PRD site IS produced — sufficient to prove pipeline
    
    ──── code ────
    
    - scripts/real-pm-smoke.js — loads root .env via dotenv resolved
      from server/node_modules (script dir has no node_modules of its own).
    
    ──── ambient ────
    
    Files modified by user/linter while real-CLI work was in flight; merged
    without revert:
    - server/routes/devloop.js — new GET /:pid/requirements endpoint
    - server/services/devloop/path-resolver.js — listProjects() includes
      archived flag + helpers; supports project archive lifecycle
    - server/services/devloop/git-vault.js — commit() now accepts files[]
      to scope which paths the commit covers (avoids dragging linked-existing
      user's unstaged files into chore commits)
    - server/src/core/devloop/loop-controller.js — createProject uses
      explicit files:['project.json','timeline.ndjson'] for first chore
      commit (avoids same issue)
    - server/tests/devloop/path-resolver.test.js — coverage for archive/
      patch/hardDelete helpers
    - web/src/components/devloop/RequirementListSection.vue (new)
    - web/src/views/DevLoopNewRequirement.vue (new)
    - web/src/views/DevLoopDashboard.vue — mounts RequirementListSection
    - web/src/views/DevLoopProjects.vue — list page polish
    - web/src/router/index.js — adds /devloop/:pid/requirements/new route
    - web/src/components/devloop/DashboardHeader.vue — back link tweak
    
    Test results: 233/233 vitest pass (was 230 → +3 path-resolver cases).
    
    ──── ⚠ SECURITY NOTE ────
    
    .env is currently TRACKED in git (committed in b1a348b) even though
    .gitignore lists it. Existing committed contents include credentials for
    DOUBAO / FEISHU / GITHUB / GOOGLE / JWT. The CLAUDE_CODE_OAUTH_TOKEN +
    AZURE_OPENAI_API_KEY I just added to .env are NOT in this commit — they
    stay in your working tree only.
    
    Recommended follow-up (separate commit):
      git rm --cached .env
      git commit -m "chore: stop tracking .env (already gitignored)"
    And rotate every key that was in the previous committed .env.
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    yibo authored
     
    Browse File »
  • Two parallel pieces of plumbing — neither has been exercised end-to-end yet
    (real CLI gated on `claude /login`; Projects list view served alongside
    existing pages):
    
    ──── real-CLI wire-up (REAL.1 + REAL.2) ────
    
    LemonBoss now has a clean toggle between mock & real Claude CLI:
    
    - packages/acp-core/protocol/ClaudeCliProtocol.js
      * `options.systemPrompt` → `--append-system-prompt <prompt>` so each
        devloop agent receives its role-specific prompt.md without losing
        Claude's default tool-use conventions.
      * `options.maxBudgetUsd` → `--max-budget-usd` (note: only effective in
        `--print` mode; documented inline).
    
    - server/src/core/devloop/loop-controller.js
      * callAgent now branches on `opts.mock`:
        - mock (P1-P5 path, untouched): fixture sequence + `mock/files` event
        - real: read system/templates/{agent}/prompt.md, pass as systemPrompt,
          snapshot project file mtimes pre-call, diff post-call to compute
          `files_written` — no fixture, no mock/files needed.
      * `_snapshotMtimes(root)` helper walks the project tree (skipping
        .git / node_modules / .cache / .tmp) and returns Map<relPath,mtime>.
      * timeline event payload now carries `real: true` flag.
    
    - scripts/real-pm-smoke.js — minimal real-CLI sanity:
      spawns claude, injects PM prompt, prints which files were written +
      git commit sha. Hard timeout 5min. Single agent → expected spend
      $0.10-0.30 per run when authenticated.
    
    Current status: process spawn + system-prompt injection + stream-json
    flow all verified up to the `Not logged in · Please run /login` gate.
    Auth is the only remaining blocker for executing the real smoke.
    
    ──── project CRUD routes ────
    
    server/routes/devloop.js + server/services/devloop/path-resolver.js
    add the lifecycle pieces the Projects list view needs:
    
    - GET    /projects?include_archived=true   list w/ archive filter
    - PATCH  /projects/:pid                    edit name + idea_summary
    - DELETE /projects/:pid                    soft delete (archive)
    - DELETE /projects/:pid?hard=true          hard delete (rm -rf sandbox;
                                                unregister linked)
    - POST   /projects/:pid/restore            un-archive
    
    path-resolver exposes matching helpers: listProjects({includeArchived}),
    patchProjectMeta(pid,patch), hardDeleteProject(pid).
    
    ──── UI ────
    
    - web/src/views/DevLoopProjects.vue (320 lines, new)  — Projects list
    - web/src/router/index.js — adds `/devloop` → DevLoopProjects
    - web/src/components/devloop/DashboardHeader.vue — back-link now points
      to `/devloop` (project list) instead of `/company`.
    
    ──── housekeeping ────
    
    - CLAUDE.md / start.sh — start.sh now boots server/index.js (full route
      surface incl. /api/devloop) instead of the historical agent-server.js;
      docs updated to reflect this.
    
    ──── tests (+12) ────
    
    - server/tests/devloop/routes-crud.test.js — 12 cases:
      PATCH validation (4) · soft DELETE + list filter (4) · POST /restore
      (1) · hard DELETE (2) · GET /projects default behavior (1).
    
    Results:
    - phase0-verify .. phase5-verify: 8+7+7+6+9+9+7 all pass
    - vitest devloop+acp-core: 230/230 (was 218 → +12)
    
    Specs:
    - docs/prd/newfunction/_spec/arch-acp-bridge.md · Mock Mode
    - docs/prd/newfunction/_spec/plan-migration.md · "自举乐趣" (real path
      prep)
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    yibo authored
     
    Browse File »
  • …b-pages + UI endpoints)
    
    Completes the §P4 acceptance UI scope that was deferred in commit
    0594b1d. Adds the full Vue Dashboard + Ops sub-pages with live SSE
    stream + auto-reconnect, unit DAG with detail drawer, PRD/SDD diff
    panel, feedback modal, and 4 ops views (Bugs / Loops / Changelog /
    Progress).
    
    Vue surface (≈1480 lines):
    - web/src/views/DevLoopDashboard.vue (~110 lines)
      * 4-region grid: status header / loop bar / units DAG / live stream /
        PRD diff. Polls /state every 2.5s; opens feedback modal & unit
        drawer; mounts Sign Off / Abandon controls.
    - web/src/views/DevLoopOps.vue (~50 lines) — tab container.
    - web/src/components/devloop/DashboardHeader.vue
      * Status badge (7 states color-coded), NEW REQUIREMENT button,
        Sign Off / Abandon buttons (disabled per FSM), Ops nav link.
    - web/src/components/devloop/LoopStatusBar.vue
      * 4-phase pipeline (Docs → L1 → L2 → Ship), highlights active phase.
    - web/src/components/devloop/UnitsDAG.vue
      * SVG DAG rendered from topological waves; per-unit status color;
        click → emits select → opens UnitDrawer.
    - web/src/components/devloop/UnitDrawer.vue
      * Slide-in panel showing unit metadata + last 3 runs + result
        summary + coder.log tail (last 1KB).
    - web/src/components/devloop/LiveAgentStream.vue
      * EventSource subscriber listening to project.status,
        unit.state, integration.result, triage.result, sdd.updated,
        prd.updated, human_intervention_needed, etc. Manual 5s reconnect
        on disconnect (browser's built-in Last-Event-ID is honored).
    - web/src/components/devloop/PrdDiffPanel.vue
      * Reads changelog.ndjson, renders prd_rev / sdd_rev entries with
        trigger labels.
    - web/src/components/devloop/FeedbackModal.vue
      * POSTs /feedback with PM incremental — shows rev bump on success.
    - web/src/components/devloop/ops/BuglistView.vue
      * Filterable bug table; status badges; severity / category columns.
    - web/src/components/devloop/ops/LoopLogView.vue
      * Timeline grouped by L1 (unit.*) / L2 (integration/triage/sdd/l2_*) /
        L3 (project.status/shipped/prd.updated/human_intervention) /
        System (rest). Free-text substring filter.
    - web/src/components/devloop/ops/ChangelogView.vue
      * Tabular prd_rev/sdd_rev entries with by/trigger/summary columns.
    - web/src/components/devloop/ops/ProgressView.vue
      * 6 metric cards (status, PRD rev, SDD rev, units passed bar,
        L2 rounds bar, open bugs) + per-unit breakdown table.
    
    Router:
    - web/src/router/index.js — adds:
      * /devloop/:pid              → DevLoopDashboard
      * /devloop/:pid/ops/:tab(bugs|loops|changelog|progress) → DevLoopOps
    
    Backend UI-supporting endpoints (server/routes/devloop.js):
    - GET /api/devloop/projects/:pid/timeline?limit=N
        Reads timeline.ndjson, returns last N events reversed.
    - GET /api/devloop/projects/:pid/changelog
        Returns full changelog.ndjson entries reversed.
    - GET /api/devloop/projects/:pid/units/:unitId
        Returns { unit, runs (last 3 result.json), coder_log_tail }.
        404 on unknown unit.
    
    Tests (+5 cases):
    - server/tests/devloop/routes.test.js — new P5 UI endpoints block:
      * timeline / changelog / units happy-paths
      * 404 on unknown unit and unknown pid
    
    Acceptance:
    - scripts/phase5-verify.js — 7 steps:
      ① Vue build artifacts (DevLoopDashboard.js + DevLoopOps.js chunks)
      ② POST /projects → state returns status + units
      ③ GET /timeline returns events
      ④ GET /changelog returns entries
      ⑤ GET /units/todo-be returns unit + runs
      ⑥ GET /bugs returns bug list
      ⑦ SSE /stream delivers ≥1 event after a triggering feedback POST
    
    Vue build:
    - npm run web:build → DevLoopDashboard chunk 15.63 kB,
      DevLoopOps chunk 9.09 kB, both with co-loaded CSS bundles.
    
    Results — all 7 phase gates green:
    - phase0-verify: 8/8
    - phase0-test-call: 7/7
    - phase1-verify: 7/7
    - phase2-verify: 6/6
    - phase3-verify: 9/9
    - phase4-verify: 9/9
    - phase5-verify: 7/7
    - vitest devloop+acp-core: 218/218 (was 213 → +5)
    
    Specs: docs/prd/newfunction/_spec/plan-migration.md · P4 L3 + UI
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    yibo authored
     
    Browse File »

  • 1. Workspace page: left file tree + right detail/editor panel
       - File info: name, path, size, created/modified timestamps
       - Three view modes: Code / Preview / Edit with save
       - HTML files auto-open in Preview tab (sandboxed iframe)
    
    2. Backend APIs:
       - GET/PUT /:companyId/workspace/files (list + content + save)
       - PUT /:companyId/files/content (company file save)
    
    3. Navbar: removed Skills/Jobs/Pipeline, added Workspace
    4. All nav links open in new tabs (target=_blank)
    yibo authored
     
    Browse File »
  • Yi Bo authored
     
    Browse File »
  • - Add TaskTimeline.vue: two-pane dashboard with task list + message timeline
    - Add task-service.js: aggregate cross-agent conversations into task tree
      - 4-strategy parent-child inference (explicit meta, time-overlap, conv→tpl, master→T)
      - Read messages.log for full tool call details (not just history.json)
    - Add tasks.js API routes: GET /api/tasks, GET /api/tasks/:taskId/timeline
    - Mount /api/tasks in agent-server.js
    - Add 'Task Logs' nav entry in AppNav.vue after Templates
    - Support taskId in URL (/tasks/:taskId?) for sharing/bookmarking
    - Add --parent flag to CLI task dispatch for explicit parentTaskId
    - Auto-detect parentTaskId in task/dispatch from sender's active task
    - Add --instructions flag to template train CLI command
    - Update master tools.md with new parameters
    yibo authored
     
    Browse File »


  • - System agents: 只保留 master (data/system/agents/master)
    - Templates: 所有可复用 agent 模板 (data/system/templates/)
    - Companies: 公司创建时自动部署 5 个元 Agent (innovator/hunter/digester/evolver/agent-creator)
    
    路径修复:
    - agent-chat.js: /list 扫描路径修正 (system/agents + companies/*/agents)
    - agent-manager.js: 动态 agent 查找路径修正
    - skill-config-loader.js: 修正 agents root
    - pipeline-service.js: pipelines 输出到 companies/{id}/pipelines/
    - billing.log: 移至 companies/{id}/logs/ 下
    
    Skills 标准化:
    - 所有 template agent 建立 .claude/skills/main_skill/SKILL.md
    - company-service._copyTemplate() 新增 .claude/ 目录复制
    - innovator SKILL.md v3.0: 移除旧 l3-hunt/l2-digest 命名
    - 清理重复 agent_creator, 统一为 agent-creator
    
    清理:
    - 移除 data/agents, data/workspace, data/logs, data/goals 旧目录
    - 清除所有未使用的 DATA_DIR 声明
    - 清除 template 中的 conversations/logs/memory 运行态数据
    yibo authored
     
    Browse File »

  • - Add Company Overview tab as default landing page
    - Show company info: status, uptime, agent count, heartbeat status
    - Start/Stop company buttons (activate/deactivate all agent heartbeats)
    - Per-agent heartbeat controls: interval dropdown, start/stop buttons
    - Backend APIs: GET status, POST start/shutdown, PUT/POST agent heartbeat
    - Track startedAt timestamp for uptime calculation
    - Update CEO agent.md with mandatory 5-step startup workflow
    - Fix company nav to default to overview tab
    Yi Bo authored
     
    Browse File »
  • …ter Agent cognitive auto-recovery loop
    
    - Refactored CompanyDashboard into read-only Observer UI
    - Enforced strict companyId:roleId namespacing across Node APIs and AgentManager
    - Added dynamic <env_status> injection to PromptBuilder for robust context
    - Introduced bin/lemon.js CLI for structured LLM tool execution
    - Implemented in-stream error interceptors for implicit silent retry loop
    yibo authored
     
    Browse File »


  • - Implement OKR GoalsService with hierarchical node tracking
    - Add /api/goals routes and integrate with dispatch/report APIs
    - Create Innovator agent with Hunt→Digest→Evolving pipeline
    - Create Hunter (l3-hunt), Digester (l2-digest), Evolver (evolving) meta agents
    - Copy L1/L2 dependency skills into each agent's .claude/skills/
    - Fix buildSystemPrompt to scan ALL skill subdirectories (critical)
    - Fix agent list sorting: master pinned top, rest by lastActiveAt
    - Rename master-001→master, innovator-001→innovator
    - Establish meta agent output convention: write to target agent dir
    - Add CXO agent base class for management agents
    - Update CEO agent with delegation-first management model
    yibo authored
     
    Browse File »

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