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.
- package/bin/swarm.serve.test.ts +6 -4
- package/bin/swarm.ts +18 -12
- package/dist/compaction-prompt-scoring.js +139 -0
- package/dist/eval-capture.js +12811 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +14834 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7743 -62593
- package/dist/plugin.js +24052 -78907
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +39407 -0
- package/dist/swarm-review.d.ts.map +1 -1
- package/dist/swarm-validation.d.ts +127 -0
- package/dist/swarm-validation.d.ts.map +1 -0
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/schema-validator.d.ts +58 -0
- package/dist/validators/schema-validator.d.ts.map +1 -0
- package/package.json +17 -5
- package/.changeset/swarm-insights-data-layer.md +0 -63
- package/.hive/analysis/eval-failure-analysis-2025-12-25.md +0 -331
- package/.hive/analysis/session-data-quality-audit.md +0 -320
- package/.hive/eval-results.json +0 -483
- package/.hive/issues.jsonl +0 -138
- package/.hive/memories.jsonl +0 -729
- package/.opencode/eval-history.jsonl +0 -327
- package/.turbo/turbo-build.log +0 -9
- package/CHANGELOG.md +0 -2286
- package/SCORER-ANALYSIS.md +0 -598
- package/docs/analysis/subagent-coordination-patterns.md +0 -902
- package/docs/analysis-socratic-planner-pattern.md +0 -504
- package/docs/planning/ADR-001-monorepo-structure.md +0 -171
- package/docs/planning/ADR-002-package-extraction.md +0 -393
- package/docs/planning/ADR-003-performance-improvements.md +0 -451
- package/docs/planning/ADR-004-message-queue-features.md +0 -187
- package/docs/planning/ADR-005-devtools-observability.md +0 -202
- package/docs/planning/ADR-007-swarm-enhancements-worktree-review.md +0 -168
- package/docs/planning/ADR-008-worker-handoff-protocol.md +0 -293
- package/docs/planning/ADR-009-oh-my-opencode-patterns.md +0 -353
- package/docs/planning/ADR-010-cass-inhousing.md +0 -1215
- package/docs/planning/ROADMAP.md +0 -368
- package/docs/semantic-memory-cli-syntax.md +0 -123
- package/docs/swarm-mail-architecture.md +0 -1147
- package/docs/testing/context-recovery-test.md +0 -470
- package/evals/ARCHITECTURE.md +0 -1189
- package/evals/README.md +0 -768
- package/evals/compaction-prompt.eval.ts +0 -149
- package/evals/compaction-resumption.eval.ts +0 -289
- package/evals/coordinator-behavior.eval.ts +0 -307
- package/evals/coordinator-session.eval.ts +0 -154
- package/evals/evalite.config.ts.bak +0 -15
- package/evals/example.eval.ts +0 -31
- package/evals/fixtures/cass-baseline.ts +0 -217
- package/evals/fixtures/compaction-cases.ts +0 -350
- package/evals/fixtures/compaction-prompt-cases.ts +0 -311
- package/evals/fixtures/coordinator-sessions.ts +0 -328
- package/evals/fixtures/decomposition-cases.ts +0 -105
- package/evals/lib/compaction-loader.test.ts +0 -248
- package/evals/lib/compaction-loader.ts +0 -320
- package/evals/lib/data-loader.evalite-test.ts +0 -289
- package/evals/lib/data-loader.test.ts +0 -345
- package/evals/lib/data-loader.ts +0 -281
- package/evals/lib/llm.ts +0 -115
- package/evals/scorers/compaction-prompt-scorers.ts +0 -145
- package/evals/scorers/compaction-scorers.ts +0 -305
- package/evals/scorers/coordinator-discipline.evalite-test.ts +0 -539
- package/evals/scorers/coordinator-discipline.ts +0 -325
- package/evals/scorers/index.test.ts +0 -146
- package/evals/scorers/index.ts +0 -328
- package/evals/scorers/outcome-scorers.evalite-test.ts +0 -27
- package/evals/scorers/outcome-scorers.ts +0 -349
- package/evals/swarm-decomposition.eval.ts +0 -121
- package/examples/commands/swarm.md +0 -745
- package/examples/plugin-wrapper-template.ts +0 -2515
- package/examples/skills/hive-workflow/SKILL.md +0 -212
- package/examples/skills/skill-creator/SKILL.md +0 -223
- package/examples/skills/swarm-coordination/SKILL.md +0 -292
- package/global-skills/cli-builder/SKILL.md +0 -344
- package/global-skills/cli-builder/references/advanced-patterns.md +0 -244
- package/global-skills/learning-systems/SKILL.md +0 -644
- package/global-skills/skill-creator/LICENSE.txt +0 -202
- package/global-skills/skill-creator/SKILL.md +0 -352
- package/global-skills/skill-creator/references/output-patterns.md +0 -82
- package/global-skills/skill-creator/references/workflows.md +0 -28
- package/global-skills/swarm-coordination/SKILL.md +0 -995
- package/global-skills/swarm-coordination/references/coordinator-patterns.md +0 -235
- package/global-skills/swarm-coordination/references/strategies.md +0 -138
- package/global-skills/system-design/SKILL.md +0 -213
- package/global-skills/testing-patterns/SKILL.md +0 -430
- package/global-skills/testing-patterns/references/dependency-breaking-catalog.md +0 -586
- package/opencode-swarm-plugin-0.30.7.tgz +0 -0
- package/opencode-swarm-plugin-0.31.0.tgz +0 -0
- package/scripts/cleanup-test-memories.ts +0 -346
- package/scripts/init-skill.ts +0 -222
- package/scripts/migrate-unknown-sessions.ts +0 -349
- package/scripts/validate-skill.ts +0 -204
- package/src/agent-mail.ts +0 -1724
- package/src/anti-patterns.test.ts +0 -1167
- package/src/anti-patterns.ts +0 -448
- package/src/compaction-capture.integration.test.ts +0 -257
- package/src/compaction-hook.test.ts +0 -838
- package/src/compaction-hook.ts +0 -1204
- package/src/compaction-observability.integration.test.ts +0 -139
- package/src/compaction-observability.test.ts +0 -187
- package/src/compaction-observability.ts +0 -324
- package/src/compaction-prompt-scorers.test.ts +0 -475
- package/src/compaction-prompt-scoring.ts +0 -300
- package/src/contributor-tools.test.ts +0 -133
- package/src/contributor-tools.ts +0 -201
- package/src/dashboard.test.ts +0 -611
- package/src/dashboard.ts +0 -462
- package/src/error-enrichment.test.ts +0 -403
- package/src/error-enrichment.ts +0 -219
- package/src/eval-capture.test.ts +0 -1015
- package/src/eval-capture.ts +0 -929
- package/src/eval-gates.test.ts +0 -306
- package/src/eval-gates.ts +0 -218
- package/src/eval-history.test.ts +0 -508
- package/src/eval-history.ts +0 -214
- package/src/eval-learning.test.ts +0 -378
- package/src/eval-learning.ts +0 -360
- package/src/eval-runner.test.ts +0 -223
- package/src/eval-runner.ts +0 -402
- package/src/export-tools.test.ts +0 -476
- package/src/export-tools.ts +0 -257
- package/src/hive.integration.test.ts +0 -2241
- package/src/hive.ts +0 -1628
- package/src/index.ts +0 -940
- package/src/learning.integration.test.ts +0 -1815
- package/src/learning.ts +0 -1079
- package/src/logger.test.ts +0 -189
- package/src/logger.ts +0 -135
- package/src/mandate-promotion.test.ts +0 -473
- package/src/mandate-promotion.ts +0 -239
- package/src/mandate-storage.integration.test.ts +0 -601
- package/src/mandate-storage.test.ts +0 -578
- package/src/mandate-storage.ts +0 -794
- package/src/mandates.ts +0 -540
- package/src/memory-tools.test.ts +0 -195
- package/src/memory-tools.ts +0 -344
- package/src/memory.integration.test.ts +0 -334
- package/src/memory.test.ts +0 -158
- package/src/memory.ts +0 -527
- package/src/model-selection.test.ts +0 -188
- package/src/model-selection.ts +0 -68
- package/src/observability-tools.test.ts +0 -359
- package/src/observability-tools.ts +0 -871
- package/src/output-guardrails.test.ts +0 -438
- package/src/output-guardrails.ts +0 -381
- package/src/pattern-maturity.test.ts +0 -1160
- package/src/pattern-maturity.ts +0 -525
- package/src/planning-guardrails.test.ts +0 -491
- package/src/planning-guardrails.ts +0 -438
- package/src/plugin.ts +0 -23
- package/src/post-compaction-tracker.test.ts +0 -251
- package/src/post-compaction-tracker.ts +0 -237
- package/src/query-tools.test.ts +0 -636
- package/src/query-tools.ts +0 -324
- package/src/rate-limiter.integration.test.ts +0 -466
- package/src/rate-limiter.ts +0 -774
- package/src/replay-tools.test.ts +0 -496
- package/src/replay-tools.ts +0 -240
- package/src/repo-crawl.integration.test.ts +0 -441
- package/src/repo-crawl.ts +0 -610
- package/src/schemas/cell-events.test.ts +0 -347
- package/src/schemas/cell-events.ts +0 -807
- package/src/schemas/cell.ts +0 -257
- package/src/schemas/evaluation.ts +0 -166
- package/src/schemas/index.test.ts +0 -199
- package/src/schemas/index.ts +0 -286
- package/src/schemas/mandate.ts +0 -232
- package/src/schemas/swarm-context.ts +0 -115
- package/src/schemas/task.ts +0 -161
- package/src/schemas/worker-handoff.test.ts +0 -302
- package/src/schemas/worker-handoff.ts +0 -131
- package/src/sessions/agent-discovery.test.ts +0 -137
- package/src/sessions/agent-discovery.ts +0 -112
- package/src/sessions/index.ts +0 -15
- package/src/skills.integration.test.ts +0 -1192
- package/src/skills.test.ts +0 -643
- package/src/skills.ts +0 -1549
- package/src/storage.integration.test.ts +0 -341
- package/src/storage.ts +0 -884
- package/src/structured.integration.test.ts +0 -817
- package/src/structured.test.ts +0 -1046
- package/src/structured.ts +0 -762
- package/src/swarm-decompose.test.ts +0 -188
- package/src/swarm-decompose.ts +0 -1302
- package/src/swarm-deferred.integration.test.ts +0 -157
- package/src/swarm-deferred.test.ts +0 -38
- package/src/swarm-insights.test.ts +0 -214
- package/src/swarm-insights.ts +0 -459
- package/src/swarm-mail.integration.test.ts +0 -970
- package/src/swarm-mail.ts +0 -739
- package/src/swarm-orchestrate.integration.test.ts +0 -282
- package/src/swarm-orchestrate.test.ts +0 -548
- package/src/swarm-orchestrate.ts +0 -3084
- package/src/swarm-prompts.test.ts +0 -1270
- package/src/swarm-prompts.ts +0 -2077
- package/src/swarm-research.integration.test.ts +0 -701
- package/src/swarm-research.test.ts +0 -698
- package/src/swarm-research.ts +0 -472
- package/src/swarm-review.integration.test.ts +0 -285
- package/src/swarm-review.test.ts +0 -879
- package/src/swarm-review.ts +0 -709
- package/src/swarm-strategies.ts +0 -407
- package/src/swarm-worktree.test.ts +0 -501
- package/src/swarm-worktree.ts +0 -575
- package/src/swarm.integration.test.ts +0 -2377
- package/src/swarm.ts +0 -38
- package/src/tool-adapter.integration.test.ts +0 -1221
- package/src/tool-availability.ts +0 -461
- package/tsconfig.json +0 -28
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Cell Event Schemas
|
|
3
|
-
*
|
|
4
|
-
* Validates event creation, validation, and type guards.
|
|
5
|
-
*/
|
|
6
|
-
import { describe, expect, test } from "bun:test";
|
|
7
|
-
import {
|
|
8
|
-
type CellCreatedEvent,
|
|
9
|
-
CellEventSchema,
|
|
10
|
-
createCellEvent,
|
|
11
|
-
getCellIdFromEvent,
|
|
12
|
-
isAgentEvent,
|
|
13
|
-
isCellEventType,
|
|
14
|
-
isEpicEvent,
|
|
15
|
-
isStateTransitionEvent,
|
|
16
|
-
// Legacy aliases for backward compatibility
|
|
17
|
-
type BeadCreatedEvent,
|
|
18
|
-
BeadEventSchema,
|
|
19
|
-
createBeadEvent,
|
|
20
|
-
getBeadIdFromEvent,
|
|
21
|
-
isBeadEventType,
|
|
22
|
-
} from "./cell-events.js";
|
|
23
|
-
|
|
24
|
-
describe("CellEventSchema", () => {
|
|
25
|
-
const projectKey = "/path/to/repo";
|
|
26
|
-
|
|
27
|
-
describe("createCellEvent", () => {
|
|
28
|
-
test("creates valid cell_created event", () => {
|
|
29
|
-
const event = createCellEvent("cell_created", {
|
|
30
|
-
project_key: projectKey,
|
|
31
|
-
cell_id: "bd-123",
|
|
32
|
-
title: "Add authentication",
|
|
33
|
-
issue_type: "feature",
|
|
34
|
-
priority: 2,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
expect(event.type).toBe("cell_created");
|
|
38
|
-
expect(event.cell_id).toBe("bd-123");
|
|
39
|
-
expect(event.title).toBe("Add authentication");
|
|
40
|
-
expect(event.timestamp).toBeGreaterThan(0);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test("creates valid cell_closed event", () => {
|
|
44
|
-
const event = createCellEvent("cell_closed", {
|
|
45
|
-
project_key: projectKey,
|
|
46
|
-
cell_id: "bd-123",
|
|
47
|
-
reason: "Implemented OAuth flow",
|
|
48
|
-
closed_by: "BlueLake",
|
|
49
|
-
files_touched: ["src/auth.ts", "src/oauth.ts"],
|
|
50
|
-
duration_ms: 45000,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
expect(event.type).toBe("cell_closed");
|
|
54
|
-
expect(event.reason).toBe("Implemented OAuth flow");
|
|
55
|
-
expect(event.closed_by).toBe("BlueLake");
|
|
56
|
-
expect(event.files_touched).toHaveLength(2);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test("creates valid cell_dependency_added event", () => {
|
|
60
|
-
const event = createCellEvent("cell_dependency_added", {
|
|
61
|
-
project_key: projectKey,
|
|
62
|
-
cell_id: "bd-123",
|
|
63
|
-
dependency: {
|
|
64
|
-
id: "bd-456",
|
|
65
|
-
type: "blocks",
|
|
66
|
-
},
|
|
67
|
-
reason: "Needs database schema before service layer",
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
expect(event.type).toBe("cell_dependency_added");
|
|
71
|
-
expect(event.dependency.type).toBe("blocks");
|
|
72
|
-
expect(event.dependency.id).toBe("bd-456");
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
test("creates valid cell_epic_child_added event", () => {
|
|
76
|
-
const event = createCellEvent("cell_epic_child_added", {
|
|
77
|
-
project_key: projectKey,
|
|
78
|
-
cell_id: "bd-epic-1",
|
|
79
|
-
child_id: "bd-epic-1.1",
|
|
80
|
-
child_index: 0,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
expect(event.type).toBe("cell_epic_child_added");
|
|
84
|
-
expect(event.child_id).toBe("bd-epic-1.1");
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test("throws on invalid event data", () => {
|
|
88
|
-
expect(() =>
|
|
89
|
-
createCellEvent("cell_created", {
|
|
90
|
-
project_key: projectKey,
|
|
91
|
-
cell_id: "bd-123",
|
|
92
|
-
title: "Test",
|
|
93
|
-
// @ts-expect-error - Testing invalid issue_type
|
|
94
|
-
issue_type: "invalid_type",
|
|
95
|
-
priority: 2,
|
|
96
|
-
}),
|
|
97
|
-
).toThrow("Invalid cell event");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe("type guards", () => {
|
|
102
|
-
test("isCellEventType narrows type correctly", () => {
|
|
103
|
-
const event: CellCreatedEvent = createCellEvent("cell_created", {
|
|
104
|
-
project_key: projectKey,
|
|
105
|
-
cell_id: "bd-123",
|
|
106
|
-
title: "Test",
|
|
107
|
-
issue_type: "task",
|
|
108
|
-
priority: 2,
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
if (isCellEventType(event, "cell_created")) {
|
|
112
|
-
// TypeScript knows this is CellCreatedEvent
|
|
113
|
-
expect(event.title).toBe("Test");
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
test("isStateTransitionEvent identifies status changes", () => {
|
|
118
|
-
const closedEvent = createCellEvent("cell_closed", {
|
|
119
|
-
project_key: projectKey,
|
|
120
|
-
cell_id: "bd-123",
|
|
121
|
-
reason: "Done",
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
expect(isStateTransitionEvent(closedEvent)).toBe(true);
|
|
125
|
-
|
|
126
|
-
const createdEvent = createCellEvent("cell_created", {
|
|
127
|
-
project_key: projectKey,
|
|
128
|
-
cell_id: "bd-123",
|
|
129
|
-
title: "Test",
|
|
130
|
-
issue_type: "task",
|
|
131
|
-
priority: 2,
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
expect(isStateTransitionEvent(createdEvent)).toBe(false);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
test("isEpicEvent identifies epic operations", () => {
|
|
138
|
-
const epicEvent = createCellEvent("cell_epic_child_added", {
|
|
139
|
-
project_key: projectKey,
|
|
140
|
-
cell_id: "bd-epic",
|
|
141
|
-
child_id: "bd-epic.1",
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
expect(isEpicEvent(epicEvent)).toBe(true);
|
|
145
|
-
|
|
146
|
-
const regularEvent = createCellEvent("cell_created", {
|
|
147
|
-
project_key: projectKey,
|
|
148
|
-
cell_id: "bd-123",
|
|
149
|
-
title: "Test",
|
|
150
|
-
issue_type: "task",
|
|
151
|
-
priority: 2,
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
expect(isEpicEvent(regularEvent)).toBe(false);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test("isAgentEvent detects agent-triggered events", () => {
|
|
158
|
-
const agentEvent = createCellEvent("cell_assigned", {
|
|
159
|
-
project_key: projectKey,
|
|
160
|
-
cell_id: "bd-123",
|
|
161
|
-
agent_name: "BlueLake",
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
expect(isAgentEvent(agentEvent)).toBe(true);
|
|
165
|
-
|
|
166
|
-
const closedByAgentEvent = createCellEvent("cell_closed", {
|
|
167
|
-
project_key: projectKey,
|
|
168
|
-
cell_id: "bd-123",
|
|
169
|
-
reason: "Done",
|
|
170
|
-
closed_by: "agent",
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
expect(isAgentEvent(closedByAgentEvent)).toBe(true);
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
describe("getCellIdFromEvent", () => {
|
|
178
|
-
test("extracts cell_id from any event", () => {
|
|
179
|
-
const events = [
|
|
180
|
-
createCellEvent("cell_created", {
|
|
181
|
-
project_key: projectKey,
|
|
182
|
-
cell_id: "bd-123",
|
|
183
|
-
title: "Test",
|
|
184
|
-
issue_type: "task",
|
|
185
|
-
priority: 2,
|
|
186
|
-
}),
|
|
187
|
-
createCellEvent("cell_closed", {
|
|
188
|
-
project_key: projectKey,
|
|
189
|
-
cell_id: "bd-456",
|
|
190
|
-
reason: "Done",
|
|
191
|
-
}),
|
|
192
|
-
createCellEvent("cell_epic_child_added", {
|
|
193
|
-
project_key: projectKey,
|
|
194
|
-
cell_id: "bd-epic",
|
|
195
|
-
child_id: "bd-epic.1",
|
|
196
|
-
}),
|
|
197
|
-
];
|
|
198
|
-
|
|
199
|
-
expect(getCellIdFromEvent(events[0])).toBe("bd-123");
|
|
200
|
-
expect(getCellIdFromEvent(events[1])).toBe("bd-456");
|
|
201
|
-
expect(getCellIdFromEvent(events[2])).toBe("bd-epic");
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
describe("discriminated union validation", () => {
|
|
206
|
-
test("validates against full CellEventSchema", () => {
|
|
207
|
-
const rawEvent = {
|
|
208
|
-
type: "cell_created",
|
|
209
|
-
project_key: projectKey,
|
|
210
|
-
timestamp: Date.now(),
|
|
211
|
-
cell_id: "bd-123",
|
|
212
|
-
title: "Test cell",
|
|
213
|
-
issue_type: "feature",
|
|
214
|
-
priority: 1,
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const result = CellEventSchema.safeParse(rawEvent);
|
|
218
|
-
expect(result.success).toBe(true);
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
test("rejects invalid event type", () => {
|
|
222
|
-
const rawEvent = {
|
|
223
|
-
type: "invalid_event",
|
|
224
|
-
project_key: projectKey,
|
|
225
|
-
timestamp: Date.now(),
|
|
226
|
-
cell_id: "bd-123",
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
const result = CellEventSchema.safeParse(rawEvent);
|
|
230
|
-
expect(result.success).toBe(false);
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
test("validates dependency types", () => {
|
|
234
|
-
const validTypes = [
|
|
235
|
-
"blocks",
|
|
236
|
-
"blocked-by",
|
|
237
|
-
"related",
|
|
238
|
-
"discovered-from",
|
|
239
|
-
] as const;
|
|
240
|
-
|
|
241
|
-
for (const depType of validTypes) {
|
|
242
|
-
const event = createCellEvent("cell_dependency_added", {
|
|
243
|
-
project_key: projectKey,
|
|
244
|
-
cell_id: "bd-123",
|
|
245
|
-
dependency: {
|
|
246
|
-
id: "bd-456",
|
|
247
|
-
type: depType,
|
|
248
|
-
},
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
expect(event.dependency.type).toBe(depType);
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
describe("event metadata", () => {
|
|
257
|
-
test("supports metadata field", () => {
|
|
258
|
-
const event = createCellEvent("cell_created", {
|
|
259
|
-
project_key: projectKey,
|
|
260
|
-
cell_id: "bd-123",
|
|
261
|
-
title: "Test",
|
|
262
|
-
issue_type: "task",
|
|
263
|
-
priority: 2,
|
|
264
|
-
metadata: {
|
|
265
|
-
epic_context: "bd-epic-1",
|
|
266
|
-
swarm_strategy: "file-based",
|
|
267
|
-
estimated_duration: 30,
|
|
268
|
-
},
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
expect(event.metadata).toBeDefined();
|
|
272
|
-
expect(event.metadata?.epic_context).toBe("bd-epic-1");
|
|
273
|
-
});
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
describe("epic closure eligible event", () => {
|
|
277
|
-
test("creates valid closure eligible event", () => {
|
|
278
|
-
const event = createCellEvent("cell_epic_closure_eligible", {
|
|
279
|
-
project_key: projectKey,
|
|
280
|
-
cell_id: "bd-epic",
|
|
281
|
-
child_ids: ["bd-epic.1", "bd-epic.2", "bd-epic.3"],
|
|
282
|
-
total_duration_ms: 120000,
|
|
283
|
-
all_files_touched: ["src/a.ts", "src/b.ts"],
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
expect(event.type).toBe("cell_epic_closure_eligible");
|
|
287
|
-
expect(event.child_ids).toHaveLength(3);
|
|
288
|
-
expect(event.total_duration_ms).toBe(120000);
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
describe("status changed event", () => {
|
|
293
|
-
test("tracks status transitions", () => {
|
|
294
|
-
const event = createCellEvent("cell_status_changed", {
|
|
295
|
-
project_key: projectKey,
|
|
296
|
-
cell_id: "bd-123",
|
|
297
|
-
from_status: "open",
|
|
298
|
-
to_status: "in_progress",
|
|
299
|
-
changed_by: "agent",
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
expect(event.from_status).toBe("open");
|
|
303
|
-
expect(event.to_status).toBe("in_progress");
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
test("includes optional reason for blocked/closed", () => {
|
|
307
|
-
const event = createCellEvent("cell_status_changed", {
|
|
308
|
-
project_key: projectKey,
|
|
309
|
-
cell_id: "bd-123",
|
|
310
|
-
from_status: "in_progress",
|
|
311
|
-
to_status: "blocked",
|
|
312
|
-
reason: "Waiting for API credentials",
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
expect(event.reason).toBe("Waiting for API credentials");
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
describe("comment events", () => {
|
|
320
|
-
test("creates comment with optional parent", () => {
|
|
321
|
-
const event = createCellEvent("cell_comment_added", {
|
|
322
|
-
project_key: projectKey,
|
|
323
|
-
cell_id: "bd-123",
|
|
324
|
-
author: "BlueLake",
|
|
325
|
-
body: "Progress update: auth service implemented",
|
|
326
|
-
parent_comment_id: 42,
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
expect(event.author).toBe("BlueLake");
|
|
330
|
-
expect(event.parent_comment_id).toBe(42);
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
describe("work tracking events", () => {
|
|
335
|
-
test("tracks work start with file reservations", () => {
|
|
336
|
-
const event = createCellEvent("cell_work_started", {
|
|
337
|
-
project_key: projectKey,
|
|
338
|
-
cell_id: "bd-123",
|
|
339
|
-
agent_name: "BlueLake",
|
|
340
|
-
reserved_files: ["src/auth/**"],
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
expect(event.agent_name).toBe("BlueLake");
|
|
344
|
-
expect(event.reserved_files).toEqual(["src/auth/**"]);
|
|
345
|
-
});
|
|
346
|
-
});
|
|
347
|
-
});
|