opencode-swarm-plugin 0.44.0 → 0.44.2

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 (215) hide show
  1. package/bin/swarm.serve.test.ts +6 -4
  2. package/bin/swarm.ts +18 -12
  3. package/dist/compaction-prompt-scoring.js +139 -0
  4. package/dist/eval-capture.js +12811 -0
  5. package/dist/hive.d.ts.map +1 -1
  6. package/dist/hive.js +14834 -0
  7. package/dist/index.d.ts +18 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +7743 -62593
  10. package/dist/plugin.js +24052 -78907
  11. package/dist/swarm-orchestrate.d.ts.map +1 -1
  12. package/dist/swarm-prompts.d.ts.map +1 -1
  13. package/dist/swarm-prompts.js +39407 -0
  14. package/dist/swarm-review.d.ts.map +1 -1
  15. package/dist/swarm-validation.d.ts +127 -0
  16. package/dist/swarm-validation.d.ts.map +1 -0
  17. package/dist/validators/index.d.ts +7 -0
  18. package/dist/validators/index.d.ts.map +1 -0
  19. package/dist/validators/schema-validator.d.ts +58 -0
  20. package/dist/validators/schema-validator.d.ts.map +1 -0
  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 -2286
  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/ADR-010-cass-inhousing.md +0 -1215
  43. package/docs/planning/ROADMAP.md +0 -368
  44. package/docs/semantic-memory-cli-syntax.md +0 -123
  45. package/docs/swarm-mail-architecture.md +0 -1147
  46. package/docs/testing/context-recovery-test.md +0 -470
  47. package/evals/ARCHITECTURE.md +0 -1189
  48. package/evals/README.md +0 -768
  49. package/evals/compaction-prompt.eval.ts +0 -149
  50. package/evals/compaction-resumption.eval.ts +0 -289
  51. package/evals/coordinator-behavior.eval.ts +0 -307
  52. package/evals/coordinator-session.eval.ts +0 -154
  53. package/evals/evalite.config.ts.bak +0 -15
  54. package/evals/example.eval.ts +0 -31
  55. package/evals/fixtures/cass-baseline.ts +0 -217
  56. package/evals/fixtures/compaction-cases.ts +0 -350
  57. package/evals/fixtures/compaction-prompt-cases.ts +0 -311
  58. package/evals/fixtures/coordinator-sessions.ts +0 -328
  59. package/evals/fixtures/decomposition-cases.ts +0 -105
  60. package/evals/lib/compaction-loader.test.ts +0 -248
  61. package/evals/lib/compaction-loader.ts +0 -320
  62. package/evals/lib/data-loader.evalite-test.ts +0 -289
  63. package/evals/lib/data-loader.test.ts +0 -345
  64. package/evals/lib/data-loader.ts +0 -281
  65. package/evals/lib/llm.ts +0 -115
  66. package/evals/scorers/compaction-prompt-scorers.ts +0 -145
  67. package/evals/scorers/compaction-scorers.ts +0 -305
  68. package/evals/scorers/coordinator-discipline.evalite-test.ts +0 -539
  69. package/evals/scorers/coordinator-discipline.ts +0 -325
  70. package/evals/scorers/index.test.ts +0 -146
  71. package/evals/scorers/index.ts +0 -328
  72. package/evals/scorers/outcome-scorers.evalite-test.ts +0 -27
  73. package/evals/scorers/outcome-scorers.ts +0 -349
  74. package/evals/swarm-decomposition.eval.ts +0 -121
  75. package/examples/commands/swarm.md +0 -745
  76. package/examples/plugin-wrapper-template.ts +0 -2515
  77. package/examples/skills/hive-workflow/SKILL.md +0 -212
  78. package/examples/skills/skill-creator/SKILL.md +0 -223
  79. package/examples/skills/swarm-coordination/SKILL.md +0 -292
  80. package/global-skills/cli-builder/SKILL.md +0 -344
  81. package/global-skills/cli-builder/references/advanced-patterns.md +0 -244
  82. package/global-skills/learning-systems/SKILL.md +0 -644
  83. package/global-skills/skill-creator/LICENSE.txt +0 -202
  84. package/global-skills/skill-creator/SKILL.md +0 -352
  85. package/global-skills/skill-creator/references/output-patterns.md +0 -82
  86. package/global-skills/skill-creator/references/workflows.md +0 -28
  87. package/global-skills/swarm-coordination/SKILL.md +0 -995
  88. package/global-skills/swarm-coordination/references/coordinator-patterns.md +0 -235
  89. package/global-skills/swarm-coordination/references/strategies.md +0 -138
  90. package/global-skills/system-design/SKILL.md +0 -213
  91. package/global-skills/testing-patterns/SKILL.md +0 -430
  92. package/global-skills/testing-patterns/references/dependency-breaking-catalog.md +0 -586
  93. package/opencode-swarm-plugin-0.30.7.tgz +0 -0
  94. package/opencode-swarm-plugin-0.31.0.tgz +0 -0
  95. package/scripts/cleanup-test-memories.ts +0 -346
  96. package/scripts/init-skill.ts +0 -222
  97. package/scripts/migrate-unknown-sessions.ts +0 -349
  98. package/scripts/validate-skill.ts +0 -204
  99. package/src/agent-mail.ts +0 -1724
  100. package/src/anti-patterns.test.ts +0 -1167
  101. package/src/anti-patterns.ts +0 -448
  102. package/src/compaction-capture.integration.test.ts +0 -257
  103. package/src/compaction-hook.test.ts +0 -838
  104. package/src/compaction-hook.ts +0 -1204
  105. package/src/compaction-observability.integration.test.ts +0 -139
  106. package/src/compaction-observability.test.ts +0 -187
  107. package/src/compaction-observability.ts +0 -324
  108. package/src/compaction-prompt-scorers.test.ts +0 -475
  109. package/src/compaction-prompt-scoring.ts +0 -300
  110. package/src/contributor-tools.test.ts +0 -133
  111. package/src/contributor-tools.ts +0 -201
  112. package/src/dashboard.test.ts +0 -611
  113. package/src/dashboard.ts +0 -462
  114. package/src/error-enrichment.test.ts +0 -403
  115. package/src/error-enrichment.ts +0 -219
  116. package/src/eval-capture.test.ts +0 -1015
  117. package/src/eval-capture.ts +0 -929
  118. package/src/eval-gates.test.ts +0 -306
  119. package/src/eval-gates.ts +0 -218
  120. package/src/eval-history.test.ts +0 -508
  121. package/src/eval-history.ts +0 -214
  122. package/src/eval-learning.test.ts +0 -378
  123. package/src/eval-learning.ts +0 -360
  124. package/src/eval-runner.test.ts +0 -223
  125. package/src/eval-runner.ts +0 -402
  126. package/src/export-tools.test.ts +0 -476
  127. package/src/export-tools.ts +0 -257
  128. package/src/hive.integration.test.ts +0 -2241
  129. package/src/hive.ts +0 -1628
  130. package/src/index.ts +0 -940
  131. package/src/learning.integration.test.ts +0 -1815
  132. package/src/learning.ts +0 -1079
  133. package/src/logger.test.ts +0 -189
  134. package/src/logger.ts +0 -135
  135. package/src/mandate-promotion.test.ts +0 -473
  136. package/src/mandate-promotion.ts +0 -239
  137. package/src/mandate-storage.integration.test.ts +0 -601
  138. package/src/mandate-storage.test.ts +0 -578
  139. package/src/mandate-storage.ts +0 -794
  140. package/src/mandates.ts +0 -540
  141. package/src/memory-tools.test.ts +0 -195
  142. package/src/memory-tools.ts +0 -344
  143. package/src/memory.integration.test.ts +0 -334
  144. package/src/memory.test.ts +0 -158
  145. package/src/memory.ts +0 -527
  146. package/src/model-selection.test.ts +0 -188
  147. package/src/model-selection.ts +0 -68
  148. package/src/observability-tools.test.ts +0 -359
  149. package/src/observability-tools.ts +0 -871
  150. package/src/output-guardrails.test.ts +0 -438
  151. package/src/output-guardrails.ts +0 -381
  152. package/src/pattern-maturity.test.ts +0 -1160
  153. package/src/pattern-maturity.ts +0 -525
  154. package/src/planning-guardrails.test.ts +0 -491
  155. package/src/planning-guardrails.ts +0 -438
  156. package/src/plugin.ts +0 -23
  157. package/src/post-compaction-tracker.test.ts +0 -251
  158. package/src/post-compaction-tracker.ts +0 -237
  159. package/src/query-tools.test.ts +0 -636
  160. package/src/query-tools.ts +0 -324
  161. package/src/rate-limiter.integration.test.ts +0 -466
  162. package/src/rate-limiter.ts +0 -774
  163. package/src/replay-tools.test.ts +0 -496
  164. package/src/replay-tools.ts +0 -240
  165. package/src/repo-crawl.integration.test.ts +0 -441
  166. package/src/repo-crawl.ts +0 -610
  167. package/src/schemas/cell-events.test.ts +0 -347
  168. package/src/schemas/cell-events.ts +0 -807
  169. package/src/schemas/cell.ts +0 -257
  170. package/src/schemas/evaluation.ts +0 -166
  171. package/src/schemas/index.test.ts +0 -199
  172. package/src/schemas/index.ts +0 -286
  173. package/src/schemas/mandate.ts +0 -232
  174. package/src/schemas/swarm-context.ts +0 -115
  175. package/src/schemas/task.ts +0 -161
  176. package/src/schemas/worker-handoff.test.ts +0 -302
  177. package/src/schemas/worker-handoff.ts +0 -131
  178. package/src/sessions/agent-discovery.test.ts +0 -137
  179. package/src/sessions/agent-discovery.ts +0 -112
  180. package/src/sessions/index.ts +0 -15
  181. package/src/skills.integration.test.ts +0 -1192
  182. package/src/skills.test.ts +0 -643
  183. package/src/skills.ts +0 -1549
  184. package/src/storage.integration.test.ts +0 -341
  185. package/src/storage.ts +0 -884
  186. package/src/structured.integration.test.ts +0 -817
  187. package/src/structured.test.ts +0 -1046
  188. package/src/structured.ts +0 -762
  189. package/src/swarm-decompose.test.ts +0 -188
  190. package/src/swarm-decompose.ts +0 -1302
  191. package/src/swarm-deferred.integration.test.ts +0 -157
  192. package/src/swarm-deferred.test.ts +0 -38
  193. package/src/swarm-insights.test.ts +0 -214
  194. package/src/swarm-insights.ts +0 -459
  195. package/src/swarm-mail.integration.test.ts +0 -970
  196. package/src/swarm-mail.ts +0 -739
  197. package/src/swarm-orchestrate.integration.test.ts +0 -282
  198. package/src/swarm-orchestrate.test.ts +0 -548
  199. package/src/swarm-orchestrate.ts +0 -3084
  200. package/src/swarm-prompts.test.ts +0 -1270
  201. package/src/swarm-prompts.ts +0 -2077
  202. package/src/swarm-research.integration.test.ts +0 -701
  203. package/src/swarm-research.test.ts +0 -698
  204. package/src/swarm-research.ts +0 -472
  205. package/src/swarm-review.integration.test.ts +0 -285
  206. package/src/swarm-review.test.ts +0 -879
  207. package/src/swarm-review.ts +0 -709
  208. package/src/swarm-strategies.ts +0 -407
  209. package/src/swarm-worktree.test.ts +0 -501
  210. package/src/swarm-worktree.ts +0 -575
  211. package/src/swarm.integration.test.ts +0 -2377
  212. package/src/swarm.ts +0 -38
  213. package/src/tool-adapter.integration.test.ts +0 -1221
  214. package/src/tool-availability.ts +0 -461
  215. package/tsconfig.json +0 -28
