opencode-swarm-plugin 0.43.0 → 0.44.1

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.
Files changed (208) hide show
  1. package/bin/cass.characterization.test.ts +422 -0
  2. package/bin/swarm.serve.test.ts +6 -4
  3. package/bin/swarm.test.ts +68 -0
  4. package/bin/swarm.ts +81 -8
  5. package/dist/compaction-prompt-scoring.js +139 -0
  6. package/dist/contributor-tools.d.ts +42 -0
  7. package/dist/contributor-tools.d.ts.map +1 -0
  8. package/dist/eval-capture.js +12811 -0
  9. package/dist/hive.d.ts.map +1 -1
  10. package/dist/index.d.ts +12 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +7728 -62590
  13. package/dist/plugin.js +23833 -78695
  14. package/dist/sessions/agent-discovery.d.ts +59 -0
  15. package/dist/sessions/agent-discovery.d.ts.map +1 -0
  16. package/dist/sessions/index.d.ts +10 -0
  17. package/dist/sessions/index.d.ts.map +1 -0
  18. package/dist/swarm-orchestrate.d.ts.map +1 -1
  19. package/dist/swarm-prompts.d.ts.map +1 -1
  20. package/dist/swarm-review.d.ts.map +1 -1
  21. package/package.json +17 -5
  22. package/.changeset/swarm-insights-data-layer.md +0 -63
  23. package/.hive/analysis/eval-failure-analysis-2025-12-25.md +0 -331
  24. package/.hive/analysis/session-data-quality-audit.md +0 -320
  25. package/.hive/eval-results.json +0 -483
  26. package/.hive/issues.jsonl +0 -138
  27. package/.hive/memories.jsonl +0 -729
  28. package/.opencode/eval-history.jsonl +0 -327
  29. package/.turbo/turbo-build.log +0 -9
  30. package/CHANGELOG.md +0 -2255
  31. package/SCORER-ANALYSIS.md +0 -598
  32. package/docs/analysis/subagent-coordination-patterns.md +0 -902
  33. package/docs/analysis-socratic-planner-pattern.md +0 -504
  34. package/docs/planning/ADR-001-monorepo-structure.md +0 -171
  35. package/docs/planning/ADR-002-package-extraction.md +0 -393
  36. package/docs/planning/ADR-003-performance-improvements.md +0 -451
  37. package/docs/planning/ADR-004-message-queue-features.md +0 -187
  38. package/docs/planning/ADR-005-devtools-observability.md +0 -202
  39. package/docs/planning/ADR-007-swarm-enhancements-worktree-review.md +0 -168
  40. package/docs/planning/ADR-008-worker-handoff-protocol.md +0 -293
  41. package/docs/planning/ADR-009-oh-my-opencode-patterns.md +0 -353
  42. package/docs/planning/ROADMAP.md +0 -368
  43. package/docs/semantic-memory-cli-syntax.md +0 -123
  44. package/docs/swarm-mail-architecture.md +0 -1147
  45. package/docs/testing/context-recovery-test.md +0 -470
  46. package/evals/ARCHITECTURE.md +0 -1189
  47. package/evals/README.md +0 -768
  48. package/evals/compaction-prompt.eval.ts +0 -149
  49. package/evals/compaction-resumption.eval.ts +0 -289
  50. package/evals/coordinator-behavior.eval.ts +0 -307
  51. package/evals/coordinator-session.eval.ts +0 -154
  52. package/evals/evalite.config.ts.bak +0 -15
  53. package/evals/example.eval.ts +0 -31
  54. package/evals/fixtures/compaction-cases.ts +0 -350
  55. package/evals/fixtures/compaction-prompt-cases.ts +0 -311
  56. package/evals/fixtures/coordinator-sessions.ts +0 -328
  57. package/evals/fixtures/decomposition-cases.ts +0 -105
  58. package/evals/lib/compaction-loader.test.ts +0 -248
  59. package/evals/lib/compaction-loader.ts +0 -320
  60. package/evals/lib/data-loader.evalite-test.ts +0 -289
  61. package/evals/lib/data-loader.test.ts +0 -345
  62. package/evals/lib/data-loader.ts +0 -281
  63. package/evals/lib/llm.ts +0 -115
  64. package/evals/scorers/compaction-prompt-scorers.ts +0 -145
  65. package/evals/scorers/compaction-scorers.ts +0 -305
  66. package/evals/scorers/coordinator-discipline.evalite-test.ts +0 -539
  67. package/evals/scorers/coordinator-discipline.ts +0 -325
  68. package/evals/scorers/index.test.ts +0 -146
  69. package/evals/scorers/index.ts +0 -328
  70. package/evals/scorers/outcome-scorers.evalite-test.ts +0 -27
  71. package/evals/scorers/outcome-scorers.ts +0 -349
  72. package/evals/swarm-decomposition.eval.ts +0 -121
  73. package/examples/commands/swarm.md +0 -745
  74. package/examples/plugin-wrapper-template.ts +0 -2426
  75. package/examples/skills/hive-workflow/SKILL.md +0 -212
  76. package/examples/skills/skill-creator/SKILL.md +0 -223
  77. package/examples/skills/swarm-coordination/SKILL.md +0 -292
  78. package/global-skills/cli-builder/SKILL.md +0 -344
  79. package/global-skills/cli-builder/references/advanced-patterns.md +0 -244
  80. package/global-skills/learning-systems/SKILL.md +0 -644
  81. package/global-skills/skill-creator/LICENSE.txt +0 -202
  82. package/global-skills/skill-creator/SKILL.md +0 -352
  83. package/global-skills/skill-creator/references/output-patterns.md +0 -82
  84. package/global-skills/skill-creator/references/workflows.md +0 -28
  85. package/global-skills/swarm-coordination/SKILL.md +0 -995
  86. package/global-skills/swarm-coordination/references/coordinator-patterns.md +0 -235
  87. package/global-skills/swarm-coordination/references/strategies.md +0 -138
  88. package/global-skills/system-design/SKILL.md +0 -213
  89. package/global-skills/testing-patterns/SKILL.md +0 -430
  90. package/global-skills/testing-patterns/references/dependency-breaking-catalog.md +0 -586
  91. package/opencode-swarm-plugin-0.30.7.tgz +0 -0
  92. package/opencode-swarm-plugin-0.31.0.tgz +0 -0
  93. package/scripts/cleanup-test-memories.ts +0 -346
  94. package/scripts/init-skill.ts +0 -222
  95. package/scripts/migrate-unknown-sessions.ts +0 -349
  96. package/scripts/validate-skill.ts +0 -204
  97. package/src/agent-mail.ts +0 -1724
  98. package/src/anti-patterns.test.ts +0 -1167
  99. package/src/anti-patterns.ts +0 -448
  100. package/src/compaction-capture.integration.test.ts +0 -257
  101. package/src/compaction-hook.test.ts +0 -838
  102. package/src/compaction-hook.ts +0 -1204
  103. package/src/compaction-observability.integration.test.ts +0 -139
  104. package/src/compaction-observability.test.ts +0 -187
  105. package/src/compaction-observability.ts +0 -324
  106. package/src/compaction-prompt-scorers.test.ts +0 -475
  107. package/src/compaction-prompt-scoring.ts +0 -300
  108. package/src/dashboard.test.ts +0 -611
  109. package/src/dashboard.ts +0 -462
  110. package/src/error-enrichment.test.ts +0 -403
  111. package/src/error-enrichment.ts +0 -219
  112. package/src/eval-capture.test.ts +0 -1015
  113. package/src/eval-capture.ts +0 -929
  114. package/src/eval-gates.test.ts +0 -306
  115. package/src/eval-gates.ts +0 -218
  116. package/src/eval-history.test.ts +0 -508
  117. package/src/eval-history.ts +0 -214
  118. package/src/eval-learning.test.ts +0 -378
  119. package/src/eval-learning.ts +0 -360
  120. package/src/eval-runner.test.ts +0 -223
  121. package/src/eval-runner.ts +0 -402
  122. package/src/export-tools.test.ts +0 -476
  123. package/src/export-tools.ts +0 -257
  124. package/src/hive.integration.test.ts +0 -2241
  125. package/src/hive.ts +0 -1628
  126. package/src/index.ts +0 -935
  127. package/src/learning.integration.test.ts +0 -1815
  128. package/src/learning.ts +0 -1079
  129. package/src/logger.test.ts +0 -189
  130. package/src/logger.ts +0 -135
  131. package/src/mandate-promotion.test.ts +0 -473
  132. package/src/mandate-promotion.ts +0 -239
  133. package/src/mandate-storage.integration.test.ts +0 -601
  134. package/src/mandate-storage.test.ts +0 -578
  135. package/src/mandate-storage.ts +0 -794
  136. package/src/mandates.ts +0 -540
  137. package/src/memory-tools.test.ts +0 -195
  138. package/src/memory-tools.ts +0 -344
  139. package/src/memory.integration.test.ts +0 -334
  140. package/src/memory.test.ts +0 -158
  141. package/src/memory.ts +0 -527
  142. package/src/model-selection.test.ts +0 -188
  143. package/src/model-selection.ts +0 -68
  144. package/src/observability-tools.test.ts +0 -359
  145. package/src/observability-tools.ts +0 -871
  146. package/src/output-guardrails.test.ts +0 -438
  147. package/src/output-guardrails.ts +0 -381
  148. package/src/pattern-maturity.test.ts +0 -1160
  149. package/src/pattern-maturity.ts +0 -525
  150. package/src/planning-guardrails.test.ts +0 -491
  151. package/src/planning-guardrails.ts +0 -438
  152. package/src/plugin.ts +0 -23
  153. package/src/post-compaction-tracker.test.ts +0 -251
  154. package/src/post-compaction-tracker.ts +0 -237
  155. package/src/query-tools.test.ts +0 -636
  156. package/src/query-tools.ts +0 -324
  157. package/src/rate-limiter.integration.test.ts +0 -466
  158. package/src/rate-limiter.ts +0 -774
  159. package/src/replay-tools.test.ts +0 -496
  160. package/src/replay-tools.ts +0 -240
  161. package/src/repo-crawl.integration.test.ts +0 -441
  162. package/src/repo-crawl.ts +0 -610
  163. package/src/schemas/cell-events.test.ts +0 -347
  164. package/src/schemas/cell-events.ts +0 -807
  165. package/src/schemas/cell.ts +0 -257
  166. package/src/schemas/evaluation.ts +0 -166
  167. package/src/schemas/index.test.ts +0 -199
  168. package/src/schemas/index.ts +0 -286
  169. package/src/schemas/mandate.ts +0 -232
  170. package/src/schemas/swarm-context.ts +0 -115
  171. package/src/schemas/task.ts +0 -161
  172. package/src/schemas/worker-handoff.test.ts +0 -302
  173. package/src/schemas/worker-handoff.ts +0 -131
  174. package/src/skills.integration.test.ts +0 -1192
  175. package/src/skills.test.ts +0 -643
  176. package/src/skills.ts +0 -1549
  177. package/src/storage.integration.test.ts +0 -341
  178. package/src/storage.ts +0 -884
  179. package/src/structured.integration.test.ts +0 -817
  180. package/src/structured.test.ts +0 -1046
  181. package/src/structured.ts +0 -762
  182. package/src/swarm-decompose.test.ts +0 -188
  183. package/src/swarm-decompose.ts +0 -1302
  184. package/src/swarm-deferred.integration.test.ts +0 -157
  185. package/src/swarm-deferred.test.ts +0 -38
  186. package/src/swarm-insights.test.ts +0 -214
  187. package/src/swarm-insights.ts +0 -459
  188. package/src/swarm-mail.integration.test.ts +0 -970
  189. package/src/swarm-mail.ts +0 -739
  190. package/src/swarm-orchestrate.integration.test.ts +0 -282
  191. package/src/swarm-orchestrate.test.ts +0 -548
  192. package/src/swarm-orchestrate.ts +0 -3084
  193. package/src/swarm-prompts.test.ts +0 -1270
  194. package/src/swarm-prompts.ts +0 -2077
  195. package/src/swarm-research.integration.test.ts +0 -701
  196. package/src/swarm-research.test.ts +0 -698
  197. package/src/swarm-research.ts +0 -472
  198. package/src/swarm-review.integration.test.ts +0 -285
  199. package/src/swarm-review.test.ts +0 -879
  200. package/src/swarm-review.ts +0 -709
  201. package/src/swarm-strategies.ts +0 -407
  202. package/src/swarm-worktree.test.ts +0 -501
  203. package/src/swarm-worktree.ts +0 -575
  204. package/src/swarm.integration.test.ts +0 -2377
  205. package/src/swarm.ts +0 -38
  206. package/src/tool-adapter.integration.test.ts +0 -1221
  207. package/src/tool-availability.ts +0 -461
  208. package/tsconfig.json +0 -28
