edsger 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/api/features/feature-utils.d.ts +13 -0
  2. package/dist/api/features/feature-utils.js +46 -0
  3. package/dist/api/features/get-feature.d.ts +5 -0
  4. package/dist/api/features/get-feature.js +19 -0
  5. package/dist/api/features/index.d.ts +7 -0
  6. package/dist/api/features/index.js +9 -0
  7. package/dist/api/features/status-updater.d.ts +27 -0
  8. package/dist/api/features/status-updater.js +64 -0
  9. package/dist/api/features/test-cases.d.ts +21 -0
  10. package/dist/api/features/test-cases.js +63 -0
  11. package/dist/api/features/update-feature.d.ts +13 -0
  12. package/dist/api/features/update-feature.js +31 -0
  13. package/dist/api/features/user-stories.d.ts +21 -0
  14. package/dist/api/features/user-stories.js +63 -0
  15. package/dist/api/features.d.ts +100 -0
  16. package/dist/api/features.js +219 -0
  17. package/dist/api/mcp-client.d.ts +18 -0
  18. package/dist/api/mcp-client.js +58 -0
  19. package/dist/api/products.d.ts +10 -0
  20. package/dist/api/products.js +22 -0
  21. package/dist/api/test-reports.d.ts +9 -0
  22. package/dist/api/test-reports.js +25 -0
  23. package/dist/cli/commands/code-implementation-command.d.ts +2 -0
  24. package/dist/cli/commands/code-implementation-command.js +36 -0
  25. package/dist/cli/commands/code-review-command.d.ts +2 -0
  26. package/dist/cli/commands/code-review-command.js +39 -0
  27. package/dist/cli/commands/feature-analysis-command.d.ts +2 -0
  28. package/dist/cli/commands/feature-analysis-command.js +36 -0
  29. package/dist/cli/commands/functional-testing-command.d.ts +2 -0
  30. package/dist/cli/commands/functional-testing-command.js +36 -0
  31. package/dist/cli/commands/technical-design-command.d.ts +2 -0
  32. package/dist/cli/commands/technical-design-command.js +36 -0
  33. package/dist/cli/commands/workflow-command.d.ts +2 -0
  34. package/dist/cli/commands/workflow-command.js +34 -0
  35. package/dist/cli/formatters/code-implementation-formatter.d.ts +9 -0
  36. package/dist/cli/formatters/code-implementation-formatter.js +27 -0
  37. package/dist/cli/formatters/feature-analysis-formatter.d.ts +2 -0
  38. package/dist/cli/formatters/feature-analysis-formatter.js +27 -0
  39. package/dist/cli/formatters/functional-testing-formatter.d.ts +15 -0
  40. package/dist/cli/formatters/functional-testing-formatter.js +37 -0
  41. package/dist/cli/formatters/technical-design-formatter.d.ts +7 -0
  42. package/dist/cli/formatters/technical-design-formatter.js +30 -0
  43. package/dist/cli/index.d.ts +3 -0
  44. package/dist/cli/index.js +99 -0
  45. package/dist/cli/utils/validation.d.ts +25 -0
  46. package/dist/cli/utils/validation.js +58 -0
  47. package/dist/cli/utils/workflow-utils.d.ts +21 -0
  48. package/dist/cli/utils/workflow-utils.js +47 -0
  49. package/dist/cli.d.ts +1 -1
  50. package/dist/cli.js +11 -466
  51. package/dist/config.d.ts +1 -1
  52. package/dist/index.d.ts +3 -3
  53. package/dist/index.js +2 -2
  54. package/dist/{bug-fixing → phases/bug-fixing}/analyzer.d.ts +1 -1
  55. package/dist/{bug-fixing → phases/bug-fixing}/analyzer.js +1 -1
  56. package/dist/{bug-fixing → phases/bug-fixing}/context-fetcher.d.ts +4 -22
  57. package/dist/{bug-fixing → phases/bug-fixing}/context-fetcher.js +14 -58
  58. package/dist/{bug-fixing → phases/bug-fixing}/mcp-server.js +1 -30
  59. package/dist/phases/code-implementation/analyzer.d.ts +33 -0
  60. package/dist/{code-implementation → phases/code-implementation}/analyzer.js +174 -15
  61. package/dist/phases/code-implementation/context-fetcher.d.ts +17 -0
  62. package/dist/phases/code-implementation/context-fetcher.js +86 -0
  63. package/dist/{code-implementation → phases/code-implementation}/mcp-server.js +1 -30
  64. package/dist/{code-review → phases/code-review}/reviewer.d.ts +1 -1
  65. package/dist/{feature-analysis → phases/feature-analysis}/analyzer.d.ts +3 -2
  66. package/dist/{feature-analysis → phases/feature-analysis}/analyzer.js +29 -127
  67. package/dist/phases/feature-analysis/context-fetcher.d.ts +18 -0
  68. package/dist/phases/feature-analysis/context-fetcher.js +86 -0
  69. package/dist/{feature-analysis → phases/feature-analysis}/http-fallback.js +1 -1
  70. package/dist/{feature-analysis → phases/feature-analysis}/mcp-server.js +1 -24
  71. package/dist/{functional-testing → phases/functional-testing}/analyzer.d.ts +17 -2
  72. package/dist/{functional-testing → phases/functional-testing}/analyzer.js +225 -31
  73. package/dist/phases/functional-testing/context-fetcher.d.ts +16 -0
  74. package/dist/phases/functional-testing/context-fetcher.js +81 -0
  75. package/dist/{functional-testing → phases/functional-testing}/http-fallback.js +1 -1
  76. package/dist/{functional-testing → phases/functional-testing}/index.d.ts +1 -1
  77. package/dist/{functional-testing → phases/functional-testing}/index.js +1 -1
  78. package/dist/{functional-testing → phases/functional-testing}/mcp-server.js +1 -30
  79. package/dist/{functional-testing → phases/functional-testing}/test-report-creator.js +1 -1
  80. package/dist/phases/functional-testing/test-retry-handler.d.ts +16 -0
  81. package/dist/phases/functional-testing/test-retry-handler.js +75 -0
  82. package/dist/{pull-request → phases/pull-request}/creator.js +47 -6
  83. package/dist/phases/pull-request/handler.d.ts +16 -0
  84. package/dist/phases/pull-request/handler.js +60 -0
  85. package/dist/{technical-design → phases/technical-design}/analyzer.d.ts +7 -2
  86. package/dist/phases/technical-design/analyzer.js +418 -0
  87. package/dist/phases/technical-design/context-fetcher.d.ts +12 -0
  88. package/dist/phases/technical-design/context-fetcher.js +39 -0
  89. package/dist/{technical-design → phases/technical-design}/http-fallback.js +1 -1
  90. package/dist/{technical-design → phases/technical-design}/mcp-server.js +1 -30
  91. package/dist/prompts/bug-fixing.d.ts +2 -0
  92. package/dist/prompts/bug-fixing.js +63 -0
  93. package/dist/prompts/code-implementation.d.ts +3 -0
  94. package/dist/prompts/code-implementation.js +132 -0
  95. package/dist/prompts/feature-analysis.d.ts +3 -0
  96. package/dist/prompts/feature-analysis.js +149 -0
  97. package/dist/prompts/formatters.d.ts +29 -0
  98. package/dist/prompts/formatters.js +139 -0
  99. package/dist/prompts/functional-testing.d.ts +3 -0
  100. package/dist/prompts/functional-testing.js +126 -0
  101. package/dist/prompts/index.d.ts +6 -0
  102. package/dist/prompts/index.js +7 -0
  103. package/dist/prompts/technical-design.d.ts +3 -0
  104. package/dist/prompts/technical-design.js +130 -0
  105. package/dist/services/checklist.d.ts +99 -0
  106. package/dist/services/checklist.js +337 -0
  107. package/dist/types/features.d.ts +29 -0
  108. package/dist/types/features.js +1 -0
  109. package/dist/types/index.d.ts +112 -0
  110. package/dist/types/index.js +1 -0
  111. package/dist/types/pipeline.d.ts +25 -0
  112. package/dist/types/pipeline.js +4 -0
  113. package/dist/utils/logger.d.ts +19 -0
  114. package/dist/utils/logger.js +52 -0
  115. package/dist/utils/pipeline-logger.d.ts +8 -0
  116. package/dist/utils/pipeline-logger.js +35 -0
  117. package/dist/workflow-runner/config/phase-configs.d.ts +5 -0
  118. package/dist/workflow-runner/config/phase-configs.js +34 -0
  119. package/dist/workflow-runner/config/stage-configs.d.ts +5 -0
  120. package/dist/workflow-runner/config/stage-configs.js +34 -0
  121. package/dist/workflow-runner/core/feature-filter.d.ts +16 -0
  122. package/dist/workflow-runner/core/feature-filter.js +46 -0
  123. package/dist/workflow-runner/core/feature-filter.test.d.ts +4 -0
  124. package/dist/workflow-runner/core/feature-filter.test.js +127 -0
  125. package/dist/workflow-runner/core/index.d.ts +8 -0
  126. package/dist/workflow-runner/core/index.js +12 -0
  127. package/dist/workflow-runner/core/pipeline-evaluator.d.ts +24 -0
  128. package/dist/workflow-runner/core/pipeline-evaluator.js +32 -0
  129. package/dist/workflow-runner/core/state-manager.d.ts +24 -0
  130. package/dist/workflow-runner/core/state-manager.js +42 -0
  131. package/dist/workflow-runner/core/workflow-logger.d.ts +20 -0
  132. package/dist/workflow-runner/core/workflow-logger.js +65 -0
  133. package/dist/workflow-runner/executors/phase-executor.d.ts +8 -0
  134. package/dist/workflow-runner/executors/phase-executor.js +183 -0
  135. package/dist/workflow-runner/executors/stage-executor.d.ts +8 -0
  136. package/dist/workflow-runner/executors/stage-executor.js +49 -0
  137. package/dist/workflow-runner/feature-service.d.ts +17 -0
  138. package/dist/workflow-runner/feature-service.js +60 -0
  139. package/dist/workflow-runner/feature-workflow-runner.d.ts +26 -0
  140. package/dist/workflow-runner/feature-workflow-runner.js +113 -0
  141. package/dist/workflow-runner/index.d.ts +0 -1
  142. package/dist/workflow-runner/index.js +0 -1
  143. package/dist/workflow-runner/pipeline-runner.d.ts +9 -19
  144. package/dist/workflow-runner/pipeline-runner.js +247 -256
  145. package/dist/workflow-runner/pipeline.d.ts +18 -0
  146. package/dist/workflow-runner/pipeline.js +197 -0
  147. package/dist/workflow-runner/processor.d.ts +40 -0
  148. package/dist/workflow-runner/processor.js +191 -0
  149. package/dist/workflow-runner/types.d.ts +48 -0
  150. package/dist/workflow-runner/types.js +4 -0
  151. package/dist/workflow-runner/workflow-processor.d.ts +6 -23
  152. package/dist/workflow-runner/workflow-processor.js +38 -100
  153. package/package.json +1 -1
  154. package/dist/code-implementation/analyzer.d.ts +0 -19
  155. package/dist/code-implementation/context-fetcher.d.ts +0 -38
  156. package/dist/code-implementation/context-fetcher.js +0 -147
  157. package/dist/feature-analysis/context-fetcher.d.ts +0 -54
  158. package/dist/feature-analysis/context-fetcher.js +0 -193
  159. package/dist/functional-testing/context-fetcher.d.ts +0 -47
  160. package/dist/functional-testing/context-fetcher.js +0 -192
  161. package/dist/technical-design/analyzer.js +0 -338
  162. package/dist/technical-design/context-fetcher.d.ts +0 -42
  163. package/dist/technical-design/context-fetcher.js +0 -170
  164. /package/dist/{bug-fixing → phases/bug-fixing}/index.d.ts +0 -0
  165. /package/dist/{bug-fixing → phases/bug-fixing}/index.js +0 -0
  166. /package/dist/{bug-fixing → phases/bug-fixing}/mcp-server.d.ts +0 -0
  167. /package/dist/{code-implementation → phases/code-implementation}/mcp-server.d.ts +0 -0
  168. /package/dist/{code-review → phases/code-review}/reviewer.js +0 -0
  169. /package/dist/{feature-analysis → phases/feature-analysis}/http-fallback.d.ts +0 -0
  170. /package/dist/{feature-analysis → phases/feature-analysis}/index.d.ts +0 -0
  171. /package/dist/{feature-analysis → phases/feature-analysis}/index.js +0 -0
  172. /package/dist/{feature-analysis → phases/feature-analysis}/mcp-server.d.ts +0 -0
  173. /package/dist/{functional-testing → phases/functional-testing}/http-fallback.d.ts +0 -0
  174. /package/dist/{functional-testing → phases/functional-testing}/mcp-server.d.ts +0 -0
  175. /package/dist/{functional-testing → phases/functional-testing}/test-report-creator.d.ts +0 -0
  176. /package/dist/{pull-request → phases/pull-request}/creator.d.ts +0 -0
  177. /package/dist/{technical-design → phases/technical-design}/http-fallback.d.ts +0 -0
  178. /package/dist/{technical-design → phases/technical-design}/mcp-server.d.ts +0 -0
