-
手工扫了两轮,扫出的是三类会持续复发的失真,不是零星笔误: ① package.json 里 12 处引用指向从未在 git 历史存在过的文件(server/src/cli/auto-dev.js 一族) ② CLAUDE.md 的 docs/ 那行列了 5 个文件名,文档移进 done/ 之后全成死链 ③ 数据存储整节把两个不同的 data 根当成一个写,server/conversations/ 这个路径根本不存在 共性是**不报错、不影响测试、git status 干净**,只有照着做的人(或 agent)撞墙才发现。 而 CLAUDE.md 是每个会话都会加载进上下文的文件 —— 写错等于把错误信息直接灌给每一个后来者。 四条扫描: - CLAUDE.md 里的仓库路径都存在 - CLAUDE.md 里出现的每条 npm run 都在 package.json 里(守反方向:删脚本忘改文档) - package.json 的 scripts / bin / main 指向的文件都存在 - docs/README.md 的相对链接都指向真实文件 判据刻意窄(本仓库有过「防线被整条注释掉」的教训):路径只认「以仓库顶层目录开头 + 含 /」, 且跳过 gitignored 的 —— 那是运行态产物(web/dist/、data/companies/、skills/),在干净机器上 本来就不存在,缺席不是文档错误;这与 no-stale-templates-path.test.js 用的是同一条判据。 上下文里的相对片段(_base/、todo/future/)、glob、<repo>/… 示意写法一律不判。 四条各带「样本非空」下限断言(当前 26 路径 / 16 script 名 / 6 入口引用 / 22 链接), 下限取当前值一半左右:正则一写错就会以「零违例」全绿,那和没有这条测试是一回事。 验证:把同一套判据跑在旧 revision 的文件内容上(只读 git,不碰工作区)—— 3e718aa:路径 ❌3 条、入口 ❌10 条 d6214f8:路径 ❌4 条、入口 ❌10 条 HEAD :全绿 顺带修掉自己写的一处假路径占位符(`data/xxx` → 「以 `data/` 开头的路径」), 文档里本来就不该出现假路径。 28-followups 守卫清单补到第六条,并写明后两条与前四条的形状差异。 npm run test:unit 1061/1061 绿。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
顺着上一笔的判据(引用了不存在的东西)继续扫,扫出的不是零星笔误,是一处结构性失真。 事实(按绝对路径解析源码里的 path.resolve(__dirname, ...),不是数字面量 —— 数字面量会错,path-resolver.js 比 db 文件深一层,同样的 '../../../data' 落点不同): 仓库内 <repo>/data/ — 11 个模块(company / okr / graph / devloop / schedule / pipeline …) 仓库外 <repo>/../data/ — 3 个模块(skill-db、user-db、benchmark-db,ArenaSK 时代遗留) 原文把六条全挂在扁平的 `data/` 前缀下,读的人只会理解成仓库内一个根。这不是抠字眼: 备份 / 迁移 / 换机器时漏掉仓库外那半边,skill、用户、benchmark 数据会**静默丢失**。 一并修掉的具体错误: - `data/benchmark.sqlite` → 实际文件名是 `benchmark_logs.sqlite` - `server/conversations/` → 该路径不存在。会话持久化实际有**两套**: ArenaSK/Innovator 侧在 `<repo>/conversations/`(config.conversationsDir), LemonBoss agent-chat 侧在公司态目录下(getConvDir → locator.companyStateDir) - 目录速查里的 `data/skills/` 改成 `<repo>/../data/skills/`,点明 `<repo>/data/skills/` 并不存在 - 补上仓库内侧原本一条没列的 graph.sqlite / companies/ / okr/ / logs/ / agents/ - 每个库补上真实的 env 覆盖名(SKILLS_DB_PATH / USERS_DB_PATH / BENCHMARK_DB_PATH / GRAPH_DB_PATH) 新写进去的每一条路径与每一个 env 名都用脚本核过存在性(10 路径 + 5 env 全 ✅)。 docs/README.md 的 markdown 链接同批扫过,零死链。 npm run test:unit 1057/1057 绿。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> -
判据统一:目标文件既不在盘上、**也从未在 git 历史里出现过**(逐个 git log --all 核过), 不是「搬了地方」而是从来没有过。跑起来一律 MODULE_NOT_FOUND。 删除(12 处,指向 4 个从未存在的目录): server/src/cli/ main、bin.auto-dev、example、example-bmi server/src/utils/ logs、analyze、parse server/src/modules/ test:browser-logger、test:design-validator server/src/tests/scripts/ test:multi-cli skills/whatsapp-bot/ whatsapp:auth、whatsapp:start (skills/ 是 gitignored 的运行时目录,确实存在, 但里面没有也从没有过 whatsapp-bot; /api/whatsapp 路由走的是 routes/whatsapp-auth.js,不受影响) 只授权了 auto-dev 那 3 处,其余 9 处是同一类缺陷、同一条判据,一并删了 —— 要退回来 `git revert` 这一笔即可。删完 package.json 零死引用(脚本目标存在性已脚本化核过)。 CLAUDE.md 同步: - 常用命令去掉已删除的 6 条,补上真实存在但之前没列的 graph:seed / okr:migrate - 上一笔加的 auto-dev 警告块随引用一起去掉 - /api/goals 从「向后兼容别名」改为「已退役」—— 7f24ef0(27-P3C §六.1)已落地, OKR 只剩 /api/okr 一个挂载点,且有守卫测试盯着 验证:npm run test:unit 1057/1057 绿;npm run spec:check 52 份 _spec 全同步; CLAUDE.md 里出现的每一条 npm run 都在 package.json 里存在(脚本核对)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> -
逐条都对着 HEAD 核过(不含工作区里其它会话未提交的改动): ① docs/ 那一行列的 5 个文件全是死链 —— 它们都搬进了 docs/done/。 根因不是路径写错,是同一份文件清单被抄在两处:CLAUDE.md 一份、docs/README.md 一份, 文档一搬家,抄的那份就烂。改成只描述「按状态分目录」的结构并指向 docs/README.md, 并写明「别在本表里加文件名」,免得再抄一次。 ② 路由清单漏项 + 错项: - index.js 实挂 /api/okr 与 /api/graph-runs,表里都没有 - 表里写的 /api/goals 是 okr 的向后兼容别名,不是独立路由;标注清楚 - agent-server.js 子集同样漏了 /api/okr、/api/graph-runs (注:工作区里有另一个会话正在退役 /api/goals 别名,尚未提交。本次按 HEAD 的事实写, 等那笔落地后这两行还要再改一次。) ③ 三个硬编码计数全部过期:routes 15→实际 17,services 26→38,views 10→15, agents「75 个」连测试建本体都会让它变。计数在这种表里只会烂,直接去掉; views 补上 GraphConsole 与 DevLoop 四页。 ④ auto-dev 是幽灵入口:server/src/cli/ 整个目录不存在,且 git 历史里从未有过 auto-dev.js。npm run example / example-bmi / bin.auto-dev 三处引用全是坏的 (实测 MODULE_NOT_FOUND)。CLAUDE.md 里改成显式警告 —— 没删 package.json 的 scripts/bin,那是代码改动,留给人定「补文件还是删引用」。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> -
承接 310a2b2 的两个遗留: ① 四类被错标成心跳 company-heartbeat-service._sendAgentChat 给五类调用(心跳巡检 / Pipeline 步骤 / 日程 / 告警 / 日报)无差别打 isHeartbeat:true,于是对话列表里全都显示成 「⏱️ 自主心跳巡检」、meta.type 一律 'heartbeat'。改成显式传 kind,五类各自标注。 isHeartbeat 仍然发,但只对真心跳为真,老消费方行为不变。 ② 310a2b2 让 Pipeline 重试变成了冷启动 Pipeline 步骤的 convId 是 `pipeline-{runId}-step-{i}`,被驳回重做时**复用同一个**。 310a2b2 按 isHeartbeat 一刀切回收,等于每次重试都要走 buildPrompt 场景 C 重注入历史。 现在回收策略挂在 CALL_KINDS 表上,判据只有一条:**convId 会不会被下一轮复用** —— 会复用的(pipeline / 人类对话)留着走 TTL,不复用的(心跳 / 日程 / 告警 / 日报)跑完即回收。 不按「是不是后台调用」分:五类后台调用里 pipeline 就是要留的那一类。 守卫补到 12 条(原 3 + kind 标注 5 + 回收策略 4)。对 310a2b2 跑过:8 红 4 绿。 convId 一律用固定字面量而非拼时间戳 —— 撞上 test-id-stability 那道防线后按它的判据改的, 固定之后第二次跑还顺带走了「复用已有对话」那条分支。 文档: - CLAUDE.md 注意事项加一条(新增会话创建路径时必须同时定回收路径,附症状与守卫位置) - 28-followups 守卫清单补第五条,并把「前四条守单一持有者」与第五条「守资源生命周期」 的形状差异写明;顺手修掉表格已有 4 行、结尾却仍写「这三条」的失配 - .env.example 补 AGENT_SESSION_IDLE_MS 全量单测 667/667 绿。重启后 /api/health 正常,心跳照常挂载。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
用户授权清理 system/templates/ 的过期引用。全仓库核了 34 处, 结论与预期相反:没有该删的死代码,但有两处正在静默失效。 真正坏掉的(demo-harness-company.js): path.join(ROOT, 'system/templates/base/agent.md') → system/agents/_base/ path.join(ROOT, 'system/templates/base/config.json') → system/agents/_base/ 两处都包在 fs.existsSync() 里,所以目录消失后**不报错**,只是 静默跳过 base 本体的挂载 —— demo 跑出来的 agent 没有四段式骨架, 但脚本照常打印成功。又一个静默降级。 顺带:real-pm-smoke.js 的提示文案、migrate-agent-naming.js 里 已失效的遍历项、docs/README.md 的 qa-judge 落点。 CLAUDE.md 目录速查表原来只有 `system/templates/devloop-*/` 一行, 连 system/agents/ 都没列。换成两行并写清三个容易踩的点:目录才是 数据源头(seedAgents 直接扫目录)、_registry.json 只补 benchmark_score、_ 前缀是保留 id 会被跳过。 **刻意不动的**:server/tests/ 下 30 处引用。它们分两类,都得留 —— ① 记录迁移过程的注释;② 断言目录已不存在的守卫 (`expect(git(['ls-files','--','system/templates'])).toBe('')`、 `expect(fs.existsSync(...)).toBe(false)`)。删掉后者等于删掉 「迁移已完成」的证明。legacy_path 那几个测试夹具同理,是历史数据形态。 验证:三个脚本 node --check 通过;改后的四个路径实测存在。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-
# Conflicts: # system/agents/master/.claude/scheduled_tasks.json
-
…_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>
-
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> -
The 50-page PRD HTML totals ~520KB; loading it all costs Claude ~222K tokens just for context. This adds a token-efficient sibling layer: - scripts/extract-spec.js → npm run spec:extract / spec:check Walks docs/prd/newfunction/*.html and produces stripped MD into _spec/. Strategy varies per page (full-extract for SDD/process/data, shell-strip for agents to keep long system prompts intact). Result: 327.9KB MD (~84K tokens) — 38% of full load, saves ~138K tokens for every Agent invocation that reads the spec. - scripts/git-hooks/pre-commit + scripts/install-hooks.sh Pre-commit guard: when any docs/prd/newfunction/*.html changes, the hook checks the corresponding _spec/*.md is up to date; fails commit if stale, telling user to `npm run spec:extract`. Auto-installed via package.json `prepare` script on `npm install`. - docs/prd/newfunction/_spec/ (51 .md files + CONVENTIONS.md) Machine-readable mirror of HTML. Used by: - Coder/Architect/Tester agents when reading spec at runtime - External Claude Code sessions doing reproducibility - CI checks (npm run spec:check) NOT hand-edited; regenerated from HTML by extract-spec.js. - CLAUDE.md: 1-line note directing future agents to read _spec/*.md preferentially, fall back to *.html only for wireframes/SVG/full human-readable context. This is the user's pre-existing scaffolding that the previous commits hadn't pulled in yet. Now tracked + enforced by hook. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
-
- Fix port to 3010 (was 3000); both server/index.js and server/agent-server.js default to 3010 per config.js - Document the two server entrypoints: index.js (full ArenaSK, run via npm run dev) vs agent-server.js (Agent Chat only, run via start.sh) - Correct counts: 15 routes (not 11), 26 services (not 16), 10 views (not 21) - Remove false 'skills/' top-level dir reference; document actual data/skills/ - Add full test/example/log npm scripts; auto-dev CLI bin; packages list - Add note on body-sanitizer middleware (the source of the JSON warning) - Add brand history note (ArenaSK → LemonBoss) - Keep existing Agentic Self-Correction Loop Prevention warning verbatim Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
-
…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
-
- 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