package/CHANGELOG.md DELETED
@@ -1,2255 +0,0 @@
1
- # opencode-swarm-plugin
2
-
3
- ## 0.43.0
4
-
5
- ### Minor Changes
6
-
7
- - [`d74f68b`](https://github.com/joelhooks/swarm-tools/commit/d74f68ba491fdd127173c1993400c16b17479c3a) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔭 Observability Stack: See What Your Swarm Is Doing
8
-
9
- ```
10
- ╭──────────────────────────────────────────────────────────╮
11
- │ │
12
- │ "Observability is about instrumenting your system │
13
- │ in a way that ensures sufficient information about │
14
- │ a system's runtime is collected and analyzed so │
15
- │ that when something goes wrong, it can help you │
16
- │ understand why." │
17
- │ │
18
- │ — AI Engineering, Chip Huyen │
19
- │ │
20
- ╰──────────────────────────────────────────────────────────╯
21
- ```
22
-
23
- Five new modules for understanding multi-agent coordination at runtime:
24
-
25
- ### Error Enrichment (`error-enrichment.ts`)
26
-
27
- ```typescript
28
- throw new SwarmError("File reservation failed", {
29
- file: "src/auth.ts",
30
- agent: "DarkHawk",
31
- epic_id: "mjmas3zxlmg",
32
- recent_events: [
33
- /* last 5 events */
34
- ],
35
- });
36
- ```
37
-
38
- - `SwarmError` class with structured context (file, line, agent, epic, events)
39
- - `enrichError()` wraps any error with swarm context
40
- - `debugLog()` respects `DEBUG=swarm:*` patterns
41
- - `suggestFix()` maps 8+ error patterns to actionable fixes
42
-
43
- ### SQL Analytics (`swarm query`)
44
-
45
- ```bash
46
- swarm query --preset failed_decompositions
47
- swarm query --sql "SELECT * FROM events WHERE type='worker_spawned'"
48
- swarm query --preset duration_by_strategy --format csv
49
- ```
50
-
51
- 10 preset queries: `failed_decompositions`, `duration_by_strategy`, `file_conflicts`, `worker_success_rate`, `review_rejections`, `blocked_tasks`, `agent_activity`, `event_frequency`, `error_patterns`, `compaction_stats`
52
-
53
- ### Dashboard Data (`swarm dashboard`)
54
-
55
- ```bash
56
- swarm dashboard --epic mjmas3zxlmg --refresh 1000
57
- ```
58
-
59
- Real-time data fetching: worker status, subtask progress, file locks, recent messages, epic list.
60
-
61
- ### Event Replay (`swarm replay`)
62
-
63
- ```bash
64
- swarm replay mjmas3zxlmg --speed 2x --type worker_spawned
65
- swarm replay mjmas3zxlmg --agent DarkHawk --since "2025-12-25T10:00:00"
66
- ```
67
-
68
- Replay epic events with timing control. Filter by type, agent, time range. Debug coordination failures by watching the sequence unfold.
69
-
70
- ### Export Formats (`swarm export`)
71
-
72
- ```bash
73
- swarm export --format otlp --epic mjmas3zxlmg # OpenTelemetry traces
74
- swarm export --format csv --output events.csv # RFC 4180 compliant
75
- swarm export --format json | jq '.[] | select(.type=="error")'
76
- ```
77
-
78
- **Test Coverage:** 225 tests (150 unit + 75 CLI integration)
79
-
80
- **TDD Enforced:** RED cells first, GREEN cells second. Every function tested before implementation.
81
-
82
- ## 0.42.9
83
-
84
- ### Patch Changes
85
-
86
- - [`823987d`](https://github.com/joelhooks/swarm-tools/commit/823987d7b7ef57bf636665008ebbcdffe333e828) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Worktree Support + Graceful Degradation
87
-
88
- ```
89
- ┌─────────────────────────────────────────────────────┐
90
- │ │
91
- │ "It is impossible to reduce the probability │
92
- │ of a fault to zero; therefore it is usually │
93
- │ best to design fault-tolerance mechanisms │
94
- │ that prevent faults from causing failures." │
95
- │ │
96
- │ — Kleppmann, DDIA │
97
- │ │
98
- └─────────────────────────────────────────────────────┘
99
- ```
100
-
101
- ### Git Worktree Support (#52)
102
-
103
- All worktrees now share the main repository's database. No more isolated state per worktree.
104
-
105
- ```
106
- BEFORE: AFTER:
107
- main-repo/.opencode/swarm.db main-repo/.opencode/swarm.db
108
- worktree-1/.opencode/swarm.db worktree-1/ ──┐
109
- worktree-2/.opencode/swarm.db worktree-2/ ──┼─→ main-repo/.opencode/
110
- worktree-3/ ──┘
111
- ```
112
-
113
- **How it works:**
114
-
115
- - Detects worktrees by checking if `.git` is a file (not directory)
116
- - Parses `gitdir:` path to resolve main repo location
117
- - All DB operations automatically use main repo's `.opencode/`
118
-
119
- ### Graceful Degradation for semantic-memory (#53)
120
-
121
- When Ollama is unavailable, `semantic-memory_find` now falls back to full-text search instead of erroring.
122
-
123
- **Before:** `OllamaError: Connection failed` → tool fails
124
- **After:** Warning logged → FTS results returned → tool works
125
-
126
- Also added `repairStaleEmbeddings()` to fix the "dimensions are different: 0 != 1024" error when memories were stored without embeddings.
127
-
128
- ### New Skill: gh-issue-triage
129
-
130
- Added `.opencode/skills/gh-issue-triage/` for GitHub issue triage workflow:
131
-
132
- - Extracts contributor profiles including Twitter handles
133
- - Templates for acknowledgment comments
134
- - Changeset credit templates with @mentions
135
-
136
- ***
137
-
138
- Thanks to [@justBCheung](https://x.com/justBCheung) for filing both issues with excellent debugging context. 🙏
139
-
140
- - Updated dependencies [[`823987d`](https://github.com/joelhooks/swarm-tools/commit/823987d7b7ef57bf636665008ebbcdffe333e828)]:
141
- - swarm-mail@1.6.0
142
-
143
- ## 0.42.8
144
-
145
- ### Patch Changes
146
-
147
- - [`a797bea`](https://github.com/joelhooks/swarm-tools/commit/a797bea871e5d698ebb38b41f47ff07faa7c108b) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔗 Tweets Now Link to the Right PR
148
-
149
- Release tweets were linking to the wrong PR. The old logic grabbed "most recent merged PR that isn't a version bump" - but with the new `release:` prefix on version PRs, it was picking up stale PRs.
150
-
151
- **Fixed:** Now uses `github.sha` to find the exact PR that triggered the workflow. No more guessing.
152
-
153
- ```
154
- BEFORE: gh pr list --limit 5 --jq 'filter...' → wrong PR
155
- AFTER: gh pr list --search "${{ github.sha }}" → triggering PR
156
- ```
157
-
158
- ## 0.42.7
159
-
160
- ### Patch Changes
161
-
162
- - [`7a6a4a3`](https://github.com/joelhooks/swarm-tools/commit/7a6a4a37c4ea753de359dac5062d11186ee98ccd) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 📐 Swarm Insights Gets Its Blueprint
163
-
164
- > _"The major documentation tool for information architecture... diagrams."_
165
- > — Jesse James Garrett, The Elements of User Experience
166
-
167
- The README now shows you how the swarm learns, not just that it does.
168
-
169
- **Added:**
170
-
171
- - ASCII diagram of the swarm learning loop (task → decompose → execute → complete → insights → repeat)
172
- - Data flow architecture showing Event Store → Insights Aggregation → Agents
173
- - Full API reference with TypeScript examples for coordinators and workers
174
- - Token budget table (500 for coordinators, 300 for workers)
175
- - Recommendation threshold table (≥80% = good, <40% = AVOID)
176
- - Data sources table (Event Store, Semantic Memory, Anti-Pattern Registry)
177
-
178
- **Why it matters:**
179
- Diagrams > prose for architecture. Now you can see the feedback loop at a glance instead of reading paragraphs. The API examples are copy-pasteable.
180
-
181
- ```
182
- ┌──────────┐ ┌──────────┐ ┌──────────┐
183
- │ TASK │───▶│ INSIGHTS │───▶│ BETTER │
184
- │ │ │ LAYER │ │ SWARMS │
185
- └──────────┘ └──────────┘ └──────────┘
186
- ```
187
-
188
- - [`0ad79d5`](https://github.com/joelhooks/swarm-tools/commit/0ad79d57cd119517a8e04d0e74b4909f20a7f0be) Thanks [@joelhooks](https://github.com/joelhooks)! - ## Release Tweets Link to Source, PR Titles Get Smart
189
-
190
- - Tweets now include link to the feature PR (or commit if pushed direct to main)
191
- - Version bump PRs get AI-generated titles from changeset content via Opus
192
- - No more "chore: update versions" - titles describe what actually shipped
193
-
194
- ## 0.42.6
195
-
196
- ### Patch Changes
197
-
198
- - [`ab90238`](https://github.com/joelhooks/swarm-tools/commit/ab902386883fa9654c9977d28888582fafc093e5) Thanks [@joelhooks](https://github.com/joelhooks)! - ## Query Epic Children Without Rawdogging JSONL
199
-
200
- `hive_cells` and `hive_query` now support `parent_id` filter. Find all children of an epic in one call:
201
-
202
- ```typescript
203
- hive_cells({ parent_id: "epic-id" }); // Returns all subtasks
204
- hive_query({ parent_id: "epic-id", status: "open" }); // Open subtasks only
205
- ```
206
-
207
- No more grep/jq on issues.jsonl. The tools do what they should.
208
-
209
- - Updated dependencies [[`ab90238`](https://github.com/joelhooks/swarm-tools/commit/ab902386883fa9654c9977d28888582fafc093e5)]:
210
- - swarm-mail@1.5.5
211
-
212
- ## 0.42.5
213
-
214
- ### Patch Changes
215
-
216
- - [`45af762`](https://github.com/joelhooks/swarm-tools/commit/45af762ce656cf652847027d176d7bb7ff91f19b) Thanks [@joelhooks](https://github.com/joelhooks)! - ## The Bees Can Finally Tweet
217
-
218
- New @swarmtoolsai app with proper OAuth. Releases now announce themselves.
219
-
220
- ## 0.42.4
221
-
222
- ### Patch Changes
223
-
224
- - [`4c7d869`](https://github.com/joelhooks/swarm-tools/commit/4c7d869e385677318fbbda7fa464bbe1223039f1) Thanks [@joelhooks](https://github.com/joelhooks)! - ## Switched to X API v2
225
-
226
- Old action used deprecated v1.1 API. Now using direct OAuth 1.0a signed requests to v2 endpoint.
227
-
228
- ## 0.42.3
229
-
230
- ### Patch Changes
231
-
232
- - [`35eab3e`](https://github.com/joelhooks/swarm-tools/commit/35eab3e9e482b41e1535020a485561d5174e943c) Thanks [@joelhooks](https://github.com/joelhooks)! - ## First Real Tweet Incoming
233
-
234
- Fixed X OAuth tokens - now with write permissions. Let's see if the bees can actually post.
235
-
236
- ## 0.42.2
237
-
238
- ### Patch Changes
239
-
240
- - [`9ded2a0`](https://github.com/joelhooks/swarm-tools/commit/9ded2a0929f430a3297e3b62858aa1143179542f) Thanks [@joelhooks](https://github.com/joelhooks)! - ## Tweet Bot Learns to Speak Swarm
241
-
242
- Release tweets now use a manyshot prompt with examples that match the project's voice: terse, technical, slightly cheeky. Focus on what devs can DO, not what we shipped.
243
-
244
- ## 0.42.1
245
-
246
- ### Patch Changes
247
-
248
- - [`f6707d5`](https://github.com/joelhooks/swarm-tools/commit/f6707d53eb92021b6976212e903994c98c798483) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐦 @swarmtoolsai Now Tweets Releases
249
-
250
- Automated release announcements are live! When packages publish to npm, Claude summarizes the changelog into a tweet and posts from @swarmtoolsai.
251
-
252
- No more manual "hey we shipped" posts - the bees handle it now.
253
-
254
- ## 0.42.0
255
-
256
- ### Minor Changes
257
-
258
- - [`a79e04b`](https://github.com/joelhooks/swarm-tools/commit/a79e04b1bb3b40c09c5265b5d11739864799e4e2) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔭 Swarm Observability: See What Your Bees Are Doing
259
-
260
- > "Observability is about instrumenting your system in a way that ensures sufficient information about a system's runtime is collected and analyzed so that when something goes wrong, it can help you understand why."
261
- > — Chip Huyen, _AI Engineering_
262
-
263
- New CLI commands to understand swarm health and history:
264
-
265
- ### `swarm stats`
266
-
267
- ```
268
- ┌─────────────────────────────────────────┐
269
- │ 🐝 SWARM STATISTICS 🐝 │
270
- ├─────────────────────────────────────────┤
271
- │ Total Swarms: 42 Success: 87% │
272
- │ Avg Duration: 4.2min │
273
- ├─────────────────────────────────────────┤
274
- │ BY STRATEGY │
275
- │ ├─ file-based 92% (23/25) │
276
- │ ├─ feature-based 78% (14/18) │
277
- │ ├─ risk-based 67% (2/3) │
278
- ├─────────────────────────────────────────┤
279
- │ COORDINATOR HEALTH │
280
- │ Violation Rate: 2% │
281
- │ Spawn Efficiency: 94% │
282
- │ Review Rate: 88% │
283
- └─────────────────────────────────────────┘
284
- ```
285
-
286
- Options: `--since 24h/7d/30d`, `--json`
287
-
288
- ### `swarm history`
289
-
290
- Timeline of recent swarm activity with filtering:
291
-
292
- - `--status success/failed/in_progress`
293
- - `--strategy file-based/feature-based/risk-based`
294
- - `--verbose` for subtask details
295
-
296
- ### Prompt Insights Integration
297
-
298
- Coordinators and workers now receive injected insights from past swarm outcomes:
299
-
300
- - Strategy success rates as markdown tables
301
- - Anti-pattern warnings for low-success strategies
302
- - File/domain-specific learnings from semantic memory
303
-
304
- This creates a feedback loop where swarms learn from their own history.
305
-
306
- ### Also in this release
307
-
308
- - **swarm-dashboard** (WIP): React/Vite visualizer scaffold
309
- - **ADR-006**: Swarm PTY decision document
310
- - **CI fix**: Smarter changeset detection prevents empty PR errors
311
-
312
- ### Patch Changes
313
-
314
- - Updated dependencies [[`a79e04b`](https://github.com/joelhooks/swarm-tools/commit/a79e04b1bb3b40c09c5265b5d11739864799e4e2)]:
315
- - swarm-mail@1.5.4
316
-
317
- ## 0.41.0
318
-
319
- ### Minor Changes
320
-
321
- - [`179b3f0`](https://github.com/joelhooks/swarm-tools/commit/179b3f0e49c7959f8d754c1274d301d0b3845a79) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Compaction Prompt Now Speaks Swarm
322
-
323
- > _"Memory is essential for communication: we recall past interactions, infer preferences, and construct evolving mental models of those we engage with."_
324
- > — Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory
325
-
326
- When context compacts mid-swarm, coordinators were waking up confused. They had state information but no protocol guidance. Now the compaction prompt includes a condensed version of the swarm command template.
327
-
328
- **What's New:**
329
-
330
- The `SWARM_COMPACTION_CONTEXT` now includes:
331
-
332
- 1. **What Good Looks Like** - Behavioral examples showing ideal coordinator behavior
333
-
334
- - ✅ Spawned researcher for unfamiliar tech → got summary → stored in semantic-memory
335
- - ✅ Checked inbox every 5-10 minutes → caught blocked worker → unblocked in 2min
336
- - ❌ Called context7 directly → dumped 50KB → context exhaustion
337
-
338
- 2. **Mandatory Behaviors Checklist** - Post-compaction protocol
339
- - Inbox monitoring (every 5-10 min with intervention triggers)
340
- - Skill loading (before spawning workers)
341
- - Worker review (after every worker returns, 3-strike rule)
342
- - Research spawning (never call context7/pdf-brain directly)
343
-
344
- **Why This Matters:**
345
-
346
- Coordinators resuming from compaction now have:
347
-
348
- - Clear behavioral guidance (not just state)
349
- - Actionable tool call examples
350
- - Anti-patterns to avoid
351
- - The same protocol as fresh `/swarm` invocations
352
-
353
- **Backward Compatible:** Existing compaction hooks continue to work. This adds guidance, doesn't change the hook signature.
354
-
355
- ### Patch Changes
356
-
357
- - [`3e7c126`](https://github.com/joelhooks/swarm-tools/commit/3e7c126b11aa6ad909ebcb2ab3cf77883f9acfe4) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🧪 Bulletproof Test Suite
358
-
359
- > "Setting up our tests to run synchronously and using mocking libraries will greatly speed up our testing"
360
- > — ng-book
361
-
362
- Fixed test isolation issues that caused 19 tests to fail when run together but pass in isolation.
363
-
364
- ### The Culprits
365
-
366
- **1. Global fetch pollution** (`ollama.test.ts`)
367
-
368
- ```typescript
369
- // BEFORE: Replaced global.fetch, never restored it
370
- global.fetch = mockFetch;
371
-
372
- // AFTER: Save and restore
373
- const originalFetch = global.fetch;
374
- afterEach(() => {
375
- global.fetch = originalFetch;
376
- });
377
- ```
378
-
379
- **2. Port conflicts** (`durable-server.test.ts`)
380
-
381
- - Tests used hardcoded ports (4483, 4484, 4485)
382
- - Parallel test runs fought over the same ports
383
- - Fixed: Use `port: 0` for OS-assigned ports, made `server.url` a getter
384
-
385
- **3. AI SDK schema incompatibility** (`memory-operations.ts`)
386
-
387
- - `z.discriminatedUnion` creates `oneOf` at top level
388
- - Anthropic API requires `type: object` at top level
389
- - Fixed: Flat object schema with optional fields
390
-
391
- ### Test Stats
392
-
393
- ```
394
- Before: 19 failures when run together
395
- After: 0 failures, 1406 tests pass
396
- ```
397
-
398
- ### Files Changed
399
-
400
- - `src/memory/ollama.test.ts` - Restore global.fetch after each test
401
- - `src/streams/durable-server.ts` - Dynamic port getter
402
- - `src/streams/durable-server.test.ts` - Use port 0, rewrite for isolation
403
- - `src/memory/memory-operations.ts` - Flat schema for Anthropic compatibility
404
- - Renamed `memory-operations.test.ts` → `memory-operations.integration.test.ts`
405
-
406
- - Updated dependencies [[`3e7c126`](https://github.com/joelhooks/swarm-tools/commit/3e7c126b11aa6ad909ebcb2ab3cf77883f9acfe4)]:
407
- - swarm-mail@1.5.3
408
-
409
- ## 0.40.0
410
-
411
- ### Minor Changes
412
-
413
- - [`948e031`](https://github.com/joelhooks/swarm-tools/commit/948e0318fe5e2c1a5d695a56533fc2a2a7753887) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔭 Observability Swarm: See What the Bees Are Doing
414
-
415
- > "The unexamined swarm is not worth coordinating." — Socrates, probably
416
-
417
- Four parallel workers descended on the observability stack and emerged victorious. The compaction hook no longer runs in darkness, coordinator sessions are now viewable, and the docs finally explain what all those JSONL files are for.
418
-
419
- ### What's New
420
-
421
- **Compaction Observability** (`src/compaction-observability.ts`)
422
-
423
- - Metrics collector tracks phases: START → GATHER → DETECT → INJECT → COMPLETE
424
- - Pattern extraction/skipping with reasons ("why didn't this get captured?")
425
- - Timing breakdown per phase (analysis vs extraction vs storage)
426
- - 15 tests (11 unit + 4 integration)
427
-
428
- **`swarm log sessions` CLI**
429
-
430
- - `swarm log sessions` — list all captured coordinator sessions
431
- - `swarm log sessions <id>` — view events for a session (partial ID matching)
432
- - `swarm log sessions --latest` — quick access to most recent
433
- - `--type`, `--since`, `--limit`, `--json` filters
434
- - 64 tests covering parsing, listing, filtering
435
-
436
- **Coordinator Observability Docs**
437
-
438
- - AGENTS.md: overview with quick commands
439
- - evals/README.md: deep dive with ASCII flow diagrams, event type reference, JSONL examples, jq recipes
440
-
441
- **Research: Coordinator Prompt Eval** (`.hive/analysis/coordinator-prompt-eval-research.md`)
442
-
443
- - 26KB analysis of prompt iteration strategies
444
- - Recommends: versioning + evalite (defer LLM-as-Judge to v0.34+)
445
- - Implementation plan with effort estimates
446
-
447
- ### The Observability Story
448
-
449
- ```
450
- CAPTURE ──────────► VIEW ──────────► SCORE
451
- (eval-capture.ts) (swarm log (coordinator
452
- sessions) evals)
453
- ```
454
-
455
- Now you can answer:
456
-
457
- - "What did the last 10 compaction runs extract?"
458
- - "Why didn't this pattern get captured?"
459
- - "Which coordinator sessions had violations?"
460
-
461
- ## 0.39.1
462
-
463
- ### Patch Changes
464
-
465
- - [`19a6557`](https://github.com/joelhooks/swarm-tools/commit/19a6557cee9878858e7f61e2aba86b37a3ec10ad) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Eval Quality Gates: Signal Over Noise
466
-
467
- The eval system now filters coordinator sessions to focus on high-quality data.
468
-
469
- **Problem:** 67 of 82 captured sessions had <3 events - noise from aborted runs, test pokes, and incomplete swarms. This diluted eval scores and made metrics unreliable.
470
-
471
- **Solution:** Quality filters applied BEFORE sampling:
472
-
473
- | Filter | Default | Purpose |
474
- | -------------------- | ------- | --------------------------------- |
475
- | `minEvents` | 3 | Skip incomplete/aborted sessions |
476
- | `requireWorkerSpawn` | true | Ensure coordinator delegated work |
477
- | `requireReview` | true | Ensure full swarm lifecycle |
478
-
479
- **Impact:**
480
-
481
- - Filters 93 noisy sessions automatically
482
- - Overall eval score: 63% → 71% (true signal, not diluted)
483
- - Coordinator discipline: 47% → 57% (accurate measurement)
484
-
485
- **Usage:**
486
-
487
- ```typescript
488
- // Default: high-quality sessions only
489
- const sessions = await loadCapturedSessions();
490
-
491
- // Override for specific analysis
492
- const allSessions = await loadCapturedSessions({
493
- minEvents: 1,
494
- requireWorkerSpawn: false,
495
- requireReview: false,
496
- });
497
- ```
498
-
499
- Includes 7 unit tests covering filter logic and edge cases.
500
-
501
- ## 0.39.0
502
-
503
- ### Minor Changes
504
-
505
- - [`aa12943`](https://github.com/joelhooks/swarm-tools/commit/aa12943f3edc8d5e23878b22f44073e4c71367c5) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Eval-Driven Development: The System That Scores Itself
506
-
507
- > "What gets measured gets managed." — Peter Drucker
508
- > "What gets scored gets improved." — The Swarm
509
-
510
- The plugin now evaluates its own output quality through a progressive gate system. Every compaction prompt gets scored, tracked, and learned from. Regressions become impossible to ignore.
511
-
512
- ### The Pipeline
513
-
514
- ```
515
- CAPTURE → SCORE → STORE → GATE → LEARN → IMPROVE
516
- ↑ ↓
517
- └──────────────────────────────────────┘
518
- ```
519
-
520
- ### What's New
521
-
522
- **Event Capture** (5 integration points)
523
-
524
- - `detection_triggered` - When compaction is detected
525
- - `prompt_generated` - Full LLM prompt captured
526
- - `context_injected` - Final content before injection
527
- - All events stored to `~/.config/swarm-tools/sessions/{session_id}.jsonl`
528
-
529
- **5 Compaction Prompt Scorers**
530
-
531
- - `epicIdSpecificity` - Real IDs, not placeholders (20%)
532
- - `actionability` - Specific tool calls with values (20%)
533
- - `coordinatorIdentity` - ASCII header + mandates (25%)
534
- - `forbiddenToolsPresent` - Lists what NOT to do (15%)
535
- - `postCompactionDiscipline` - First tool is correct (20%)
536
-
537
- **Progressive Gates**
538
- | Phase | Threshold | Behavior |
539
- |-------|-----------|----------|
540
- | Bootstrap | N/A | Always pass, building baseline |
541
- | Stabilization | 0.6 | Warn but pass |
542
- | Production | 0.7 | Fail CI on regression |
543
-
544
- **CLI Commands**
545
-
546
- ```bash
547
- swarm eval status # Current phase, thresholds, scores
548
- swarm eval history # Trends with sparklines ▁▂▃▄▅▆▇█
549
- swarm eval run [--ci] # Execute evals, gate check
550
- ```
551
-
552
- **CI Integration**
553
-
554
- - Runs after tests pass
555
- - Posts results as PR comment with emoji status
556
- - Only fails in production phase with actual regression
557
-
558
- **Learning Feedback Loop**
559
-
560
- - Significant score drops auto-stored to semantic memory
561
- - Future agents learn from past failures
562
- - Pattern maturity tracking
563
-
564
- ### Breaking Changes
565
-
566
- None. All new functionality is additive.
567
-
568
- ### Files Changed
569
-
570
- - `src/eval-capture.ts` - Event capture with Zod schemas
571
- - `src/eval-gates.ts` - Progressive gate logic
572
- - `src/eval-history.ts` - Score tracking over time
573
- - `src/eval-learning.ts` - Failure-to-learning extraction
574
- - `src/compaction-prompt-scoring.ts` - 5 pure scoring functions
575
- - `evals/compaction-prompt.eval.ts` - Evalite integration
576
- - `bin/swarm.ts` - CLI commands
577
- - `.github/workflows/ci.yml` - CI integration
578
-
579
- ### Test Coverage
580
-
581
- - 422 new tests for eval-capture
582
- - 48 CLI tests
583
- - 7 integration tests for capture wiring
584
- - All existing tests still passing
585
-
586
- ### Patch Changes
587
-
588
- - Updated dependencies [[`aa12943`](https://github.com/joelhooks/swarm-tools/commit/aa12943f3edc8d5e23878b22f44073e4c71367c5)]:
589
- - swarm-mail@1.5.2
590
-
591
- ## 0.38.0
592
-
593
- ### Minor Changes
594
-
595
- - [`41a1965`](https://github.com/joelhooks/swarm-tools/commit/41a19657b252eb1c7a7dc82bc59ab13589e8758f) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Coordinators Now Delegate Research to Workers
596
-
597
- Coordinators finally know their place. They orchestrate, they don't fetch.
598
-
599
- **The Problem:**
600
- Coordinators were calling `repo-crawl_file`, `webfetch`, `context7_*` directly, burning expensive Sonnet context on raw file contents instead of spawning researcher workers.
601
-
602
- **The Fix:**
603
-
604
- ### Forbidden Tools Section
605
-
606
- COORDINATOR_PROMPT now explicitly lists tools coordinators must NEVER call:
607
-
608
- - `repo-crawl_*`, `repo-autopsy_*` - repository fetching
609
- - `webfetch`, `fetch_fetch` - web fetching
610
- - `context7_*` - library documentation
611
- - `pdf-brain_search`, `pdf-brain_read` - knowledge base
612
-
613
- ### Phase 1.5: Research Phase
614
-
615
- New workflow phase between Initialize and Knowledge Gathering:
616
-
617
- ```
618
- swarm_spawn_researcher(
619
- research_id="research-nextjs-cache",
620
- tech_stack=["Next.js 16 Cache Components"],
621
- project_path="/path/to/project"
622
- )
623
- ```
624
-
625
- ### Strong Coordinator Identity Post-Compaction
626
-
627
- When context compacts, the resuming agent now sees:
628
-
629
- ```
630
- ┌─────────────────────────────────────────────────────────────┐
631
- │ 🐝 YOU ARE THE COORDINATOR 🐝 │
632
- │ NOT A WORKER. NOT AN IMPLEMENTER. │
633
- │ YOU ORCHESTRATE. │
634
- └─────────────────────────────────────────────────────────────┘
635
- ```
636
-
637
- ### runResearchPhase Returns Spawn Instructions
638
-
639
- ```typescript
640
- const result = await runResearchPhase(task, projectPath);
641
- // result.spawn_instructions = [
642
- // { research_id, tech, prompt, subagent_type: "swarm/researcher" }
643
- // ]
644
- ```
645
-
646
- **32+ new tests, all 425 passing.**
647
-
648
- - [`b06f69b`](https://github.com/joelhooks/swarm-tools/commit/b06f69bc3db099c14f712585d88b42c801123d01) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔬 Eval Capture Pipeline: Complete
649
-
650
- > "The purpose of computing is insight, not numbers." — Richard Hamming
651
-
652
- Wire all eval-capture functions into the swarm execution path, enabling ground-truth collection from real swarm executions.
653
-
654
- **What changed:**
655
-
656
- | Function | Wired Into | Purpose |
657
- | ------------------------- | ------------------------------ | ---------------------------------- |
658
- | `captureDecomposition()` | `swarm_validate_decomposition` | Records task → subtasks mapping |
659
- | `captureSubtaskOutcome()` | `swarm_complete` | Records per-subtask execution data |
660
- | `finalizeEvalRecord()` | `swarm_record_outcome` | Computes aggregate metrics |
661
-
662
- **New npm scripts:**
663
-
664
- ```bash
665
- bun run eval:run # Run all evals
666
- bun run eval:decomposition # Decomposition quality
667
- bun run eval:coordinator # Coordinator discipline
668
- ```
669
-
670
- **Data flow:**
671
-
672
- ```
673
- swarm_decompose → captureDecomposition → .opencode/eval-data.jsonl
674
-
675
- swarm_complete → captureSubtaskOutcome → updates record with outcomes
676
-
677
- swarm_record_outcome → finalizeEvalRecord → computes scope_accuracy, time_balance
678
-
679
- evalite → reads JSONL → scores decomposition quality
680
- ```
681
-
682
- **Why it matters:**
683
-
684
- - Enables data-driven decomposition strategy selection
685
- - Tracks which strategies work for which task types
686
- - Provides ground truth for Evalite evals
687
- - Foundation for learning from swarm outcomes
688
-
689
- **Key discovery:** New cell ID format doesn't follow `epicId.subtaskNum` pattern. Must use `cell.parent_id` to get epic ID for subtasks.
690
-
691
- ### Patch Changes
692
-
693
- - [`56e5d4c`](https://github.com/joelhooks/swarm-tools/commit/56e5d4c5ac96ddd2184d12c63e163bb9c291fb69) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔬 Eval Capture Pipeline: Phase 1
694
-
695
- > "The first step toward wisdom is getting things right. The second step is getting them wrong in interesting ways." — Marvin Minsky
696
-
697
- Wire `captureDecomposition()` into `swarm_validate_decomposition` to record decomposition inputs/outputs for evaluation.
698
-
699
- **What changed:**
700
-
701
- - `swarm_validate_decomposition` now calls `captureDecomposition()` after successful validation
702
- - Captures: epicId, projectPath, task, context, strategy, epicTitle, subtasks
703
- - Data persisted to `.opencode/eval-data.jsonl` for Evalite consumption
704
-
705
- **Why it matters:**
706
-
707
- - Enables ground-truth collection from real swarm executions
708
- - Foundation for decomposition quality evals
709
- - Tracks what strategies work for which task types
710
-
711
- **Tests added:**
712
-
713
- - Verifies `captureDecomposition` called with correct params on success
714
- - Verifies NOT called on validation failure
715
- - Handles optional context/description fields
716
-
717
- **Next:** Wire `captureSubtaskOutcome()` and `finalizeEvalRecord()` to complete the pipeline.
718
-
719
- ## 0.37.0
720
-
721
- ### Minor Changes
722
-
723
- - [`66b5795`](https://github.com/joelhooks/swarm-tools/commit/66b57951e2c114702c663b98829d5f7626607a16) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 `swarm cells` - Query Your Hive Like a Pro
724
-
725
- New CLI command AND plugin tool for querying cells directly from the database.
726
-
727
- ### CLI: `swarm cells`
728
-
729
- ```bash
730
- swarm cells # List all cells (table format)
731
- swarm cells --status open # Filter by status
732
- swarm cells --type bug # Filter by type
733
- swarm cells --ready # Next unblocked cell
734
- swarm cells mjkmd # Partial ID lookup
735
- swarm cells --json # Raw JSON for scripting
736
- ```
737
-
738
- **Replaces:** The awkward `swarm tool hive_query --json '{"status":"open"}'` pattern.
739
-
740
- ### Plugin Tool: `hive_cells`
741
-
742
- ```typescript
743
- // Agents can now query cells directly
744
- hive_cells({ status: "open", type: "task" });
745
- hive_cells({ id: "mjkmd" }); // Partial ID works!
746
- hive_cells({ ready: true }); // Next unblocked
747
- ```
748
-
749
- **Why this matters:**
750
-
751
- - Reads from DATABASE (fast, indexed) not JSONL files
752
- - Partial ID resolution built-in
753
- - Consistent JSON array output
754
- - Rich descriptions encourage agentic use
755
-
756
- ### Also Fixed
757
-
758
- - `swarm_review_feedback` tests updated for coordinator-driven retry architecture
759
- - 425 tests passing
760
-
761
- ## 0.36.1
762
-
763
- ### Patch Changes
764
-
765
- - [`9c1f3f3`](https://github.com/joelhooks/swarm-tools/commit/9c1f3f3e7204f02c133c4a036fa34e83d8376a8c) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Coordinator Discipline: Prohibition-First Enforcement
766
-
767
- Coordinators kept "just doing it themselves" after compaction. Now they can't.
768
-
769
- **The Problem:**
770
- After context compaction, coordinators would ignore their own instructions to "spawn workers for remaining subtasks" and edit files directly. The compaction context was narrative ("do this") rather than prescriptive ("NEVER do that").
771
-
772
- **The Fix:**
773
-
774
- ### 1. Prohibition-First Compaction Context
775
-
776
- The `SWARM_COMPACTION_CONTEXT` now leads with explicit anti-patterns:
777
-
778
- ```markdown
779
- ### ⛔ NEVER DO THESE (Coordinator Anti-Patterns)
780
-
781
- - ❌ **NEVER** use `edit` or `write` tools - SPAWN A WORKER
782
- - ❌ **NEVER** run tests with `bash` - SPAWN A WORKER
783
- - ❌ **NEVER** implement features yourself - SPAWN A WORKER
784
- - ❌ **NEVER** "just do it myself to save time" - NO. SPAWN A WORKER.
785
- ```
786
-
787
- ### 2. Runtime Violation Detection
788
-
789
- `detectCoordinatorViolation()` is now wired up in `tool.execute.before`:
790
-
791
- - Detects when coordinators call `edit`, `write`, or test commands
792
- - Emits warnings to help coordinators self-correct
793
- - Captures VIOLATION events for post-hoc analysis
794
-
795
- ### 3. Coordinator Context Tracking
796
-
797
- New functions track when we're in coordinator mode:
798
-
799
- - `setCoordinatorContext()` - Activated when `hive_create_epic` or `swarm_decompose` is called
800
- - `isInCoordinatorContext()` - Checks if we're currently coordinating
801
- - `clearCoordinatorContext()` - Cleared when epic is closed
802
-
803
- **Why This Matters:**
804
-
805
- Coordinators that do implementation work burn context, create conflicts, and defeat the purpose of swarm coordination. This fix makes the anti-pattern visible and provides guardrails to prevent it.
806
-
807
- **Validation:**
808
-
809
- - Check `~/.config/swarm-tools/sessions/` for VIOLATION events
810
- - Run `coordinator-behavior.eval.ts` to score coordinator discipline
811
-
812
- - [`4c23c7a`](https://github.com/joelhooks/swarm-tools/commit/4c23c7a31013bc6537d83a9294b51540056cde93) Thanks [@joelhooks](https://github.com/joelhooks)! - ## Fix Double Hook Registration
813
-
814
- The compaction hook was firing twice per compaction event because OpenCode's plugin loader
815
- calls ALL exports as plugin functions. We were exporting `SwarmPlugin` as both:
816
-
817
- 1. Named export: `export const SwarmPlugin`
818
- 2. Default export: `export default SwarmPlugin`
819
-
820
- This caused the plugin to register twice, doubling all hook invocations.
821
-
822
- **Fix:** Changed to default-only export pattern:
823
-
824
- - `src/index.ts`: `const SwarmPlugin` (no export keyword)
825
- - `src/plugin.ts`: `export default SwarmPlugin` (no named re-export)
826
-
827
- **Impact:** Compaction hooks now fire once. LLM calls during compaction reduced by 50%.
828
-
829
- - Updated dependencies [[`e0c422d`](https://github.com/joelhooks/swarm-tools/commit/e0c422de3f5e15c117cc0cc655c0b03242245be4), [`43c8c93`](https://github.com/joelhooks/swarm-tools/commit/43c8c93ef90b2f04ce59317192334f69d7c4204e)]:
830
- - swarm-mail@1.5.1
831
-
832
- ## 0.36.0
833
-
834
- ### Minor Changes
835
-
836
- - [`ae213aa`](https://github.com/joelhooks/swarm-tools/commit/ae213aa49be977e425e0a767b5b2db16e462f76b) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔬 Compaction Hook: Now With X-Ray Vision
837
-
838
- The compaction hook was logging to `console.log` like a caveman. Now it writes structured JSON logs to `~/.config/swarm-tools/logs/compaction.log` - visible via `swarm log compaction`.
839
-
840
- **The Problem:**
841
-
842
- - Plugin wrapper used `console.log` → stdout → invisible
843
- - npm package had pino logging → but wrapper didn't use it
844
- - Running `/compact` gave zero visibility into what happened
845
-
846
- **The Fix:**
847
- Added comprehensive file-based logging throughout the compaction flow:
848
-
849
- ```
850
- ┌─────────────────────────────────────────────────────────────┐
851
- │ COMPACTION LOGGING │
852
- ├─────────────────────────────────────────────────────────────┤
853
- │ compaction_hook_invoked │ Full input/output objects │
854
- │ detect_swarm_* │ CLI calls, cells, confidence │
855
- │ query_swarm_state_* │ Epic/subtask extraction │
856
- │ generate_compaction_prompt_*│ LLM timing, success/failure │
857
- │ context_injected_via_* │ Which API used │
858
- │ compaction_complete_* │ Final result + timing │
859
- └─────────────────────────────────────────────────────────────┘
860
- ```
861
-
862
- **Also Enhanced:**
863
-
864
- - SDK message scanning for precise swarm state extraction
865
- - Merged scanned state (ground truth) with hive detection (heuristic)
866
- - 9 new tests for `scanSessionMessages()` (32 total passing)
867
-
868
- **To See It Work:**
869
-
870
- ```bash
871
- swarm setup --reinstall # Regenerate plugin wrapper
872
- # Run /compact in OpenCode
873
- swarm log compaction # See what happened
874
- ```
875
-
876
- ### Patch Changes
877
-
878
- - [`5cfc42e`](https://github.com/joelhooks/swarm-tools/commit/5cfc42e93d3e5424e308857a40af4fd9fbda0ba3) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Swarm Workers Unchained
879
-
880
- Removed the vestigial `max_subtasks` parameter from decomposition tools. It was dead code - the prompts already say "as many as needed" and the replacement was doing nothing.
881
-
882
- **What changed:**
883
-
884
- - Removed `max_subtasks` arg from `swarm_decompose`, `swarm_plan_prompt`, `swarm_delegate_planning`
885
- - Removed from `DecomposeArgsSchema`
886
- - Renamed `max_subtasks` → `subtask_count` in eval capture (records actual count, not a limit)
887
- - Cleaned up tests that were passing the unused parameter
888
-
889
- **Why it matters:**
890
- The LLM decides how many subtasks based on task complexity, not an arbitrary cap. "Plan aggressively" means spawn as many workers as the task needs.
891
-
892
- **No functional change** - the parameter wasn't being used anyway.
893
-
894
- ## 0.35.0
895
-
896
- ### Minor Changes
897
-
898
- - [`084f888`](https://github.com/joelhooks/swarm-tools/commit/084f888fcac4912f594428b1ac7148c8a8aaa422) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 👁️ Watch Your Swarm in Real-Time
899
-
900
- `swarm log` now has a `--watch` mode for continuous log monitoring. No more running the command repeatedly - just sit back and watch the bees work.
901
-
902
- ```bash
903
- # Watch all logs
904
- swarm log --watch
905
-
906
- # Watch with filters
907
- swarm log compaction -w --level error
908
-
909
- # Faster polling (500ms instead of default 1s)
910
- swarm log --watch --interval 500
911
- ```
912
-
913
- **New flags:**
914
-
915
- - `--watch`, `-w` - Enable continuous monitoring mode
916
- - `--interval <ms>` - Poll interval in milliseconds (default: 1000, min: 100)
917
-
918
- **How it works:**
919
-
920
- - Shows initial logs (last N lines based on `--limit`)
921
- - Polls log files for new entries at the specified interval
922
- - Tracks file positions for efficient incremental reads
923
- - Handles log rotation gracefully (detects file truncation)
924
- - All existing filters work: `--level`, `--since`, module name
925
- - Clean shutdown on Ctrl+C
926
-
927
- _"The hive that watches itself, debugs itself."_
928
-
929
- ## 0.34.0
930
-
931
- ### Minor Changes
932
-
933
- - [`704c366`](https://github.com/joelhooks/swarm-tools/commit/704c36690fb6fd52cfb9222ddeef3b663dfdb9ed) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🪵 Pino Logging Infrastructure
934
-
935
- > "You can't improve what you can't measure." — Peter Drucker
936
-
937
- Finally, visibility into what the swarm is actually doing.
938
-
939
- ### What's New
940
-
941
- **Structured Logging with Pino**
942
-
943
- - Daily log rotation via `pino-roll` (14-day retention)
944
- - Logs to `~/.config/swarm-tools/logs/`
945
- - Module-specific log files (e.g., `compaction.1log`, `swarm.1log`)
946
- - Pretty mode for development: `SWARM_LOG_PRETTY=1`
947
-
948
- **Compaction Hook Instrumented**
949
-
950
- - 14 strategic log points across all phases
951
- - START: session context, trigger reason
952
- - GATHER: per-source timing (hive, swarm-mail, skills)
953
- - DETECT/INJECT: confidence scores, context decisions
954
- - COMPLETE: duration, success, what was injected
955
-
956
- **New CLI: `swarm log`**
957
-
958
- ```bash
959
- swarm log # Tail recent logs
960
- swarm log compaction # Filter by module
961
- swarm log --level warn # Filter by severity
962
- swarm log --since 1h # Last hour only
963
- swarm log --json | jq # Pipe to jq for analysis
964
- ```
965
-
966
- ### Why This Matters
967
-
968
- The compaction hook does a LOT of work with zero visibility:
969
-
970
- - Context injection decisions
971
- - Data gathering from multiple sources
972
- - Template rendering and size calculations
973
-
974
- Now you can answer: "What did compaction do on the last run?"
975
-
976
- ### Technical Details
977
-
978
- - Pino + pino-roll for async, non-blocking file writes
979
- - Child loggers for module namespacing
980
- - Lazy initialization pattern for test isolation
981
- - 56 new tests (10 logger + 18 compaction + 28 CLI)
982
-
983
- Complements existing `DEBUG=swarm:*` env var approach — Pino for structured file logs, debug for stderr filtering.
984
-
985
- ### Patch Changes
986
-
987
- - [`b5792bd`](https://github.com/joelhooks/swarm-tools/commit/b5792bd5f6aa4bf3ad9757fe351bc144e84f09af) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🎯 Coordinators Remember Who They Are
988
-
989
- Fixed the compaction bug where coordinators lost their identity after context compression.
990
-
991
- **The Problem:**
992
- After compaction, coordinators would wake up and start doing worker tasks directly (running tests, editing files) instead of spawning workers. The injected context said "you are a coordinator" but gave worker-style resume commands.
993
-
994
- **The Fix:**
995
- `buildDynamicSwarmState()` now generates coordinator-focused context:
996
-
997
- ```
998
- ## 🎯 YOU ARE THE COORDINATOR
999
-
1000
- **Primary role:** Orchestrate workers, review their output, unblock dependencies.
1001
- **Spawn workers** for implementation tasks - don't do them yourself.
1002
-
1003
- **RESUME STEPS:**
1004
- 1. Check swarm status: `swarm_status(epic_id="bd-actual-id", ...)`
1005
- 2. Check inbox: `swarmmail_inbox(limit=5)`
1006
- 3. For in_progress subtasks: Review with `swarm_review`
1007
- 4. For open subtasks: Spawn workers with `swarm_spawn_subtask`
1008
- 5. For blocked subtasks: Investigate and unblock
1009
- ```
1010
-
1011
- Also captures specific swarm state during detection:
1012
-
1013
- - Epic ID and title (not placeholders)
1014
- - Subtask counts by status
1015
- - Actual project path
1016
-
1017
- **New eval infrastructure:**
1018
-
1019
- - `coordinator-behavior.eval.ts` - LLM-as-judge eval testing whether Claude actually behaves like a coordinator given the injected context
1020
- - Scorers for coordinator tools, avoiding worker behaviors, and coordinator mindset
1021
-
1022
- > "The coordinator's job is to keep the swarm cooking, not to cook themselves."
1023
-
1024
- - Updated dependencies [[`a78a40d`](https://github.com/joelhooks/swarm-tools/commit/a78a40de32eb34d1738b208f2a36929a4ab6cb81), [`5a7c084`](https://github.com/joelhooks/swarm-tools/commit/5a7c084514297b5b9ca5df9459a74f18eb805b8a)]:
1025
- - swarm-mail@1.5.0
1026
-
1027
- ## 0.33.0
1028
-
1029
- ### Minor Changes
1030
-
1031
- - [`c41abcf`](https://github.com/joelhooks/swarm-tools/commit/c41abcfa37292b72fe41e0cf9d25c6612ae75fa2) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🎓 Skills Grow Up: Discovery Moves to OpenCode
1032
-
1033
- > _"The best code is no code at all. Every new line of code you willingly bring into the world is code that has to be debugged, code that has to be read and understood, code that has to be supported."_
1034
- > — Jeff Atwood
1035
-
1036
- Skills outgrew the nest. OpenCode is shipping native skills support following the [Agent Skills spec](https://spec.agentskills.com/), and our discovery tools are now redundant. Time to deprecate the scaffolding and let the platform handle what it does best.
1037
-
1038
- ### What Changed
1039
-
1040
- **Deprecated Tools** (soft deprecation with console warnings):
1041
-
1042
- - `skills_list` - OpenCode will handle discovery natively
1043
- - `skills_use` - OpenCode will handle loading via `use skill <name>` syntax
1044
- - `skills_read` - OpenCode will handle resource access transparently
1045
- - `skills_execute` - OpenCode will handle script execution in skill context
1046
-
1047
- **Authoring Tools Kept** (fully functional, no changes):
1048
-
1049
- - `skills_create` - Create new skills with SKILL.md template
1050
- - `skills_update` - Update existing skill content
1051
- - `skills_init` - Initialize skills directory in projects
1052
- - `skills_add_script` - Add executable scripts to skills
1053
- - `skills_delete` - Remove project skills
1054
-
1055
- **Bundled Skills** - All 6 global skills remain intact and spec-compliant:
1056
-
1057
- - `testing-patterns` - Feathers seams + Beck's 4 rules
1058
- - `swarm-coordination` - Multi-agent task orchestration
1059
- - `cli-builder` - Command-line interface patterns
1060
- - `learning-systems` - Confidence decay, pattern maturity
1061
- - `skill-creator` - Meta-skill for authoring new skills
1062
- - `system-design` - Architecture decision frameworks
1063
-
1064
- ### Why It Matters
1065
-
1066
- **Before:** Two overlapping skill systems causing confusion. Agents could use plugin tools OR OpenCode's native syntax, with different behavior and semantics.
1067
-
1068
- **After:** One canonical path. OpenCode owns discovery and loading. Plugin owns authoring and validation. Clean separation of concerns.
1069
-
1070
- **Benefits:**
1071
-
1072
- - No tool conflicts between plugin and platform
1073
- - Native OpenCode syntax (`use skill testing-patterns`) works seamlessly
1074
- - Simpler mental model for users
1075
- - Authoring tools remain for creating spec-compliant skills
1076
-
1077
- ### Migration Path
1078
-
1079
- **For Discovery/Loading:**
1080
-
1081
- ```typescript
1082
- // OLD (deprecated, still works but warns)
1083
- skills_list()
1084
- skills_use(name="testing-patterns")
1085
-
1086
- // NEW (OpenCode native syntax)
1087
- use skill testing-patterns
1088
- use skill cli-builder with "building argument parser"
1089
- ```
1090
-
1091
- **For Authoring (no change needed):**
1092
-
1093
- ```typescript
1094
- // Still fully supported
1095
- skills_create((name = "my-skill"), (description = "Domain expertise"));
1096
- skills_update((name = "my-skill"), (content = "Updated SKILL.md"));
1097
- skills_add_script(
1098
- (skill_name = "my-skill"),
1099
- (script_name = "validate.ts"),
1100
- (content = "...")
1101
- );
1102
- ```
1103
-
1104
- ### Backward Compatibility
1105
-
1106
- **Yes, with warnings.** Deprecated tools continue to function but emit console warnings directing users to OpenCode's native syntax. No breaking changes in this release.
1107
-
1108
- Future major version (v1.0) will remove deprecated discovery tools entirely. Authoring tools remain permanent.
1109
-
1110
- ### What This Means for Bundled Skills
1111
-
1112
- Nothing changes. All 6 global skills ship with the plugin and are accessible via OpenCode's native `use skill <name>` syntax. They follow the Agent Skills spec and work identically whether loaded via deprecated plugin tools or native OpenCode.
1113
-
1114
- The `global-skills/` directory remains the canonical source for our curated skill library.
1115
-
1116
- - [`4feebaf`](https://github.com/joelhooks/swarm-tools/commit/4feebafed61caa8e2e8729b44bd415d71afd6834) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 LLM-Powered Compaction: The Swarm Remembers
1117
-
1118
- > "The best way to predict the future is to invent it." — Alan Kay
1119
-
1120
- Compaction just got smarter. Instead of static "here's what to preserve" instructions, the swarm now **generates dynamic continuation prompts** with actual state data.
1121
-
1122
- **What changed:**
1123
-
1124
- The `experimental.session.compacting` hook now uses a three-level fallback chain:
1125
-
1126
- 1. **LLM-Generated Prompt** (NEW) - Queries actual swarm state (cells, epics, subtasks), shells out to `opencode run -m <liteModel>` to generate a structured continuation prompt with real IDs, real status, real next actions
1127
- 2. **Static Context** - Falls back to `SWARM_COMPACTION_CONTEXT` if LLM fails
1128
- 3. **Detection Fallback** - For low-confidence swarm detection, injects `SWARM_DETECTION_FALLBACK`
1129
- 4. **None** - No injection if no swarm evidence
1130
-
1131
- **Progressive Enhancement:**
1132
-
1133
- Uses OpenCode PR #5907's new `output.prompt` API when available:
1134
-
1135
- ```typescript
1136
- if ("prompt" in output) {
1137
- output.prompt = llmGeneratedPrompt; // Replaces entire compaction prompt
1138
- } else {
1139
- output.context.push(llmGeneratedPrompt); // Old API fallback
1140
- }
1141
- ```
1142
-
1143
- **New interfaces:**
1144
-
1145
- - `SwarmStateSnapshot` - Structured state for LLM input
1146
- - `querySwarmState()` - Queries cells via swarm CLI
1147
- - `generateCompactionPrompt()` - Shells out to lite model (30s timeout)
1148
-
1149
- **Why it matters:**
1150
-
1151
- Before: "Hey, you should preserve swarm state" (agent has to figure out what that means)
1152
- After: "Here's epic bd-xyz with 3/5 subtasks done, bd-xyz.2 is blocked on auth, spawn bd-xyz.4 next"
1153
-
1154
- The coordinator wakes up from compaction with **concrete data**, not instructions to go find data.
1155
-
1156
- **Backward compatible:** Falls back gracefully on older OpenCode versions or LLM failures.
1157
-
1158
- - [`652fd16`](https://github.com/joelhooks/swarm-tools/commit/652fd16ff424eff92ebb3f5da0599caf676de2ce) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔭 Observability Stack MVP: See What Your Swarm Is Doing
1159
-
1160
- > "You can't improve what you can't measure." — Peter Drucker
1161
-
1162
- The swarm just got eyes. This release adds comprehensive observability for multi-agent coordination, answering the eternal question: "Why did my epic fail?"
1163
-
1164
- ### What's New
1165
-
1166
- **Structured Error Classes** (swarm-mail)
1167
-
1168
- - `BaseSwarmError` with rich context: agent, bead_id, epic_id, timestamp, recent events
1169
- - Specialized errors: `ReservationError`, `CheckpointError`, `ValidationError`, `DecompositionError`
1170
- - Every error includes actionable suggestions for resolution
1171
- - Full `toJSON()` serialization for logging and debugging
1172
-
1173
- **DEBUG Logging** (swarm-mail)
1174
-
1175
- - `DEBUG=swarm:*` environment variable filtering
1176
- - 4 subsystems: `swarm:events`, `swarm:reservations`, `swarm:messages`, `swarm:checkpoints`
1177
- - Zero overhead when disabled
1178
-
1179
- **swarm-db CLI** (swarm-mail)
1180
-
1181
- ```bash
1182
- # Raw SQL queries (SELECT only, max 1000 rows)
1183
- swarm-db query "SELECT type, COUNT(*) FROM events GROUP BY type"
1184
-
1185
- # Pre-built analytics
1186
- swarm-db analytics failed-decompositions --since 7d --format json
1187
-
1188
- # List available analytics
1189
- swarm-db list
1190
- ```
1191
-
1192
- **10 Pre-built Analytics Queries** (Four Golden Signals mapped)
1193
- | Query | What It Answers |
1194
- |-------|-----------------|
1195
- | `failed-decompositions` | Which strategies are failing? |
1196
- | `strategy-success-rates` | What's working? |
1197
- | `lock-contention` | Where are agents fighting over files? |
1198
- | `agent-activity` | Who's doing what? |
1199
- | `message-latency` | How fast is coordination? |
1200
- | `scope-violations` | Who's touching files they shouldn't? |
1201
- | `task-duration` | How long do tasks take? |
1202
- | `checkpoint-frequency` | Are agents checkpointing enough? |
1203
- | `recovery-success` | Do checkpoints actually help? |
1204
- | `human-feedback` | What are reviewers rejecting? |
1205
-
1206
- **Agent-Facing Tools** (opencode-swarm-plugin)
1207
-
1208
- ```typescript
1209
- // Query analytics programmatically
1210
- swarm_analytics({
1211
- query: "failed-decompositions",
1212
- since: "7d",
1213
- format: "summary",
1214
- });
1215
-
1216
- // Raw SQL for power users (max 50 rows, context-safe)
1217
- swarm_query({ sql: "SELECT * FROM events WHERE type = 'task_blocked'" });
1218
-
1219
- // Auto-diagnosis for debugging
1220
- swarm_diagnose({
1221
- epic_id: "bd-123",
1222
- include: ["blockers", "errors", "timeline"],
1223
- });
1224
-
1225
- // Learning insights for feedback loops
1226
- swarm_insights({ scope: "epic", metrics: ["success_rate", "avg_duration"] });
1227
- ```
1228
-
1229
- ### Why This Matters
1230
-
1231
- Before: "The swarm failed. No idea why."
1232
- After: "Strategy X failed 80% of the time due to file conflicts. Switching to Y."
1233
-
1234
- Event sourcing was already 80% of the solution. This release adds the diagnostic views to make that data actionable.
1235
-
1236
- ### Test Coverage
1237
-
1238
- - 588 tests passing
1239
- - 1214 assertions
1240
- - Full TDD: every feature started with a failing test
1241
-
1242
- - [`ca9936d`](https://github.com/joelhooks/swarm-tools/commit/ca9936d09b749449ef3c88fd3ec8b937f6ed7c29) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔬 Research Phase: Docs Before Decomposition
1243
-
1244
- Swarm coordinators now gather documentation BEFORE breaking down tasks. No more workers fumbling through outdated API assumptions.
1245
-
1246
- **What's New:**
1247
-
1248
- - **swarm/researcher agent** - READ-ONLY doc gatherer that discovers tools, reads lockfiles, fetches version-specific docs, and stores findings in semantic-memory
1249
- - **Pre-decomposition research** - Coordinator analyzes task → identifies tech stack → spawns researchers → injects findings into shared_context
1250
- - **On-demand research for workers** - Workers can spawn researchers when hitting unknowns mid-task
1251
- - **`--check-upgrades` flag** - Compare installed vs latest versions from npm registry
1252
-
1253
- **New Tools:**
1254
-
1255
- | Tool | Purpose |
1256
- | ------------------------ | ----------------------------------------------------------- |
1257
- | `swarm_discover_tools` | Runtime discovery of available doc tools (MCP, CLI, skills) |
1258
- | `swarm_get_versions` | Parse lockfiles (npm/pnpm/yarn/bun) for installed versions |
1259
- | `swarm_spawn_researcher` | Generate researcher prompt for Task tool |
1260
- | `swarm_research_phase` | Manual trigger for research orchestration |
1261
-
1262
- **Architecture:**
1263
-
1264
- ```
1265
- Coordinator receives task
1266
-
1267
- runResearchPhase(task, projectPath)
1268
-
1269
- extractTechStack() → identify technologies
1270
- discoverDocTools() → find available tools
1271
- getInstalledVersions() → read lockfiles
1272
- Spawn researchers (parallel)
1273
- Collect summaries → shared_context
1274
-
1275
- Normal decomposition with enriched context
1276
- ```
1277
-
1278
- **Why This Matters:**
1279
-
1280
- Workers now start with version-specific documentation instead of hallucinating APIs. Researchers store detailed findings in semantic-memory, so future agents don't repeat the research.
1281
-
1282
- ### Patch Changes
1283
-
1284
- - Updated dependencies [[`652fd16`](https://github.com/joelhooks/swarm-tools/commit/652fd16ff424eff92ebb3f5da0599caf676de2ce)]:
1285
- - swarm-mail@1.4.0
1286
-
1287
- ## 0.32.0
1288
-
1289
- ### Minor Changes
1290
-
1291
- - [#54](https://github.com/joelhooks/swarm-tools/pull/54) [`358e18f`](https://github.com/joelhooks/swarm-tools/commit/358e18f0f7f18d03492ef16c2c1d3edd85c00101) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🔍 Coordinator Review Gate + UBS Removal
1292
-
1293
- > _"This asynchronous back and forth between submitter and reviewer can add days to the process of getting changes made. Do Code Reviews Promptly!"_
1294
- > — Sam Newman, _Building Microservices_
1295
-
1296
- Two changes that make swarm coordination tighter:
1297
-
1298
- ### Coordinator Review Tools
1299
-
1300
- New tools for coordinators to review worker output before approval:
1301
-
1302
- ```
1303
- ┌─────────────────────────────────────────────────────┐
1304
- │ COORDINATOR REVIEW FLOW │
1305
- ├─────────────────────────────────────────────────────┤
1306
- │ 1. Worker completes → sends completion message │
1307
- │ 2. Coordinator: swarm_review(task_id, files) │
1308
- │ → Gets diff + epic context + review prompt │
1309
- │ 3. Coordinator reviews against epic goals │
1310
- │ 4. swarm_review_feedback(status, issues) │
1311
- │ → approved: worker can finalize │
1312
- │ → needs_changes: worker gets feedback │
1313
- │ 5. 3-strike rule: 3 rejections = blocked │
1314
- └─────────────────────────────────────────────────────┘
1315
- ```
1316
-
1317
- **New tools:**
1318
-
1319
- - `swarm_review` - Generate review prompt with epic context + git diff
1320
- - `swarm_review_feedback` - Send approval/rejection with structured issues
1321
-
1322
- **Updated prompts:**
1323
-
1324
- - Coordinator prompt now includes review checklist
1325
- - Worker prompt explains the review gate
1326
- - Skills updated with review patterns
1327
-
1328
- ### UBS Scan Removed from swarm_complete
1329
-
1330
- The `skip_ubs_scan` parameter is gone. UBS was already disabled in v0.31 for performance - this cleans up the vestigial code.
1331
-
1332
- **Removed:**
1333
-
1334
- - `skip_ubs_scan` parameter from schema
1335
- - `ubs_scan` deprecation object from output
1336
- - All UBS-related helper functions
1337
- - ~100 lines of dead code
1338
-
1339
- **If you need UBS scanning:** Run it manually before commit:
1340
-
1341
- ```bash
1342
- ubs scan src/
1343
- ```
1344
-
1345
- ### CLI Improvements
1346
-
1347
- The `swarm` CLI got smarter:
1348
-
1349
- - Better error messages for missing dependencies
1350
- - Cleaner output formatting
1351
- - Improved help text
1352
-
1353
- ### Patch Changes
1354
-
1355
- - [#54](https://github.com/joelhooks/swarm-tools/pull/54) [`358e18f`](https://github.com/joelhooks/swarm-tools/commit/358e18f0f7f18d03492ef16c2c1d3edd85c00101) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🧪 Integration Test Coverage: 0% → 95%
1356
-
1357
- > _"Many characterization tests look like 'sunny day' tests. They don't test many special conditions; they just verify that particular behaviors are present. From their presence, we can infer that refactoring hasn't broken anything."_
1358
- > — Michael Feathers, _Working Effectively with Legacy Code_
1359
-
1360
- We had a bug that broke ALL swarm tools:
1361
-
1362
- ```
1363
- Error: [streams/store] dbOverride parameter is required for this function.
1364
- PGlite getDatabase() has been removed.
1365
- ```
1366
-
1367
- **Why didn't tests catch it?** No integration tests exercised the full tool → store → DB path.
1368
-
1369
- **Now they do.**
1370
-
1371
- ```
1372
- ┌─────────────────────────────────────────────────────────────────┐
1373
- │ tool-adapter.integration.test.ts │
1374
- ├─────────────────────────────────────────────────────────────────┤
1375
- │ 20 tests | 75 assertions | 1.3s │
1376
- │ │
1377
- │ ✅ swarmmail_* tools (6 tests) │
1378
- │ ✅ hive_* tools (7 tests) │
1379
- │ ✅ swarm_progress, swarm_status (2 tests) │
1380
- │ ✅ swarm_broadcast, swarm_checkpoint (2 tests) │
1381
- │ ✅ semantic_memory_store, semantic_memory_find (2 tests) │
1382
- │ ✅ Smoke test - 9 tools in sequence (1 test) │
1383
- └─────────────────────────────────────────────────────────────────┘
1384
- ```
1385
-
1386
- ### What's Tested
1387
-
1388
- Each test calls `tool.execute()` and verifies:
1389
-
1390
- 1. No "dbOverride required" error (the bug symptom)
1391
- 2. Tool returns expected structure
1392
- 3. Full path works: tool → store → DB → response
1393
-
1394
- ### The Smoke Test
1395
-
1396
- Runs 9 tools in sequence to catch interaction bugs:
1397
-
1398
- ```
1399
- swarmmail_init → hive_create → swarmmail_reserve → swarm_progress
1400
- → semantic_memory_store → semantic_memory_find → swarmmail_send
1401
- → hive_close → swarmmail_release
1402
- ```
1403
-
1404
- If ANY step throws "dbOverride required", the test fails.
1405
-
1406
- ### Also Fixed
1407
-
1408
- - **Auto-adapter creation** in store.ts - functions now auto-create adapters when not provided
1409
- - **Exported `clearAdapterCache()`** for test isolation
1410
- - **Migrated test files** from old `getDatabase()` to adapter pattern
1411
-
1412
- ### Mandatory Coordinator Review Loop
1413
-
1414
- Added `COORDINATOR_POST_WORKER_CHECKLIST` constant and `post_completion_instructions` field to `swarm_spawn_subtask`. Coordinators now get explicit instructions to review worker output before spawning the next worker.
1415
-
1416
- The "dbOverride required" bug **cannot recur undetected**.
1417
-
1418
- - Updated dependencies [[`358e18f`](https://github.com/joelhooks/swarm-tools/commit/358e18f0f7f18d03492ef16c2c1d3edd85c00101), [`358e18f`](https://github.com/joelhooks/swarm-tools/commit/358e18f0f7f18d03492ef16c2c1d3edd85c00101), [`358e18f`](https://github.com/joelhooks/swarm-tools/commit/358e18f0f7f18d03492ef16c2c1d3edd85c00101), [`358e18f`](https://github.com/joelhooks/swarm-tools/commit/358e18f0f7f18d03492ef16c2c1d3edd85c00101)]:
1419
- - swarm-mail@1.3.0
1420
-
1421
- ## 0.31.7
1422
-
1423
- ### Patch Changes
1424
-
1425
- - [`97e89a6`](https://github.com/joelhooks/swarm-tools/commit/97e89a6d944b70f205eeb83eb3f2c55a42f5dc08) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Setup Skips Already-Migrated Memories
1426
-
1427
- `swarm setup` now detects when semantic memories have already been migrated and skips the migration prompt entirely.
1428
-
1429
- **Before:** Setup would prompt "Migrate to swarm-mail database?" even when all memories were already migrated, then hang.
1430
-
1431
- **After:** Setup checks if target database has memories first. If already migrated, shows dim "Already migrated to swarm-mail" and moves on.
1432
-
1433
- **Changes:**
1434
-
1435
- - Added `targetHasMemories(targetDb)` function to swarm-mail
1436
- - Updated setup flow to check target before prompting
1437
- - Fixed connection cleanup in all code paths (try/finally pattern)
1438
- - Suppressed internal PGLite NOTICE messages from user output
1439
-
1440
- **Root cause of hang:** PGLite connection wasn't being closed in all paths, keeping the Node.js event loop alive indefinitely.
1441
-
1442
- - Updated dependencies [[`97e89a6`](https://github.com/joelhooks/swarm-tools/commit/97e89a6d944b70f205eeb83eb3f2c55a42f5dc08)]:
1443
- - swarm-mail@1.2.2
1444
-
1445
- ## 0.31.6
1446
-
1447
- ### Patch Changes
1448
-
1449
- - [`3147d36`](https://github.com/joelhooks/swarm-tools/commit/3147d36cf2355b9cfe461c7dfc3b30675ea36d89) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🚪 Setup Now Exits Cleanly After Migration
1450
-
1451
- Fixed a process hang where `swarm setup` would complete the migration but never exit.
1452
-
1453
- **Root cause:** The PGLite connection created for memory migration kept the Node.js event loop alive indefinitely.
1454
-
1455
- **Fix:** Close the swarmMail connection after migration completes. The connection is scoped to the migration block and not needed afterward.
1456
-
1457
- ```typescript
1458
- // After migration completes
1459
- await swarmMail.close();
1460
- ```
1461
-
1462
- **Before:** `swarm setup` hangs after "Migration complete" message
1463
- **After:** Process exits cleanly, returns to shell
1464
-
1465
- ## 0.31.5
1466
-
1467
- ### Patch Changes
1468
-
1469
- - Updated dependencies [[`64368aa`](https://github.com/joelhooks/swarm-tools/commit/64368aa6106089346cd2b1324f6235d5c673964b)]:
1470
- - swarm-mail@1.2.1
1471
-
1472
- ## 0.31.4
1473
-
1474
- ### Patch Changes
1475
-
1476
- - Updated dependencies [[`70ff3e0`](https://github.com/joelhooks/swarm-tools/commit/70ff3e054cd1991154f7631ce078798de1076ba8)]:
1477
- - swarm-mail@1.2.0
1478
-
1479
- ## 0.31.3
1480
-
1481
- ### Patch Changes
1482
-
1483
- - [`fdddd27`](https://github.com/joelhooks/swarm-tools/commit/fdddd27f9c8627f7de2b9f108827c66c7040b049) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Short Hashes Now Welcome
1484
-
1485
- The WorkerHandoff schema was too strict - it rejected short project names and partial hashes.
1486
-
1487
- **Before:** Required 3+ hyphen-separated segments (regex nightmare)
1488
-
1489
- ```
1490
- /^[a-z0-9]+(-[a-z0-9]+){2,}(\.[\w-]+)?$/
1491
- ```
1492
-
1493
- **After:** Any non-empty string, validated at runtime via `resolvePartialId()`
1494
-
1495
- Now you can use:
1496
-
1497
- - Full IDs: `opencode-swarm-monorepo-lf2p4u-mjd4pjujc7e`
1498
- - Short hashes: `mjd4pjujc7e`
1499
- - Partial hashes: `mjd4pjuj`
1500
-
1501
- The hive tools already had smart ID resolution - we just needed to stop blocking it at the schema level.
1502
-
1503
- ## 0.31.2
1504
-
1505
- ### Patch Changes
1506
-
1507
- - [`d5ec86e`](https://github.com/joelhooks/swarm-tools/commit/d5ec86e77bdb1cd06cf168946aaaff91208dfac1) Thanks [@joelhooks](https://github.com/joelhooks)! - Rebuild with fixed swarm-mail dependency (bigint date fix)
1508
-
1509
- ## 0.31.1
1510
-
1511
- ### Patch Changes
1512
-
1513
- - [`19995a6`](https://github.com/joelhooks/swarm-tools/commit/19995a68dd1283de1d13afa6fc028bd1273d1b27) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Squashed the BigInt Date Bug
1514
-
1515
- PGLite returns BIGINT columns as JavaScript `bigint` type. The `Date` constructor throws when given a bigint:
1516
-
1517
- ```javascript
1518
- new Date(1734628445371n); // TypeError: Cannot convert a BigInt value to a number
1519
- ```
1520
-
1521
- This caused `Invalid Date` errors in all hive operations (`hive_query`, `hive_create`, etc).
1522
-
1523
- **Fix:** Wrap timestamps in `Number()` before passing to `Date`:
1524
-
1525
- ```typescript
1526
- // Before (broken)
1527
- new Date(cell.created_at);
1528
-
1529
- // After (works with both number and bigint)
1530
- new Date(Number(cell.created_at));
1531
- ```
1532
-
1533
- **Files fixed:**
1534
-
1535
- - `swarm-mail/src/hive/jsonl.ts` - JSONL export functions
1536
- - `opencode-swarm-plugin/src/hive.ts` - `formatCellForOutput()`
1537
-
1538
- **Tests added:** 6 new tests covering bigint date handling edge cases.
1539
-
1540
- - Updated dependencies [[`19995a6`](https://github.com/joelhooks/swarm-tools/commit/19995a68dd1283de1d13afa6fc028bd1273d1b27)]:
1541
- - swarm-mail@1.1.1
1542
-
1543
- ## 0.31.0
1544
-
1545
- ### Minor Changes
1546
-
1547
- - [`39593d7`](https://github.com/joelhooks/swarm-tools/commit/39593d7ee817c683ad1877af52ad5f2ca140c4e2) Thanks [@joelhooks](https://github.com/joelhooks)! - ## Smart ID Resolution: Git-Style Partial Hashes for Hive
1548
-
1549
- ```
1550
- ┌─────────────────────────────────────────────────────────────┐
1551
- │ BEFORE: hive_close(id="opencode-swarm-monorepo-lf2p4u-mjcadqq3fb9") │
1552
- │ AFTER: hive_close(id="mjcadqq3fb9") │
1553
- └─────────────────────────────────────────────────────────────┘
1554
- ```
1555
-
1556
- Cell IDs got long. Now you can use just the hash portion.
1557
-
1558
- **What changed:**
1559
-
1560
- ### swarm-mail
1561
-
1562
- - Added `resolvePartialId(adapter, partialId)` to resolve partial hashes to full cell IDs
1563
- - Supports exact match, prefix match, suffix match, and substring match
1564
- - Returns helpful error messages for ambiguous matches ("Found 3 cells matching 'abc': ...")
1565
- - 36 new tests covering all resolution scenarios
1566
-
1567
- ### opencode-swarm-plugin
1568
-
1569
- - `hive_update`, `hive_close`, `hive_start` now accept partial IDs
1570
- - Resolution happens transparently - full ID returned in response
1571
- - Backward compatible - full IDs still work
1572
-
1573
- **JSONL Fix (bonus):**
1574
-
1575
- - `serializeToJSONL()` now adds trailing newline for POSIX compliance
1576
- - Prevents parse errors when appending to existing files
1577
-
1578
- **Why it matters:**
1579
-
1580
- - Less typing, fewer copy-paste errors
1581
- - Matches git's partial SHA workflow (muscle memory)
1582
- - Ambiguous matches fail fast with actionable error messages
1583
-
1584
- > "The best interface is no interface" - Golden Krishna
1585
- > (But if you must have one, make it forgive typos)
1586
-
1587
- ***
1588
-
1589
- ## Auto-Sync at Key Events
1590
-
1591
- ```
1592
- ┌─────────────────────────────────────────┐
1593
- │ hive_create_epic → auto-sync │
1594
- │ swarm_complete → auto-sync │
1595
- │ process.exit → safety net sync │
1596
- └─────────────────────────────────────────┘
1597
- ```
1598
-
1599
- Cells no longer get lost when processes exit unexpectedly.
1600
-
1601
- **What changed:**
1602
-
1603
- - `hive_create_epic` syncs after creating epic + subtasks (workers can see them immediately)
1604
- - `swarm_complete` syncs before worker exits (completed work persists)
1605
- - `process.on('beforeExit')` hook catches any remaining dirty cells
1606
-
1607
- **Why it matters:**
1608
-
1609
- - Spawned workers couldn't see cells created by coordinator (race condition)
1610
- - Worker crashes could lose completed work
1611
- - Now the lazy-write pattern has strategic checkpoints
1612
-
1613
- ***
1614
-
1615
- ## Removed Arbitrary Subtask Limits
1616
-
1617
- ```
1618
- BEFORE: max_subtasks capped at 10 (why tho?)
1619
- AFTER: no limit - LLM decides based on task complexity
1620
- ```
1621
-
1622
- **What changed:**
1623
-
1624
- - Removed `.max(10)` from `swarm_decompose` and `swarm_plan_prompt`
1625
- - `max_subtasks` is now optional with no default
1626
- - Prompt says "as many as needed" instead of "2-10"
1627
-
1628
- **Why it matters:**
1629
-
1630
- - Complex epics need more than 10 subtasks
1631
- - Arbitrary limits force awkward decomposition
1632
- - Trust the coordinator to make good decisions
1633
-
1634
- ### Patch Changes
1635
-
1636
- - Updated dependencies [[`39593d7`](https://github.com/joelhooks/swarm-tools/commit/39593d7ee817c683ad1877af52ad5f2ca140c4e2)]:
1637
- - swarm-mail@1.1.0
1638
-
1639
- ## 0.30.7
1640
-
1641
- ### Patch Changes
1642
-
1643
- - Updated dependencies [[`230e9aa`](https://github.com/joelhooks/swarm-tools/commit/230e9aa91708610183119680cb5f6924c1089552), [`181fdd5`](https://github.com/joelhooks/swarm-tools/commit/181fdd507b957ceb95e069ae71d527d3f7e1b940)]:
1644
- - swarm-mail@1.0.0
1645
-
1646
- ## 0.30.6
1647
-
1648
- ### Patch Changes
1649
-
1650
- - [`32a2885`](https://github.com/joelhooks/swarm-tools/commit/32a2885115cc3e574e86d8e492f60ee189627488) Thanks [@joelhooks](https://github.com/joelhooks)! - chore: verify CI publish flow works
1651
-
1652
- ## 0.30.5
1653
-
1654
- ### Patch Changes
1655
-
1656
- - [`08e61ab`](https://github.com/joelhooks/swarm-tools/commit/08e61abd96ced0443a5ac5dca0e8f362ed869075) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Workers Now Choose Their Own Model
1657
-
1658
- Added intelligent model selection for swarm workers based on task characteristics.
1659
-
1660
- **What changed:**
1661
-
1662
- - `swarm setup` now asks for a "lite model" preference (docs/tests/simple edits)
1663
- - New `selectWorkerModel()` function auto-selects based on file types
1664
- - `swarm_spawn_subtask` includes `recommended_model` in metadata
1665
- - `DecomposedSubtask` schema supports optional explicit `model` field
1666
-
1667
- **Model selection priority:**
1668
-
1669
- 1. Explicit `model` field in subtask (if specified)
1670
- 2. File-type inference:
1671
- - All `.md`/`.mdx` files → lite model
1672
- - All `.test.`/`.spec.` files → lite model
1673
- 3. Mixed or implementation files → primary model
1674
-
1675
- **Why it matters:**
1676
-
1677
- - Cost savings: docs and tests don't need expensive models
1678
- - Faster execution: lite models are snappier for simple tasks
1679
- - Better defaults: right-sized models for each subtask type
1680
- - Still flexible: coordinators can override per-subtask
1681
-
1682
- **Backward compatible:**
1683
-
1684
- - Existing workflows continue to work
1685
- - Model selection is transparent to agents
1686
- - Defaults to primary model if lite model not configured
1687
-
1688
- **Example:**
1689
-
1690
- ```typescript
1691
- // Subtask with all markdown files
1692
- { files: ["README.md", "docs/guide.mdx"] }
1693
- // → selects lite model (haiku)
1694
-
1695
- // Subtask with mixed files
1696
- { files: ["src/auth.ts", "README.md"] }
1697
- // → selects primary model (sonnet)
1698
-
1699
- // Explicit override
1700
- { files: ["complex-refactor.ts"], model: "anthropic/claude-opus-4-5" }
1701
- // → uses opus as specified
1702
- ```
1703
-
1704
- ## 0.30.4
1705
-
1706
- ### Patch Changes
1707
-
1708
- - [`1c9a2e8`](https://github.com/joelhooks/swarm-tools/commit/1c9a2e8a148b79a33cb8c5b565e485f33d1f617c) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Fix Migration Adapter Type (for real this time)
1709
-
1710
- The previous release (0.30.3) was published before this fix landed. Now it's actually in.
1711
-
1712
- **The Bug:**
1713
-
1714
- ```
1715
- targetDb.query is not a function
1716
- ```
1717
-
1718
- **Root Cause:**
1719
- `getSwarmMail()` returns `SwarmMailAdapter`, not `DatabaseAdapter`. Need to call `getDatabase()` first.
1720
-
1721
- **The Fix:**
1722
-
1723
- ```typescript
1724
- const swarmMail = await getSwarmMail(cwd);
1725
- const targetDb = await swarmMail.getDatabase(cwd);
1726
- ```
1727
-
1728
- ## 0.30.3
1729
-
1730
- ### Patch Changes
1731
-
1732
- - [`cc84c8f`](https://github.com/joelhooks/swarm-tools/commit/cc84c8f066696c7625dc307a5163ff50d672634e) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Fix Migration Adapter Type Mismatch
1733
-
1734
- > _"The compiler is your friend. Listen to it."_
1735
- > — Every TypeScript developer, eventually
1736
-
1737
- Fixed a runtime error in `swarm setup` where the legacy memory migration was receiving a `SwarmMailAdapter` instead of a `DatabaseAdapter`.
1738
-
1739
- **The Bug:**
1740
-
1741
- ```
1742
- targetDb.query is not a function
1743
- ```
1744
-
1745
- **Root Cause:**
1746
- `getSwarmMail()` returns a `SwarmMailAdapter` which has `getDatabase()` method, not a direct `query()` method. The migration code expected a `DatabaseAdapter`.
1747
-
1748
- **The Fix:**
1749
-
1750
- ```typescript
1751
- // Before (wrong)
1752
- const targetDb = await getSwarmMail(cwd);
1753
-
1754
- // After (correct)
1755
- const swarmMail = await getSwarmMail(cwd);
1756
- const targetDb = await swarmMail.getDatabase(cwd);
1757
- ```
1758
-
1759
- **Test Added:**
1760
- New test case verifies that passing an invalid adapter (without `query()`) fails gracefully with a descriptive error instead of crashing.
1761
-
1762
- - [`1e41c9b`](https://github.com/joelhooks/swarm-tools/commit/1e41c9b42ae468761f813d406171d182fb9948e0) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Semantic Memory Consolidation
1763
-
1764
- > _"Simplicity is the ultimate sophistication."_
1765
- > — Leonardo da Vinci
1766
-
1767
- The semantic memory system has moved into swarm-mail, bringing persistent learning to the hive.
1768
-
1769
- ### What's New
1770
-
1771
- **Semantic Memory in swarm-mail:**
1772
-
1773
- - `createSemanticMemory()` - Initialize memory store with PGLite + Ollama embeddings
1774
- - `getMigrationStatus()` - Check if legacy memory needs migration
1775
- - `migrateLegacyMemory()` - Migrate from old semantic-memory-mcp format
1776
- - Automatic migration on first use (no manual intervention needed)
1777
-
1778
- **Legacy Migration:**
1779
-
1780
- - Detects old `~/.semantic-memory/` databases
1781
- - Migrates memories, embeddings, and metadata
1782
- - Preserves all tags and timestamps
1783
- - Creates backup before migration
1784
-
1785
- **Worker Handoff Protocol:**
1786
-
1787
- - Agents can now hand off work mid-task
1788
- - State preserved via swarm mail messages
1789
- - Enables long-running tasks across context limits
1790
-
1791
- ### Breaking Changes
1792
-
1793
- None - this is additive. The old semantic-memory-mcp still works but is deprecated.
1794
-
1795
- ### Files Added/Changed
1796
-
1797
- - `packages/swarm-mail/src/memory/` - New memory subsystem
1798
- - `packages/swarm-mail/src/memory/migrate-legacy.ts` - Migration tooling
1799
- - `packages/opencode-swarm-plugin/bin/swarm.ts` - Uses new exports
1800
-
1801
- - Updated dependencies [[`1e41c9b`](https://github.com/joelhooks/swarm-tools/commit/1e41c9b42ae468761f813d406171d182fb9948e0)]:
1802
- - swarm-mail@0.5.0
1803
-
1804
- ## 0.30.2
1805
-
1806
- ### Patch Changes
1807
-
1808
- - [`5858148`](https://github.com/joelhooks/swarm-tools/commit/5858148d5785393c0a6993a2595fba275f305707) Thanks [@joelhooks](https://github.com/joelhooks)! - chore: trigger publish workflow
1809
-
1810
- ## 0.30.1
1811
-
1812
- ### Patch Changes
1813
-
1814
- - [`57d5600`](https://github.com/joelhooks/swarm-tools/commit/57d5600a53e148ce1d1da48b3b5a8723a5552e04) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🚦 Review Gate UX Fix + Verbose Setup
1815
-
1816
- > _"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."_
1817
- > — Douglas Adams, _Mostly Harmless_
1818
-
1819
- Two UX improvements that make swarm coordination feel less like shouting into the void.
1820
-
1821
- ### What Changed
1822
-
1823
- **Review Gate Response Fix:**
1824
-
1825
- - `swarm_complete` no longer returns `success: false` when code review is pending
1826
- - Now returns `success: true` with `status: "pending_review"` or `status: "needs_changes"`
1827
- - **Why it matters**: The old format made review checkpoints look like errors. Agents would retry unnecessarily or report failures when the workflow was actually working as designed. Review gates are a feature, not a bug.
1828
-
1829
- **Setup Command Verbosity:**
1830
-
1831
- - Added `p.log.step()` and `p.log.success()` throughout swarm setup
1832
- - Users can now see exactly what's happening: dependency checks, git init, swarm-mail connection
1833
- - **Why it matters**: Silent setup commands feel broken. Explicit progress logs build trust and make debugging easier when setup actually does fail.
1834
-
1835
- ### Why It Matters
1836
-
1837
- **For Agents:**
1838
-
1839
- - No more false-negative responses from review gates
1840
- - Clear workflow state (pending vs. needs changes vs. complete)
1841
- - Reduced retry loops and error noise
1842
-
1843
- **For Users:**
1844
-
1845
- - Setup command shows its work (not a black box)
1846
- - Review process is transparent in logs
1847
- - Easier to diagnose when things actually break
1848
-
1849
- **Backward compatible:** Yes. Existing agents checking for `success: false` will still work, they just won't see false errors anymore.
1850
-
1851
- ## 0.30.0
1852
-
1853
- ### Minor Changes
1854
-
1855
- - [`f3917ad`](https://github.com/joelhooks/swarm-tools/commit/f3917ad911d3c716a2470a01c66bce3500f644f4) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 The Great bd CLI Purge
1856
-
1857
- The `bd` CLI is officially dead. Long live HiveAdapter!
1858
-
1859
- **What changed:**
1860
-
1861
- ### `swarm init` Command Rewritten
1862
-
1863
- - No longer shells out to `bd init` or `bd create`
1864
- - Uses `ensureHiveDirectory()` and `getHiveAdapter()` directly
1865
- - Supports `.beads` → `.hive` migration with user prompts
1866
- - Creates cells via HiveAdapter, not CLI
1867
-
1868
- ### Auto-sync Removed from `index.ts`
1869
-
1870
- - Removed `void $\`bd sync\`.quiet().nothrow()`after`hive_close`
1871
- - Users should call `hive_sync` explicitly at session end
1872
- - This was a fire-and-forget that could race with other operations
1873
-
1874
- ### Plugin Template Updated
1875
-
1876
- - `detectSwarm()` now has confidence levels (HIGH/MEDIUM/LOW/NONE)
1877
- - Added `SWARM_DETECTION_FALLBACK` for uncertain cases
1878
- - Compaction hook injects context based on confidence:
1879
- - HIGH/MEDIUM → Full swarm context
1880
- - LOW → Fallback detection prompt
1881
- - NONE → No injection
1882
-
1883
- ### Error Handling Fixed
1884
-
1885
- - `execTool()` now handles both string and object error formats
1886
- - Fixes "Tool execution failed" generic error from `swarm_complete`
1887
- - Actual error messages now propagate to the agent
1888
-
1889
- **Why it matters:**
1890
-
1891
- - No external CLI dependency for core functionality
1892
- - HiveAdapter is type-safe and testable
1893
- - Plugin works in environments without `bd` installed
1894
- - Better error messages for debugging
1895
-
1896
- **Migration:** Run `swarm setup` to update your deployed plugin.
1897
-
1898
- ## 0.29.0
1899
-
1900
- ### Minor Changes
1901
-
1902
- - [`a2ff1f4`](https://github.com/joelhooks/swarm-tools/commit/a2ff1f4257a2e9857f63abe4e9b941a573f44380) Thanks [@joelhooks](https://github.com/joelhooks)! - ## 🐝 Cell IDs Now Wear Their Project Colors
1903
-
1904
- > _"We may fantasize about being International Men of Mystery, but our code needs to be mundane and clear. One of the most important parts of clear code is good names."_
1905
- > — Martin Fowler, _Refactoring_
1906
-
1907
- Cell IDs finally know where they came from. Instead of anonymous `bd-xxx` prefixes,
1908
- new cells proudly display their project name: `swarm-mail-lf2p4u-abc123`.
1909
-
1910
- ### What Changed
1911
-
1912
- **swarm-mail:**
1913
-
1914
- - `generateBeadId()` now reads `package.json` name field from project directory
1915
- - Added `slugifyProjectName()` for safe ID generation (lowercase, special chars → dashes)
1916
- - Falls back to `cell-` prefix if no package.json or no name field
1917
-
1918
- **opencode-swarm-plugin:**
1919
-
1920
- - Removed all `bd` CLI usage from `swarm-orchestrate.ts` - now uses HiveAdapter
1921
- - Improved compaction hook swarm detection with confidence levels (high/medium/low)
1922
- - Added fallback detection prompt for uncertain swarm states
1923
-
1924
- ### Examples
1925
-
1926
- | Before | After |
1927
- | ----------------------- | ------------------------------- |
1928
- | `bd-lf2p4u-mjbneh7mqah` | `swarm-mail-lf2p4u-mjbneh7mqah` |
1929
- | `bd-abc123-xyz` | `my-cool-app-abc123-xyz` |
1930
- | (no package.json) | `cell-abc123-xyz` |
1931
-
1932
- ### Why It Matters
1933
-
1934
- - **Identifiable at a glance** - Know which project a cell belongs to without looking it up
1935
- - **Multi-project workspaces** - Filter/search cells by project prefix
1936
- - **Terminology cleanup** - Removes legacy "bead" (`bd-`) from user-facing IDs
1937
-
1938
- ### Backward Compatible
1939
-
1940
- Existing `bd-*` IDs still work fine. No migration needed - only NEW cells get project prefixes.
1941
-
1942
- ### Compaction: Keeping the Swarm Alive
1943
-
1944
- > _"Intelligent and structured group dynamics that emerge not from a leader, but from the local interactions of the elements themselves."_
1945
- > — Daniel Shiffman, _The Nature of Code_
1946
-
1947
- The compaction hook now uses multi-signal detection to keep swarms cooking through context compression:
1948
-
1949
- - **HIGH confidence:** Active reservations, in_progress cells → full swarm context
1950
- - **MEDIUM confidence:** Open subtasks, unclosed epics → full swarm context
1951
- - **LOW confidence:** Any cells exist → fallback detection prompt
1952
-
1953
- Philosophy: Err on the side of continuation. A false positive costs context space. A false negative loses the swarm.
1954
-
1955
- ### Patch Changes
1956
-
1957
- - Updated dependencies [[`a2ff1f4`](https://github.com/joelhooks/swarm-tools/commit/a2ff1f4257a2e9857f63abe4e9b941a573f44380)]:
1958
- - swarm-mail@0.4.0
1959
-
1960
- ## 0.28.2
1961
-
1962
- ### Patch Changes
1963
-
1964
- - Updated dependencies [[`90409ef`](https://github.com/joelhooks/swarm-tools/commit/90409ef4f353844b25fe04221bc80d6f930eced2)]:
1965
- - swarm-mail@0.3.4
1966
-
1967
- ## 0.28.1
1968
-
1969
- ### Patch Changes
1970
-
1971
- - [`0ee4f65`](https://github.com/joelhooks/swarm-tools/commit/0ee4f656c2fb2cf62d3ef06d329d9e093d124c33) Thanks [@joelhooks](https://github.com/joelhooks)! - Add postinstall hint and update repo URL
1972
-
1973
- - Show "Run swarm setup" hint after npm install
1974
- - Update repo URL to github.com/joelhooks/swarm-tools
1975
- - Add "Get started" commands to version output
1976
-
1977
- ## 0.28.0
1978
-
1979
- ### Minor Changes
1980
-
1981
- - [`de2fa62`](https://github.com/joelhooks/swarm-tools/commit/de2fa628524b88511e06164104ff7b5fb93d39e5) Thanks [@joelhooks](https://github.com/joelhooks)! - Add full beads→hive migration pipeline with JSONL import to PGLite
1982
-
1983
- - Add `mergeHistoricBeads()` to merge beads.base.jsonl into issues.jsonl
1984
- - Add `importJsonlToPGLite()` to import JSONL records into PGLite database
1985
- - Wire both functions into `swarm setup` migration flow
1986
- - Fix closed_at constraint issue when importing closed cells
1987
- - TDD: 12 new integration tests for migration functions
1988
-
1989
- ## 0.27.4
1990
-
1991
- ### Patch Changes
1992
-
1993
- - [`f23f774`](https://github.com/joelhooks/swarm-tools/commit/f23f774e4b83a3422d8266b6b1ad083daaec03e2) Thanks [@joelhooks](https://github.com/joelhooks)! - Enforce coordinator always spawns workers, never executes work directly
1994
-
1995
- - Added "Coordinator Role Boundaries" section to /swarm command
1996
- - Coordinators now explicitly forbidden from editing code, running tests, or making "quick fixes"
1997
- - Updated Phase 5 to clarify coordinators NEVER reserve files (workers do)
1998
- - Updated Phase 6 with patterns for both parallel and sequential worker spawning
1999
- - Worker agent template now confirms it was spawned correctly and to report coordinator violations
2000
-
2001
- ## 0.27.3
2002
-
2003
- ### Patch Changes
2004
-
2005
- - [`ec23d25`](https://github.com/joelhooks/swarm-tools/commit/ec23d25aeca667c0294a6255fecf11dd7d7fd6b3) Thanks [@joelhooks](https://github.com/joelhooks)! - Add .beads → .hive directory migration support
2006
-
2007
- - Fix migration version collision: beadsMigration now v7, cellsViewMigration now v8 (was conflicting with streams v6)
2008
- - Add `checkBeadsMigrationNeeded()` to detect legacy .beads directories
2009
- - Add `migrateBeadsToHive()` to rename .beads to .hive
2010
- - Add `ensureHiveDirectory()` to create .hive if missing (called by hive_sync)
2011
- - Update hive_sync to ensure .hive directory exists before writing
2012
- - Add migration prompt to `swarm setup` CLI flow
2013
-
2014
- - Updated dependencies [[`ec23d25`](https://github.com/joelhooks/swarm-tools/commit/ec23d25aeca667c0294a6255fecf11dd7d7fd6b3)]:
2015
- - swarm-mail@0.3.3
2016
-
2017
- ## 0.27.2
2018
-
2019
- ### Patch Changes
2020
-
2021
- - [`50a2bf5`](https://github.com/joelhooks/swarm-tools/commit/50a2bf51c5320c038f202191d7acbfd2179f2cb3) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix cells view migration not being applied
2022
-
2023
- The v7 migration (cellsViewMigration) that creates the `cells` view was added after
2024
- swarm-mail@0.3.0 was published. This caused `hive_sync` to fail with
2025
- "relation cells does not exist" because the JSONL export queries the `cells` view.
2026
-
2027
- This patch ensures the v7 migration is included in the published package.
2028
-
2029
- - Updated dependencies [[`50a2bf5`](https://github.com/joelhooks/swarm-tools/commit/50a2bf51c5320c038f202191d7acbfd2179f2cb3)]:
2030
- - swarm-mail@0.3.2
2031
-
2032
- ## 0.27.0
2033
-
2034
- ### Minor Changes
2035
-
2036
- - [`26fd2ef`](https://github.com/joelhooks/swarm-tools/commit/26fd2ef27562edc39f7db7a9cdbed399a465200d) Thanks [@joelhooks](https://github.com/joelhooks)! - Rename beads → hive across the codebase
2037
-
2038
- - `createBeadsAdapter` → `createHiveAdapter` (old name still exported as alias)
2039
- - `BeadsAdapter` type → `HiveAdapter` type
2040
- - All internal references updated to use hive terminology
2041
- - Backward compatible: old exports still work but are deprecated
2042
-
2043
- - [`ab23071`](https://github.com/joelhooks/swarm-tools/commit/ab23071cc7509c4fc37e1cac0f38a3812022cdf5) Thanks [@joelhooks](https://github.com/joelhooks)! - Add swarm-aware compaction hook to keep swarms cooking after context compression
2044
-
2045
- - New `experimental.session.compacting` hook detects active swarms and injects recovery context
2046
- - `hasSwarmSign()` checks for swarm evidence: in-progress beads, subtasks, unclosed epics
2047
- - Compaction prompt instructs coordinator to immediately resume orchestration
2048
- - Fix @types/node conflicts by pinning to 22.19.3 in root overrides
2049
-
2050
- ### Patch Changes
2051
-
2052
- - Updated dependencies [[`26fd2ef`](https://github.com/joelhooks/swarm-tools/commit/26fd2ef27562edc39f7db7a9cdbed399a465200d)]:
2053
- - swarm-mail@0.3.0
2054
-
2055
- ## 0.26.1
2056
-
2057
- ### Patch Changes
2058
-
2059
- - [`b2d4a84`](https://github.com/joelhooks/swarm-tools/commit/b2d4a84748cdef4b9dbca7666dd3d313b6cd2b24) Thanks [@joelhooks](https://github.com/joelhooks)! - Add automatic JSONL migration for beads on first use
2060
-
2061
- - Auto-migrate from `.beads/issues.jsonl` when database is empty
2062
- - Fix import to handle missing dependencies/labels/comments arrays
2063
- - Fix closed bead import to satisfy check constraint (status + closed_at)
2064
- - Migrates 500+ historical beads seamlessly on first adapter initialization
2065
-
2066
- - Updated dependencies [[`b2d4a84`](https://github.com/joelhooks/swarm-tools/commit/b2d4a84748cdef4b9dbca7666dd3d313b6cd2b24)]:
2067
- - swarm-mail@0.2.1
2068
-
2069
- ## 0.26.0
2070
-
2071
- ### Minor Changes
2072
-
2073
- - [`1a7b02f`](https://github.com/joelhooks/swarm-tools/commit/1a7b02f707a1490f14465467c6024331d5064878) Thanks [@joelhooks](https://github.com/joelhooks)! - Add PGLite socket server adapter with hybrid daemon management and move streams storage to $TMPDIR.
2074
-
2075
- **Socket Server Adapter:**
2076
-
2077
- - New `createSocketAdapter()` wrapping postgres.js for DatabaseAdapter interface
2078
- - Daemon lifecycle: `startDaemon()`, `stopDaemon()`, `isDaemonRunning()`, `healthCheck()`
2079
- - Auto-start daemon on first use with `SWARM_MAIL_SOCKET=true` env var
2080
- - Graceful fallback to embedded PGLite on failure
2081
- - CLI: `swarm-mail-daemon start|stop|status`
2082
-
2083
- **$TMPDIR Storage (BREAKING):**
2084
-
2085
- - Streams now stored in `$TMPDIR/opencode-<project-name>-<hash>/streams`
2086
- - Eliminates git pollution from `.opencode/streams/`
2087
- - Auto-cleaned on reboot (ephemeral coordination state)
2088
- - New exports: `getProjectTempDirName()`, `hashProjectPath()`
2089
-
2090
- This fixes the multi-agent PGLite corruption issue by having all agents connect to a single pglite-server daemon via PostgreSQL wire protocol.
2091
-
2092
- ### Patch Changes
2093
-
2094
- - Updated dependencies [[`1a7b02f`](https://github.com/joelhooks/swarm-tools/commit/1a7b02f707a1490f14465467c6024331d5064878)]:
2095
- - swarm-mail@0.2.0
2096
-
2097
- ## 0.25.3
2098
-
2099
- ### Patch Changes
2100
-
2101
- - [`7471fd4`](https://github.com/joelhooks/swarm-tools/commit/7471fd43ef9b16b32e503d7cd4bdc5b7a74537e4) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix swarm_complete tool execution failures and remove debug logging
2102
-
2103
- **opencode-swarm-plugin:**
2104
-
2105
- - Fix: Made sendSwarmMessage non-fatal in swarm_complete - failures no longer cause "Tool execution failed" errors
2106
- - Fix: Added message_sent and message_error fields to swarm_complete response for better error visibility
2107
- - Chore: Removed console.log statements from index.ts, swarm-orchestrate.ts, storage.ts, rate-limiter.ts
2108
- - Test: Added integration tests for swarm_complete error handling
2109
-
2110
- **swarm-mail:**
2111
-
2112
- - Chore: Cleaned up debug logging and improved migration handling
2113
-
2114
- - Updated dependencies [[`7471fd4`](https://github.com/joelhooks/swarm-tools/commit/7471fd43ef9b16b32e503d7cd4bdc5b7a74537e4)]:
2115
- - swarm-mail@0.1.4
2116
-
2117
- ## 0.25.2
2118
-
2119
- ### Patch Changes
2120
-
2121
- - [`34a2c3a`](https://github.com/joelhooks/swarm-tools/commit/34a2c3a07f036297db449414ef8dbeb7b39721e2) Thanks [@joelhooks](https://github.com/joelhooks)! - Grant swarm workers autonomy to file beads against the epic
2122
-
2123
- Workers can now create bugs, tech debt, and follow-up tasks linked to their parent epic via `parent_id`. Prompt explicitly encourages workers to file issues rather than silently ignoring them.
2124
-
2125
- ## 0.25.1
2126
-
2127
- ### Patch Changes
2128
-
2129
- - [`757f4a6`](https://github.com/joelhooks/swarm-tools/commit/757f4a690721b3f04a414e4c1694660862504e54) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix skills_update tool - add `content` parameter as primary (with `body` as backwards-compat alias)
2130
-
2131
- The tool was only accepting `body` but users expected `content`. Now both work:
2132
-
2133
- - `skills_update(name="foo", content="new stuff")` - preferred
2134
- - `skills_update(name="foo", body="new stuff")` - still works for backwards compat
2135
-
2136
- - [`3d619ff`](https://github.com/joelhooks/swarm-tools/commit/3d619ffda78b2e6066491f053e8fad8dac7b5b71) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix swarm_complete failing when bead project doesn't match CWD
2137
-
2138
- - Use `project_key` as working directory for `bd close` command
2139
- - Improved error messages with context-specific recovery steps
2140
- - Added planning guardrails to warn when todowrite is used for parallel work (should use swarm)
2141
-
2142
- ## 0.25.0
2143
-
2144
- ### Minor Changes
2145
-
2146
- - [`b70ae35`](https://github.com/joelhooks/swarm-tools/commit/b70ae352876515bdfe68511d72bb472c85b7fdfc) Thanks [@joelhooks](https://github.com/joelhooks)! - Add Socratic planning phase and improved worker prompts to swarm setup
2147
-
2148
- **SWARM_COMMAND template:**
2149
-
2150
- - Added Phase 0: Socratic Planning - asks clarifying questions before decomposing
2151
- - Supports `--fast`, `--auto`, `--confirm-only` flags to skip questions
2152
- - ONE question at a time with concrete options and recommendations
2153
-
2154
- **Worker agent template:**
2155
-
2156
- - Reinforces the 9-step survival checklist from SUBTASK_PROMPT_V2
2157
- - Explicitly lists all steps with emphasis on non-negotiables
2158
- - Explains WHY skipping steps causes problems (lost work, conflicts, etc.)
2159
-
2160
- **Agent path consolidation:**
2161
-
2162
- - Now creates nested paths: `~/.config/opencode/agent/swarm/worker.md`
2163
- - Matches `Task(subagent_type="swarm/worker")` format
2164
- - Cleans up legacy flat files (`swarm-worker.md`) on reinstall
2165
-
2166
- To get the new prompts, run `swarm setup` and choose "Reinstall everything".
2167
-
2168
- ## 0.24.0
2169
-
2170
- ### Minor Changes
2171
-
2172
- - [`434f48f`](https://github.com/joelhooks/swarm-tools/commit/434f48f207c3509f6b924caeb47cd6e019dcc0e1) Thanks [@joelhooks](https://github.com/joelhooks)! - Add worker survival checklist and Socratic planning for swarm coordination
2173
-
2174
- **Worker Survival Checklist (9-step mandatory flow):**
2175
-
2176
- - Workers now follow a strict initialization sequence: swarmmail_init → semantic-memory_find → skills_use → swarmmail_reserve
2177
- - Workers reserve their own files (coordinators no longer reserve on behalf of workers)
2178
- - Auto-checkpoint at 25/50/75% progress milestones
2179
- - Workers store learnings via semantic-memory before completing
2180
-
2181
- **Socratic Planning:**
2182
-
2183
- - New `swarm_plan_interactive` tool with 4 modes: socratic (default), fast, auto, confirm-only
2184
- - Default mode asks clarifying questions before decomposition
2185
- - Escape hatches for experienced users: `--fast`, `--auto`, `--confirm-only` flags on /swarm command
2186
-
2187
- **Updated Skills:**
2188
-
2189
- - swarm-coordination skill now documents worker survival patterns and coordinator rules
2190
-
2191
- ### Patch Changes
2192
-
2193
- - [#15](https://github.com/joelhooks/swarm-tools/pull/15) [`299f2d3`](https://github.com/joelhooks/swarm-tools/commit/299f2d3305796bcb411f9b90715cda3513d17b54) Thanks [@tayiorbeii](https://github.com/tayiorbeii)! - Sync bundled skills into the global skills directory during `swarm setup` reinstall, fix bundled-skill path resolution, and make AGENTS.md skill-awareness updates work without relying on `opencode run`.
2194
-
2195
- ## 0.23.6
2196
-
2197
- ### Patch Changes
2198
-
2199
- - Updated dependencies [[`22befbf`](https://github.com/joelhooks/opencode-swarm-plugin/commit/22befbfa120a37a585cfec0709597172efda92a4)]:
2200
- - swarm-mail@0.1.3
2201
-
2202
- ## 0.23.5
2203
-
2204
- ### Patch Changes
2205
-
2206
- - [`3826c6d`](https://github.com/joelhooks/opencode-swarm-plugin/commit/3826c6d887f937ccb201b7c4322cbc7b46823658) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix workspace:\* resolution by running bun install before pack
2207
-
2208
- The lockfile was stale, causing bun pack to resolve workspace:\* to old versions.
2209
- Now runs bun install first to ensure lockfile matches current package.json versions.
2210
-
2211
- ## 0.23.4
2212
-
2213
- ### Patch Changes
2214
-
2215
- - Updated dependencies [[`2d0fe9f`](https://github.com/joelhooks/opencode-swarm-plugin/commit/2d0fe9fc6278874ea6c4a92f0395cbdd11c4e994)]:
2216
- - swarm-mail@0.1.2
2217
-
2218
- ## 0.23.3
2219
-
2220
- ### Patch Changes
2221
-
2222
- - [`9c4e4f9`](https://github.com/joelhooks/opencode-swarm-plugin/commit/9c4e4f9511672ab8598c7202850c87acf1bfd4b7) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix swarm-mail package to include dist folder
2223
-
2224
- - Add files field to swarm-mail package.json to explicitly include dist/
2225
- - Previous publish was missing build output, causing "Cannot find module" errors
2226
-
2227
- - Updated dependencies [[`9c4e4f9`](https://github.com/joelhooks/opencode-swarm-plugin/commit/9c4e4f9511672ab8598c7202850c87acf1bfd4b7)]:
2228
- - swarm-mail@0.1.1
2229
-
2230
- ## 0.23.2
2231
-
2232
- ### Patch Changes
2233
-
2234
- - [`7f9ead6`](https://github.com/joelhooks/opencode-swarm-plugin/commit/7f9ead65dab1dd5dc9aff57df0871cc390556fe1) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix workspace:\* protocol resolution using bun pack + npm publish
2235
-
2236
- Uses bun pack to create tarball (which resolves workspace:\* to actual versions) then npm publish for OIDC trusted publisher support.
2237
-
2238
- ## 0.23.1
2239
-
2240
- ### Patch Changes
2241
-
2242
- - [`64ad0e4`](https://github.com/joelhooks/opencode-swarm-plugin/commit/64ad0e4fc033597027e3b0614865cfbf955b5983) Thanks [@joelhooks](https://github.com/joelhooks)! - Fix workspace:\* protocol resolution in npm publish
2243
-
2244
- Use bun publish instead of npm publish to properly resolve workspace:\* protocols to actual versions.
2245
-
2246
- ## 0.23.0
2247
-
2248
- ### Minor Changes
2249
-
2250
- - [`b66d77e`](https://github.com/joelhooks/opencode-swarm-plugin/commit/b66d77e484e9b7021b3264d1a7e8f54a16ea5204) Thanks [@joelhooks](https://github.com/joelhooks)! - Add changesets workflow and semantic memory test isolation
2251
-
2252
- - OIDC publish workflow with GitHub Actions
2253
- - Changesets for independent package versioning
2254
- - TEST_SEMANTIC_MEMORY_COLLECTION env var for test isolation
2255
- - Prevents test pollution of production semantic-memory