@auto-engineer/pipeline 0.0.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.
- package/.turbo/turbo-build.log +5 -0
- package/LICENSE +10 -0
- package/claude.md +160 -0
- package/dist/src/builder/define.d.ts +90 -0
- package/dist/src/builder/define.d.ts.map +1 -0
- package/dist/src/builder/define.js +425 -0
- package/dist/src/builder/define.js.map +1 -0
- package/dist/src/builder/define.specs.d.ts +2 -0
- package/dist/src/builder/define.specs.d.ts.map +1 -0
- package/dist/src/builder/define.specs.js +435 -0
- package/dist/src/builder/define.specs.js.map +1 -0
- package/dist/src/config/pipeline-config.d.ts +13 -0
- package/dist/src/config/pipeline-config.d.ts.map +1 -0
- package/dist/src/config/pipeline-config.js +15 -0
- package/dist/src/config/pipeline-config.js.map +1 -0
- package/dist/src/core/descriptors.d.ts +84 -0
- package/dist/src/core/descriptors.d.ts.map +1 -0
- package/dist/src/core/descriptors.js +2 -0
- package/dist/src/core/descriptors.js.map +1 -0
- package/dist/src/core/descriptors.specs.d.ts +2 -0
- package/dist/src/core/descriptors.specs.d.ts.map +1 -0
- package/dist/src/core/descriptors.specs.js +24 -0
- package/dist/src/core/descriptors.specs.js.map +1 -0
- package/dist/src/core/types.d.ts +10 -0
- package/dist/src/core/types.d.ts.map +1 -0
- package/dist/src/core/types.js +4 -0
- package/dist/src/core/types.js.map +1 -0
- package/dist/src/core/types.specs.d.ts +2 -0
- package/dist/src/core/types.specs.d.ts.map +1 -0
- package/dist/src/core/types.specs.js +40 -0
- package/dist/src/core/types.specs.js.map +1 -0
- package/dist/src/graph/types.d.ts +17 -0
- package/dist/src/graph/types.d.ts.map +1 -0
- package/dist/src/graph/types.js +2 -0
- package/dist/src/graph/types.js.map +1 -0
- package/dist/src/graph/types.specs.d.ts +2 -0
- package/dist/src/graph/types.specs.d.ts.map +1 -0
- package/dist/src/graph/types.specs.js +148 -0
- package/dist/src/graph/types.specs.js.map +1 -0
- package/dist/src/index.d.ts +20 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/logging/event-logger.d.ts +21 -0
- package/dist/src/logging/event-logger.d.ts.map +1 -0
- package/dist/src/logging/event-logger.js +31 -0
- package/dist/src/logging/event-logger.js.map +1 -0
- package/dist/src/logging/event-logger.specs.d.ts +2 -0
- package/dist/src/logging/event-logger.specs.d.ts.map +1 -0
- package/dist/src/logging/event-logger.specs.js +81 -0
- package/dist/src/logging/event-logger.specs.js.map +1 -0
- package/dist/src/plugins/handler-adapter.d.ts +5 -0
- package/dist/src/plugins/handler-adapter.d.ts.map +1 -0
- package/dist/src/plugins/handler-adapter.js +17 -0
- package/dist/src/plugins/handler-adapter.js.map +1 -0
- package/dist/src/plugins/handler-adapter.specs.d.ts +2 -0
- package/dist/src/plugins/handler-adapter.specs.d.ts.map +1 -0
- package/dist/src/plugins/handler-adapter.specs.js +129 -0
- package/dist/src/plugins/handler-adapter.specs.js.map +1 -0
- package/dist/src/plugins/plugin-loader.d.ts +25 -0
- package/dist/src/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/src/plugins/plugin-loader.js +150 -0
- package/dist/src/plugins/plugin-loader.js.map +1 -0
- package/dist/src/plugins/plugin-loader.specs.d.ts +2 -0
- package/dist/src/plugins/plugin-loader.specs.d.ts.map +1 -0
- package/dist/src/plugins/plugin-loader.specs.js +246 -0
- package/dist/src/plugins/plugin-loader.specs.js.map +1 -0
- package/dist/src/runtime/await-tracker.d.ts +10 -0
- package/dist/src/runtime/await-tracker.d.ts.map +1 -0
- package/dist/src/runtime/await-tracker.js +42 -0
- package/dist/src/runtime/await-tracker.js.map +1 -0
- package/dist/src/runtime/await-tracker.specs.d.ts +2 -0
- package/dist/src/runtime/await-tracker.specs.d.ts.map +1 -0
- package/dist/src/runtime/await-tracker.specs.js +46 -0
- package/dist/src/runtime/await-tracker.specs.js.map +1 -0
- package/dist/src/runtime/context.d.ts +12 -0
- package/dist/src/runtime/context.d.ts.map +1 -0
- package/dist/src/runtime/context.js +2 -0
- package/dist/src/runtime/context.js.map +1 -0
- package/dist/src/runtime/context.specs.d.ts +2 -0
- package/dist/src/runtime/context.specs.d.ts.map +1 -0
- package/dist/src/runtime/context.specs.js +26 -0
- package/dist/src/runtime/context.specs.js.map +1 -0
- package/dist/src/runtime/event-command-map.d.ts +15 -0
- package/dist/src/runtime/event-command-map.d.ts.map +1 -0
- package/dist/src/runtime/event-command-map.js +26 -0
- package/dist/src/runtime/event-command-map.js.map +1 -0
- package/dist/src/runtime/event-command-map.specs.d.ts +2 -0
- package/dist/src/runtime/event-command-map.specs.d.ts.map +1 -0
- package/dist/src/runtime/event-command-map.specs.js +108 -0
- package/dist/src/runtime/event-command-map.specs.js.map +1 -0
- package/dist/src/runtime/phased-executor.d.ts +29 -0
- package/dist/src/runtime/phased-executor.d.ts.map +1 -0
- package/dist/src/runtime/phased-executor.js +164 -0
- package/dist/src/runtime/phased-executor.js.map +1 -0
- package/dist/src/runtime/phased-executor.specs.d.ts +2 -0
- package/dist/src/runtime/phased-executor.specs.d.ts.map +1 -0
- package/dist/src/runtime/phased-executor.specs.js +256 -0
- package/dist/src/runtime/phased-executor.specs.js.map +1 -0
- package/dist/src/runtime/pipeline-runtime.d.ts +17 -0
- package/dist/src/runtime/pipeline-runtime.d.ts.map +1 -0
- package/dist/src/runtime/pipeline-runtime.js +87 -0
- package/dist/src/runtime/pipeline-runtime.js.map +1 -0
- package/dist/src/runtime/pipeline-runtime.specs.d.ts +2 -0
- package/dist/src/runtime/pipeline-runtime.specs.d.ts.map +1 -0
- package/dist/src/runtime/pipeline-runtime.specs.js +192 -0
- package/dist/src/runtime/pipeline-runtime.specs.js.map +1 -0
- package/dist/src/runtime/settled-tracker.d.ts +42 -0
- package/dist/src/runtime/settled-tracker.d.ts.map +1 -0
- package/dist/src/runtime/settled-tracker.js +161 -0
- package/dist/src/runtime/settled-tracker.js.map +1 -0
- package/dist/src/runtime/settled-tracker.specs.d.ts +2 -0
- package/dist/src/runtime/settled-tracker.specs.d.ts.map +1 -0
- package/dist/src/runtime/settled-tracker.specs.js +361 -0
- package/dist/src/runtime/settled-tracker.specs.js.map +1 -0
- package/dist/src/server/full-orchestration.e2e.specs.d.ts +2 -0
- package/dist/src/server/full-orchestration.e2e.specs.d.ts.map +1 -0
- package/dist/src/server/full-orchestration.e2e.specs.js +561 -0
- package/dist/src/server/full-orchestration.e2e.specs.js.map +1 -0
- package/dist/src/server/pipeline-server.d.ts +59 -0
- package/dist/src/server/pipeline-server.d.ts.map +1 -0
- package/dist/src/server/pipeline-server.e2e.specs.d.ts +2 -0
- package/dist/src/server/pipeline-server.e2e.specs.d.ts.map +1 -0
- package/dist/src/server/pipeline-server.e2e.specs.js +381 -0
- package/dist/src/server/pipeline-server.e2e.specs.js.map +1 -0
- package/dist/src/server/pipeline-server.js +527 -0
- package/dist/src/server/pipeline-server.js.map +1 -0
- package/dist/src/server/pipeline-server.specs.d.ts +2 -0
- package/dist/src/server/pipeline-server.specs.d.ts.map +1 -0
- package/dist/src/server/pipeline-server.specs.js +662 -0
- package/dist/src/server/pipeline-server.specs.js.map +1 -0
- package/dist/src/server/sse-manager.d.ts +12 -0
- package/dist/src/server/sse-manager.d.ts.map +1 -0
- package/dist/src/server/sse-manager.js +63 -0
- package/dist/src/server/sse-manager.js.map +1 -0
- package/dist/src/server/sse-manager.specs.d.ts +2 -0
- package/dist/src/server/sse-manager.specs.d.ts.map +1 -0
- package/dist/src/server/sse-manager.specs.js +158 -0
- package/dist/src/server/sse-manager.specs.js.map +1 -0
- package/dist/src/testing/event-capture.d.ts +14 -0
- package/dist/src/testing/event-capture.d.ts.map +1 -0
- package/dist/src/testing/event-capture.js +55 -0
- package/dist/src/testing/event-capture.js.map +1 -0
- package/dist/src/testing/event-capture.specs.d.ts +2 -0
- package/dist/src/testing/event-capture.specs.d.ts.map +1 -0
- package/dist/src/testing/event-capture.specs.js +114 -0
- package/dist/src/testing/event-capture.specs.js.map +1 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.d.ts +7 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.d.ts.map +1 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.js +168 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.js.map +1 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.specs.d.ts +2 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.specs.d.ts.map +1 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.specs.js +263 -0
- package/dist/src/testing/fixtures/kanban-full.pipeline.specs.js.map +1 -0
- package/dist/src/testing/fixtures/kanban-todo.config.d.ts +3 -0
- package/dist/src/testing/fixtures/kanban-todo.config.d.ts.map +1 -0
- package/dist/src/testing/fixtures/kanban-todo.config.js +19 -0
- package/dist/src/testing/fixtures/kanban-todo.config.js.map +1 -0
- package/dist/src/testing/fixtures/kanban.pipeline.d.ts +5 -0
- package/dist/src/testing/fixtures/kanban.pipeline.d.ts.map +1 -0
- package/dist/src/testing/fixtures/kanban.pipeline.js +76 -0
- package/dist/src/testing/fixtures/kanban.pipeline.js.map +1 -0
- package/dist/src/testing/fixtures/kanban.pipeline.specs.d.ts +2 -0
- package/dist/src/testing/fixtures/kanban.pipeline.specs.d.ts.map +1 -0
- package/dist/src/testing/fixtures/kanban.pipeline.specs.js +29 -0
- package/dist/src/testing/fixtures/kanban.pipeline.specs.js.map +1 -0
- package/dist/src/testing/kanban-todo.e2e.specs.d.ts +2 -0
- package/dist/src/testing/kanban-todo.e2e.specs.d.ts.map +1 -0
- package/dist/src/testing/kanban-todo.e2e.specs.js +160 -0
- package/dist/src/testing/kanban-todo.e2e.specs.js.map +1 -0
- package/dist/src/testing/mock-handlers.d.ts +21 -0
- package/dist/src/testing/mock-handlers.d.ts.map +1 -0
- package/dist/src/testing/mock-handlers.js +34 -0
- package/dist/src/testing/mock-handlers.js.map +1 -0
- package/dist/src/testing/mock-handlers.specs.d.ts +2 -0
- package/dist/src/testing/mock-handlers.specs.d.ts.map +1 -0
- package/dist/src/testing/mock-handlers.specs.js +193 -0
- package/dist/src/testing/mock-handlers.specs.js.map +1 -0
- package/dist/src/testing/real-execution.e2e.specs.d.ts +2 -0
- package/dist/src/testing/real-execution.e2e.specs.d.ts.map +1 -0
- package/dist/src/testing/real-execution.e2e.specs.js +140 -0
- package/dist/src/testing/real-execution.e2e.specs.js.map +1 -0
- package/dist/src/testing/real-plugin.e2e.specs.d.ts +2 -0
- package/dist/src/testing/real-plugin.e2e.specs.d.ts.map +1 -0
- package/dist/src/testing/real-plugin.e2e.specs.js +65 -0
- package/dist/src/testing/real-plugin.e2e.specs.js.map +1 -0
- package/dist/src/testing/server-startup.e2e.specs.d.ts +2 -0
- package/dist/src/testing/server-startup.e2e.specs.d.ts.map +1 -0
- package/dist/src/testing/server-startup.e2e.specs.js +104 -0
- package/dist/src/testing/server-startup.e2e.specs.js.map +1 -0
- package/dist/src/testing/snapshot-compare.d.ts +18 -0
- package/dist/src/testing/snapshot-compare.d.ts.map +1 -0
- package/dist/src/testing/snapshot-compare.js +86 -0
- package/dist/src/testing/snapshot-compare.js.map +1 -0
- package/dist/src/testing/snapshot-compare.specs.d.ts +2 -0
- package/dist/src/testing/snapshot-compare.specs.d.ts.map +1 -0
- package/dist/src/testing/snapshot-compare.specs.js +112 -0
- package/dist/src/testing/snapshot-compare.specs.js.map +1 -0
- package/dist/src/testing/snapshot-sanitize.d.ts +8 -0
- package/dist/src/testing/snapshot-sanitize.d.ts.map +1 -0
- package/dist/src/testing/snapshot-sanitize.js +10 -0
- package/dist/src/testing/snapshot-sanitize.js.map +1 -0
- package/dist/src/testing/snapshot-sanitize.specs.d.ts +2 -0
- package/dist/src/testing/snapshot-sanitize.specs.d.ts.map +1 -0
- package/dist/src/testing/snapshot-sanitize.specs.js +104 -0
- package/dist/src/testing/snapshot-sanitize.specs.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docs/testing-analysis.md +395 -0
- package/package.json +31 -0
- package/pipeline-api-new.md +1078 -0
- package/pomodoro-plan.md +651 -0
- package/scripts/run-kanban-e2e.ts +219 -0
- package/scripts/start-server.ts +64 -0
- package/snapshots/e2e-run-2025-12-22T15-52-03.json +613 -0
- package/snapshots/e2e-run-2025-12-22T16-51-30.json +699 -0
- package/src/builder/define.specs.ts +531 -0
- package/src/builder/define.ts +700 -0
- package/src/config/pipeline-config.ts +32 -0
- package/src/core/descriptors.specs.ts +28 -0
- package/src/core/descriptors.ts +99 -0
- package/src/core/types.specs.ts +44 -0
- package/src/core/types.ts +16 -0
- package/src/graph/types.specs.ts +176 -0
- package/src/graph/types.ts +19 -0
- package/src/index.ts +54 -0
- package/src/logging/event-logger.specs.ts +100 -0
- package/src/logging/event-logger.ts +50 -0
- package/src/plugins/handler-adapter.specs.ts +164 -0
- package/src/plugins/handler-adapter.ts +21 -0
- package/src/plugins/plugin-loader.specs.ts +295 -0
- package/src/plugins/plugin-loader.ts +202 -0
- package/src/runtime/await-tracker.specs.ts +52 -0
- package/src/runtime/await-tracker.ts +50 -0
- package/src/runtime/context.specs.ts +28 -0
- package/src/runtime/context.ts +13 -0
- package/src/runtime/event-command-map.specs.ts +136 -0
- package/src/runtime/event-command-map.ts +38 -0
- package/src/runtime/phased-executor.specs.ts +358 -0
- package/src/runtime/phased-executor.ts +224 -0
- package/src/runtime/pipeline-runtime.specs.ts +214 -0
- package/src/runtime/pipeline-runtime.ts +119 -0
- package/src/runtime/settled-tracker.specs.ts +448 -0
- package/src/runtime/settled-tracker.ts +237 -0
- package/src/server/full-orchestration.e2e.specs.ts +672 -0
- package/src/server/pipeline-server.e2e.specs.ts +505 -0
- package/src/server/pipeline-server.specs.ts +761 -0
- package/src/server/pipeline-server.ts +656 -0
- package/src/server/sse-manager.specs.ts +208 -0
- package/src/server/sse-manager.ts +79 -0
- package/src/testing/event-capture.specs.ts +143 -0
- package/src/testing/event-capture.ts +65 -0
- package/src/testing/fixtures/kanban-full.pipeline.specs.ts +337 -0
- package/src/testing/fixtures/kanban-full.pipeline.ts +225 -0
- package/src/testing/fixtures/kanban-todo.config.ts +19 -0
- package/src/testing/fixtures/kanban.pipeline.specs.ts +33 -0
- package/src/testing/fixtures/kanban.pipeline.ts +124 -0
- package/src/testing/kanban-todo.e2e.specs.ts +209 -0
- package/src/testing/mock-handlers.specs.ts +229 -0
- package/src/testing/mock-handlers.ts +58 -0
- package/src/testing/real-execution.e2e.specs.ts +193 -0
- package/src/testing/real-plugin.e2e.specs.ts +94 -0
- package/src/testing/server-startup.e2e.specs.ts +162 -0
- package/src/testing/snapshot-compare.specs.ts +136 -0
- package/src/testing/snapshot-compare.ts +106 -0
- package/src/testing/snapshot-sanitize.specs.ts +131 -0
- package/src/testing/snapshot-sanitize.ts +17 -0
- package/tsconfig.json +11 -0
- package/tsconfig.test.json +9 -0
- package/vitest.config.ts +29 -0
package/pomodoro-plan.md
ADDED
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
# Pipeline Package - Pomodoro Plan
|
|
2
|
+
|
|
3
|
+
## TODO
|
|
4
|
+
|
|
5
|
+
### Phase 3: Phased Execution Pattern (Pomodoros 27-34)
|
|
6
|
+
|
|
7
|
+
#### Pomodoro 27: ForEachBuilder Interface & TriggerBuilder.forEach()
|
|
8
|
+
|
|
9
|
+
| Value | Entry point to phased execution pattern |
|
|
10
|
+
| Approach | TriggerBuilder.forEach() returns ForEachBuilder |
|
|
11
|
+
| Size | S |
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
it('should return ForEachBuilder from TriggerBuilder.forEach()', () => {
|
|
15
|
+
type ItemsEvent = { data: { items: Array<{ id: string }> } };
|
|
16
|
+
const builder = define('test')
|
|
17
|
+
.on('ItemsReady')
|
|
18
|
+
.forEach((e: ItemsEvent) => e.data.items);
|
|
19
|
+
|
|
20
|
+
expect(builder).toBeDefined();
|
|
21
|
+
expect(typeof builder.groupInto).toBe('function');
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
#### Pomodoro 28: ForEachBuilder.groupInto() with phases
|
|
28
|
+
|
|
29
|
+
| Value | Define execution phases for items |
|
|
30
|
+
| Approach | groupInto() accepts phase names and classifier |
|
|
31
|
+
| Size | M |
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
it('should configure phases with groupInto()', () => {
|
|
35
|
+
type Item = { id: string; type: 'critical' | 'normal' };
|
|
36
|
+
const pipeline = define('test')
|
|
37
|
+
.on('ItemsReady')
|
|
38
|
+
.forEach((e: { data: { items: Item[] } }) => e.data.items)
|
|
39
|
+
.groupInto(['critical', 'normal'], (item: Item) => item.type)
|
|
40
|
+
.process('ProcessItem', (item: Item) => ({ itemId: item.id }))
|
|
41
|
+
.build();
|
|
42
|
+
|
|
43
|
+
const handler = pipeline.descriptor.handlers[0] as ForEachPhasedDescriptor;
|
|
44
|
+
expect(handler.phases).toEqual(['critical', 'normal']);
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
#### Pomodoro 29: PhasedBuilder.process() with emit factory
|
|
51
|
+
|
|
52
|
+
| Value | Define command emission for each item |
|
|
53
|
+
| Approach | process() accepts commandType and data factory |
|
|
54
|
+
| Size | S |
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
it('should configure emitFactory with process()', () => {
|
|
58
|
+
type Item = { id: string };
|
|
59
|
+
const pipeline = define('test')
|
|
60
|
+
.on('ItemsReady')
|
|
61
|
+
.forEach((e: { data: { items: Item[] } }) => e.data.items)
|
|
62
|
+
.groupInto(['phase1'], () => 'phase1')
|
|
63
|
+
.process('ProcessItem', (item: Item) => ({ itemId: item.id }))
|
|
64
|
+
.build();
|
|
65
|
+
|
|
66
|
+
const handler = pipeline.descriptor.handlers[0] as ForEachPhasedDescriptor;
|
|
67
|
+
expect(typeof handler.emitFactory).toBe('function');
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
#### Pomodoro 30: PhasedBuilder.stopOnFailure()
|
|
74
|
+
|
|
75
|
+
| Value | Configure failure behavior |
|
|
76
|
+
| Approach | stopOnFailure() sets flag in descriptor |
|
|
77
|
+
| Size | S |
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
it('should set stopOnFailure flag', () => {
|
|
81
|
+
const pipeline = define('test')
|
|
82
|
+
.on('ItemsReady')
|
|
83
|
+
.forEach((e: { data: { items: unknown[] } }) => e.data.items)
|
|
84
|
+
.groupInto(['phase1'], () => 'phase1')
|
|
85
|
+
.process('ProcessItem', () => ({}))
|
|
86
|
+
.stopOnFailure()
|
|
87
|
+
.build();
|
|
88
|
+
|
|
89
|
+
const handler = pipeline.descriptor.handlers[0] as ForEachPhasedDescriptor;
|
|
90
|
+
expect(handler.stopOnFailure).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
#### Pomodoro 31: PhasedBuilder.onComplete()
|
|
97
|
+
|
|
98
|
+
| Value | Configure completion events |
|
|
99
|
+
| Approach | onComplete() sets success/failure event types |
|
|
100
|
+
| Size | M |
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
it('should configure completion events', () => {
|
|
104
|
+
type Item = { id: string };
|
|
105
|
+
const pipeline = define('test')
|
|
106
|
+
.on('ItemsReady')
|
|
107
|
+
.forEach((e: { data: { items: Item[] } }) => e.data.items)
|
|
108
|
+
.groupInto(['phase1'], () => 'phase1')
|
|
109
|
+
.process('ProcessItem', (item: Item) => ({ itemId: item.id }))
|
|
110
|
+
.onComplete({
|
|
111
|
+
success: 'AllItemsProcessed',
|
|
112
|
+
failure: 'ProcessingFailed',
|
|
113
|
+
itemKey: (e: { data: { itemId: string } }) => e.data.itemId,
|
|
114
|
+
})
|
|
115
|
+
.build();
|
|
116
|
+
|
|
117
|
+
const handler = pipeline.descriptor.handlers[0] as ForEachPhasedDescriptor;
|
|
118
|
+
expect(handler.completion.successEvent).toBe('AllItemsProcessed');
|
|
119
|
+
expect(handler.completion.failureEvent).toBe('ProcessingFailed');
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
#### Pomodoro 32: Chaining from PhasedBuilder
|
|
126
|
+
|
|
127
|
+
| Value | Continue pipeline definition after phased |
|
|
128
|
+
| Approach | PhasedBuilder returns to chain |
|
|
129
|
+
| Size | S |
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
it('should chain on() from PhasedBuilder', () => {
|
|
133
|
+
const pipeline = define('test')
|
|
134
|
+
.on('ItemsReady')
|
|
135
|
+
.forEach((e: { data: { items: unknown[] } }) => e.data.items)
|
|
136
|
+
.groupInto(['phase1'], () => 'phase1')
|
|
137
|
+
.process('ProcessItem', () => ({}))
|
|
138
|
+
.onComplete({ success: 'Done', failure: 'Failed', itemKey: () => '' })
|
|
139
|
+
.on('Done')
|
|
140
|
+
.emit('Notify', {})
|
|
141
|
+
.build();
|
|
142
|
+
|
|
143
|
+
expect(pipeline.descriptor.handlers).toHaveLength(2);
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
#### Pomodoro 33: Default stopOnFailure behavior
|
|
150
|
+
|
|
151
|
+
| Value | Sensible defaults |
|
|
152
|
+
| Approach | stopOnFailure defaults to false |
|
|
153
|
+
| Size | S |
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
it('should default stopOnFailure to false', () => {
|
|
157
|
+
const pipeline = define('test')
|
|
158
|
+
.on('ItemsReady')
|
|
159
|
+
.forEach((e: { data: { items: unknown[] } }) => e.data.items)
|
|
160
|
+
.groupInto(['phase1'], () => 'phase1')
|
|
161
|
+
.process('ProcessItem', () => ({}))
|
|
162
|
+
.onComplete({ success: 'Done', failure: 'Failed', itemKey: () => '' })
|
|
163
|
+
.build();
|
|
164
|
+
|
|
165
|
+
const handler = pipeline.descriptor.handlers[0] as ForEachPhasedDescriptor;
|
|
166
|
+
expect(handler.stopOnFailure).toBe(false);
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
#### Pomodoro 34: Phase 3 Integration Test
|
|
173
|
+
|
|
174
|
+
| Value | Validate complete phased pipeline |
|
|
175
|
+
| Approach | Integration test with realistic scenario |
|
|
176
|
+
| Size | M |
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
it('should create complete phased execution pipeline', () => {
|
|
180
|
+
type Component = { path: string; priority: 'high' | 'medium' | 'low' };
|
|
181
|
+
type ComponentEvent = { data: { components: Component[] } };
|
|
182
|
+
|
|
183
|
+
const pipeline = define('component-processor')
|
|
184
|
+
.version('1.0.0')
|
|
185
|
+
.description('Process components in priority phases')
|
|
186
|
+
.on('ComponentsGenerated')
|
|
187
|
+
.when((e: ComponentEvent) => e.data.components.length > 0)
|
|
188
|
+
.forEach((e: ComponentEvent) => e.data.components)
|
|
189
|
+
.groupInto(['high', 'medium', 'low'], (c: Component) => c.priority)
|
|
190
|
+
.process('ImplementComponent', (c: Component) => ({ componentPath: c.path }))
|
|
191
|
+
.stopOnFailure()
|
|
192
|
+
.onComplete({
|
|
193
|
+
success: 'AllComponentsImplemented',
|
|
194
|
+
failure: 'ComponentImplementationFailed',
|
|
195
|
+
itemKey: (e: { data: { componentPath: string } }) => e.data.componentPath,
|
|
196
|
+
})
|
|
197
|
+
.build();
|
|
198
|
+
|
|
199
|
+
expect(pipeline.descriptor.name).toBe('component-processor');
|
|
200
|
+
const handler = pipeline.descriptor.handlers[0] as ForEachPhasedDescriptor;
|
|
201
|
+
expect(handler.type).toBe('foreach-phased');
|
|
202
|
+
expect(handler.phases).toEqual(['high', 'medium', 'low']);
|
|
203
|
+
expect(handler.stopOnFailure).toBe(true);
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### Phase 4: Custom Handlers (Pomodoros 35-37)
|
|
210
|
+
|
|
211
|
+
#### Pomodoro 35: TriggerBuilder.handle() basic
|
|
212
|
+
|
|
213
|
+
| Value | Escape hatch for imperative logic |
|
|
214
|
+
| Approach | handle() accepts async handler function |
|
|
215
|
+
| Size | S |
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
it('should capture custom handler', () => {
|
|
219
|
+
const handler = async (e: { data: unknown }) => {
|
|
220
|
+
console.log(e);
|
|
221
|
+
};
|
|
222
|
+
const pipeline = define('test').on('CustomEvent').handle(handler).build();
|
|
223
|
+
|
|
224
|
+
const desc = pipeline.descriptor.handlers[0] as CustomHandlerDescriptor;
|
|
225
|
+
expect(desc.type).toBe('custom');
|
|
226
|
+
expect(desc.handler).toBe(handler);
|
|
227
|
+
});
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
#### Pomodoro 36: handle() with declaredEmits
|
|
233
|
+
|
|
234
|
+
| Value | Graph introspection support |
|
|
235
|
+
| Approach | Optional second param for declared emits |
|
|
236
|
+
| Size | S |
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
it('should capture declaredEmits for graph introspection', () => {
|
|
240
|
+
const pipeline = define('test')
|
|
241
|
+
.on('CustomEvent')
|
|
242
|
+
.handle(async () => {}, { emits: ['EventA', 'EventB'] })
|
|
243
|
+
.build();
|
|
244
|
+
|
|
245
|
+
const desc = pipeline.descriptor.handlers[0] as CustomHandlerDescriptor;
|
|
246
|
+
expect(desc.declaredEmits).toEqual(['EventA', 'EventB']);
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
#### Pomodoro 37: Phase 4 Integration & Chaining
|
|
253
|
+
|
|
254
|
+
| Value | Complete custom handler support |
|
|
255
|
+
| Approach | Chaining from handle() |
|
|
256
|
+
| Size | S |
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
it('should chain on() from handle()', () => {
|
|
260
|
+
const pipeline = define('test')
|
|
261
|
+
.on('EventA')
|
|
262
|
+
.handle(async () => {})
|
|
263
|
+
.on('EventB')
|
|
264
|
+
.emit('CommandB', {})
|
|
265
|
+
.build();
|
|
266
|
+
|
|
267
|
+
expect(pipeline.descriptor.handlers).toHaveLength(2);
|
|
268
|
+
});
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
### Phase 5: Graph Extraction (Pomodoros 38-42)
|
|
274
|
+
|
|
275
|
+
#### Pomodoro 38: GraphIR type definition
|
|
276
|
+
|
|
277
|
+
| Value | Intermediate representation for visualization |
|
|
278
|
+
| Approach | Define nodes and edges types |
|
|
279
|
+
| Size | S |
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
it('should define GraphIR with nodes and edges', () => {
|
|
283
|
+
const graph: GraphIR = {
|
|
284
|
+
nodes: [
|
|
285
|
+
{ id: 'evt:Start', type: 'event', label: 'Start' },
|
|
286
|
+
{ id: 'cmd:Process', type: 'command', label: 'Process' },
|
|
287
|
+
],
|
|
288
|
+
edges: [{ from: 'evt:Start', to: 'cmd:Process', label: 'triggers' }],
|
|
289
|
+
};
|
|
290
|
+
expect(graph.nodes).toHaveLength(2);
|
|
291
|
+
});
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
#### Pomodoro 39: Pipeline.toGraph() basic
|
|
297
|
+
|
|
298
|
+
| Value | Extract graph from pipeline |
|
|
299
|
+
| Approach | toGraph() method on Pipeline |
|
|
300
|
+
| Size | M |
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
it('should extract graph from emit handler', () => {
|
|
304
|
+
const pipeline = define('test').on('Start').emit('Process', {}).build();
|
|
305
|
+
|
|
306
|
+
const graph = pipeline.toGraph();
|
|
307
|
+
expect(graph.nodes.some((n) => n.id === 'evt:Start')).toBe(true);
|
|
308
|
+
expect(graph.nodes.some((n) => n.id === 'cmd:Process')).toBe(true);
|
|
309
|
+
});
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
#### Pomodoro 40: toGraph() with run-await handlers
|
|
315
|
+
|
|
316
|
+
| Value | Graph extraction for scatter-gather |
|
|
317
|
+
| Approach | Include await relationships |
|
|
318
|
+
| Size | M |
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
#### Pomodoro 41: toGraph() with foreach-phased handlers
|
|
323
|
+
|
|
324
|
+
| Value | Graph extraction for phased execution |
|
|
325
|
+
| Approach | Include phase groupings |
|
|
326
|
+
| Size | M |
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
#### Pomodoro 42: toGraph() with custom handlers
|
|
331
|
+
|
|
332
|
+
| Value | Graph extraction using declaredEmits |
|
|
333
|
+
| Approach | Use declaredEmits for edges |
|
|
334
|
+
| Size | S |
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### Phase 6: Cloud Abstractions (Pomodoros 43-48)
|
|
339
|
+
|
|
340
|
+
(Deferred - interfaces only, no runtime implementation yet)
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
### Phase 7: Pipeline Runtime (Pomodoros 49-54)
|
|
345
|
+
|
|
346
|
+
(Deferred - requires Phase 6 abstractions)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## DONE
|
|
351
|
+
|
|
352
|
+
### Phase 8: CLI Integration (Pomodoros 67-70) ✅
|
|
353
|
+
|
|
354
|
+
Pomodoro 67-70 complete. E2E tests validate CLI parity.
|
|
355
|
+
|
|
356
|
+
### Pomodoro 69-70: E2E Tests for CLI Parity
|
|
357
|
+
|
|
358
|
+
Implemented:
|
|
359
|
+
|
|
360
|
+
- 8 E2E tests validating endpoint compatibility
|
|
361
|
+
- Tests for `/registry`, `/pipeline`, `/sessions`, `/messages`, `/stats`, `/command`
|
|
362
|
+
- Tests for command execution and event routing through pipeline
|
|
363
|
+
- Tests for pipeline chain with multiple handlers
|
|
364
|
+
|
|
365
|
+
All 99 tests pass with 100% coverage.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### Pomodoro 67-68: Enhanced /pipeline Response
|
|
370
|
+
|
|
371
|
+
Implemented:
|
|
372
|
+
|
|
373
|
+
- Added `folds: []` to `/registry` response
|
|
374
|
+
- Added `commandToEvents` mapping from command handlers
|
|
375
|
+
- Added `eventToCommand` mapping from pipeline handlers
|
|
376
|
+
- Added `PipelineNode` shape with `id`, `name`, `title`, `status`
|
|
377
|
+
- 4 new tests for response shapes
|
|
378
|
+
|
|
379
|
+
All 91 tests pass with 100% coverage.
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
### Pomodoro 53-54: AwaitTracker
|
|
384
|
+
|
|
385
|
+
Implemented:
|
|
386
|
+
|
|
387
|
+
- `AwaitTracker` class for scatter-gather completion tracking
|
|
388
|
+
- `startAwaiting()` to register pending keys
|
|
389
|
+
- `markComplete()` to mark individual keys as done
|
|
390
|
+
- `isComplete()` to check if all keys are done
|
|
391
|
+
- `getResults()` to collect results and clear tracking
|
|
392
|
+
- 7 tests for await tracking functionality
|
|
393
|
+
- Exported from package index
|
|
394
|
+
|
|
395
|
+
All 87 tests pass with 100% coverage.
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### Pomodoro 55-66: PipelineServer
|
|
400
|
+
|
|
401
|
+
Implemented:
|
|
402
|
+
|
|
403
|
+
- `PipelineServer` class with HTTP endpoints
|
|
404
|
+
- `/health`, `/registry`, `/pipeline`, `/messages`, `/sessions`, `/stats` endpoints
|
|
405
|
+
- `POST /command` with command handler validation and 404 for unknown commands
|
|
406
|
+
- Event routing through registered pipelines
|
|
407
|
+
- Custom handler context support (emit, sendCommand)
|
|
408
|
+
- Command handlers returning multiple events
|
|
409
|
+
- Integration test for complete workflow
|
|
410
|
+
- 16 tests for server functionality
|
|
411
|
+
- Exports added to public API
|
|
412
|
+
|
|
413
|
+
All 80 tests pass with 100% coverage.
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
### Pomodoro 51-52: Run-await and ForEach-phased Runtime
|
|
418
|
+
|
|
419
|
+
Implemented:
|
|
420
|
+
|
|
421
|
+
- `handleEvent()` for run-await handlers with command dispatch
|
|
422
|
+
- Data factory support in static run-await commands
|
|
423
|
+
- ForEach-phased item processing with phase ordering
|
|
424
|
+
- Custom handler receives PipelineContext
|
|
425
|
+
|
|
426
|
+
All 80 tests pass with 100% coverage.
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
### Pomodoro 45-50: PipelineRuntime Core
|
|
431
|
+
|
|
432
|
+
Implemented:
|
|
433
|
+
|
|
434
|
+
- `PipelineRuntime` class with descriptor and handler index
|
|
435
|
+
- `getHandlersForEvent()` for O(1) handler lookup by event type
|
|
436
|
+
- `getMatchingHandlers()` with predicate filtering
|
|
437
|
+
- `handleEvent()` for emit and custom handlers
|
|
438
|
+
- Data factory resolution for emit handlers
|
|
439
|
+
- 7 tests for runtime functionality
|
|
440
|
+
|
|
441
|
+
All 59 tests pass with 100% coverage.
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
### Pomodoro 43-44: PipelineContext & RuntimeConfig
|
|
446
|
+
|
|
447
|
+
Implemented:
|
|
448
|
+
|
|
449
|
+
- `PipelineContext` interface with `emit()`, `sendCommand()`, `correlationId`
|
|
450
|
+
- `RuntimeConfig` interface with optional `defaultTimeout`
|
|
451
|
+
- 4 tests for context/config types
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
### Pomodoro 38-42: Phase 5 Graph Extraction
|
|
456
|
+
|
|
457
|
+
Implemented:
|
|
458
|
+
|
|
459
|
+
- `GraphIR` type with `nodes` and `edges` arrays
|
|
460
|
+
- `GraphNode` with `id`, `type` ('event' | 'command'), `label`
|
|
461
|
+
- `GraphEdge` with `from`, `to`, optional `label`
|
|
462
|
+
- `Pipeline.toGraph()` method for all handler types
|
|
463
|
+
- Emit handler graph extraction
|
|
464
|
+
- Run-await handler graph extraction with success/failure events
|
|
465
|
+
- Foreach-phased handler graph extraction with completion events
|
|
466
|
+
- Custom handler graph extraction using `declaredEmits`
|
|
467
|
+
- Node deduplication
|
|
468
|
+
- 9 tests for graph functionality
|
|
469
|
+
|
|
470
|
+
All 46 tests pass with 100% coverage.
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
### Pomodoro 35-37: Phase 4 Custom Handlers
|
|
475
|
+
|
|
476
|
+
Implemented:
|
|
477
|
+
|
|
478
|
+
- `TriggerBuilder.handle()` with async handler function
|
|
479
|
+
- `handle()` with `declaredEmits` option for graph introspection
|
|
480
|
+
- `HandleChain` for chaining `on()` and `build()`
|
|
481
|
+
- 3 tests for custom handler functionality
|
|
482
|
+
|
|
483
|
+
All 37 tests pass with 100% coverage.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
### Pomodoro 27-34: Phase 3 Phased Execution Pattern
|
|
488
|
+
|
|
489
|
+
Implemented:
|
|
490
|
+
|
|
491
|
+
- `TriggerBuilder.forEach()` returns `ForEachBuilder`
|
|
492
|
+
- `ForEachBuilder.groupInto()` with phase classifier
|
|
493
|
+
- `PhasedBuilder.process()` with emit factory
|
|
494
|
+
- `PhasedChain.stopOnFailure()` optional flag
|
|
495
|
+
- `PhasedChain.onComplete()` with success/failure events
|
|
496
|
+
- `PhasedTerminal` for chaining
|
|
497
|
+
- Integration test with complete phased pipeline
|
|
498
|
+
|
|
499
|
+
All 34 tests pass with 100% coverage.
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
### Pomodoro 19-26: Phase 2 Scatter-Gather Pattern
|
|
504
|
+
|
|
505
|
+
Implemented:
|
|
506
|
+
|
|
507
|
+
- `TriggerBuilder.run()` returns `RunBuilder`
|
|
508
|
+
- `run()` accepts static `CommandDispatch[]` or factory function
|
|
509
|
+
- `RunBuilder.awaitAll()` with key extractor and optional timeout
|
|
510
|
+
- `GatherBuilder.onSuccess()` with `SuccessContext`
|
|
511
|
+
- `GatherBuilder.onFailure()` with `FailureContext`
|
|
512
|
+
- Chaining: `on()` and `build()` from `GatherBuilder`
|
|
513
|
+
- Integration test with complete scatter-gather pipeline
|
|
514
|
+
|
|
515
|
+
New types added:
|
|
516
|
+
|
|
517
|
+
- `SuccessContext<T>` - results, duration, triggerEvent
|
|
518
|
+
- `FailureContext<T>` - failures, successes, triggerEvent
|
|
519
|
+
- `GatherEventConfig<T>` - eventType, dataFactory
|
|
520
|
+
|
|
521
|
+
All 26 tests pass with 100% coverage.
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
### Pomodoro 13, 15, 18: Remaining Phase 1 features
|
|
526
|
+
|
|
527
|
+
- emit() with data factory
|
|
528
|
+
- when() predicate for conditional execution
|
|
529
|
+
- Integration test with complete pipeline
|
|
530
|
+
|
|
531
|
+
All Phase 1 tests pass with 100% coverage.
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
### Pomodoro 6-12, 14, 16, 17: Builder API (batched)
|
|
536
|
+
|
|
537
|
+
Implemented:
|
|
538
|
+
|
|
539
|
+
- define() entry point
|
|
540
|
+
- version() and description()
|
|
541
|
+
- build() returns frozen Pipeline
|
|
542
|
+
- on() returns TriggerBuilder
|
|
543
|
+
- emit() with static data
|
|
544
|
+
- EmitChain.build() captures handler
|
|
545
|
+
- Parallel emit() chain
|
|
546
|
+
- EmitChain.on() continues chain
|
|
547
|
+
- key() named extractors
|
|
548
|
+
|
|
549
|
+
All tests pass with 100% coverage.
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
### Pomodoro 5: PipelineDescriptor Type
|
|
554
|
+
|
|
555
|
+
| Value | Pipeline structure definition |
|
|
556
|
+
| Approach | Interface with metadata + handlers array |
|
|
557
|
+
| Size | S |
|
|
558
|
+
|
|
559
|
+
```typescript
|
|
560
|
+
it('should create PipelineDescriptor', () => {
|
|
561
|
+
const descriptor: PipelineDescriptor = {
|
|
562
|
+
name: 'test-pipeline',
|
|
563
|
+
version: '1.0.0',
|
|
564
|
+
keys: new Map(),
|
|
565
|
+
handlers: [],
|
|
566
|
+
};
|
|
567
|
+
expect(descriptor.name).toBe('test-pipeline');
|
|
568
|
+
});
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
### Pomodoro 4: dispatch() Helper
|
|
574
|
+
|
|
575
|
+
| Value | Ergonomic CommandDispatch creation |
|
|
576
|
+
| Approach | Simple factory function |
|
|
577
|
+
| Size | S |
|
|
578
|
+
|
|
579
|
+
```typescript
|
|
580
|
+
it('should create CommandDispatch via dispatch()', () => {
|
|
581
|
+
const cmd = dispatch('CheckTests', { targetDirectory: './src' });
|
|
582
|
+
expect(cmd).toEqual({
|
|
583
|
+
commandType: 'CheckTests',
|
|
584
|
+
data: { targetDirectory: './src' },
|
|
585
|
+
});
|
|
586
|
+
});
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
### Pomodoro 3: CommandDispatch Type
|
|
592
|
+
|
|
593
|
+
| Value | Dispatch instruction type |
|
|
594
|
+
| Approach | Simple interface with commandType + data |
|
|
595
|
+
| Size | S |
|
|
596
|
+
|
|
597
|
+
```typescript
|
|
598
|
+
it('should create CommandDispatch with static data', () => {
|
|
599
|
+
const cmd: CommandDispatch = {
|
|
600
|
+
commandType: 'CheckTests',
|
|
601
|
+
data: { targetDirectory: './src', scope: 'slice' },
|
|
602
|
+
};
|
|
603
|
+
expect(cmd).toEqual({
|
|
604
|
+
commandType: 'CheckTests',
|
|
605
|
+
data: { targetDirectory: './src', scope: 'slice' },
|
|
606
|
+
});
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
it('should create CommandDispatch with data factory', () => {
|
|
610
|
+
const cmd: CommandDispatch = {
|
|
611
|
+
commandType: 'ImplementSlice',
|
|
612
|
+
data: (e) => ({ slicePath: e.data.path }),
|
|
613
|
+
};
|
|
614
|
+
const event: Event = { type: 'SliceGenerated', data: { path: './slice' } };
|
|
615
|
+
const resolved = typeof cmd.data === 'function' ? cmd.data(event) : cmd.data;
|
|
616
|
+
expect(resolved).toEqual({ slicePath: './slice' });
|
|
617
|
+
});
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
### Pomodoro 2: Core Types
|
|
623
|
+
|
|
624
|
+
| Value | Foundation types |
|
|
625
|
+
| Approach | Re-export message-bus types + add pipeline types |
|
|
626
|
+
| Size | S |
|
|
627
|
+
|
|
628
|
+
```typescript
|
|
629
|
+
it('should re-export Command and Event from message-bus', () => {
|
|
630
|
+
const cmd: Command = { type: 'Test', data: {} };
|
|
631
|
+
const evt: Event = { type: 'TestDone', data: {} };
|
|
632
|
+
expect(cmd.type).toBe('Test');
|
|
633
|
+
expect(evt.type).toBe('TestDone');
|
|
634
|
+
});
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
### Pomodoro 1: Package Scaffold
|
|
640
|
+
|
|
641
|
+
| Value | Foundation for all work |
|
|
642
|
+
| Approach | Copy patterns from `@auto-engineer/id` |
|
|
643
|
+
| Size | S |
|
|
644
|
+
|
|
645
|
+
**Files:**
|
|
646
|
+
|
|
647
|
+
- `package.json` - deps: `@auto-engineer/message-bus: workspace:*`
|
|
648
|
+
- `tsconfig.json` - extends base, composite: true
|
|
649
|
+
- `tsconfig.test.json` - includes \*.specs.ts
|
|
650
|
+
- `vitest.config.ts` - 100% coverage thresholds
|
|
651
|
+
- `src/index.ts` - empty export
|