Commit 4611a4b7604a6e2f4981548b43987f63eb5d3681

Authored by yibo
1 parent 0f6bcf21

fix(company): completely remove legacy Phase M meta-agent auto-deployment to str…

…ictly enforce empty shell company creation
data/system/agents/master/memory/hippocampus-index.json
@@ -12,8 +12,8 @@ @@ -12,8 +12,8 @@
12 ], 12 ],
13 "planFile": "task-callback.md", 13 "planFile": "task-callback.md",
14 "confidence": 0.76, 14 "confidence": 0.76,
15 - "useCount": 24,  
16 - "lastUsed": "2026-03-27", 15 + "useCount": 25,
  16 + "lastUsed": "2026-03-28",
17 "createdAt": "2026-03-27" 17 "createdAt": "2026-03-27"
18 }, 18 },
19 { 19 {
data/system/agents/master/memory/memory.md
@@ -33,3 +33,5 @@ @@ -33,3 +33,5 @@
33 - [2026-03-27] hi → 你好,我是 Master Agent,LemonBoss 组织的管理者。告诉我你想做什么,我会把任务分配给合适的 Agent 来执行。 33 - [2026-03-27] hi → 你好,我是 Master Agent,LemonBoss 组织的管理者。告诉我你想做什么,我会把任务分配给合适的 Agent 来执行。
34 - [2026-03-27] [TASK_CALLBACK] → 收到 Innovator 任务完成回调。让我先检查 plan.md 了解当前整体进度。 34 - [2026-03-27] [TASK_CALLBACK] → 收到 Innovator 任务完成回调。让我先检查 plan.md 了解当前整体进度。
35 - [2026-03-27] [TASK_CALLBACK] → 收到 weibo-scraper 训练完成回调。让我更新记录并汇报。 35 - [2026-03-27] [TASK_CALLBACK] → 收到 weibo-scraper 训练完成回调。让我更新记录并汇报。
  36 +- [2026-03-27] 所以weibo-scraper 最后训练完后,跑出来的最终结果是在 output 目录下?我怎么没看 → ...orkspace/weibo_scraper_fde_report.md
  37 +- [2026-03-28] 帮我创建一个新的公司,叫做 test ,然后雇佣一下weibo-scraper,我需要给他运行一个任 → 我来帮你创建公司并雇佣 weibo-scraper。
data/system/agents/master/memory/reflections/reflect-1774636548950.json 0 → 100644
  1 +{
  2 + "timestamp": "2026-03-27T18:35:48.949Z",
  3 + "convId": "conv-mn98qtq8",
  4 + "task": "所以weibo-scraper 最后训练完后,跑出来的最终结果是在 output 目录下?我怎么没看",
  5 + "status": "completed",
  6 + "toolCount": 12,
  7 + "durationSec": 61,
  8 + "patterns": [
  9 + "成功创建/修改了 5 个文件: data/system/templates/weibo-scraper/workspace/weibo_scraper_fde_report.md, data/system/templates/weibo-scraper/.claude/skills/main_skill/SKILL.md, data/system/templates/weibo-scraper/weibo_scraper.py",
  10 + "完成了 12 步工具调用的复杂任务 (61秒)",
  11 + "涉及技能训练/评分/进化流程"
  12 + ],
  13 + "lessons": [],
  14 + "plan": null
  15 +}
0 \ No newline at end of file 16 \ No newline at end of file
data/system/agents/master/memory/reflections/reflect-1774665780685.json 0 → 100644
  1 +{
  2 + "timestamp": "2026-03-28T02:43:00.684Z",
  3 + "convId": "conv-mn98ulpm",
  4 + "task": "帮我创建一个新的公司,叫做 test ,然后雇佣一下weibo-scraper,我需要给他运行一个任",
  5 + "status": "completed",
  6 + "toolCount": 11,
  7 + "durationSec": 29117,
  8 + "patterns": [
  9 + "成功创建/修改了 2 个文件: data/companies/test/agents/weibo-scraper/workspace/reports/`, workspace/reports/`",
  10 + "完成了 11 步工具调用的复杂任务 (29117秒)"
  11 + ],
  12 + "lessons": [],
  13 + "plan": null
  14 +}
0 \ No newline at end of file 15 \ No newline at end of file
data/system/agents/master/memory/short-term/session-1774636548947.md 0 → 100644
  1 +# Session 摘要
  2 +
  3 +- **时间**: 2026-03-27 18:35:48
  4 +- **对话ID**: conv-mn98qtq8
  5 +- **状态**: completed
  6 +- **工具调用**: 12 次
  7 +- **耗时**: 1分钟
  8 +
  9 +## 任务
  10 +所以weibo-scraper 最后训练完后,跑出来的最终结果是在 output 目录下?我怎么没看
  11 +
  12 +## 结果
  13 +...orkspace/weibo_scraper_fde_report.md
  14 +```
  15 +这是 FDE 训练的完整报告,记录了 4 次迭代过程和最终得分 **92.65 / 100**(通过阈值 90)。
  16 +
  17 +### 2. 技能定义文件(生产版本)
  18 +```
  19 +data/system/templates/weibo-scraper/.claude/skills/main_skill/SKILL.md
  20 +```
  21 +这是训练达标后的技能代码,版本已更新为 **v1.6.0**。这个文件就是给 Agent 用的"技能包"。
  22 +
  23 +### 3. 爬虫脚本
  24 +```
  25 +data/system/templates/weibo-scraper/weibo_scraper.py
  26 +```
  27 +这是实际的爬虫代码文件。
  28 +
  29 +---
  30 +
  31 +**总结**: FDE 训练不像传统机器学习那样有单独的 output 目录。训练"产出"就是更新了:
  32 +- 技能代码(SKILL.md)
  33 +- 配置文件(config.json 中 status: ready, benchmark_score: 92.65)
  34 +- 训练报告(workspace/ 下的报告文件)
  35 +
  36 +## 涉及文件
  37 +- data/system/templates/weibo-scraper/workspace/weibo_scraper_fde_report.md
  38 +- data/system/templates/weibo-scraper/.claude/skills/main_skill/SKILL.md
  39 +- data/system/templates/weibo-scraper/weibo_scraper.py
  40 +- workspace/)
  41 +- workspace/weibo_scraper_fde_report.md
data/system/agents/master/memory/short-term/session-1774665780683.md 0 → 100644
  1 +# Session 摘要
  2 +
  3 +- **时间**: 2026-03-28 02:43:00
  4 +- **对话ID**: conv-mn98ulpm
  5 +- **状态**: completed
  6 +- **工具调用**: 11 次
  7 +- **耗时**: 485分钟
  8 +
  9 +## 任务
  10 +帮我创建一个新的公司,叫做 test ,然后雇佣一下weibo-scraper,我需要给他运行一个任
  11 +
  12 +## 结果
  13 +我来帮你创建公司并雇佣 weibo-scraper。
  14 +
  15 +
  16 +✅ **已完成所有操作:**
  17 +
  18 +| 步骤 | 状态 |
  19 +|------|------|
  20 +| 1. 创建 test 公司 | ✅ 完成 |
  21 +| 2. 雇佣 weibo-scraper | ✅ 完成 |
  22 +| 3. 雇佣 CEO (系统未自动创建) | ✅ 完成 |
  23 +| 4. 分发任务给 CEO 设置定时任务 | ✅ 完成 (taskId: T-mn9q6djf) |
  24 +| 5. 设置每小时定时任务 | ✅ 已创建 Cron 任务 |
  25 +
  26 +**定时任务详情:**
  27 +- 触发时间:每小时整点 (`0 * * * *`)
  28 +- 任务内容:执行 weibo-scraper 爬取微博热点,生成报告保存到公司工作区
  29 +- 报告路径:`data/companies/test/agents/weibo-scraper/workspace/reports/`
  30 +- 报告格式:`YYYY-MM-DD-HH-report.md`
  31 +
  32 +CEO 正在异步执行任务设置,每小时会自动运行并生成报告。
  33 +
  34 +## 涉及文件
  35 +- data/companies/test/agents/weibo-scraper/workspace/reports/`
  36 +- workspace/reports/`
data/system/templates/_company_bootstrap/manifest.json deleted
1 -{  
2 - "description": "公司自举(Bootstrap)模板 — 创建时自动部署核心骨干团队",  
3 - "bootstrap_agents": [  
4 - { "role": "ceo", "type": "cxo", "name": "首席执行官" },  
5 - { "role": "cto", "type": "cxo", "name": "首席技术官" },  
6 - { "role": "coo", "type": "cxo", "name": "首席运营官" },  
7 - { "role": "hr", "type": "specialist", "name": "人事总监" }  
8 - ],  
9 - "auto_dispatch_to_ceo": true,  
10 - "ceo_startup_prompt": "你的公司刚刚创建,系统已经自动为你配备了 CTO、COO、HR 三位核心高管。请立刻执行你的五步战略工作流:1.撰写商业蓝图 2.设计Pipeline JSON 3.设定OKR 4.将Pipeline设计图移交CTO(让他通过HR批量招聘执行层Agent) 5.通知COO接管运营。"  
11 -}  
data/system/templates/_registry.json
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 "description": "公司战略规划、团队管理、OKR 制定、任务委派", 6 "description": "公司战略规划、团队管理、OKR 制定、任务委派",
7 "benchmarkScore": 97, 7 "benchmarkScore": 97,
8 "trainedAt": "2026-03-20", 8 "trainedAt": "2026-03-20",
9 - "usedCount": 12 9 + "usedCount": 13
10 }, 10 },
11 { 11 {
12 "id": "qa-judge", 12 "id": "qa-judge",
server/services/company-service.js
@@ -70,85 +70,7 @@ class CompanyService { @@ -70,85 +70,7 @@ class CompanyService {
70 70
71 this._saveCompany(company); 71 this._saveCompany(company);
72 72
73 - // ── Phase M: 初始化元 Agent (innovator/hunter/digester/evolver) ──  
74 - // 从 data/system/agents/ 复制元 Agent 到公司, 注入公司上下文  
75 - const META_AGENTS = ['innovator', 'hunter', 'digester', 'evolver', 'agent-creator'];  
76 - for (const metaId of META_AGENTS) {  
77 - const srcDir = path.join(GLOBAL_AGENTS_DIR, metaId);  
78 - if (!fs.existsSync(srcDir)) {  
79 - console.log(`[Company] ⚠️ 系统元 Agent "${metaId}" 不存在,跳过`);  
80 - continue;  
81 - }  
82 - const destDir = path.join(companyDir, 'agents', metaId);  
83 - if (fs.existsSync(destDir)) continue; // 已存在则跳过  
84 -  
85 - // 复制骨架文件  
86 - this._copyTemplate(srcDir, destDir);  
87 - // 额外复制 skills 和 knowledge 目录  
88 - for (const extra of ['skills', 'knowledge']) {  
89 - const srcExtra = path.join(srcDir, extra);  
90 - if (fs.existsSync(srcExtra)) {  
91 - this._copyDirRecursive(srcExtra, path.join(destDir, extra));  
92 - }  
93 - }  
94 -  
95 - // 注入公司上下文到 config.json  
96 - const cfgPath = path.join(destDir, 'config.json');  
97 - if (fs.existsSync(cfgPath)) {  
98 - const cfg = JSON.parse(fs.readFileSync(cfgPath, 'utf-8'));  
99 - cfg.companyId = id;  
100 - cfg.status = 'active';  
101 - cfg.parent_id = 'hr'; // 元 Agent 由 HR 监督管理  
102 - cfg.meta = true; // 标记为元 Agent  
103 - fs.writeFileSync(cfgPath, JSON.stringify(cfg, null, 2), 'utf-8');  
104 - }  
105 -  
106 - // 追加公司上下文到 agent.md  
107 - const agentMdPath = path.join(destDir, 'agent.md');  
108 - if (fs.existsSync(agentMdPath)) {  
109 - const content = fs.readFileSync(agentMdPath, 'utf-8');  
110 - const ctx = [  
111 - '', '---', '',  
112 - '## 所属公司上下文',  
113 - `- **公司ID**: ${id}`,  
114 - `- **公司名称**: ${name}`,  
115 - `- **公司使命**: ${description || '待定义'}`,  
116 - '',  
117 - '> 你是本公司的内部培训部元 Agent。你的工作职责是:',  
118 - '> 1. 阅读公司 OKR、SOP、岗位说明等上下文文件',  
119 - '> 2. 针对公司业务特点,训练和优化公司内每一个业务 Agent',  
120 - '> 3. 接受 HR 的监督和管理',  
121 - '',  
122 - `工作目录: data/companies/${id}/agents/`,  
123 - `公司目标: data/companies/${id}/goals/`,  
124 - `公司SOP: data/companies/${id}/pipelines/`,  
125 - ].join('\n');  
126 - fs.writeFileSync(agentMdPath, content + ctx, 'utf-8');  
127 - }  
128 73
129 - // 更新 user.md: 汇报给 HR  
130 - const userPath = path.join(destDir, 'user.md');  
131 - const userContent = [  
132 - '# 与上级的关系',  
133 - '',  
134 - '## 所属公司',  
135 - `- **公司**: ${name} (${id})`,  
136 - '',  
137 - '## 汇报对象',  
138 - '- **直接汇报**: HR (人力资源总监)',  
139 - '- **角色**: 公司内部培训部元 Agent',  
140 - '- **职责**: 对公司业务 Agent 进行调研、知识消化、技能训练和进化',  
141 - '',  
142 - '## 沟通规则',  
143 - '1. 训练完成后向 HR 汇报结果和 Benchmark 分数',  
144 - '2. 需要调研新领域时提前告知 HR',  
145 - '3. 保持对公司目标(OKR)和流程(SOP)的了解',  
146 - ].join('\n');  
147 - fs.writeFileSync(userPath, userContent, 'utf-8');  
148 -  
149 - company.agents.push(metaId);  
150 - console.log(`[Company] 🧬 ${id} 初始化元 Agent: ${metaId} (由 HR 管理)`);  
151 - }  
152 74
153 // 重新保存(agents 列表已更新) 75 // 重新保存(agents 列表已更新)
154 this._saveCompany(company); 76 this._saveCompany(company);