@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.
Files changed (270) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/LICENSE +10 -0
  3. package/claude.md +160 -0
  4. package/dist/src/builder/define.d.ts +90 -0
  5. package/dist/src/builder/define.d.ts.map +1 -0
  6. package/dist/src/builder/define.js +425 -0
  7. package/dist/src/builder/define.js.map +1 -0
  8. package/dist/src/builder/define.specs.d.ts +2 -0
  9. package/dist/src/builder/define.specs.d.ts.map +1 -0
  10. package/dist/src/builder/define.specs.js +435 -0
  11. package/dist/src/builder/define.specs.js.map +1 -0
  12. package/dist/src/config/pipeline-config.d.ts +13 -0
  13. package/dist/src/config/pipeline-config.d.ts.map +1 -0
  14. package/dist/src/config/pipeline-config.js +15 -0
  15. package/dist/src/config/pipeline-config.js.map +1 -0
  16. package/dist/src/core/descriptors.d.ts +84 -0
  17. package/dist/src/core/descriptors.d.ts.map +1 -0
  18. package/dist/src/core/descriptors.js +2 -0
  19. package/dist/src/core/descriptors.js.map +1 -0
  20. package/dist/src/core/descriptors.specs.d.ts +2 -0
  21. package/dist/src/core/descriptors.specs.d.ts.map +1 -0
  22. package/dist/src/core/descriptors.specs.js +24 -0
  23. package/dist/src/core/descriptors.specs.js.map +1 -0
  24. package/dist/src/core/types.d.ts +10 -0
  25. package/dist/src/core/types.d.ts.map +1 -0
  26. package/dist/src/core/types.js +4 -0
  27. package/dist/src/core/types.js.map +1 -0
  28. package/dist/src/core/types.specs.d.ts +2 -0
  29. package/dist/src/core/types.specs.d.ts.map +1 -0
  30. package/dist/src/core/types.specs.js +40 -0
  31. package/dist/src/core/types.specs.js.map +1 -0
  32. package/dist/src/graph/types.d.ts +17 -0
  33. package/dist/src/graph/types.d.ts.map +1 -0
  34. package/dist/src/graph/types.js +2 -0
  35. package/dist/src/graph/types.js.map +1 -0
  36. package/dist/src/graph/types.specs.d.ts +2 -0
  37. package/dist/src/graph/types.specs.d.ts.map +1 -0
  38. package/dist/src/graph/types.specs.js +148 -0
  39. package/dist/src/graph/types.specs.js.map +1 -0
  40. package/dist/src/index.d.ts +20 -0
  41. package/dist/src/index.d.ts.map +1 -0
  42. package/dist/src/index.js +12 -0
  43. package/dist/src/index.js.map +1 -0
  44. package/dist/src/logging/event-logger.d.ts +21 -0
  45. package/dist/src/logging/event-logger.d.ts.map +1 -0
  46. package/dist/src/logging/event-logger.js +31 -0
  47. package/dist/src/logging/event-logger.js.map +1 -0
  48. package/dist/src/logging/event-logger.specs.d.ts +2 -0
  49. package/dist/src/logging/event-logger.specs.d.ts.map +1 -0
  50. package/dist/src/logging/event-logger.specs.js +81 -0
  51. package/dist/src/logging/event-logger.specs.js.map +1 -0
  52. package/dist/src/plugins/handler-adapter.d.ts +5 -0
  53. package/dist/src/plugins/handler-adapter.d.ts.map +1 -0
  54. package/dist/src/plugins/handler-adapter.js +17 -0
  55. package/dist/src/plugins/handler-adapter.js.map +1 -0
  56. package/dist/src/plugins/handler-adapter.specs.d.ts +2 -0
  57. package/dist/src/plugins/handler-adapter.specs.d.ts.map +1 -0
  58. package/dist/src/plugins/handler-adapter.specs.js +129 -0
  59. package/dist/src/plugins/handler-adapter.specs.js.map +1 -0
  60. package/dist/src/plugins/plugin-loader.d.ts +25 -0
  61. package/dist/src/plugins/plugin-loader.d.ts.map +1 -0
  62. package/dist/src/plugins/plugin-loader.js +150 -0
  63. package/dist/src/plugins/plugin-loader.js.map +1 -0
  64. package/dist/src/plugins/plugin-loader.specs.d.ts +2 -0
  65. package/dist/src/plugins/plugin-loader.specs.d.ts.map +1 -0
  66. package/dist/src/plugins/plugin-loader.specs.js +246 -0
  67. package/dist/src/plugins/plugin-loader.specs.js.map +1 -0
  68. package/dist/src/runtime/await-tracker.d.ts +10 -0
  69. package/dist/src/runtime/await-tracker.d.ts.map +1 -0
  70. package/dist/src/runtime/await-tracker.js +42 -0
  71. package/dist/src/runtime/await-tracker.js.map +1 -0
  72. package/dist/src/runtime/await-tracker.specs.d.ts +2 -0
  73. package/dist/src/runtime/await-tracker.specs.d.ts.map +1 -0
  74. package/dist/src/runtime/await-tracker.specs.js +46 -0
  75. package/dist/src/runtime/await-tracker.specs.js.map +1 -0
  76. package/dist/src/runtime/context.d.ts +12 -0
  77. package/dist/src/runtime/context.d.ts.map +1 -0
  78. package/dist/src/runtime/context.js +2 -0
  79. package/dist/src/runtime/context.js.map +1 -0
  80. package/dist/src/runtime/context.specs.d.ts +2 -0
  81. package/dist/src/runtime/context.specs.d.ts.map +1 -0
  82. package/dist/src/runtime/context.specs.js +26 -0
  83. package/dist/src/runtime/context.specs.js.map +1 -0
  84. package/dist/src/runtime/event-command-map.d.ts +15 -0
  85. package/dist/src/runtime/event-command-map.d.ts.map +1 -0
  86. package/dist/src/runtime/event-command-map.js +26 -0
  87. package/dist/src/runtime/event-command-map.js.map +1 -0
  88. package/dist/src/runtime/event-command-map.specs.d.ts +2 -0
  89. package/dist/src/runtime/event-command-map.specs.d.ts.map +1 -0
  90. package/dist/src/runtime/event-command-map.specs.js +108 -0
  91. package/dist/src/runtime/event-command-map.specs.js.map +1 -0
  92. package/dist/src/runtime/phased-executor.d.ts +29 -0
  93. package/dist/src/runtime/phased-executor.d.ts.map +1 -0
  94. package/dist/src/runtime/phased-executor.js +164 -0
  95. package/dist/src/runtime/phased-executor.js.map +1 -0
  96. package/dist/src/runtime/phased-executor.specs.d.ts +2 -0
  97. package/dist/src/runtime/phased-executor.specs.d.ts.map +1 -0
  98. package/dist/src/runtime/phased-executor.specs.js +256 -0
  99. package/dist/src/runtime/phased-executor.specs.js.map +1 -0
  100. package/dist/src/runtime/pipeline-runtime.d.ts +17 -0
  101. package/dist/src/runtime/pipeline-runtime.d.ts.map +1 -0
  102. package/dist/src/runtime/pipeline-runtime.js +87 -0
  103. package/dist/src/runtime/pipeline-runtime.js.map +1 -0
  104. package/dist/src/runtime/pipeline-runtime.specs.d.ts +2 -0
  105. package/dist/src/runtime/pipeline-runtime.specs.d.ts.map +1 -0
  106. package/dist/src/runtime/pipeline-runtime.specs.js +192 -0
  107. package/dist/src/runtime/pipeline-runtime.specs.js.map +1 -0
  108. package/dist/src/runtime/settled-tracker.d.ts +42 -0
  109. package/dist/src/runtime/settled-tracker.d.ts.map +1 -0
  110. package/dist/src/runtime/settled-tracker.js +161 -0
  111. package/dist/src/runtime/settled-tracker.js.map +1 -0
  112. package/dist/src/runtime/settled-tracker.specs.d.ts +2 -0
  113. package/dist/src/runtime/settled-tracker.specs.d.ts.map +1 -0
  114. package/dist/src/runtime/settled-tracker.specs.js +361 -0
  115. package/dist/src/runtime/settled-tracker.specs.js.map +1 -0
  116. package/dist/src/server/full-orchestration.e2e.specs.d.ts +2 -0
  117. package/dist/src/server/full-orchestration.e2e.specs.d.ts.map +1 -0
  118. package/dist/src/server/full-orchestration.e2e.specs.js +561 -0
  119. package/dist/src/server/full-orchestration.e2e.specs.js.map +1 -0
  120. package/dist/src/server/pipeline-server.d.ts +59 -0
  121. package/dist/src/server/pipeline-server.d.ts.map +1 -0
  122. package/dist/src/server/pipeline-server.e2e.specs.d.ts +2 -0
  123. package/dist/src/server/pipeline-server.e2e.specs.d.ts.map +1 -0
  124. package/dist/src/server/pipeline-server.e2e.specs.js +381 -0
  125. package/dist/src/server/pipeline-server.e2e.specs.js.map +1 -0
  126. package/dist/src/server/pipeline-server.js +527 -0
  127. package/dist/src/server/pipeline-server.js.map +1 -0
  128. package/dist/src/server/pipeline-server.specs.d.ts +2 -0
  129. package/dist/src/server/pipeline-server.specs.d.ts.map +1 -0
  130. package/dist/src/server/pipeline-server.specs.js +662 -0
  131. package/dist/src/server/pipeline-server.specs.js.map +1 -0
  132. package/dist/src/server/sse-manager.d.ts +12 -0
  133. package/dist/src/server/sse-manager.d.ts.map +1 -0
  134. package/dist/src/server/sse-manager.js +63 -0
  135. package/dist/src/server/sse-manager.js.map +1 -0
  136. package/dist/src/server/sse-manager.specs.d.ts +2 -0
  137. package/dist/src/server/sse-manager.specs.d.ts.map +1 -0
  138. package/dist/src/server/sse-manager.specs.js +158 -0
  139. package/dist/src/server/sse-manager.specs.js.map +1 -0
  140. package/dist/src/testing/event-capture.d.ts +14 -0
  141. package/dist/src/testing/event-capture.d.ts.map +1 -0
  142. package/dist/src/testing/event-capture.js +55 -0
  143. package/dist/src/testing/event-capture.js.map +1 -0
  144. package/dist/src/testing/event-capture.specs.d.ts +2 -0
  145. package/dist/src/testing/event-capture.specs.d.ts.map +1 -0
  146. package/dist/src/testing/event-capture.specs.js +114 -0
  147. package/dist/src/testing/event-capture.specs.js.map +1 -0
  148. package/dist/src/testing/fixtures/kanban-full.pipeline.d.ts +7 -0
  149. package/dist/src/testing/fixtures/kanban-full.pipeline.d.ts.map +1 -0
  150. package/dist/src/testing/fixtures/kanban-full.pipeline.js +168 -0
  151. package/dist/src/testing/fixtures/kanban-full.pipeline.js.map +1 -0
  152. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.d.ts +2 -0
  153. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.d.ts.map +1 -0
  154. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.js +263 -0
  155. package/dist/src/testing/fixtures/kanban-full.pipeline.specs.js.map +1 -0
  156. package/dist/src/testing/fixtures/kanban-todo.config.d.ts +3 -0
  157. package/dist/src/testing/fixtures/kanban-todo.config.d.ts.map +1 -0
  158. package/dist/src/testing/fixtures/kanban-todo.config.js +19 -0
  159. package/dist/src/testing/fixtures/kanban-todo.config.js.map +1 -0
  160. package/dist/src/testing/fixtures/kanban.pipeline.d.ts +5 -0
  161. package/dist/src/testing/fixtures/kanban.pipeline.d.ts.map +1 -0
  162. package/dist/src/testing/fixtures/kanban.pipeline.js +76 -0
  163. package/dist/src/testing/fixtures/kanban.pipeline.js.map +1 -0
  164. package/dist/src/testing/fixtures/kanban.pipeline.specs.d.ts +2 -0
  165. package/dist/src/testing/fixtures/kanban.pipeline.specs.d.ts.map +1 -0
  166. package/dist/src/testing/fixtures/kanban.pipeline.specs.js +29 -0
  167. package/dist/src/testing/fixtures/kanban.pipeline.specs.js.map +1 -0
  168. package/dist/src/testing/kanban-todo.e2e.specs.d.ts +2 -0
  169. package/dist/src/testing/kanban-todo.e2e.specs.d.ts.map +1 -0
  170. package/dist/src/testing/kanban-todo.e2e.specs.js +160 -0
  171. package/dist/src/testing/kanban-todo.e2e.specs.js.map +1 -0
  172. package/dist/src/testing/mock-handlers.d.ts +21 -0
  173. package/dist/src/testing/mock-handlers.d.ts.map +1 -0
  174. package/dist/src/testing/mock-handlers.js +34 -0
  175. package/dist/src/testing/mock-handlers.js.map +1 -0
  176. package/dist/src/testing/mock-handlers.specs.d.ts +2 -0
  177. package/dist/src/testing/mock-handlers.specs.d.ts.map +1 -0
  178. package/dist/src/testing/mock-handlers.specs.js +193 -0
  179. package/dist/src/testing/mock-handlers.specs.js.map +1 -0
  180. package/dist/src/testing/real-execution.e2e.specs.d.ts +2 -0
  181. package/dist/src/testing/real-execution.e2e.specs.d.ts.map +1 -0
  182. package/dist/src/testing/real-execution.e2e.specs.js +140 -0
  183. package/dist/src/testing/real-execution.e2e.specs.js.map +1 -0
  184. package/dist/src/testing/real-plugin.e2e.specs.d.ts +2 -0
  185. package/dist/src/testing/real-plugin.e2e.specs.d.ts.map +1 -0
  186. package/dist/src/testing/real-plugin.e2e.specs.js +65 -0
  187. package/dist/src/testing/real-plugin.e2e.specs.js.map +1 -0
  188. package/dist/src/testing/server-startup.e2e.specs.d.ts +2 -0
  189. package/dist/src/testing/server-startup.e2e.specs.d.ts.map +1 -0
  190. package/dist/src/testing/server-startup.e2e.specs.js +104 -0
  191. package/dist/src/testing/server-startup.e2e.specs.js.map +1 -0
  192. package/dist/src/testing/snapshot-compare.d.ts +18 -0
  193. package/dist/src/testing/snapshot-compare.d.ts.map +1 -0
  194. package/dist/src/testing/snapshot-compare.js +86 -0
  195. package/dist/src/testing/snapshot-compare.js.map +1 -0
  196. package/dist/src/testing/snapshot-compare.specs.d.ts +2 -0
  197. package/dist/src/testing/snapshot-compare.specs.d.ts.map +1 -0
  198. package/dist/src/testing/snapshot-compare.specs.js +112 -0
  199. package/dist/src/testing/snapshot-compare.specs.js.map +1 -0
  200. package/dist/src/testing/snapshot-sanitize.d.ts +8 -0
  201. package/dist/src/testing/snapshot-sanitize.d.ts.map +1 -0
  202. package/dist/src/testing/snapshot-sanitize.js +10 -0
  203. package/dist/src/testing/snapshot-sanitize.js.map +1 -0
  204. package/dist/src/testing/snapshot-sanitize.specs.d.ts +2 -0
  205. package/dist/src/testing/snapshot-sanitize.specs.d.ts.map +1 -0
  206. package/dist/src/testing/snapshot-sanitize.specs.js +104 -0
  207. package/dist/src/testing/snapshot-sanitize.specs.js.map +1 -0
  208. package/dist/tsconfig.tsbuildinfo +1 -0
  209. package/docs/testing-analysis.md +395 -0
  210. package/package.json +31 -0
  211. package/pipeline-api-new.md +1078 -0
  212. package/pomodoro-plan.md +651 -0
  213. package/scripts/run-kanban-e2e.ts +219 -0
  214. package/scripts/start-server.ts +64 -0
  215. package/snapshots/e2e-run-2025-12-22T15-52-03.json +613 -0
  216. package/snapshots/e2e-run-2025-12-22T16-51-30.json +699 -0
  217. package/src/builder/define.specs.ts +531 -0
  218. package/src/builder/define.ts +700 -0
  219. package/src/config/pipeline-config.ts +32 -0
  220. package/src/core/descriptors.specs.ts +28 -0
  221. package/src/core/descriptors.ts +99 -0
  222. package/src/core/types.specs.ts +44 -0
  223. package/src/core/types.ts +16 -0
  224. package/src/graph/types.specs.ts +176 -0
  225. package/src/graph/types.ts +19 -0
  226. package/src/index.ts +54 -0
  227. package/src/logging/event-logger.specs.ts +100 -0
  228. package/src/logging/event-logger.ts +50 -0
  229. package/src/plugins/handler-adapter.specs.ts +164 -0
  230. package/src/plugins/handler-adapter.ts +21 -0
  231. package/src/plugins/plugin-loader.specs.ts +295 -0
  232. package/src/plugins/plugin-loader.ts +202 -0
  233. package/src/runtime/await-tracker.specs.ts +52 -0
  234. package/src/runtime/await-tracker.ts +50 -0
  235. package/src/runtime/context.specs.ts +28 -0
  236. package/src/runtime/context.ts +13 -0
  237. package/src/runtime/event-command-map.specs.ts +136 -0
  238. package/src/runtime/event-command-map.ts +38 -0
  239. package/src/runtime/phased-executor.specs.ts +358 -0
  240. package/src/runtime/phased-executor.ts +224 -0
  241. package/src/runtime/pipeline-runtime.specs.ts +214 -0
  242. package/src/runtime/pipeline-runtime.ts +119 -0
  243. package/src/runtime/settled-tracker.specs.ts +448 -0
  244. package/src/runtime/settled-tracker.ts +237 -0
  245. package/src/server/full-orchestration.e2e.specs.ts +672 -0
  246. package/src/server/pipeline-server.e2e.specs.ts +505 -0
  247. package/src/server/pipeline-server.specs.ts +761 -0
  248. package/src/server/pipeline-server.ts +656 -0
  249. package/src/server/sse-manager.specs.ts +208 -0
  250. package/src/server/sse-manager.ts +79 -0
  251. package/src/testing/event-capture.specs.ts +143 -0
  252. package/src/testing/event-capture.ts +65 -0
  253. package/src/testing/fixtures/kanban-full.pipeline.specs.ts +337 -0
  254. package/src/testing/fixtures/kanban-full.pipeline.ts +225 -0
  255. package/src/testing/fixtures/kanban-todo.config.ts +19 -0
  256. package/src/testing/fixtures/kanban.pipeline.specs.ts +33 -0
  257. package/src/testing/fixtures/kanban.pipeline.ts +124 -0
  258. package/src/testing/kanban-todo.e2e.specs.ts +209 -0
  259. package/src/testing/mock-handlers.specs.ts +229 -0
  260. package/src/testing/mock-handlers.ts +58 -0
  261. package/src/testing/real-execution.e2e.specs.ts +193 -0
  262. package/src/testing/real-plugin.e2e.specs.ts +94 -0
  263. package/src/testing/server-startup.e2e.specs.ts +162 -0
  264. package/src/testing/snapshot-compare.specs.ts +136 -0
  265. package/src/testing/snapshot-compare.ts +106 -0
  266. package/src/testing/snapshot-sanitize.specs.ts +131 -0
  267. package/src/testing/snapshot-sanitize.ts +17 -0
  268. package/tsconfig.json +11 -0
  269. package/tsconfig.test.json +9 -0
  270. package/vitest.config.ts +29 -0
@@ -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