@@ -1,217 +0,0 @@
1
- /**
2
- * CASS Baseline Response Fixtures
3
- *
4
- * These fixtures capture the ACTUAL behavior of the CASS binary tools.
5
- * DO NOT modify to match desired behavior - these document what the binary DOES.
6
- *
7
- * Purpose: Characterization tests for ADR-010 (CASS inhousing).
8
- * These ensure our inhouse implementation matches the binary's behavior.
9
- */
10
-
11
- /**
12
- * cass stats --json
13
- * Captured: 2025-12-25
14
- */
15
- export const cassStatsBaseline = {
16
- by_agent: [
17
- {
18
- agent: "claude_code",
19
- count: 137,
20
- },
21
- {
22
- agent: "cursor",
23
- count: 23,
24
- },
25
- {
26
- agent: "codex",
27
- count: 2,
28
- },
29
- ],
30
- conversations: 162,
31
- date_range: {
32
- newest: "2025-12-08T04:20:36.526+00:00",
33
- oldest: "2025-07-14T01:14:44.997+00:00",
34
- },
35
- db_path:
36
- "/Users/joel/Library/Application Support/com.coding-agent-search.coding-agent-search/agent_search.db",
37
- messages: 4213,
38
- top_workspaces: [
39
- {
40
- count: 28,
41
- workspace:
42
- "/Users/joel/Code/vercel/academy-vectr-workflow-course-content/external/workflow-builder-starter",
43
- },
44
- {
45
- count: 22,
46
- workspace: "/Users/joel/Code/vercel/slack-agents-course",
47
- },
48
- ],
49
- } as const;
50
-
51
- /**
52
- * cass search "swarm" --limit 2 --json
53
- * Captured: 2025-12-25
54
- */
55
- export const cassSearchBaseline = {
56
- count: 2,
57
- cursor: null,
58
- hits: [
59
- {
60
- agent: "claude_code",
61
- content:
62
- 'Fixed. The `plugins` key is invalid - OpenCode auto-loads plugins from directories instead.\n\n**Changes:**\n1. ✅ Removed invalid `plugins` array from `opencode.jsonc`\n2. ✅ Created `~/.config/opencode/plugin/` directory\n3. ✅ Symlinked your swarm plugin → `~/.config/opencode/plugin/swarm.js`\n\nThe plugin will now auto-load on startup. Restart OpenCode to pick it up.\n\nSources:\n- [OpenCode Plugins Documentation](https://opencode.ai/docs/plugins/)\n- [OpenCode Config Documentation](https://opencode.ai/docs/config/)',
63
- created_at: 1765161767083,
64
- line_number: 9,
65
- match_type: "exact",
66
- score: 15.536974906921387,
67
- snippet:
68
- "Symlinked your swarm plugin → `~/.config/opencode/plugin/swarm.js`\n\nThe plugin will now auto-load on startup. Restart OpenCode to pick it up.\n\nSources:\n- [OpenC…",
69
- source_path:
70
- "/Users/joel/.claude/projects/-Users-joel--config-opencode/ccd64ac6-bca7-40e5-9150-cea58c3788ae.jsonl",
71
- title:
72
- "@opencode.jsonc has an invalid plugins key https://opencode.ai/docs/plugins/ https://opencode.ai/doc",
73
- workspace: "/Users/joel/.config/opencode",
74
- },
75
- {
76
- agent: "claude_code",
77
- content:
78
- "I'm ready to help you explore the codebase and design implementation plans. I'm in **READ-ONLY mode** - I can explore files, understand architecture, and create detailed plans, but I cannot and will not modify any files.\n\nI have access to the beads issue tracker (`bd` commands) and can see your current working directory is `/Users/joel/.config/opencode`.\n\n**Current git status shows:**\n- Modified: `.beads/issues.jsonl`, `AGENTS.md`, `command/swarm.md`, `opencode.jsonc`\n- Untracked: `command/swarm-collect.md`, `command/swarm-status.md`, `plugin/`\n\n**What would you like me to explore and plan?**\n\nCommon scenarios I can help with:\n- Designing new command implementations\n- Planning plugin architecture\n- Exploring existing patterns for feature additions\n- Creating implementation strategies for beads issues\n\nLet me know what you need, and I'll dive into the codebase, understand the current architecture, and provide a detailed implementation plan.",
79
- created_at: 1765161814722,
80
- line_number: 1,
81
- match_type: "exact",
82
- score: 14.522254943847656,
83
- snippet:
84
- ".md`, `command/swarm.md`, `opencode.jsonc`\n- Untracked: `command/swarm-collect.md`, `command/swarm-status.md`, `plugin/`\n\n**What would you like me to explore an…",
85
- source_path:
86
- "/Users/joel/.claude/projects/-Users-joel--config-opencode/agent-ee2a73ee.jsonl",
87
- title: "opencode",
88
- workspace: "/Users/joel/.config/opencode",
89
- },
90
- ],
91
- hits_clamped: false,
92
- limit: 2,
93
- max_tokens: null,
94
- offset: 0,
95
- query: "swarm",
96
- request_id: null,
97
- total_matches: 2,
98
- } as const;
99
-
100
- /**
101
- * cass health (human-readable output)
102
- * Captured: 2025-12-25
103
- */
104
- export const cassHealthHumanBaseline = `✓ Healthy (3ms)
105
- Note: index stale (older than 300s)`;
106
-
107
- /**
108
- * cass stats (human-readable output)
109
- * Captured: 2025-12-25
110
- */
111
- export const cassStatsHumanBaseline = `CASS Index Statistics
112
- =====================
113
- Database: /Users/joel/Library/Application Support/com.coding-agent-search.coding-agent-search/agent_search.db
114
-
115
- Totals:
116
- Conversations: 162
117
- Messages: 4213
118
-
119
- By Agent:
120
- claude_code: 137
121
- cursor: 23
122
- codex: 2
123
-
124
- Top Workspaces:
125
- /Users/joel/Code/vercel/academy-vectr-workflow-course-content/external/workflow-builder-starter: 28
126
- /Users/joel/Code/vercel/slack-agents-course: 22
127
- /Users/joel/Code/vercel/academy-vectr-workflow-course-content: 22
128
- /Users/joel/Code/vercel/academy-content: 13
129
- /Users/joel/Code/joelhooks/trt-buddy: 13
130
- /Users/joel/Code/vercel/front: 11
131
- /Users/joel/.config/opencode: 9
132
- /Users/joel: 6
133
- /Users/joel/Code/badass-courses/course-builder/apps/ai-hero: 5
134
- /Users/joel/Code/vercel/front/apps/vercel-academy: 4
135
-
136
- Date Range: 2025-07-14 to 2025-12-08`;
137
-
138
- /**
139
- * cass view <file> -n <line>
140
- * Captured: 2025-12-25
141
- *
142
- * Format: File path header, line indicator with context window, separator, content with line numbers
143
- */
144
- export const cassViewBaseline = `File: /Users/joel/.config/swarm-tools/sessions/ses_19yz2iaMpHxY1ddvVq2voC.jsonl
145
- Line: 1 (context: 5)
146
- ----------------------------------------
147
- > 1 | {"session_id":"ses_19yz2iaMpHxY1ddvVq2voC","epic_id":"cell-f2p61v-mjko4d89zdt","timestamp":"2025-12-24T23:51:52.896Z","event_type":"OUTCOME","outcome_type":"subtask_success","payload":{"bead_id":"cell-f2p61v-mjko4d89zdt","duration_ms":0,"files_touched":[],"verification_passed":false,"verification_skipped":true}}
148
- ----------------------------------------`;
149
-
150
- /**
151
- * Error responses (captured from actual failures)
152
- */
153
- export const cassErrorBaseline = {
154
- fileNotFound: {
155
- error: {
156
- code: 3,
157
- hint: null,
158
- kind: "file-not-found",
159
- message:
160
- "File not found: /Users/joel/.config/swarm-tools/sessions/ses_fRrFb7WrNr9K89JBCKd6GV.jsonl",
161
- retryable: false,
162
- },
163
- },
164
- invalidArgument: {
165
- error: {
166
- code: 2,
167
- hint: {
168
- common_mistakes: [
169
- {
170
- correct: "cass robot-docs",
171
- wrong: "cass --robot-docs",
172
- },
173
- {
174
- correct: "cass robot-docs commands",
175
- wrong: "cass --robot-docs=commands",
176
- },
177
- {
178
- correct: "cass robot-docs",
179
- wrong: "cass robot-docs --robot",
180
- },
181
- ],
182
- error:
183
- "error: unexpected argument '--robot' found\\n\\nUsage: cass stats [OPTIONS]\\n\\nFor more information, try '--help'.\\n",
184
- examples: [
185
- "cass robot-docs commands",
186
- "cass robot-docs schemas",
187
- "cass robot-docs examples",
188
- "cass --robot-help",
189
- ],
190
- flag_syntax: {
191
- correct: ["--limit 5", "--robot", "--json"],
192
- incorrect: ["-limit 5", "limit=5", "--Limit"],
193
- },
194
- hints: [
195
- "For get robot-mode documentation, try: cass --robot-help",
196
- ],
197
- kind: "argument_parsing",
198
- status: "error",
199
- },
200
- kind: "usage",
201
- message: "Could not parse arguments",
202
- retryable: false,
203
- },
204
- },
205
- } as const;
206
-
207
- /**
208
- * Schema definitions extracted from actual responses
209
- */
210
- export type CassStatsResponse = typeof cassStatsBaseline;
211
- export type CassSearchResponse = typeof cassSearchBaseline;
212
- export type CassSearchHit = CassSearchResponse["hits"][number];
213
- export type CassAgentStats = CassStatsResponse["by_agent"][number];
214
- export type CassWorkspaceStats = CassStatsResponse["top_workspaces"][number];
215
- export type CassError =
216
- | typeof cassErrorBaseline.fileNotFound
217
- | typeof cassErrorBaseline.invalidArgument;
@@ -1,350 +0,0 @@
1
- /**
2
- * Test cases for compaction hook coordinator resumption
3
- *
4
- * Each case simulates a different swarm state and verifies that
5
- * the compaction hook injects the correct context for resumption.
6
- */
7
-
8
- import type { Cell } from "swarm-mail";
9
-
10
- /**
11
- * Compaction test case structure
12
- */
13
- export interface CompactionTestCase {
14
- name: string;
15
- description: string;
16
- /**
17
- * Simulated hive state (cells to create)
18
- */
19
- hiveCells: Array<Omit<Cell, "created_at" | "updated_at" | "closed_at">>;
20
- /**
21
- * Simulated swarm-mail state
22
- */
23
- swarmMailState: {
24
- agents: number;
25
- reservations: number;
26
- messages: number;
27
- };
28
- /**
29
- * Expected detection confidence
30
- */
31
- expected: {
32
- confidence: "high" | "medium" | "low" | "none";
33
- contextInjected: boolean;
34
- contextType: "full" | "fallback" | "none";
35
- /**
36
- * Patterns that MUST appear in injected context (if injected)
37
- */
38
- mustContain?: string[];
39
- /**
40
- * Patterns that MUST NOT appear
41
- */
42
- mustNotContain?: string[];
43
- };
44
- }
45
-
46
- export const compactionCases: CompactionTestCase[] = [
47
- // ============================================================================
48
- // HIGH CONFIDENCE: Active swarm with in_progress epic
49
- // ============================================================================
50
- {
51
- name: "Active swarm with in_progress epic",
52
- description:
53
- "Compaction happens mid-swarm with an active epic and subtasks. Should inject full context with specific epic ID.",
54
- hiveCells: [
55
- {
56
- id: "test-project-lf2p4u-epic123",
57
- project_key: "/test/project",
58
- type: "epic",
59
- status: "in_progress",
60
- title: "Add user authentication",
61
- description: "Implement OAuth with NextAuth.js",
62
- priority: 2,
63
- parent_id: null,
64
- assignee: "coordinator",
65
- closed_reason: null,
66
- deleted_at: null,
67
- deleted_by: null,
68
- delete_reason: null,
69
- created_by: "coordinator",
70
- },
71
- {
72
- id: "test-project-lf2p4u-epic123.1",
73
- project_key: "/test/project",
74
- type: "task",
75
- status: "closed",
76
- title: "OAuth provider config",
77
- description: "Configure GitHub OAuth provider",
78
- priority: 2,
79
- parent_id: "test-project-lf2p4u-epic123",
80
- assignee: "BlueLake",
81
- closed_reason: "Done: configured GitHub provider",
82
- deleted_at: null,
83
- deleted_by: null,
84
- delete_reason: null,
85
- created_by: "coordinator",
86
- },
87
- {
88
- id: "test-project-lf2p4u-epic123.2",
89
- project_key: "/test/project",
90
- type: "task",
91
- status: "in_progress",
92
- title: "Auth middleware",
93
- description: "Create middleware for protecting routes",
94
- priority: 2,
95
- parent_id: "test-project-lf2p4u-epic123",
96
- assignee: "RedMountain",
97
- closed_reason: null,
98
- deleted_at: null,
99
- deleted_by: null,
100
- delete_reason: null,
101
- created_by: "coordinator",
102
- },
103
- {
104
- id: "test-project-lf2p4u-epic123.3",
105
- project_key: "/test/project",
106
- type: "task",
107
- status: "open",
108
- title: "Session management",
109
- description: "Implement session persistence with Redis",
110
- priority: 2,
111
- parent_id: "test-project-lf2p4u-epic123",
112
- assignee: null,
113
- closed_reason: null,
114
- deleted_at: null,
115
- deleted_by: null,
116
- delete_reason: null,
117
- created_by: "coordinator",
118
- },
119
- ],
120
- swarmMailState: {
121
- agents: 2,
122
- reservations: 1,
123
- messages: 5,
124
- },
125
- expected: {
126
- confidence: "high",
127
- contextInjected: true,
128
- contextType: "full",
129
- mustContain: [
130
- "SWARM ACTIVE",
131
- "COORDINATOR",
132
- "swarm_status",
133
- "swarmmail_inbox",
134
- "Keep Cooking",
135
- ],
136
- mustNotContain: [
137
- "bd-xxx", // Should NOT contain placeholder IDs
138
- "Check Your Context", // Should NOT be fallback detection
139
- ],
140
- },
141
- },
142
-
143
- // ============================================================================
144
- // MEDIUM CONFIDENCE: Multiple epics, need to identify active one
145
- // ============================================================================
146
- {
147
- name: "Multiple epics with one in_progress",
148
- description:
149
- "Multiple epics exist, but only one is in_progress. Should detect and inject context for the active one.",
150
- hiveCells: [
151
- {
152
- id: "test-project-lf2p4u-epic100",
153
- project_key: "/test/project",
154
- type: "epic",
155
- status: "closed",
156
- title: "Refactor auth system",
157
- description: "Old completed epic",
158
- priority: 2,
159
- parent_id: null,
160
- assignee: null,
161
- closed_reason: "Done",
162
- deleted_at: null,
163
- deleted_by: null,
164
- delete_reason: null,
165
- created_by: "coordinator",
166
- },
167
- {
168
- id: "test-project-lf2p4u-epic200",
169
- project_key: "/test/project",
170
- type: "epic",
171
- status: "in_progress",
172
- title: "Add rate limiting",
173
- description: "Implement Redis-based rate limiting",
174
- priority: 2,
175
- parent_id: null,
176
- assignee: "coordinator",
177
- closed_reason: null,
178
- deleted_at: null,
179
- deleted_by: null,
180
- delete_reason: null,
181
- created_by: "coordinator",
182
- },
183
- {
184
- id: "test-project-lf2p4u-epic200.1",
185
- project_key: "/test/project",
186
- type: "task",
187
- status: "open",
188
- title: "Rate limit middleware",
189
- description: "Create Express middleware",
190
- priority: 2,
191
- parent_id: "test-project-lf2p4u-epic200",
192
- assignee: null,
193
- closed_reason: null,
194
- deleted_at: null,
195
- deleted_by: null,
196
- delete_reason: null,
197
- created_by: "coordinator",
198
- },
199
- {
200
- id: "test-project-lf2p4u-epic300",
201
- project_key: "/test/project",
202
- type: "epic",
203
- status: "open",
204
- title: "Future epic",
205
- description: "Not started yet",
206
- priority: 1,
207
- parent_id: null,
208
- assignee: null,
209
- closed_reason: null,
210
- deleted_at: null,
211
- deleted_by: null,
212
- delete_reason: null,
213
- created_by: "coordinator",
214
- },
215
- ],
216
- swarmMailState: {
217
- agents: 1,
218
- reservations: 0,
219
- messages: 2,
220
- },
221
- expected: {
222
- confidence: "medium",
223
- contextInjected: true,
224
- contextType: "full",
225
- mustContain: ["SWARM ACTIVE", "COORDINATOR"],
226
- mustNotContain: ["bd-xxx"],
227
- },
228
- },
229
-
230
- // ============================================================================
231
- // LOW CONFIDENCE: Cells exist but no active work
232
- // ============================================================================
233
- {
234
- name: "Cells exist but no active swarm",
235
- description:
236
- "Hive has some cells but no in_progress work. Should inject fallback detection prompt.",
237
- hiveCells: [
238
- {
239
- id: "test-project-lf2p4u-task001",
240
- project_key: "/test/project",
241
- type: "task",
242
- status: "open",
243
- title: "Fix typo in README",
244
- description: null,
245
- priority: 0,
246
- parent_id: null,
247
- assignee: null,
248
- closed_reason: null,
249
- deleted_at: null,
250
- deleted_by: null,
251
- delete_reason: null,
252
- created_by: null,
253
- },
254
- ],
255
- swarmMailState: {
256
- agents: 0,
257
- reservations: 0,
258
- messages: 0,
259
- },
260
- expected: {
261
- confidence: "low",
262
- contextInjected: true,
263
- contextType: "fallback",
264
- mustContain: [
265
- "Swarm Detection",
266
- "Check Your Context",
267
- "swarm_decompose",
268
- "swarmmail_init",
269
- ],
270
- mustNotContain: ["SWARM ACTIVE", "COORDINATOR"],
271
- },
272
- },
273
-
274
- // ============================================================================
275
- // NONE: Empty hive, no swarm activity
276
- // ============================================================================
277
- {
278
- name: "Empty hive - no swarm activity",
279
- description:
280
- "No cells, no swarm-mail activity. Should NOT inject any context.",
281
- hiveCells: [],
282
- swarmMailState: {
283
- agents: 0,
284
- reservations: 0,
285
- messages: 0,
286
- },
287
- expected: {
288
- confidence: "none",
289
- contextInjected: false,
290
- contextType: "none",
291
- mustContain: [],
292
- mustNotContain: ["SWARM", "COORDINATOR", "swarm_status"],
293
- },
294
- },
295
-
296
- // ============================================================================
297
- // EDGE CASE: Blocked epic (should still detect as active swarm)
298
- // ============================================================================
299
- {
300
- name: "Blocked epic with subtasks",
301
- description:
302
- "Epic is blocked but has in_progress subtasks. Should detect as active swarm.",
303
- hiveCells: [
304
- {
305
- id: "test-project-lf2p4u-epic400",
306
- project_key: "/test/project",
307
- type: "epic",
308
- status: "blocked",
309
- title: "Migration to TypeScript",
310
- description: "Full codebase migration",
311
- priority: 3,
312
- parent_id: null,
313
- assignee: "coordinator",
314
- closed_reason: null,
315
- deleted_at: null,
316
- deleted_by: null,
317
- delete_reason: null,
318
- created_by: "coordinator",
319
- },
320
- {
321
- id: "test-project-lf2p4u-epic400.1",
322
- project_key: "/test/project",
323
- type: "task",
324
- status: "in_progress",
325
- title: "Migrate utils",
326
- description: "Convert utils to TypeScript",
327
- priority: 2,
328
- parent_id: "test-project-lf2p4u-epic400",
329
- assignee: "GreenValley",
330
- closed_reason: null,
331
- deleted_at: null,
332
- deleted_by: null,
333
- delete_reason: null,
334
- created_by: "coordinator",
335
- },
336
- ],
337
- swarmMailState: {
338
- agents: 1,
339
- reservations: 1,
340
- messages: 3,
341
- },
342
- expected: {
343
- confidence: "high",
344
- contextInjected: true,
345
- contextType: "full",
346
- mustContain: ["SWARM ACTIVE", "COORDINATOR"],
347
- mustNotContain: ["bd-xxx"],
348
- },
349
- },
350
- ];