self-evolving-workflow 0.0.0-stage → 0.1.3
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/LICENSE +27 -0
- package/README.md +90 -2
- package/dist/agent-memory-prompts.d.ts +13 -0
- package/dist/agent-memory-prompts.js +55 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +6 -0
- package/dist/closeout.d.ts +105 -0
- package/dist/closeout.js +479 -0
- package/dist/code.d.ts +39 -0
- package/dist/code.js +124 -0
- package/dist/common.d.ts +9 -0
- package/dist/common.js +42 -0
- package/dist/context-envelope.d.ts +59 -0
- package/dist/context-envelope.js +23 -0
- package/dist/host-adapters.d.ts +34 -0
- package/dist/host-adapters.js +151 -0
- package/dist/http.d.ts +3 -0
- package/dist/http.js +90 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +13 -0
- package/dist/knowledge-cli.d.ts +183 -0
- package/dist/knowledge-cli.js +654 -0
- package/dist/knowledge-reads.d.ts +71 -0
- package/dist/knowledge-reads.js +193 -0
- package/dist/memory.d.ts +97 -0
- package/dist/memory.js +250 -0
- package/dist/retrospective.d.ts +57 -0
- package/dist/retrospective.js +248 -0
- package/dist/search.d.ts +36 -0
- package/dist/search.js +112 -0
- package/dist/skill-addition.d.ts +25 -0
- package/dist/skill-addition.js +89 -0
- package/dist/skill-design.d.ts +96 -0
- package/dist/skill-design.js +226 -0
- package/dist/skill-replay.d.ts +55 -0
- package/dist/skill-replay.js +451 -0
- package/dist/skill-route.d.ts +30 -0
- package/dist/skill-route.js +75 -0
- package/dist/transcript-evidence.d.ts +3 -0
- package/dist/transcript-evidence.js +58 -0
- package/dist/upstream/chunker.d.ts +24 -0
- package/dist/upstream/chunker.js +96 -0
- package/dist/upstream/file-protocol.d.ts +45 -0
- package/dist/upstream/file-protocol.js +117 -0
- package/dist/upstream/frontmatter.d.ts +47 -0
- package/dist/upstream/frontmatter.js +86 -0
- package/dist/upstream/graph-search.d.ts +33 -0
- package/dist/upstream/graph-search.js +67 -0
- package/dist/upstream/l1-extraction.d.ts +26 -0
- package/dist/upstream/l1-extraction.js +405 -0
- package/dist/upstream/llm.d.ts +8 -0
- package/dist/upstream/llm.js +1 -0
- package/dist/upstream/merge.d.ts +50 -0
- package/dist/upstream/merge.js +153 -0
- package/dist/upstream/prompts.d.ts +53 -0
- package/dist/upstream/prompts.js +185 -0
- package/dist/upstream/search-utils.d.ts +34 -0
- package/dist/upstream/search-utils.js +55 -0
- package/dist/upstream/slug.d.ts +26 -0
- package/dist/upstream/slug.js +103 -0
- package/dist/upstream/template.d.ts +29 -0
- package/dist/upstream/template.js +80 -0
- package/dist/upstream/tokenize.d.ts +4 -0
- package/dist/upstream/tokenize.js +29 -0
- package/dist/wiki-change.d.ts +76 -0
- package/dist/wiki-change.js +299 -0
- package/dist/wiki-entry.d.ts +26 -0
- package/dist/wiki-entry.js +93 -0
- package/dist/wiki-ingest.d.ts +12 -0
- package/dist/wiki-ingest.js +126 -0
- package/dist/wiki-migration.d.ts +16 -0
- package/dist/wiki-migration.js +268 -0
- package/dist/wiki-tokens.d.ts +1 -0
- package/dist/wiki-tokens.js +46 -0
- package/dist/wiki.d.ts +103 -0
- package/dist/wiki.js +330 -0
- package/dist/workflow-cli.d.ts +2 -0
- package/dist/workflow-cli.js +258 -0
- package/dist/workflow-install.d.ts +36 -0
- package/dist/workflow-install.js +148 -0
- package/dist/workflow-knowledge.d.ts +16 -0
- package/dist/workflow-knowledge.js +24 -0
- package/dist/workflow-mcp.d.ts +2 -0
- package/dist/workflow-mcp.js +144 -0
- package/dist/workflow-names.d.ts +4 -0
- package/dist/workflow-names.js +18 -0
- package/dist/workflow-runtime.d.ts +622 -0
- package/dist/workflow-runtime.js +627 -0
- package/dist/workflow-skills.d.ts +48 -0
- package/dist/workflow-skills.js +141 -0
- package/package.json +76 -4
- package/skills/ew-odyssey/SKILL.md +237 -0
- package/skills/ew-odyssey/references/audit-artifacts.md +7 -0
- package/skills/ew-odyssey/references/odyssey-base-codex.md +3 -0
- package/skills/ew-odyssey/references/odyssey-base.md +278 -0
- package/skills/ew-odyssey/references/odyssey-debug.codex.md +305 -0
- package/skills/ew-odyssey/references/odyssey-debug.md +283 -0
- package/skills/ew-odyssey/references/odyssey-defensive.codex.md +395 -0
- package/skills/ew-odyssey/references/odyssey-defensive.md +369 -0
- package/skills/ew-odyssey/references/odyssey-improve.codex.md +270 -0
- package/skills/ew-odyssey/references/odyssey-improve.md +248 -0
- package/skills/ew-odyssey/references/odyssey-planex.codex.md +352 -0
- package/skills/ew-odyssey/references/odyssey-planex.md +312 -0
- package/skills/ew-odyssey/references/odyssey-review.codex.md +283 -0
- package/skills/ew-odyssey/references/odyssey-review.md +251 -0
- package/skills/ew-odyssey/references/odyssey-security.md +249 -0
- package/skills/ew-odyssey/references/odyssey-ui.codex.md +294 -0
- package/skills/ew-odyssey/references/odyssey-ui.md +250 -0
- package/skills/ew-odyssey/references/prepare/odyssey-debug.md +105 -0
- package/skills/ew-odyssey/references/prepare/odyssey-defensive.md +121 -0
- package/skills/ew-odyssey/references/prepare/odyssey-improve.md +93 -0
- package/skills/ew-odyssey/references/prepare/odyssey-planex.md +104 -0
- package/skills/ew-odyssey/references/prepare/odyssey-review.md +98 -0
- package/skills/ew-odyssey/references/prepare/odyssey-security.md +94 -0
- package/skills/ew-odyssey/references/prepare/odyssey-ui.md +87 -0
- package/skills/ew-orchestrate/SKILL.md +236 -0
- package/skills/ew-orchestrate/references/auto-policy.md +165 -0
- package/skills/ew-orchestrate/references/companion-route.md +52 -0
- package/skills/ew-orchestrate/references/ew-orchestrate.md +27 -0
- package/skills/ew-orchestrate/references/goal.md +53 -0
- package/skills/ew-orchestrate/references/knowledge-route.md +163 -0
- package/skills/ew-orchestrate/references/orchestrator-run-loop.md +36 -0
- package/skills/ew-orchestrate/references/planning.md +137 -0
- package/skills/ew-orchestrate/steps/ew-analyze/SKILL.md +62 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/boundary-grill.md +50 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/issue-gaps-analyze.md +59 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/prepare.md +42 -0
- package/skills/ew-orchestrate/steps/ew-analyze/references/workflow.md +401 -0
- package/skills/ew-orchestrate/steps/ew-brainstorm/SKILL.md +32 -0
- package/skills/ew-orchestrate/steps/ew-companion/SKILL.md +9 -0
- package/skills/ew-orchestrate/steps/ew-execute/SKILL.md +71 -0
- package/skills/ew-orchestrate/steps/ew-execute/references/prepare.md +69 -0
- package/skills/ew-orchestrate/steps/ew-execute/references/workflow.md +373 -0
- package/skills/ew-orchestrate/steps/ew-plan/SKILL.md +102 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/boundary-grill.md +50 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/prepare.md +51 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/tdd.md +53 -0
- package/skills/ew-orchestrate/steps/ew-plan/references/workflow.md +278 -0
- package/skills/ew-orchestrate/steps/ew-review/SKILL.md +44 -0
- package/skills/ew-orchestrate/steps/ew-review/references/odyssey-base-codex.md +3 -0
- package/skills/ew-orchestrate/steps/ew-review/references/prepare.md +76 -0
- package/skills/ew-orchestrate/steps/ew-review/references/workflow.md +283 -0
- package/skills/ew-skill-design/SKILL.md +28 -0
- package/skills/ew-skill-design/references/package-contract.md +28 -0
- package/skills/ew-skill-design/references/validation.md +7 -0
- package/skills/team-swarm/SKILL.md +231 -0
- package/skills/team-swarm/references/mcp-coordination.md +10 -0
- package/skills/team-swarm/roles/analyst/role.md +181 -0
- package/skills/team-swarm/roles/ant/role.md +149 -0
- package/skills/team-swarm/roles/coordinator/commands/converge.md +154 -0
- package/skills/team-swarm/roles/coordinator/commands/init-swarm.md +134 -0
- package/skills/team-swarm/roles/coordinator/commands/iterate.md +202 -0
- package/skills/team-swarm/roles/coordinator/role.md +228 -0
- package/skills/team-swarm/roles/scorer/role.md +150 -0
- package/skills/team-swarm/scripts/aco.py +646 -0
- package/skills/team-swarm/scripts/pheromone.py +144 -0
- package/skills/team-swarm/scripts/scoring.py +111 -0
- package/skills/team-swarm/scripts/test_aco.py +606 -0
- package/skills/team-swarm/specs/ant-output-schema.md +127 -0
- package/skills/team-swarm/specs/convergence-criteria.md +108 -0
- package/skills/team-swarm/specs/pheromone-schema.md +125 -0
- package/skills/team-swarm/specs/swarm-config-template.json +71 -0
- package/skills/team-swarm/specs/swarm-protocol.md +123 -0
- package/skills/workflow-closeout/SKILL.md +10 -0
- package/skills/workflow-evolve/SKILL.md +79 -0
- package/skills/workflow-evolve/references/agy-gate.md +27 -0
- package/skills/workflow-evolve/references/auto-loop.md +20 -0
- package/skills/workflow-evolve/references/history-review.md +14 -0
- package/skills/workflow-evolve/scripts/codex-memory-replay.mjs +76 -0
- package/skills/workflow-evolve/scripts/codex-replay.mjs +1 -0
- package/skills/workflow-evolve/scripts/evolve-loop.mjs +259 -0
- package/skills/workflow-evolve/scripts/memory-codex-mcp.mjs +124 -0
- package/workflows/index.json +23 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
<!-- session-mode: inherited -->
|
|
2
|
+
|
|
3
|
+
# Workflow: Odyssey Review (Codex)
|
|
4
|
+
|
|
5
|
+
Codex-adapted: uses `spawn_agents_on_csv`, `request_user_input`, `update_plan`.
|
|
6
|
+
|
|
7
|
+
## State Chain
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_REVIEW → S_FIX → S_CONFIRM → [back-half]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Back-half: `S_GENERALIZE → S_DISCOVER → S_RECORD → END` (see [shared Codex phases](odyssey-base-codex.md)).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Boundary
|
|
18
|
+
|
|
19
|
+
**In scope:** Multi-dimensional deep review of target code → exhaustive fix ALL findings by severity → generalize patterns project-wide.
|
|
20
|
+
**Out of scope:** Root cause debug → `--mode debug` | Feature implementation → `--mode planex` | UI visual optimization → `--mode ui`. Zero-residual applies (fix ALL findings within fix_threshold, default all).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Target Resolution
|
|
25
|
+
|
|
26
|
+
| Input | Resolution |
|
|
27
|
+
|-------|-----------|
|
|
28
|
+
| File/dir path | Review those files |
|
|
29
|
+
| `HEAD` / `staged` | `git diff HEAD` / `git diff --staged` |
|
|
30
|
+
| Phase number | state.json → changed files |
|
|
31
|
+
| PR number | `git diff main...HEAD` |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Session Fields
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{ "target": "", "dimensions": [], "review_result": {"remaining_actionable": 0},
|
|
39
|
+
"patterns": [], "confirmation": null, "generalization_stats": null }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## evidence.ndjson Phases
|
|
45
|
+
|
|
46
|
+
`archaeology|explore|review|fix|discovery|decision|self-iteration`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## phase_goals[]
|
|
51
|
+
|
|
52
|
+
| ID | Goal | done_when | phase | skip_when |
|
|
53
|
+
|----|------|-----------|-------|-----------|
|
|
54
|
+
| G1 | Review completed | all dimensions reviewed | S_REVIEW | — |
|
|
55
|
+
| G2 | Explore context | explore.json populated | S_EXPLORE | — |
|
|
56
|
+
| G3 | Zero remaining | `remaining_actionable == 0` | S_CONFIRM | skip_fix |
|
|
57
|
+
| G4 | Pattern generalized | patterns[] ≥1 | S_GENERALIZE | skip_generalize |
|
|
58
|
+
| G5 | Discoveries triaged | all hits classified | S_DISCOVER | skip_generalize |
|
|
59
|
+
| G6 | Learnings persisted | spec entries or no actionable | S_RECORD | — |
|
|
60
|
+
|
|
61
|
+
`update_plan({ plan: [{ step: "G1: review", status: "pending" }, ..., { step: "G6: record", status: "pending" }] })`(按上方 gate 表初始化 G1-G6 步骤清单)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## understanding.md — 8 Sections
|
|
66
|
+
|
|
67
|
+
1. Target & Scope
|
|
68
|
+
2. Archaeology
|
|
69
|
+
3. Exploration
|
|
70
|
+
4. Review Results
|
|
71
|
+
5. Fix & Confirmation
|
|
72
|
+
6. Generalization
|
|
73
|
+
7. Discoveries
|
|
74
|
+
8. Learnings
|
|
75
|
+
|
|
76
|
+
Specs: use matching `session-priors` and look up any additional review scope through `wiki_context`.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## State Machine — Transitions
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
S_ARCHAEOLOGY → S_EXPLORE : complete
|
|
84
|
+
S_EXPLORE → S_REVIEW : complete
|
|
85
|
+
S_REVIEW → S_FIX : !skip_fix AND findings
|
|
86
|
+
S_REVIEW → S_GENERALIZE : skip_fix OR no findings, !skip_generalize
|
|
87
|
+
S_REVIEW → S_RECORD : both skip
|
|
88
|
+
S_FIX → S_CONFIRM : tier complete
|
|
89
|
+
S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
|
|
90
|
+
S_CONFIRM → S_RECORD : confirmed, skip_generalize
|
|
91
|
+
S_CONFIRM → S_FIX : needs_rework
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Discover routes: fixable sibling → S_FIX; new target needing review → S_REVIEW (loops < max_loops).
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Actions
|
|
99
|
+
|
|
100
|
+
### A_ARCHAEOLOGY
|
|
101
|
+
|
|
102
|
+
Generate `archaeology.csv` with 2 rows for parallel agents:
|
|
103
|
+
|
|
104
|
+
```csv
|
|
105
|
+
id,title,description,target,deps,status,findings,error
|
|
106
|
+
"1","Timeline","Run git log --oneline -20 -- {files} for target files. Identify recent changes, authors, and change frequency. Return JSON: [{commit_sha, date, author, message, files_changed}]","{target}","","","",""
|
|
107
|
+
"2","Blame","Run git blame -L {region} on top 3 files by change frequency. Identify ownership patterns and recent modifications. Return JSON: [{file, line_range, author, commit_sha, date, content_summary}]","{target}","","","",""
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
spawn_agents_on_csv({
|
|
112
|
+
csv_path: `${sessionFolder}/archaeology.csv`,
|
|
113
|
+
id_column: "id",
|
|
114
|
+
instruction: "You are performing git archaeology on target code. Read 'description' for your specific task and 'target' for the files to analyze. Use git commands to gather evidence. Write findings as a concise summary.",
|
|
115
|
+
max_concurrency: 2,
|
|
116
|
+
max_runtime_seconds: 3600,
|
|
117
|
+
output_csv_path: `${sessionFolder}/archaeology-results.csv`,
|
|
118
|
+
output_schema: { id, status: ["completed"|"failed"], findings, error }
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Evidence phase=archaeology.
|
|
123
|
+
|
|
124
|
+
`evolve delegate --role analyze --mode analysis` (`run_in_background: true`):
|
|
125
|
+
- PURPOSE: review recent modifications related to {target}
|
|
126
|
+
- EXPECTED: JSON `[{commit_sha, risk_level, analysis, could_cause_issue, explanation}]`
|
|
127
|
+
|
|
128
|
+
Update §2 (Archaeology).
|
|
129
|
+
|
|
130
|
+
If an archaeology agent fails, log W003 and proceed with available results.
|
|
131
|
+
|
|
132
|
+
### A_EXPLORE
|
|
133
|
+
|
|
134
|
+
Skip if no CLI tools (W006).
|
|
135
|
+
|
|
136
|
+
`evolve delegate --role explore --mode analysis` (`run_in_background: true`):
|
|
137
|
+
- PURPOSE: call chains, recent changes, error gaps, similar patterns
|
|
138
|
+
- EXPECTED: JSON `{call_chains, recent_changes, error_gaps, similar_patterns}`
|
|
139
|
+
|
|
140
|
+
Write `explore.json` + evidence phase=explore. Update §3 (Exploration). Mark G2. `update_plan`(G2 → completed)
|
|
141
|
+
|
|
142
|
+
**GATE: discovery-complete** — archaeology/explore evidence logged, understanding.md §2-§3 updated, G2 marked (W003 partial / W006 skip acceptable).
|
|
143
|
+
|
|
144
|
+
### A_REVIEW
|
|
145
|
+
|
|
146
|
+
Generate `review-dimensions.csv` with 4 dimension rows:
|
|
147
|
+
|
|
148
|
+
```csv
|
|
149
|
+
id,dimension,focus,target,deps,status,findings_json,error
|
|
150
|
+
"1","Correctness","Logic errors, boundary conditions, null/undefined handling, race conditions, type mismatches, off-by-one errors, missing error handling","{target}","","","",""
|
|
151
|
+
"2","Security","Injection vulnerabilities, XSS, CSRF, data exposure, auth bypass, insecure defaults, secret leakage, path traversal","{target}","","","",""
|
|
152
|
+
"3","Performance","Hot paths, N+1 queries, memory leaks, unnecessary recomputation, missing caching, blocking operations, large allocations","{target}","","","",""
|
|
153
|
+
"4","Architecture","Layer violations, circular dependencies, interface contract breaks, separation of concerns, abstraction leaks, coupling issues","{target}","","","",""
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```javascript
|
|
157
|
+
spawn_agents_on_csv({
|
|
158
|
+
csv_path: `${sessionFolder}/review-dimensions.csv`,
|
|
159
|
+
id_column: "id",
|
|
160
|
+
instruction: "You are reviewing code for a specific dimension. Read 'dimension' and 'focus' columns for your review scope. Read 'target' for the files to review. Scan target files thoroughly, identify issues matching your dimension. Return findings_json as a JSON array: [{title, severity, file, line, description, suggestion, cwe}]. Severity levels: critical, high, medium, low.",
|
|
161
|
+
max_concurrency: 4,
|
|
162
|
+
max_runtime_seconds: 3600,
|
|
163
|
+
output_csv_path: `${sessionFolder}/review-results.csv`,
|
|
164
|
+
output_schema: { id, status: ["completed"|"failed"], findings_json, error }
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Merge all dimension findings → evidence phase=review. Write `review_result` + §4 severity matrix. Mark G1. `update_plan`(G1 → completed)
|
|
169
|
+
|
|
170
|
+
**GATE: all-dimensions-reviewed** — all 4 dimension agents (correctness, security, performance, architecture) completed, findings merged into review_result with severity classification, evidence phase=review logged, §4 severity matrix written, G1 marked. Zero dimensions reviewed is BLOCKED (W002 partial with ≥1 dimension allowed).
|
|
171
|
+
|
|
172
|
+
### A_FIX
|
|
173
|
+
|
|
174
|
+
Exhaustive iterative fix — descend by severity until `remaining_actionable == 0`:
|
|
175
|
+
```
|
|
176
|
+
for tier in [critical, high, medium, low].filter(>= threshold):
|
|
177
|
+
for each unfixed candidate: read ±20 lines → fix → evidence phase=fix
|
|
178
|
+
re-review modified area (new findings → append, continue; max 2 per tier)
|
|
179
|
+
tier done → auto-commit
|
|
180
|
+
```
|
|
181
|
+
Normal: `request_user_input` per tier | `-y`: auto-fix all. Remaining > 0 → retry (**MANDATORY hard limit: max_fix_rounds = 5**). Unchanged 2 rounds → classify each individually. After 5 rounds remaining > 0 → escalate: Normal: `request_user_input` (continue/accept/reclassify) | `-y`: classify remaining as `deferred`, proceed. **No partial-tier advancement** — a tier is complete only when every finding is fixed or individually classified. Blanket "pre-existing" forbidden. Commit per tier: `"odyssey-review({slug}): FIX-{tier} — {N} items fixed"`.
|
|
182
|
+
|
|
183
|
+
### A_CONFIRM
|
|
184
|
+
|
|
185
|
+
Run tests + `evolve delegate --role review --mode analysis` (`run_in_background: true`) zero-residual review. `remaining == 0 AND new == 0` → confirmed, mark G3 `update_plan`(G3 → completed); otherwise → needs_rework → S_FIX. Update `confirmation` + `remaining_actionable` + §5.
|
|
186
|
+
|
|
187
|
+
**GATE: zero-remaining** — exhaustive fix applied tier-by-tier, `remaining_actionable == 0` (or all remaining individually classified as deferred after 5-round escalation), tests pass, CLI re-review confirms no new findings, confirmation + §5 written, G3 marked. `needs_rework` routes back to FIX; skippable only when `skip_fix == true`.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Generalize Source
|
|
192
|
+
|
|
193
|
+
Review findings with severity >= medium.
|
|
194
|
+
|
|
195
|
+
**Discover routing:** fixable sibling → S_FIX; new target → S_REVIEW.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Knowledge Persistence (§8)
|
|
200
|
+
|
|
201
|
+
Include verified reusable findings in the Run summary and harvest the completed Session through Agent Memory closeout.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
| Category | Content | Follow-up |
|
|
205
|
+
|----------|---------|-----------|
|
|
206
|
+
| Cross-dimension recurring pattern | Pattern + affected dimensions + coding standard | `stage spec → review` |
|
|
207
|
+
| Security finding | Vulnerability type + triggers + fix approach | `stage spec → debug` |
|
|
208
|
+
| Architecture violation pattern | Violation + correct boundary + verification | `stage spec → arch` |
|
|
209
|
+
| Reusable generalization pattern | Signature + risk + fix template + scope | `stage spec → coding` |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Completion Summary
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
--- REVIEW-TEST-FIX ODYSSEY COMPLETE ---
|
|
217
|
+
Target: {target} Dimensions: {dims}
|
|
218
|
+
Findings: {C}C {H}H {M}M {L}L Fix: {fixed}, confirmed={yes|skip}
|
|
219
|
+
Patterns: {N} ({by_layer}) Scan hits: {total} ({cross} cross-layer)
|
|
220
|
+
Issues: {N} created
|
|
221
|
+
Decisions: {N} resolved, {M} pending, {K} deferred
|
|
222
|
+
Learnings: {N} persisted
|
|
223
|
+
Self-iter: {N} rounds across {M} stages
|
|
224
|
+
Goals: {done}/{total} ({skipped} skipped)
|
|
225
|
+
---
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## `-y` Decision Points
|
|
231
|
+
|
|
232
|
+
| Decision Point | Normal | `-y` |
|
|
233
|
+
|---------------|--------|------|
|
|
234
|
+
| S_FIX tier candidates | `request_user_input` | auto-fix `deferred` |
|
|
235
|
+
| S_FIX re-review new findings | `request_user_input` | auto-append |
|
|
236
|
+
| S_CONFIRM needs_rework | `request_user_input` | auto proceed |
|
|
237
|
+
| A_DISCOVER routing | `request_user_input` | auto-fix w/ template, issue for rest |
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Mode-Specific Phase Gates
|
|
242
|
+
|
|
243
|
+
- **Discovery gate** (ARCHAEOLOGY/EXPLORE): evidence logged, understanding.md updated. Archaeology partial via W003 acceptable; explore W006 skip acceptable.
|
|
244
|
+
- **Audit gate** (REVIEW): all dimension agents completed, findings merged. Zero dimensions reviewed is BLOCKED (W002 partial allowed).
|
|
245
|
+
- **FIX gate:** current severity tier fully addressed. Per-fix evidence logged. Auto-commit per tier. No partial-tier advancement.
|
|
246
|
+
- **CONFIRM gate:** tests pass; `remaining_actionable == 0` and new findings == 0; confirmation written. needs_rework → route back to FIX.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Error Codes (review-specific)
|
|
251
|
+
|
|
252
|
+
| Code | Severity | Condition | Recovery |
|
|
253
|
+
|------|----------|-----------|----------|
|
|
254
|
+
| W003 | warning | Archaeology agent failure | Proceed with available results |
|
|
255
|
+
| W006 | warning | No CLI tools | Skip explore |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Success Criteria (review-specific)
|
|
260
|
+
|
|
261
|
+
- [ ] Session + 4 output files + prior knowledge searched
|
|
262
|
+
- [ ] Archaeology + CLI review → evidence
|
|
263
|
+
- [ ] CLI exploration → explore.json
|
|
264
|
+
- [ ] All 4 dimensions reviewed with findings merged
|
|
265
|
+
- [ ] understanding.md 8 sections progressive
|
|
266
|
+
- [ ] Exhaustive fix by severity tier + confirmed (unless --skip-fix)
|
|
267
|
+
- [ ] Generalization + scan (unless --skip-generalize)
|
|
268
|
+
- [ ] Discoveries classified; unfixed findings individually justified
|
|
269
|
+
- [ ] phase_goals + goal audit + resumable via -c
|
|
270
|
+
- [ ] Completion summary
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Next Step Routing (review-specific)
|
|
275
|
+
|
|
276
|
+
| Condition | Next |
|
|
277
|
+
|-----------|------|
|
|
278
|
+
| Discovery issues | `Open the follow-up findings in the project issue tracker` |
|
|
279
|
+
| Document pattern | `Review the module and stage the reusable method via Agent Memory closeout` |
|
|
280
|
+
| Debug root cause | `$ew-odyssey <issue> --mode debug` |
|
|
281
|
+
| Second opinion | `evolve delegate "<review prompt>" --mode analysis` |
|
|
282
|
+
| Related question | `Use an Evolve analyze step for the question` |
|
|
283
|
+
| Pending decisions | Filter evidence phase=decision status=pending |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ew-skill-design
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
description: Design, migrate, or validate a Evolve project Skill with linked
|
|
5
|
+
Markdown, a Session/Run contract where needed, and reproducible host cases.
|
|
6
|
+
allowed-tools:
|
|
7
|
+
- Bash
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Read
|
|
12
|
+
- Write
|
|
13
|
+
session-mode: none
|
|
14
|
+
version: 0.5.93
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Evolve Skill Design
|
|
18
|
+
|
|
19
|
+
Use the requested outcome and the target project's conventions to design or validate `skills/<id>/SKILL.md` and its package. This Skill is entered explicitly when the Agent Memory knowledge route classifies a verified candidate as `skill-design`, or when the user directly requests a new Skill. A route decision alone never starts this Skill. When migrating an existing Skill, inventory its entry points, parameters, outputs, and recovery paths before moving guidance. Keep those interfaces in the design and exercise them in acceptance cases.
|
|
20
|
+
|
|
21
|
+
1. Resolve the project's knowledge and applicable constraints. Record the Skill's triggers, expected artifacts, effects, and success cases. Choose Session/Run when the task needs durable progression, decisions, or artifact handoff. A standalone Skill can use the host's completion receipt. Reuse any Run already assigned to the authoring task.
|
|
22
|
+
2. Put dispatch rules and short instructions in `SKILL.md`. Move conditional procedures into package-relative Markdown links. Put scripts and role instructions beside the Skill when it owns them. Use [the package contract guide](references/package-contract.md) when choosing the lifecycle or declaring Run inputs, outputs, and linked documents.
|
|
23
|
+
3. Inspect the package as the host will see it. Validate the intended Git revision and test the main workflow, one existing success case, and each affected recovery or conditional branch. For a plan or review request, deliver the design or identified gaps. For authoring, leave the requested files and verification results in the workspace.
|
|
24
|
+
4. For changes motivated by a finished Session, use its Memory retrospective to ground the change. Follow [the replay and release procedure](references/validation.md) to verify the actual loaded version and preserve a rollback path.
|
|
25
|
+
|
|
26
|
+
## Agent Memory design-task handoff
|
|
27
|
+
|
|
28
|
+
When entered from `agent-memory closeout route`, read the generated task with `agent-memory skill-design task <task-id>`. Return a `skill-design/1.0` envelope containing `task_id` and a replayable `draft`. Keep the target Skill entry, evidence sources, baseline hash, priority, and conditional links explicit. The caller runs `agent-memory skill-design review <design-id>`, `skill-design replay`, and `skill-design apply` after the design response is returned. Do not edit the target Skill during design generation.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Project Skill package
|
|
2
|
+
|
|
3
|
+
Use the package directory name in `name`, and describe the actual invocation in `description`. Keep common steps in `SKILL.md`. For any bundle-only phase, add a standard Markdown link and describe when to follow it. A path is relative to the document that contains its link. Use regular `.md` files tracked under the same Skill directory. Keep every required root link in `required_links` as well as in the body. A header fragment such as `#verify-result` must resolve to an actual heading in the linked file.
|
|
4
|
+
|
|
5
|
+
For a Skill with no Session/Run lifecycle, use `session-mode: none`. A stateful Skill uses `session-mode: run` and a structured `contract` with `contract_version: 2.1`. Use the same artifact schema, roles, and aliases as the consuming steps. For example:
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
session-mode: run
|
|
9
|
+
required_links:
|
|
10
|
+
- references/check.md
|
|
11
|
+
contract:
|
|
12
|
+
contract_version: 2.1
|
|
13
|
+
consumes:
|
|
14
|
+
- kind: findings
|
|
15
|
+
alias: current-analysis
|
|
16
|
+
schema: findings/1.0
|
|
17
|
+
role: primary
|
|
18
|
+
required: true
|
|
19
|
+
produces:
|
|
20
|
+
- path: outputs/verification.json
|
|
21
|
+
kind: verification
|
|
22
|
+
schema: verification/1.0
|
|
23
|
+
role: primary
|
|
24
|
+
alias: latest-verification
|
|
25
|
+
required: true
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Describe how each declared input is used and what each output proves. Put typed outputs under the current Run's `outputs/` directory. Ensure each output's metadata matches its slot. Use the current Run's `report.md` for the execution narrative and `evidence/` for verification traces. Keep scratch files outside `outputs/`. Define the observable pass condition, blocked result, and next authorized action at each phase boundary that affects correctness or recovery. The coordinator owns progression through the existing Session/Run commands and receipts.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Validate and release a project Skill
|
|
2
|
+
|
|
3
|
+
Run `evolve skills validate <id> --root <repo>` against the intended Git revision. The command checks the committed entry, Run contract, required links, and reachable Markdown. Use a test commit in an isolated worktree to exercise unpublished changes when needed. Resolve any broken link, unsupported lifecycle, or output mismatch at the source.
|
|
4
|
+
|
|
5
|
+
For a stateful Skill, verify a fresh Run binds the expected commit and contract. Read the entry and exercised links through the host's `evolve run skill-read`, confirm the input aliases and output schemas, and run `evolve run check` before sealing the sample. When migrating existing guidance, also resume a Run bound to the prior commit and repeat one historically successful case. For a standalone Skill, verify its actual host entry, expected result, and completion receipt.
|
|
6
|
+
|
|
7
|
+
For a behavior change based on a finished Session, run `agent-memory session review <session-id>` in that project. Use evidence tied to the affected Skill version. Follow `workflow-evolve` for a short inline change, a conditional link, or an optional reference, depending on severity and applicability. Replay the original case and an existing successful case. Apply the replayed change through the workflow's authorized adoption step, using its receipt for rollback.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: team-swarm
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
description: Swarm intelligence team skill — ACO-driven multi-agent exploration
|
|
5
|
+
with hybrid LLM coordinator + Python optimization controller. Coordinator
|
|
6
|
+
generates swarm-config from user task, then runs K iterations of N parallel
|
|
7
|
+
ants guided by pheromone state. Universal task space via config (nodes +
|
|
8
|
+
scoring rule). Triggers on "team swarm", "swarm intelligence", "蚁群".
|
|
9
|
+
allowed-tools:
|
|
10
|
+
- Bash
|
|
11
|
+
- Edit
|
|
12
|
+
- Glob
|
|
13
|
+
- Grep
|
|
14
|
+
- Read
|
|
15
|
+
- Write
|
|
16
|
+
- followup_task
|
|
17
|
+
- interrupt_agent
|
|
18
|
+
- list_agents
|
|
19
|
+
- request_user_input
|
|
20
|
+
- send_message
|
|
21
|
+
- spawn_agent
|
|
22
|
+
- spawn_agents_on_csv
|
|
23
|
+
- update_plan
|
|
24
|
+
- wait_agent
|
|
25
|
+
session-mode: run
|
|
26
|
+
required_links:
|
|
27
|
+
- roles/coordinator/role.md
|
|
28
|
+
- specs/swarm-protocol.md
|
|
29
|
+
contract:
|
|
30
|
+
contract_version: 2.1
|
|
31
|
+
consumes: []
|
|
32
|
+
produces:
|
|
33
|
+
- path: outputs/best-solution.md
|
|
34
|
+
kind: swarm-best-solution
|
|
35
|
+
schema: swarm-best-solution/1.0
|
|
36
|
+
role: primary
|
|
37
|
+
required: true
|
|
38
|
+
- path: outputs/swarm-report.json
|
|
39
|
+
kind: swarm-report
|
|
40
|
+
schema: swarm-report/1.0
|
|
41
|
+
role: attachment
|
|
42
|
+
required: true
|
|
43
|
+
- path: outputs/ant-{iteration}-{ant_id}.json
|
|
44
|
+
kind: swarm-ant-result
|
|
45
|
+
schema: swarm-ant-result/1.0
|
|
46
|
+
role: evidence
|
|
47
|
+
required: false
|
|
48
|
+
gates:
|
|
49
|
+
entry: []
|
|
50
|
+
exit: []
|
|
51
|
+
version: 0.5.93
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
> **Agent timeout**: `spawn_agent` 异步执行且无内置超时 — 除明确短任务外一律 `spawn_agent` 后立即 `wait_agent({ timeout_ms: 3600000 })`(上限 1 小时)阻塞等待,绝不依赖 30000 默认值;`timed_out: true` 且 Agent 未完成时再次 `wait_agent` 续等,不丢弃。批量场景使用 `spawn_agents_on_csv({ max_runtime_seconds: 3600, ... })`。
|
|
55
|
+
|
|
56
|
+
# Team Swarm
|
|
57
|
+
|
|
58
|
+
Orchestrate ant-colony-style exploration over a user-defined task space. **Hybrid coordinator**: LLM handles task translation + worker spawning; Python script owns all numeric decisions (selection / pheromone update / convergence). Universal — task space and scoring rule come from `swarm-config.json`.
|
|
59
|
+
|
|
60
|
+
## Architecture
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
spawn_agent({ task_name: "team_swarm", message: "Execute skill team-swarm, args: task description" })
|
|
64
|
+
|
|
|
65
|
+
SKILL.md (this file) = Router
|
|
66
|
+
|
|
|
67
|
+
+--------------+--------------+
|
|
68
|
+
| |
|
|
69
|
+
no --role flag --role <name>
|
|
70
|
+
| |
|
|
71
|
+
Coordinator Worker
|
|
72
|
+
roles/coordinator/role.md roles/<name>/role.md
|
|
73
|
+
|
|
|
74
|
+
+-- Phase 1: gen swarm-config
|
|
75
|
+
+-- Phase 2: init --> Bash: scripts/aco.py init
|
|
76
|
+
+-- Phase 3: iterate (K rounds, each = spawn-and-stop)
|
|
77
|
+
| |
|
|
78
|
+
| +-- Bash: aco.py select --iter k -> N assignments
|
|
79
|
+
| +-- Spawn N x team-worker(ant)
|
|
80
|
+
| +-- [callback when all ants done]
|
|
81
|
+
| +-- (optional) Spawn team-worker(scorer)
|
|
82
|
+
| +-- Bash: aco.py update --iter k
|
|
83
|
+
| +-- Bash: aco.py converged
|
|
84
|
+
| +-- branch: loop k+1 OR Phase 4
|
|
85
|
+
|
|
|
86
|
+
+-- Phase 4: converge --> Bash: aco.py report -> Spawn team-worker(analyst)
|
|
87
|
+
-> best-solution.md
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Role Registry
|
|
91
|
+
|
|
92
|
+
| Role | Path | Prefix | Inner Loop |
|
|
93
|
+
|------|------|--------|------------|
|
|
94
|
+
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
|
|
95
|
+
| ant | [roles/ant/role.md](roles/ant/role.md) | ANT-* | false |
|
|
96
|
+
| scorer | [roles/scorer/role.md](roles/scorer/role.md) | SCORE-* | false |
|
|
97
|
+
| analyst | [roles/analyst/role.md](roles/analyst/role.md) | ANALYST-* | false |
|
|
98
|
+
|
|
99
|
+
## Role Router
|
|
100
|
+
|
|
101
|
+
Parse `$ARGUMENTS`:
|
|
102
|
+
- Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
|
|
103
|
+
- No `--role` -> `@roles/coordinator/role.md`, execute entry router
|
|
104
|
+
|
|
105
|
+
## Shared Constants
|
|
106
|
+
|
|
107
|
+
- **Session prefix**: `TS`
|
|
108
|
+
- **Session path**: `{run_dir}/work/team/`
|
|
109
|
+
- **Team name**: `swarm`
|
|
110
|
+
- **Script root**: `<skill_root>/scripts/aco.py` (Python 3.10+)
|
|
111
|
+
- **Roster**: `evolve team list --session <session> --run <run>`
|
|
112
|
+
|
|
113
|
+
For a version-bound Run, open the role and protocol through `evolve run skill-read`. Before running Python, extract `scripts/` and the configuration template from the commit and package path in `skill_ref` into the current Run's work directory. Run the controller and its bundled imports from there. On resume use the same commit; keep coordination state under `{run_dir}/work/team/`.
|
|
114
|
+
|
|
115
|
+
When the host has no `TeamCreate` / teammate tools, follow [MCP coordination](references/mcp-coordination.md) for member dispatch, task tracking, callbacks and recovery.
|
|
116
|
+
|
|
117
|
+
## Worker Spawn Template
|
|
118
|
+
|
|
119
|
+
Coordinator spawns workers using this template:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
spawn_agent({
|
|
123
|
+
subagent_type: "team-worker",
|
|
124
|
+
description: "Spawn <role> worker",
|
|
125
|
+
team_name: "swarm",
|
|
126
|
+
name: "<role>",
|
|
127
|
+
run_in_background: true,
|
|
128
|
+
prompt: `## Role Assignment
|
|
129
|
+
role: <role>
|
|
130
|
+
role_spec: <skill_root>/roles/<role>/role.md
|
|
131
|
+
session: {run_dir}/work/team
|
|
132
|
+
session_id: <run-id>
|
|
133
|
+
run_dir: <exact run_dir from the birth packet or team-session.json.run.run_dir>
|
|
134
|
+
team_name: swarm
|
|
135
|
+
requirement: <task-description>
|
|
136
|
+
inner_loop: false
|
|
137
|
+
|
|
138
|
+
## Assignment (ant only)
|
|
139
|
+
<assignment JSON from aco.py select>
|
|
140
|
+
|
|
141
|
+
## Progress Milestones
|
|
142
|
+
session_id: <run-id>
|
|
143
|
+
Use the host to report progress or blockers. Submit each finished assignment with evolve team report and keep its returned digest.
|
|
144
|
+
|
|
145
|
+
Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
|
|
146
|
+
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
|
|
147
|
+
})
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## User Commands
|
|
151
|
+
|
|
152
|
+
| Command | Action |
|
|
153
|
+
|---------|--------|
|
|
154
|
+
| `check` / `status` | View iteration progress + convergence curve |
|
|
155
|
+
| `resume` / `continue` | Resume interrupted iteration |
|
|
156
|
+
| `feedback <text>` | Inject feedback into wisdom; applies at next iteration |
|
|
157
|
+
| `revise <ITER>` | Re-run a specific iteration (rare) |
|
|
158
|
+
|
|
159
|
+
## Specs Reference
|
|
160
|
+
|
|
161
|
+
| Spec | Purpose |
|
|
162
|
+
|------|---------|
|
|
163
|
+
| [specs/swarm-protocol.md](specs/swarm-protocol.md) | Master protocol: script <-> coordinator interface, data flow |
|
|
164
|
+
| [specs/pheromone-schema.md](specs/pheromone-schema.md) | Pheromone JSON structure, update formula, evaporation |
|
|
165
|
+
| [specs/ant-output-schema.md](specs/ant-output-schema.md) | Critical contract for ant JSON artifacts |
|
|
166
|
+
| [specs/convergence-criteria.md](specs/convergence-criteria.md) | Stop conditions, multi-criterion logic |
|
|
167
|
+
| [specs/swarm-config-template.json](specs/swarm-config-template.json) | User-facing config template with all knobs |
|
|
168
|
+
|
|
169
|
+
## Scripts
|
|
170
|
+
|
|
171
|
+
| Script | Purpose | Invocation |
|
|
172
|
+
|--------|---------|------------|
|
|
173
|
+
| `scripts/aco.py` | Main CLI: init / select / update / converged / report | `python aco.py --session <path> <cmd>` |
|
|
174
|
+
| `scripts/pheromone.py` | Pheromone matrix module (imported by aco.py) | — |
|
|
175
|
+
| `scripts/scoring.py` | Pluggable scorer (script + fallback modes) | — |
|
|
176
|
+
|
|
177
|
+
## Run Directory
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
{run_dir}/
|
|
181
|
+
├── outputs/ # Formal deliverables (registered at Run completion)
|
|
182
|
+
│ ├── ant-<iter>-<id>.json
|
|
183
|
+
│ ├── swarm-report.json
|
|
184
|
+
│ └── best-solution.md
|
|
185
|
+
└── work/team/ # Coordination state (not formal artifacts)
|
|
186
|
+
├── team-session.json
|
|
187
|
+
├── swarm-config.json
|
|
188
|
+
├── role-binding.json
|
|
189
|
+
├── task-space.json
|
|
190
|
+
├── pheromone/
|
|
191
|
+
│ ├── current.json
|
|
192
|
+
│ ├── init.json
|
|
193
|
+
│ └── history/<iter>.json
|
|
194
|
+
├── trails/<iter>.jsonl
|
|
195
|
+
├── scores/iter-<iter>-scores.json
|
|
196
|
+
├── best.json
|
|
197
|
+
├── wisdom/
|
|
198
|
+
└── .msg/
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Completion Action
|
|
202
|
+
|
|
203
|
+
When swarm converges, coordinator presents:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
request_user_input({
|
|
207
|
+
questions: [{
|
|
208
|
+
question: "Swarm pipeline complete. What would you like to do?",
|
|
209
|
+
header: "Completion",
|
|
210
|
+
multiSelect: false,
|
|
211
|
+
options: [
|
|
212
|
+
{ label: "Archive & Clean (Recommended)", description: "Archive session, delete team" },
|
|
213
|
+
{ label: "Keep Active", description: "Preserve for follow-up" },
|
|
214
|
+
{ label: "Export Best Solution", description: "Copy best-solution.md to target" },
|
|
215
|
+
{ label: "Run Another Round", description: "Reset convergence, K more iterations" }
|
|
216
|
+
]
|
|
217
|
+
}]
|
|
218
|
+
})
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Error Handling
|
|
222
|
+
|
|
223
|
+
| Scenario | Resolution |
|
|
224
|
+
|----------|------------|
|
|
225
|
+
| `aco.py` not found | Verify `<skill_root>/scripts/aco.py`; check Python install |
|
|
226
|
+
| Python version < 3.10 | Use `python3` or report dependency error |
|
|
227
|
+
| Config validation fails | request_user_input to fix, regenerate, retry |
|
|
228
|
+
| All ants fail in iteration | Halt, request_user_input (retry / abort / refine config) |
|
|
229
|
+
| Hallucination cluster (>50%) | Pause, request_user_input (continue / refine scoring) |
|
|
230
|
+
| Convergence never trips | `max_iterations` safety net always fires |
|
|
231
|
+
| Session corruption | Phase 0 reconciliation; archive if irrecoverable |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Evolve Swarm coordination
|
|
2
|
+
|
|
3
|
+
Use the exact Session and Run returned by Evolve. The Evolve database holds the roster and result receipts. Python owns the ACO assignments, history, pheromone updates and convergence under the Run's work/team directory.
|
|
4
|
+
|
|
5
|
+
1. Call evolve team controller --session <session> --run <run> to materialize the committed Python scripts. Prepare swarm-config.json in work/team and run init. Run select --iter <k> and retain the assigned ant IDs, start nodes and preferences.
|
|
6
|
+
2. Register each assignment with evolve team assign --session <session> --run <run> --id <assignment-id> --role <worker-id> --path outputs/ant-<iteration>-<id>.json --actor <coordinator> --expected-orchestration-revision <revision>. Dispatch the host workers with their assignment, role documents, work boundary, and the Evolve MCP connection when available. Wait for all jobs through the host.
|
|
7
|
+
3. Each worker opens its role from the bound revision, writes and checks its JSON, then runs evolve team report --session <session> --run <run> --id <assignment-id> --actor <worker-id> --summary "<result>" --expected-orchestration-revision <revision>. After a contention error, fetch the current revision and replay the report with a new request ID. A retry of an uncertain response uses the original request ID and payload.
|
|
8
|
+
4. The coordinator checks evolve team list --session <session> --run <run> and validates the assignment receipts against the controller's selected batch. A scorer uses the same roster with a path under work/team/scores/. Register and dispatch the scorer after accepting the ant artifacts. Run update after the scorer finishes and its scores cover the assigned ants. If the coordinator accepts ACO score fallback, record the failed scorer through evolve team cancel with its assignment ID, current revision and reason before passing --allow-score-fallback to Python.
|
|
9
|
+
5. Resume with evolve run brief and the saved team-session.json, controller assignments and roster. Reuse completed jobs and retry unfinished assignments using the original assignment identity. Re-run select --iter <k> for the persisted batch. ACO update owns score-fallback choices, commit receipts and idempotent projection of history.
|
|
10
|
+
6. Run converged and report, write the synthesis and declared artifacts, then seal through the Evolve Session guide. The runtime verifies that reported assignment files match their stored digests.
|