@@ -0,0 +1,337 @@
1
+ /**
2
+ * Checklist service for pipeline integration
3
+ */
4
+ /**
5
+ * Fetch checklists for a specific phase
6
+ */
7
+ export async function getChecklistsForPhase(options, phase) {
8
+ const { mcpServerUrl, mcpToken, featureId } = options;
9
+ // Convert phase name from hyphen to underscore format for database compatibility
10
+ // e.g., 'feature-analysis' -> 'feature_analysis'
11
+ const dbPhase = phase.replace(/-/g, '_');
12
+ // Log the request details for debugging
13
+ const requestBody = {
14
+ jsonrpc: '2.0',
15
+ id: 1,
16
+ method: 'checklists/phase',
17
+ params: {
18
+ feature_id: featureId,
19
+ phase: dbPhase, // Use underscore format for database
20
+ },
21
+ };
22
+ console.log(`🔍 Fetching checklists: phase="${phase}" (db: "${dbPhase}"), feature_id="${featureId}"`);
23
+ const response = await fetch(`${mcpServerUrl}/mcp`, {
24
+ method: 'POST',
25
+ headers: {
26
+ 'Content-Type': 'application/json',
27
+ Authorization: `Bearer ${mcpToken}`,
28
+ },
29
+ body: JSON.stringify(requestBody),
30
+ });
31
+ if (!response.ok) {
32
+ const errorText = await response.text();
33
+ throw new Error(`Failed to fetch checklists for phase "${phase}": ${response.status} ${response.statusText}. Response: ${errorText}`);
34
+ }
35
+ const data = await response.json();
36
+ if (data.error) {
37
+ throw new Error(`MCP Error for phase "${phase}": ${data.error.message || JSON.stringify(data.error)}`);
38
+ }
39
+ // Handle empty result gracefully
40
+ if (!data.result) {
41
+ return {
42
+ phase,
43
+ feature_id: featureId,
44
+ checklists: [],
45
+ };
46
+ }
47
+ return data.result;
48
+ }
49
+ /**
50
+ * Validate checklist completion for a phase
51
+ */
52
+ export async function validateChecklistsForPhase(options, phase) {
53
+ const { mcpServerUrl, mcpToken, featureId } = options;
54
+ // Convert phase name from hyphen to underscore format for database compatibility
55
+ const dbPhase = phase.replace(/-/g, '_');
56
+ const response = await fetch(`${mcpServerUrl}/mcp`, {
57
+ method: 'POST',
58
+ headers: {
59
+ 'Content-Type': 'application/json',
60
+ Authorization: `Bearer ${mcpToken}`,
61
+ },
62
+ body: JSON.stringify({
63
+ jsonrpc: '2.0',
64
+ id: 1,
65
+ method: 'checklists/validate',
66
+ params: {
67
+ feature_id: featureId,
68
+ phase: dbPhase, // Use underscore format for database
69
+ },
70
+ }),
71
+ });
72
+ if (!response.ok) {
73
+ throw new Error(`Failed to validate checklists for phase: ${response.statusText}`);
74
+ }
75
+ const data = await response.json();
76
+ if (data.error) {
77
+ throw new Error(`MCP Error: ${data.error.message}`);
78
+ }
79
+ return data.result;
80
+ }
81
+ /**
82
+ * Create checklist results (mark as started/in-progress)
83
+ */
84
+ export async function createChecklistResult(options, checklistId, itemResults) {
85
+ const { mcpServerUrl, mcpToken, featureId } = options;
86
+ const response = await fetch(`${mcpServerUrl}/mcp`, {
87
+ method: 'POST',
88
+ headers: {
89
+ 'Content-Type': 'application/json',
90
+ Authorization: `Bearer ${mcpToken}`,
91
+ },
92
+ body: JSON.stringify({
93
+ jsonrpc: '2.0',
94
+ id: 1,
95
+ method: 'checklist_results/create',
96
+ params: {
97
+ feature_id: featureId,
98
+ checklist_id: checklistId,
99
+ item_results: itemResults,
100
+ },
101
+ }),
102
+ });
103
+ if (!response.ok) {
104
+ throw new Error(`Failed to create checklist result: ${response.statusText}`);
105
+ }
106
+ const data = await response.json();
107
+ if (data.error) {
108
+ throw new Error(`MCP Error: ${data.error.message}`);
109
+ }
110
+ return data.result;
111
+ }
112
+ /**
113
+ * Strictly validate that all required checklists have results
114
+ * Returns error if any checklists exist but don't have results
115
+ */
116
+ export async function validateRequiredChecklistResults(options, phase, verbose) {
117
+ try {
118
+ // Get checklists for this phase
119
+ const checklistContext = await getChecklistsForPhase(options, phase);
120
+ // If no checklists exist for this phase, validation passes
121
+ if (!checklistContext.checklists ||
122
+ checklistContext.checklists.length === 0) {
123
+ if (verbose) {
124
+ console.log(`📋 No checklists found for phase ${phase} - validation passes`);
125
+ }
126
+ return { success: true, missingChecklists: [] };
127
+ }
128
+ // Validate checklist completion
129
+ const validation = await validateChecklistsForPhase(options, phase);
130
+ const missingChecklists = [];
131
+ // Check each checklist to ensure it has been addressed with results
132
+ for (const checklistValidation of validation.checklists_validation) {
133
+ // If checklist exists but has no result created (status is 'not_started')
134
+ if (checklistValidation.status === 'not_started') {
135
+ missingChecklists.push(checklistValidation.checklist_name);
136
+ }
137
+ }
138
+ if (missingChecklists.length > 0) {
139
+ const errorMsg = `Phase ${phase} has ${checklistContext.checklists.length} MANDATORY checklists but ${missingChecklists.length} are missing results. All checklists must be addressed. Missing: ${missingChecklists.join(', ')}`;
140
+ if (verbose) {
141
+ console.log(`❌ ${errorMsg}`);
142
+ }
143
+ return {
144
+ success: false,
145
+ error: errorMsg,
146
+ missingChecklists,
147
+ };
148
+ }
149
+ if (verbose) {
150
+ console.log(`✅ All ${validation.checklists_validation.length} mandatory checklists for phase ${phase} have been addressed`);
151
+ }
152
+ return { success: true, missingChecklists: [] };
153
+ }
154
+ catch (error) {
155
+ const errorMsg = `Failed to validate mandatory checklist compliance for phase ${phase}: ${error instanceof Error ? error.message : String(error)}`;
156
+ return {
157
+ success: false,
158
+ error: errorMsg,
159
+ missingChecklists: [],
160
+ };
161
+ }
162
+ }
163
+ /**
164
+ * Create checklist item result
165
+ */
166
+ export async function createChecklistItemResult(options, checklistItemId, isPassed, value, notes) {
167
+ const { mcpServerUrl, mcpToken, featureId } = options;
168
+ const response = await fetch(`${mcpServerUrl}/mcp`, {
169
+ method: 'POST',
170
+ headers: {
171
+ 'Content-Type': 'application/json',
172
+ Authorization: `Bearer ${mcpToken}`,
173
+ },
174
+ body: JSON.stringify({
175
+ jsonrpc: '2.0',
176
+ id: 1,
177
+ method: 'checklist_item_results/create',
178
+ params: {
179
+ feature_id: featureId,
180
+ checklist_item_id: checklistItemId,
181
+ is_passed: isPassed,
182
+ value: value,
183
+ notes: notes,
184
+ },
185
+ }),
186
+ });
187
+ if (!response.ok) {
188
+ throw new Error(`Failed to create checklist item result: ${response.statusText}`);
189
+ }
190
+ const data = await response.json();
191
+ if (data.error) {
192
+ throw new Error(`MCP Error: ${data.error.message}`);
193
+ }
194
+ return data.result;
195
+ }
196
+ /**
197
+ * Process checklist item results from phase JSON response and create MCP results
198
+ */
199
+ export async function processChecklistItemResultsFromResponse(options, phase, checklistItemResults, verbose) {
200
+ const errors = [];
201
+ let created = 0;
202
+ if (!checklistItemResults || checklistItemResults.length === 0) {
203
+ if (verbose) {
204
+ console.log('📋 No checklist item results to process');
205
+ }
206
+ return { created, errors };
207
+ }
208
+ // Get current checklists to map checklist_item_id to checklist_id
209
+ const checklistContext = await getChecklistsForPhase(options, phase);
210
+ // Create a map from checklist_item_id to checklist_id
211
+ const itemToChecklistMap = new Map();
212
+ const checklistIds = new Set();
213
+ for (const checklist of checklistContext.checklists) {
214
+ checklistIds.add(checklist.id);
215
+ for (const item of checklist.items) {
216
+ itemToChecklistMap.set(item.id, checklist.id);
217
+ }
218
+ }
219
+ // Group checklist item results by checklist
220
+ const resultsByChecklist = new Map();
221
+ for (const result of checklistItemResults) {
222
+ const checklistId = itemToChecklistMap.get(result.checklist_item_id);
223
+ if (!checklistId) {
224
+ const errorMsg = `Could not find checklist for item ${result.checklist_item_id}`;
225
+ errors.push(errorMsg);
226
+ if (verbose) {
227
+ console.log(`❌ ${errorMsg}`);
228
+ }
229
+ continue;
230
+ }
231
+ if (!resultsByChecklist.has(checklistId)) {
232
+ resultsByChecklist.set(checklistId, []);
233
+ }
234
+ resultsByChecklist.get(checklistId).push({
235
+ checklist_item_id: result.checklist_item_id,
236
+ is_passed: result.is_passed,
237
+ value: result.value,
238
+ notes: result.notes,
239
+ });
240
+ }
241
+ // Create checklist results with item results for each checklist
242
+ for (const [checklistId, itemResults] of resultsByChecklist) {
243
+ try {
244
+ await createChecklistResult(options, checklistId, itemResults);
245
+ created += itemResults.length;
246
+ if (verbose) {
247
+ console.log(`📋 Created checklist result for ${checklistId} with ${itemResults.length} item results`);
248
+ for (const itemResult of itemResults) {
249
+ const status = itemResult.is_passed ? '✅' : '❌';
250
+ console.log(` ${status} Item: ${itemResult.checklist_item_id}`);
251
+ if (itemResult.notes) {
252
+ console.log(` Notes: ${itemResult.notes}`);
253
+ }
254
+ }
255
+ }
256
+ }
257
+ catch (error) {
258
+ const errorMsg = `Failed to create checklist result for ${checklistId}: ${error instanceof Error ? error.message : String(error)}`;
259
+ errors.push(errorMsg);
260
+ if (verbose) {
261
+ console.log(`❌ ${errorMsg}`);
262
+ }
263
+ }
264
+ }
265
+ return { created, errors };
266
+ }
267
+ /**
268
+ * Process checklist results from phase JSON response and create MCP results
269
+ */
270
+ export async function processChecklistResultsFromResponse(options, checklistResults, verbose) {
271
+ const errors = [];
272
+ let created = 0;
273
+ if (!checklistResults || checklistResults.length === 0) {
274
+ if (verbose) {
275
+ console.log('📋 No checklist results to process');
276
+ }
277
+ return { created, errors };
278
+ }
279
+ for (const result of checklistResults) {
280
+ if (result.satisfied) {
281
+ try {
282
+ await createChecklistResult(options, result.checklist_id);
283
+ created++;
284
+ if (verbose) {
285
+ console.log(`✅ Created checklist result for: ${result.checklist_id}`);
286
+ if (result.notes) {
287
+ console.log(` Notes: ${result.notes}`);
288
+ }
289
+ }
290
+ }
291
+ catch (error) {
292
+ const errorMsg = `Failed to create checklist result for ${result.checklist_id}: ${error instanceof Error ? error.message : String(error)}`;
293
+ errors.push(errorMsg);
294
+ if (verbose) {
295
+ console.log(`❌ ${errorMsg}`);
296
+ }
297
+ }
298
+ }
299
+ else {
300
+ // For unsatisfied checklists, still create a result but mark as failed/incomplete
301
+ if (verbose) {
302
+ console.log(`⚠️ Checklist ${result.checklist_id} marked as NOT satisfied`);
303
+ if (result.notes) {
304
+ console.log(` Reason: ${result.notes}`);
305
+ }
306
+ }
307
+ // Note: We still need to create some form of result to track that this checklist was addressed
308
+ // but marked as unsatisfied. The current MCP API might need to support this case.
309
+ }
310
+ }
311
+ return { created, errors };
312
+ }
313
+ /**
314
+ * Format checklist context as string for LLM consumption
315
+ */
316
+ export function formatChecklistsForContext(context) {
317
+ if (!context.checklists || context.checklists.length === 0) {
318
+ return `No checklists defined for phase: ${context.phase}`;
319
+ }
320
+ const sections = context.checklists
321
+ .map((checklist) => {
322
+ const itemsText = checklist.items
323
+ .map((item) => ` - **${item.title}** (ID: ${item.id})${item.is_required ? ' (required)' : ''}: ${item.description || 'No description'}`)
324
+ .join('\n');
325
+ return `**${checklist.name}** (${checklist.role})
326
+ ID: ${checklist.id}
327
+ ${checklist.description || 'No description'}
328
+ Items:
329
+ ${itemsText}`;
330
+ })
331
+ .join('\n\n');
332
+ return `# Checklists for ${context.phase} phase
333
+
334
+ ${sections}
335
+
336
+ Please review these checklists and ensure your work addresses the relevant requirements for your role. These checklists will be used to validate the completion of this phase.`;
337
+ }
@@ -0,0 +1,29 @@
1
+ export interface FeatureInfo {
2
+ id: string;
3
+ name: string;
4
+ description?: string;
5
+ technical_design?: string;
6
+ status: string;
7
+ product_id: string;
8
+ execution_mode?: string;
9
+ created_at?: string;
10
+ updated_at?: string;
11
+ }
12
+ export interface UserStory {
13
+ id: string;
14
+ title: string;
15
+ description: string;
16
+ status: string;
17
+ created_at?: string;
18
+ updated_at?: string;
19
+ [key: string]: any;
20
+ }
21
+ export interface TestCase {
22
+ id: string;
23
+ name: string;
24
+ description: string;
25
+ is_critical: boolean;
26
+ created_at?: string;
27
+ updated_at?: string;
28
+ [key: string]: any;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,112 @@
1
+ export interface EdsgerConfig {
2
+ patterns: string[];
3
+ exclude: string[];
4
+ severity: 'error' | 'warning';
5
+ maxFiles: number;
6
+ claude: {
7
+ model?: string;
8
+ timeout?: number;
9
+ };
10
+ }
11
+ export interface GitFile {
12
+ path: string;
13
+ content: string;
14
+ status: 'modified' | 'added' | 'deleted' | 'renamed';
15
+ }
16
+ export interface ReviewResult {
17
+ file: string;
18
+ status: 'OK' | 'WARN' | 'BLOCK';
19
+ message: string;
20
+ details?: string;
21
+ }
22
+ export interface CliOptions {
23
+ review?: boolean;
24
+ staged?: boolean;
25
+ files?: string[];
26
+ config?: string;
27
+ verbose?: boolean;
28
+ featureAnalysis?: string;
29
+ technicalDesign?: string;
30
+ implement?: string;
31
+ test?: string;
32
+ workflow?: boolean;
33
+ }
34
+ export type ReviewSeverity = 'error' | 'warning';
35
+ export type ExitCode = 0 | 1;
36
+ export interface FeatureAnalysisResult {
37
+ featureId: string;
38
+ productInfo: unknown;
39
+ featureInfo: unknown;
40
+ existingUserStories: UserStory[];
41
+ existingTestCases: TestCase[];
42
+ createdUserStories: UserStory[];
43
+ createdTestCases: TestCase[];
44
+ summary: string;
45
+ status: 'pending' | 'success' | 'error';
46
+ data?: {
47
+ checklist_results?: Array<{
48
+ checklist_id: string;
49
+ satisfied: boolean;
50
+ notes?: string;
51
+ }>;
52
+ checklist_item_results?: Array<{
53
+ checklist_item_id: string;
54
+ is_passed: boolean;
55
+ value?: any;
56
+ notes?: string;
57
+ }>;
58
+ };
59
+ }
60
+ export interface FeatureData {
61
+ feature: {
62
+ id: string;
63
+ name: string;
64
+ description: string;
65
+ status: string;
66
+ product_id: string;
67
+ created_at: string;
68
+ updated_at: string;
69
+ };
70
+ product: {
71
+ id: string;
72
+ name: string;
73
+ description: string;
74
+ status: string;
75
+ features: unknown[];
76
+ metadata: {
77
+ created_at: string;
78
+ updated_at: string;
79
+ };
80
+ };
81
+ }
82
+ export interface UserStory {
83
+ id: string;
84
+ title: string;
85
+ description: string;
86
+ status: 'draft' | 'ready' | 'in_progress' | 'done' | 'cancelled';
87
+ created_at: string;
88
+ updated_at: string;
89
+ }
90
+ export interface TestCase {
91
+ id: string;
92
+ name: string;
93
+ description: string;
94
+ is_critical: boolean;
95
+ created_at: string;
96
+ updated_at: string;
97
+ }
98
+ export interface DisplayUserStory {
99
+ title: string;
100
+ }
101
+ export interface DisplayTestCase {
102
+ name: string;
103
+ is_critical?: boolean;
104
+ }
105
+ export interface FeatureAnalysisDisplayResult {
106
+ featureId: string;
107
+ status: string;
108
+ summary?: string;
109
+ createdUserStories?: DisplayUserStory[];
110
+ createdTestCases?: DisplayTestCase[];
111
+ }
112
+ export type FeatureStatus = 'backlog' | 'ready_for_dev' | 'feature_analysis' | 'technical_design' | 'code_implementation' | 'code_review' | 'ready_for_review' | 'shipped' | 'testing_in_progress' | 'testing_passed' | 'testing_failed';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Type definitions for pipeline execution
3
+ */
4
+ import { EdsgerConfig } from './index.js';
5
+ import { ChecklistPhaseContext } from '../services/checklist.js';
6
+ export type ExecutionMode = 'full_pipeline' | 'only_feature_analysis' | 'only_technical_design' | 'only_code_implementation' | 'only_functional_testing' | 'from_feature_analysis' | 'from_technical_design' | 'from_code_implementation' | 'from_functional_testing';
7
+ export interface PipelinePhaseOptions {
8
+ readonly featureId: string;
9
+ readonly mcpServerUrl: string;
10
+ readonly mcpToken: string;
11
+ readonly verbose?: boolean;
12
+ }
13
+ export interface PipelineResult {
14
+ readonly featureId: string;
15
+ readonly phase: string;
16
+ readonly status: 'success' | 'error';
17
+ readonly message: string;
18
+ readonly data?: unknown;
19
+ }
20
+ export interface PhaseConfig {
21
+ readonly name: string;
22
+ readonly checkRequirements: () => Promise<boolean>;
23
+ readonly execute: (options: PipelinePhaseOptions, config: EdsgerConfig, checklistContext?: ChecklistPhaseContext | null) => Promise<any>;
24
+ readonly requirementsError: string;
25
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type definitions for pipeline execution
3
+ */
4
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ReviewResult } from '../types/index.js';
2
+ export declare const colors: {
3
+ reset: string;
4
+ bright: string;
5
+ red: string;
6
+ green: string;
7
+ yellow: string;
8
+ blue: string;
9
+ magenta: string;
10
+ cyan: string;
11
+ gray: string;
12
+ };
13
+ export declare const colorize: (text: string, color: keyof typeof colors) => string;
14
+ export declare const logInfo: (message: string) => void;
15
+ export declare const logSuccess: (message: string) => void;
16
+ export declare const logWarning: (message: string) => void;
17
+ export declare const logError: (message: string) => void;
18
+ export declare const logProgress: (current: number, total: number, file: string) => void;
19
+ export declare const logResults: (results: ReviewResult[], verbose?: boolean) => void;
@@ -0,0 +1,52 @@
1
+ export const colors = {
2
+ reset: '\x1b[0m',
3
+ bright: '\x1b[1m',
4
+ red: '\x1b[31m',
5
+ green: '\x1b[32m',
6
+ yellow: '\x1b[33m',
7
+ blue: '\x1b[34m',
8
+ magenta: '\x1b[35m',
9
+ cyan: '\x1b[36m',
10
+ gray: '\x1b[90m'
11
+ };
12
+ export const colorize = (text, color) => {
13
+ return `${colors[color]}${text}${colors.reset}`;
14
+ };
15
+ export const logInfo = (message) => {
16
+ console.log(colorize(`ℹ ${message}`, 'blue'));
17
+ };
18
+ export const logSuccess = (message) => {
19
+ console.log(colorize(`✓ ${message}`, 'green'));
20
+ };
21
+ export const logWarning = (message) => {
22
+ console.log(colorize(`⚠ ${message}`, 'yellow'));
23
+ };
24
+ export const logError = (message) => {
25
+ console.error(colorize(`✗ ${message}`, 'red'));
26
+ };
27
+ export const logProgress = (current, total, file) => {
28
+ const percentage = Math.round((current / total) * 100);
29
+ const progress = `[${current}/${total}] ${percentage}%`;
30
+ console.log(colorize(`${progress} Reviewing ${file}`, 'gray'));
31
+ };
32
+ export const logResults = (results, verbose = false) => {
33
+ const okCount = results.filter(r => r.status === 'OK').length;
34
+ const warnCount = results.filter(r => r.status === 'WARN').length;
35
+ const blockCount = results.filter(r => r.status === 'BLOCK').length;
36
+ console.log('\n' + colorize('='.repeat(60), 'gray'));
37
+ console.log(colorize('Review Results', 'bright'));
38
+ console.log(colorize('='.repeat(60), 'gray'));
39
+ results.forEach(result => {
40
+ const icon = result.status === 'OK' ? '✓' : result.status === 'WARN' ? '⚠' : '✗';
41
+ const color = result.status === 'OK' ? 'green' : result.status === 'WARN' ? 'yellow' : 'red';
42
+ console.log(colorize(`${icon} ${result.file}: ${result.message}`, color));
43
+ if (verbose && result.details && result.status !== 'OK') {
44
+ console.log(colorize(` Details: ${result.details}`, 'gray'));
45
+ }
46
+ });
47
+ console.log('\n' + colorize('Summary:', 'bright'));
48
+ console.log(colorize(` ✓ Passed: ${okCount}`, 'green'));
49
+ console.log(colorize(` ⚠ Warnings: ${warnCount}`, 'yellow'));
50
+ console.log(colorize(` ✗ Blocked: ${blockCount}`, 'red'));
51
+ console.log(colorize(` Total: ${results.length} files reviewed`, 'gray'));
52
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Logging utilities for pipeline execution
3
+ */
4
+ import { PipelineResult } from '../types/pipeline.js';
5
+ export declare const logPipelineStart: (featureId: string, verbose?: boolean) => void;
6
+ export declare const logPhaseResult: (result: PipelineResult, verbose?: boolean) => PipelineResult;
7
+ export declare const logPipelineComplete: (results: readonly PipelineResult[], verbose?: boolean) => readonly PipelineResult[];
8
+ export declare const shouldContinuePipeline: (results: readonly PipelineResult[]) => boolean;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Logging utilities for pipeline execution
3
+ */
4
+ // Pipeline execution utilities
5
+ export const logPipelineStart = (featureId, verbose) => {
6
+ if (verbose) {
7
+ console.log(`🚀 Starting complete pipeline for feature: ${featureId}`);
8
+ console.log('📋 Pipeline phases: feature-analysis → technical-design → code-implementation → functional-testing');
9
+ }
10
+ };
11
+ export const logPhaseResult = (result, verbose) => {
12
+ if (verbose) {
13
+ const statusIcon = result.status === 'success' ? '✅' : '❌';
14
+ console.log(`${statusIcon} ${result.phase}: ${result.message}`);
15
+ }
16
+ return result;
17
+ };
18
+ export const logPipelineComplete = (results, verbose) => {
19
+ if (verbose) {
20
+ const lastResult = results[results.length - 1];
21
+ const featureId = lastResult?.featureId;
22
+ if (lastResult?.status === 'success') {
23
+ console.log(`✅ Complete pipeline finished successfully for feature: ${featureId}`);
24
+ }
25
+ else {
26
+ console.log(`❌ Pipeline failed at ${lastResult?.phase}: ${lastResult?.message}`);
27
+ }
28
+ }
29
+ return results;
30
+ };
31
+ // Pure function to check if pipeline should continue
32
+ export const shouldContinuePipeline = (results) => {
33
+ const lastResult = results[results.length - 1];
34
+ return lastResult?.status === 'success';
35
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Phase configurations for the pipeline runner
3
+ */
4
+ import { PhaseConfig } from '../../types/pipeline.js';
5
+ export declare const phaseConfigs: readonly PhaseConfig[];
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Phase configurations for the pipeline runner
3
+ */
4
+ import { analyzeFeatureWithMCP, checkFeatureAnalysisRequirements, } from '../../phases/feature-analysis/analyzer.js';
5
+ import { generateTechnicalDesign, checkTechnicalDesignRequirements, } from '../../phases/technical-design/analyzer.js';
6
+ import { implementFeatureCode, checkCodeImplementationRequirements, } from '../../phases/code-implementation/analyzer.js';
7
+ import { runFunctionalTesting, checkFunctionalTestingRequirements, } from '../../phases/functional-testing/analyzer.js';
8
+ // Pipeline phase configurations
9
+ export const phaseConfigs = [
10
+ {
11
+ name: 'feature-analysis',
12
+ checkRequirements: checkFeatureAnalysisRequirements,
13
+ execute: analyzeFeatureWithMCP,
14
+ requirementsError: 'Feature analysis requirements not met. Install with: npm install @anthropic-ai/claude-code zod',
15
+ },
16
+ {
17
+ name: 'technical-design',
18
+ checkRequirements: checkTechnicalDesignRequirements,
19
+ execute: generateTechnicalDesign,
20
+ requirementsError: 'Technical design requirements not met. Install with: npm install @anthropic-ai/claude-code zod',
21
+ },
22
+ {
23
+ name: 'code-implementation',
24
+ checkRequirements: checkCodeImplementationRequirements,
25
+ execute: implementFeatureCode,
26
+ requirementsError: 'Code implementation requirements not met. Install with: npm install @anthropic-ai/claude-code zod',
27
+ },
28
+ {
29
+ name: 'functional-testing',
30
+ checkRequirements: checkFunctionalTestingRequirements,
31
+ execute: runFunctionalTesting,
32
+ requirementsError: 'Functional testing requirements not met. Install with: npm install @anthropic-ai/claude-code zod',
33
+ },
34
+ ];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Stage configurations for the pipeline runner
3
+ */
4
+ import { StageConfig } from '../../types/pipeline.js';
5
+ export declare const stageConfigs: readonly StageConfig[];