maestro-flow 0.4.19 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/agents/workflow-collab-planner.md +4 -1
- package/.agents/agents/workflow-plan-checker.md +11 -1
- package/.agents/agents/workflow-planner.md +4 -1
- package/.agents/skills/maestro/SKILL.md +8 -5
- package/.agents/skills/maestro-analyze/SKILL.md +1 -1
- package/.agents/skills/maestro-brainstorm/SKILL.md +2 -1
- package/.agents/skills/maestro-companion/SKILL.md +533 -0
- package/.agents/skills/maestro-grill/SKILL.md +116 -0
- package/.agents/skills/maestro-plan/SKILL.md +4 -0
- package/.agents/skills/maestro-ralph/SKILL.md +11 -7
- package/.agents/skills/maestro-ralph-execute/SKILL.md +2 -1
- package/.agents/skills/maestro-swarm-workflow/SKILL.md +266 -0
- package/.agents/skills/maestro-universal-workflow/SKILL.md +563 -0
- package/.agents/skills/manage-codebase-rebuild/SKILL.md +13 -1
- package/.agents/skills/manage-codebase-refresh/SKILL.md +3 -0
- package/.agents/skills/spec-setup/SKILL.md +9 -5
- package/.agents/skills/team-adversarial-swarm/SKILL.md +235 -0
- package/.agents/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/.agents/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/.agents/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/.agents/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/.agents/skills/team-adversarial-swarm/specs/ant-output-schema.md +115 -0
- package/.agents/skills/team-adversarial-swarm/specs/convergence-criteria.md +75 -0
- package/.agents/skills/team-adversarial-swarm/specs/pheromone-schema.md +90 -0
- package/.agents/skills/team-adversarial-swarm/specs/swarm-config-template.json +66 -0
- package/.agents/skills/team-adversarial-swarm/specs/swarm-protocol.md +105 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-converge.js +197 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-explore.js +194 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-score.js +188 -0
- package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -0
- package/.agy/agents/workflow-collab-planner.md +4 -1
- package/.agy/agents/workflow-plan-checker.md +11 -1
- package/.agy/agents/workflow-planner.md +4 -1
- package/.agy/skills/maestro/SKILL.md +8 -5
- package/.agy/skills/maestro-analyze/SKILL.md +1 -1
- package/.agy/skills/maestro-brainstorm/SKILL.md +2 -1
- package/.agy/skills/maestro-companion/SKILL.md +529 -0
- package/.agy/skills/maestro-grill/SKILL.md +116 -0
- package/.agy/skills/maestro-plan/SKILL.md +4 -0
- package/.agy/skills/maestro-ralph/SKILL.md +11 -7
- package/.agy/skills/maestro-ralph-execute/SKILL.md +2 -1
- package/.agy/skills/maestro-swarm-workflow/SKILL.md +263 -0
- package/.agy/skills/maestro-universal-workflow/SKILL.md +560 -0
- package/.agy/skills/manage-codebase-rebuild/SKILL.md +13 -1
- package/.agy/skills/manage-codebase-refresh/SKILL.md +3 -0
- package/.agy/skills/spec-setup/SKILL.md +9 -5
- package/.agy/skills/team-adversarial-swarm/SKILL.md +244 -0
- package/.agy/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/.agy/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/.agy/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/.agy/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/.agy/skills/team-adversarial-swarm/specs/ant-output-schema.md +115 -0
- package/.agy/skills/team-adversarial-swarm/specs/convergence-criteria.md +75 -0
- package/.agy/skills/team-adversarial-swarm/specs/pheromone-schema.md +90 -0
- package/.agy/skills/team-adversarial-swarm/specs/swarm-config-template.json +66 -0
- package/.agy/skills/team-adversarial-swarm/specs/swarm-protocol.md +105 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-converge.js +197 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-explore.js +194 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-score.js +188 -0
- package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -0
- package/.claude/agents/workflow-collab-planner.md +4 -1
- package/.claude/agents/workflow-plan-checker.md +11 -1
- package/.claude/agents/workflow-planner.md +4 -1
- package/.claude/commands/maestro-analyze.md +1 -1
- package/.claude/commands/maestro-brainstorm.md +2 -1
- package/.claude/commands/maestro-companion.md +531 -0
- package/.claude/commands/maestro-grill.md +114 -0
- package/.claude/commands/maestro-plan.md +4 -0
- package/.claude/commands/maestro-ralph-execute.md +2 -1
- package/.claude/commands/maestro-ralph.md +11 -7
- package/.claude/commands/maestro-swarm-workflow.md +264 -0
- package/.claude/commands/maestro-universal-workflow.md +561 -0
- package/.claude/commands/maestro.md +8 -5
- package/.claude/commands/manage-codebase-rebuild.md +13 -1
- package/.claude/commands/manage-codebase-refresh.md +3 -0
- package/.claude/commands/spec-setup.md +9 -5
- package/.claude/skills/team-adversarial-swarm/SKILL.md +233 -0
- package/.claude/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/.claude/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/.claude/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/.claude/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/.claude/skills/team-adversarial-swarm/specs/ant-output-schema.md +115 -0
- package/.claude/skills/team-adversarial-swarm/specs/convergence-criteria.md +75 -0
- package/.claude/skills/team-adversarial-swarm/specs/pheromone-schema.md +90 -0
- package/.claude/skills/team-adversarial-swarm/specs/swarm-config-template.json +66 -0
- package/.claude/skills/team-adversarial-swarm/specs/swarm-protocol.md +105 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-converge.js +197 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-explore.js +194 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-score.js +188 -0
- package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -0
- package/.codex/skills/maestro/SKILL.md +7 -2
- package/.codex/skills/maestro-companion/SKILL.md +485 -0
- package/.codex/skills/maestro-grill/SKILL.md +111 -0
- package/.codex/skills/maestro-ralph/SKILL.md +11 -7
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +6 -0
- package/.codex/skills/manage-codebase-refresh/SKILL.md +6 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.d.ts +36 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js +138 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js +13 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +11 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +178 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +39 -23
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/src/graph/types.d.ts +111 -0
- package/dashboard/dist-server/src/graph/types.js +2 -0
- package/dashboard/dist-server/src/graph/types.js.map +1 -0
- package/dist/src/cli.js +1 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/kg.d.ts +11 -0
- package/dist/src/commands/kg.d.ts.map +1 -0
- package/dist/src/commands/kg.js +486 -0
- package/dist/src/commands/kg.js.map +1 -0
- package/dist/src/graph/analyzers/fs-analyzer.d.ts +10 -0
- package/dist/src/graph/analyzers/fs-analyzer.d.ts.map +1 -0
- package/dist/src/graph/analyzers/fs-analyzer.js +959 -0
- package/dist/src/graph/analyzers/fs-analyzer.js.map +1 -0
- package/dist/src/graph/index.d.ts +6 -0
- package/dist/src/graph/index.d.ts.map +1 -0
- package/dist/src/graph/index.js +6 -0
- package/dist/src/graph/index.js.map +1 -0
- package/dist/src/graph/loader.d.ts +3 -0
- package/dist/src/graph/loader.d.ts.map +1 -0
- package/dist/src/graph/loader.js +12 -0
- package/dist/src/graph/loader.js.map +1 -0
- package/dist/src/graph/merger.d.ts +56 -0
- package/dist/src/graph/merger.d.ts.map +1 -0
- package/dist/src/graph/merger.js +896 -0
- package/dist/src/graph/merger.js.map +1 -0
- package/dist/src/graph/query.d.ts +7 -0
- package/dist/src/graph/query.d.ts.map +1 -0
- package/dist/src/graph/query.js +126 -0
- package/dist/src/graph/query.js.map +1 -0
- package/dist/src/graph/types.d.ts +112 -0
- package/dist/src/graph/types.d.ts.map +1 -0
- package/dist/src/graph/types.js +2 -0
- package/dist/src/graph/types.js.map +1 -0
- package/dist/src/tui/install-ui/KgVendorConfig.d.ts +7 -0
- package/dist/src/tui/install-ui/KgVendorConfig.d.ts.map +1 -0
- package/dist/src/tui/install-ui/KgVendorConfig.js +9 -0
- package/dist/src/tui/install-ui/KgVendorConfig.js.map +1 -0
- package/dist/src/utils/update-notices.js +23 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/workflows/analyze.md +2 -1
- package/workflows/brainstorm.md +24 -1
- package/workflows/codebase-rebuild.md +141 -1
- package/workflows/codebase-refresh.md +20 -0
- package/workflows/finish-work.md +7 -2
- package/workflows/grill.md +513 -0
- package/workflows/plan.md +7 -4
- package/workflows/specs-setup.md +99 -3
- package/workflows/swarm/wf-analyze.js +347 -0
- package/workflows/swarm/wf-brainstorm.js +456 -0
- package/workflows/swarm/wf-execute.js +379 -0
- package/workflows/swarm/wf-grill.js +359 -0
- package/workflows/swarm/wf-milestone-audit.js +385 -0
- package/workflows/swarm/wf-plan.js +468 -0
- package/workflows/swarm/wf-review.js +341 -0
- package/workflows/swarm/wf-verify.js +395 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: team-adversarial-swarm
|
|
3
|
+
description: "ACO swarm intelligence with modular Workflow composition and adversarial decision gates. Coordinator drives iteration loop; 4 composable Workflow scripts handle exploration, scoring, convergence, and synthesis — each with built-in adversarial patterns."
|
|
4
|
+
allowed-tools: read(*), write(*), edit(*), bash(*), glob(*), grep(*), workflow(*), ask_user_question(*), agent(*)
|
|
5
|
+
---
|
|
6
|
+
<!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Team Adversarial Swarm
|
|
10
|
+
|
|
11
|
+
ACO 蚁群优化 + 模块化 Workflow 编排 + 对抗决策。
|
|
12
|
+
|
|
13
|
+
继承 `team-swarm` 的蚁群算法核心(Python ACO 脚本),用 4 个可组合的 Workflow 脚本
|
|
14
|
+
替代 team-worker 架构,在每个决策节点注入对抗性 agent 模式。
|
|
15
|
+
|
|
16
|
+
## Architecture
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
SKILL.md (Coordinator — this file)
|
|
20
|
+
│
|
|
21
|
+
│ Phase 1: Config Generation (inline)
|
|
22
|
+
│ Phase 2: ACO Init (Bash: aco.py init)
|
|
23
|
+
│
|
|
24
|
+
│ Phase 3: Iteration Loop ×K
|
|
25
|
+
│ ┌──────────────────────────────────────────────────┐
|
|
26
|
+
│ │ 3a. Bash: aco.py select → assignments │
|
|
27
|
+
│ │ 3b. Workflow(wf-swarm-explore) ← 模块1 │
|
|
28
|
+
│ │ N ants parallel → ant_results │
|
|
29
|
+
│ │ 3c. Workflow(wf-swarm-score) ← 模块2 │
|
|
30
|
+
│ │ 3-vote adversarial scoring → verified_scores │
|
|
31
|
+
│ │ 3d. Write scores → Bash: aco.py update │
|
|
32
|
+
│ │ 3e. Workflow(wf-swarm-converge) ← 模块3 │
|
|
33
|
+
│ │ prosecutor/defender/judge → converged? │
|
|
34
|
+
│ │ 3f. if converged: break │
|
|
35
|
+
│ └──────────────────────────────────────────────────┘
|
|
36
|
+
│
|
|
37
|
+
│ Phase 4: Bash: aco.py report
|
|
38
|
+
│ Workflow(wf-swarm-synthesize) ← 模块4
|
|
39
|
+
│ 3-perspective analysis + arbitration → best-solution.md
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Workflow Module Registry
|
|
43
|
+
|
|
44
|
+
| Module | Script | Args Interface | Adversarial Pattern | Returns |
|
|
45
|
+
|--------|--------|---------------|--------------------|---------|
|
|
46
|
+
| **Explore** | `workflows/wf-swarm-explore.js` | `{ iteration, assignments[], objective, session, config }` | N ants parallel | `{ ant_results[] }` |
|
|
47
|
+
| **Score** | `workflows/wf-swarm-score.js` | `{ iteration, ant_results[], objective, rubric? }` | 3-vote per ant (prosecutor/defender/judge) | `{ scores{}, calibration }` |
|
|
48
|
+
| **Converge** | `workflows/wf-swarm-converge.js` | `{ iteration, best, history[], config }` | prosecutor(continue)/defender(stop)/judge | `{ converged, reason, confidence }` |
|
|
49
|
+
| **Synthesize** | `workflows/wf-swarm-synthesize.js` | `{ best, top_k[], convergence_story, objective }` | 3-perspective + arbitrator | `{ report, caveats }` |
|
|
50
|
+
|
|
51
|
+
每个模块独立可用,也可由 Coordinator 组合编排。
|
|
52
|
+
|
|
53
|
+
## Shared Dependencies
|
|
54
|
+
|
|
55
|
+
**所有依赖均在本 skill 内部,无外部引用。**
|
|
56
|
+
|
|
57
|
+
- **Python ACO 脚本**: `<this-skill>/scripts/aco.py`
|
|
58
|
+
- 运行时解析: `find_files(".claude/skills/team-adversarial-swarm/scripts/aco.py")`
|
|
59
|
+
- 依赖模块: `pheromone.py`, `scoring.py`(同目录)
|
|
60
|
+
- 命令: `init` / `select` / `update` / `converged` / `report`
|
|
61
|
+
- 协议: [specs/swarm-protocol.md](specs/swarm-protocol.md)
|
|
62
|
+
- **Workflow 脚本**: `<this-skill>/workflows/wf-swarm-*.js`
|
|
63
|
+
- 运行时解析: `find_files(".claude/skills/team-adversarial-swarm/workflows/wf-swarm-*.js")`
|
|
64
|
+
|
|
65
|
+
## Specs Reference
|
|
66
|
+
|
|
67
|
+
| Spec | Purpose |
|
|
68
|
+
|------|---------|
|
|
69
|
+
| [specs/swarm-protocol.md](specs/swarm-protocol.md) | Coordinator ↔ Script ↔ Workflow 三方协议 |
|
|
70
|
+
| [specs/pheromone-schema.md](specs/pheromone-schema.md) | 信息素矩阵结构、更新公式、蒸发规则 |
|
|
71
|
+
| [specs/ant-output-schema.md](specs/ant-output-schema.md) | 蚁输出 JSON 合约(三层评分) |
|
|
72
|
+
| [specs/convergence-criteria.md](specs/convergence-criteria.md) | 双层收敛:Python 信号 + 对抗辩论 |
|
|
73
|
+
| [specs/swarm-config-template.json](specs/swarm-config-template.json) | 用户配置模板 |
|
|
74
|
+
|
|
75
|
+
## Session Directory
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
.workflow/.team/TAS-<slug>-<date>/
|
|
79
|
+
├── swarm-config.json # Phase 1 output
|
|
80
|
+
├── pheromone/ # ACO state (managed by aco.py)
|
|
81
|
+
│ ├── current.json
|
|
82
|
+
│ └── history/
|
|
83
|
+
├── trails/ # Per-iteration trails (managed by aco.py)
|
|
84
|
+
├── scores/ # Adversarial scoring results
|
|
85
|
+
│ └── iter-<k>-scores.json
|
|
86
|
+
├── artifacts/
|
|
87
|
+
│ ├── ant-<k>-<id>.json # Ant outputs
|
|
88
|
+
│ └── best-solution.md # Final synthesis
|
|
89
|
+
├── workflows/ # Workflow run artifacts
|
|
90
|
+
│ ├── explore-<k>.json # Per-iteration explore results
|
|
91
|
+
│ ├── score-<k>.json # Per-iteration score results
|
|
92
|
+
│ └── converge-<k>.json # Per-iteration convergence decision
|
|
93
|
+
└── best.json # Canonical best (managed by aco.py)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Coordinator Execution Flow
|
|
99
|
+
|
|
100
|
+
### Phase 0: Resume Check
|
|
101
|
+
|
|
102
|
+
1. `find_files(".workflow/.team/TAS-*/swarm-config.json")` → 查找活跃 session
|
|
103
|
+
2. 若存在且有 `workflows/converge-*.json` 未标记 converged → 恢复到对应迭代
|
|
104
|
+
3. 若无活跃 session → Phase 1
|
|
105
|
+
|
|
106
|
+
### Phase 1: Config Generation
|
|
107
|
+
|
|
108
|
+
解析用户 intent,生成 `swarm-config.json`。
|
|
109
|
+
|
|
110
|
+
若 intent 不够明确,用 ask_user 澄清:
|
|
111
|
+
- 搜索空间是什么?(文件 glob / 节点列表 / 抽象决策集)
|
|
112
|
+
- 目标是什么?(最优方案 / 发现问题 / 优化路径)
|
|
113
|
+
- 如何评分?(测试通过率 / lint / 自定义规则 / LLM 对抗评分)
|
|
114
|
+
- 预算?(最大迭代 / 每轮蚁数 / token 预算)
|
|
115
|
+
|
|
116
|
+
生成 config 字段:
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"task": { "objective": "...", "evidence_requirements": "..." },
|
|
120
|
+
"swarm": { "n_ants": 5, "max_iterations": 5 },
|
|
121
|
+
"aco": { "alpha": 1.0, "beta": 2.0, "rho": 0.1, "q": 1.0 },
|
|
122
|
+
"task_space": { "nodes": [...], "auto_discover_from": "..." },
|
|
123
|
+
"scoring": { "mode": "adversarial", "rubric": "..." },
|
|
124
|
+
"convergence": { "patience": 2, "min_improvement": 0.01, "max_iterations": 5 }
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Write 到 `<session>/swarm-config.json`。
|
|
129
|
+
|
|
130
|
+
### Phase 2: ACO Init
|
|
131
|
+
|
|
132
|
+
1. 创建 session 目录: `TAS-<slug>-<date>`
|
|
133
|
+
2. 解析 aco.py 路径(从 team-swarm skill 继承)
|
|
134
|
+
3. `Bash: python <aco.py> --session <session> init`
|
|
135
|
+
4. 解析输出: `{ n_nodes, n_edges, pheromone_path }`
|
|
136
|
+
|
|
137
|
+
### Phase 3: Iteration Loop
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
for k in range(1, max_iterations + 1):
|
|
141
|
+
# 3a. ACO selection
|
|
142
|
+
assignments = shell("python aco.py --session <session> select --iter k")
|
|
143
|
+
|
|
144
|
+
# 3b. Parallel exploration (Workflow Module 1)
|
|
145
|
+
explore_result = Workflow({
|
|
146
|
+
scriptPath: "<skill>/workflows/wf-swarm-explore.js",
|
|
147
|
+
args: { iteration: k, assignments, objective, session, config }
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
# 3c. Adversarial scoring (Workflow Module 2)
|
|
151
|
+
score_result = Workflow({
|
|
152
|
+
scriptPath: "<skill>/workflows/wf-swarm-score.js",
|
|
153
|
+
args: { iteration: k, ant_results: explore_result.ant_results, objective, rubric }
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
# 3d. Write scores + pheromone update
|
|
157
|
+
write_file("<session>/scores/iter-k-scores.json", score_result)
|
|
158
|
+
shell("python aco.py --session <session> update --iter k")
|
|
159
|
+
|
|
160
|
+
# 3e. Adversarial convergence check (Workflow Module 3)
|
|
161
|
+
converge_result = Workflow({
|
|
162
|
+
scriptPath: "<skill>/workflows/wf-swarm-converge.js",
|
|
163
|
+
args: { iteration: k, best: aco_best, history: iter_history, config }
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
# 3f. Save + check
|
|
167
|
+
write_file("<session>/workflows/converge-k.json", converge_result)
|
|
168
|
+
if converge_result.converged: break
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**注意**:每次 Workflow 调用是独立的,数据通过 args 传入、返回值传出。
|
|
172
|
+
Coordinator 负责 Workflow 间的数据桥接和 Python 脚本调用。
|
|
173
|
+
|
|
174
|
+
### Phase 4: Synthesis
|
|
175
|
+
|
|
176
|
+
1. `Bash: python aco.py --session <session> report` → 获取 best + top_k + curve
|
|
177
|
+
2. 调用 Workflow Module 4:
|
|
178
|
+
```
|
|
179
|
+
Workflow({
|
|
180
|
+
scriptPath: "<skill>/workflows/wf-swarm-synthesize.js",
|
|
181
|
+
args: { best, top_k, convergence_story, objective }
|
|
182
|
+
})
|
|
183
|
+
```
|
|
184
|
+
3. 将 synthesis 结果写入 `<session>/artifacts/best-solution.md`
|
|
185
|
+
4. 展示完成摘要 + ask_user(归档 / 保留 / 导出 / 再跑一轮)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Module Composition Patterns
|
|
190
|
+
|
|
191
|
+
### 完整流水线(默认)
|
|
192
|
+
```
|
|
193
|
+
explore → score → update → converge → [loop] → synthesize
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### 仅探索(跳过评分,用 self_score)
|
|
197
|
+
```
|
|
198
|
+
explore → update(self_score) → converge → synthesize
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 单次迭代调试
|
|
202
|
+
```
|
|
203
|
+
explore(k=1) → score(k=1) // 不循环,只看一轮
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 独立评分(已有 ant artifacts)
|
|
207
|
+
```
|
|
208
|
+
score(ant_results from files) → 输出 verified_scores
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### 独立综合(已有 best + trails)
|
|
212
|
+
```
|
|
213
|
+
synthesize(best, top_k) → best-solution.md
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Error Handling
|
|
219
|
+
|
|
220
|
+
| Scenario | Resolution |
|
|
221
|
+
|----------|------------|
|
|
222
|
+
| aco.py 未找到 | Glob team-swarm skill 路径;提示安装 |
|
|
223
|
+
| Python < 3.10 | 尝试 python3;报告依赖 |
|
|
224
|
+
| Workflow 执行失败 | 记录错误,提供 --resume 恢复点 |
|
|
225
|
+
| 所有蚁全部失败 | 暂停,ask_user(重试/终止/调整config) |
|
|
226
|
+
| 收敛从不触发 | max_iterations 安全网总会触发 |
|
|
227
|
+
| 幻觉集群 (>50% 蚁被降分) | 暂停,ask_user(继续/调整评分规则) |
|
|
228
|
+
|
|
229
|
+
## Completion
|
|
230
|
+
|
|
231
|
+
展示最终结果 + 交互选择:
|
|
232
|
+
- **归档**: 保存 session,展示 best-solution.md
|
|
233
|
+
- **继续**: 保持 session,可追加迭代
|
|
234
|
+
- **导出**: 复制 best-solution.md 到目标位置
|
|
235
|
+
- **再跑**: 重置收敛,继续 K 轮
|