edsger 0.2.3 → 0.2.5
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/README.md +17 -0
- package/dist/api/features/batch-operations.d.ts +16 -0
- package/dist/api/features/batch-operations.js +100 -0
- package/dist/api/features/index.d.ts +1 -0
- package/dist/api/features/index.js +1 -0
- package/dist/api/features/test-cases.d.ts +8 -0
- package/dist/api/features/test-cases.js +45 -0
- package/dist/api/features/user-stories.d.ts +8 -0
- package/dist/api/features/user-stories.js +45 -0
- package/dist/cli/commands/refactor-command.d.ts +2 -0
- package/dist/cli/commands/refactor-command.js +123 -0
- package/dist/cli/formatters/formatter-utils.d.ts +23 -0
- package/dist/cli/formatters/formatter-utils.js +67 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/utils/command-handler.d.ts +23 -0
- package/dist/cli/utils/command-handler.js +39 -0
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +4 -99
- package/dist/phases/code-implementation/analyzer-helpers.d.ts +28 -0
- package/dist/phases/code-implementation/analyzer-helpers.js +177 -0
- package/dist/phases/code-implementation/analyzer.d.ts +2 -0
- package/dist/phases/code-implementation/analyzer.js +304 -175
- package/dist/phases/code-implementation-verification/index.d.ts +1 -0
- package/dist/phases/code-implementation-verification/index.js +1 -0
- package/dist/phases/code-implementation-verification/verifier.d.ts +31 -0
- package/dist/phases/code-implementation-verification/verifier.js +196 -0
- package/dist/phases/feature-analysis/analyzer-helpers.d.ts +62 -0
- package/dist/phases/feature-analysis/analyzer-helpers.js +450 -0
- package/dist/phases/feature-analysis/analyzer.d.ts +1 -0
- package/dist/phases/feature-analysis/analyzer.js +132 -219
- package/dist/phases/feature-analysis-verification/index.d.ts +1 -0
- package/dist/phases/feature-analysis-verification/index.js +1 -0
- package/dist/phases/feature-analysis-verification/verifier.d.ts +37 -0
- package/dist/phases/feature-analysis-verification/verifier.js +147 -0
- package/dist/phases/pull-request/creator.js +2 -1
- package/dist/phases/technical-design/analyzer-helpers.d.ts +37 -0
- package/dist/phases/technical-design/analyzer-helpers.js +144 -0
- package/dist/phases/technical-design/analyzer.d.ts +3 -0
- package/dist/phases/technical-design/analyzer.js +282 -318
- package/dist/phases/technical-design-verification/index.d.ts +1 -0
- package/dist/phases/technical-design-verification/index.js +1 -0
- package/dist/phases/technical-design-verification/verifier.d.ts +36 -0
- package/dist/phases/technical-design-verification/verifier.js +147 -0
- package/dist/prompts/checklist-verification.d.ts +11 -0
- package/dist/prompts/checklist-verification.js +153 -0
- package/dist/prompts/code-implementation-improvement.d.ts +5 -0
- package/dist/prompts/code-implementation-improvement.js +108 -0
- package/dist/prompts/code-implementation-verification.d.ts +3 -0
- package/dist/prompts/code-implementation-verification.js +176 -0
- package/dist/prompts/feature-analysis-improvement.d.ts +8 -0
- package/dist/prompts/feature-analysis-improvement.js +109 -0
- package/dist/prompts/feature-analysis.js +1 -1
- package/dist/prompts/technical-design-improvement.d.ts +5 -0
- package/dist/prompts/technical-design-improvement.js +93 -0
- package/dist/prompts/technical-design-verification.d.ts +11 -0
- package/dist/prompts/technical-design-verification.js +134 -0
- package/dist/prompts/technical-design.js +1 -1
- package/dist/services/audit-logs.d.ts +60 -0
- package/dist/services/audit-logs.js +115 -0
- package/dist/services/checklist.d.ts +1 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/workflow-runner/executors/phase-executor.js +56 -12
- package/package.json +1 -1
- package/dist/api/features.d.ts +0 -100
- package/dist/api/features.js +0 -219
- package/dist/logger.d.ts +0 -19
- package/dist/logger.js +0 -52
- package/dist/types.d.ts +0 -99
- package/dist/types.js +0 -1
- package/dist/utils/image-processor.d.ts +0 -5
- package/dist/utils/image-processor.js +0 -55
- package/dist/workflow-runner/config/stage-configs.d.ts +0 -5
- package/dist/workflow-runner/config/stage-configs.js +0 -34
- package/dist/workflow-runner/core/feature-filter.test.d.ts +0 -4
- package/dist/workflow-runner/core/feature-filter.test.js +0 -127
- package/dist/workflow-runner/executors/stage-executor.d.ts +0 -8
- package/dist/workflow-runner/executors/stage-executor.js +0 -49
- package/dist/workflow-runner/feature-fetcher.d.ts +0 -41
- package/dist/workflow-runner/feature-fetcher.js +0 -121
- package/dist/workflow-runner/feature-service.d.ts +0 -17
- package/dist/workflow-runner/feature-service.js +0 -60
- package/dist/workflow-runner/pipeline.d.ts +0 -18
- package/dist/workflow-runner/pipeline.js +0 -197
- package/dist/workflow-runner/processor.d.ts +0 -40
- package/dist/workflow-runner/processor.js +0 -191
- package/dist/workflow-runner/status-updater.d.ts +0 -27
- package/dist/workflow-runner/status-updater.js +0 -80
- package/dist/workflow-runner/types.d.ts +0 -48
- package/dist/workflow-runner/types.js +0 -4
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { logInfo, logError } from '../../utils/logger.js';
|
|
2
|
+
import { processChecklistItemResultsFromResponse, } from '../../services/checklist.js';
|
|
3
|
+
import { verifyTechnicalDesignCompliance, } from '../technical-design-verification/index.js';
|
|
4
|
+
import { createTechnicalDesignImprovementPrompt } from '../../prompts/technical-design-improvement.js';
|
|
5
|
+
import { logFeatureVerificationEvent } from '../../services/audit-logs.js';
|
|
6
|
+
/**
|
|
7
|
+
* Perform verification and determine if iteration should continue
|
|
8
|
+
*/
|
|
9
|
+
export async function performVerificationCycle(technicalDesign, checklistContext, featureId, featureName, featureDescription, config, currentIteration, maxIterations, mcpServerUrl, mcpToken, verbose) {
|
|
10
|
+
// No verification needed if no checklist context
|
|
11
|
+
if (!checklistContext || checklistContext.checklists.length === 0) {
|
|
12
|
+
return { passed: true, verificationResult: null };
|
|
13
|
+
}
|
|
14
|
+
if (verbose) {
|
|
15
|
+
logInfo('🔍 Starting technical design verification...');
|
|
16
|
+
}
|
|
17
|
+
const verificationResult = await verifyTechnicalDesignCompliance({
|
|
18
|
+
checklistContext,
|
|
19
|
+
featureId,
|
|
20
|
+
featureName,
|
|
21
|
+
featureDescription,
|
|
22
|
+
technicalDesign,
|
|
23
|
+
verbose,
|
|
24
|
+
}, config);
|
|
25
|
+
// Verification passed
|
|
26
|
+
if (verificationResult.rejected_count === 0) {
|
|
27
|
+
if (verbose) {
|
|
28
|
+
logInfo(`✅ Checklist verification passed: ${verificationResult.confirmed_count} confirmed, ${verificationResult.uncertain_count} uncertain`);
|
|
29
|
+
}
|
|
30
|
+
// Log verification success
|
|
31
|
+
await logFeatureVerificationEvent(mcpServerUrl, mcpToken, {
|
|
32
|
+
featureId,
|
|
33
|
+
phase: 'technical_design',
|
|
34
|
+
iteration: currentIteration,
|
|
35
|
+
result: 'success',
|
|
36
|
+
verificationData: {
|
|
37
|
+
confirmed_count: verificationResult.confirmed_count,
|
|
38
|
+
rejected_count: verificationResult.rejected_count,
|
|
39
|
+
uncertain_count: verificationResult.uncertain_count,
|
|
40
|
+
summary: verificationResult.summary,
|
|
41
|
+
},
|
|
42
|
+
}, verbose);
|
|
43
|
+
// Create checklist results based on verification result
|
|
44
|
+
const checklistItemResults = verificationResult.item_verifications.map((item) => ({
|
|
45
|
+
checklist_item_id: item.checklist_item_id,
|
|
46
|
+
is_passed: item.is_satisfied && item.verification_status === 'confirmed',
|
|
47
|
+
value: item.verification_status,
|
|
48
|
+
notes: item.verification_reason || undefined,
|
|
49
|
+
}));
|
|
50
|
+
await processChecklistItemResultsFromResponse({ featureId, mcpServerUrl, mcpToken }, 'technical_design', checklistItemResults, verbose);
|
|
51
|
+
return { passed: true, verificationResult };
|
|
52
|
+
}
|
|
53
|
+
// Verification failed
|
|
54
|
+
logError(`❌ Iteration ${currentIteration}: Checklist verification FAILED - ${verificationResult.rejected_count} items rejected, ${verificationResult.uncertain_count} uncertain`);
|
|
55
|
+
// Log verification failure with improvement suggestions
|
|
56
|
+
await logFeatureVerificationEvent(mcpServerUrl, mcpToken, {
|
|
57
|
+
featureId,
|
|
58
|
+
phase: 'technical_design',
|
|
59
|
+
iteration: currentIteration,
|
|
60
|
+
result: 'error',
|
|
61
|
+
verificationData: {
|
|
62
|
+
confirmed_count: verificationResult.confirmed_count,
|
|
63
|
+
rejected_count: verificationResult.rejected_count,
|
|
64
|
+
uncertain_count: verificationResult.uncertain_count,
|
|
65
|
+
rejected_items: verificationResult.item_verifications
|
|
66
|
+
.filter((item) => item.verification_status === 'rejected')
|
|
67
|
+
.map((item) => ({
|
|
68
|
+
checklist_item_id: item.checklist_item_id,
|
|
69
|
+
reason: item.verification_reason || 'No reason provided',
|
|
70
|
+
concerns: item.concerns || [],
|
|
71
|
+
improvement_suggestions: item.improvement_suggestions || [],
|
|
72
|
+
})),
|
|
73
|
+
uncertain_items: verificationResult.item_verifications
|
|
74
|
+
.filter((item) => item.verification_status === 'uncertain')
|
|
75
|
+
.map((item) => ({
|
|
76
|
+
checklist_item_id: item.checklist_item_id,
|
|
77
|
+
reason: item.verification_reason || 'No reason provided',
|
|
78
|
+
concerns: item.concerns || [],
|
|
79
|
+
improvement_suggestions: item.improvement_suggestions || [],
|
|
80
|
+
})),
|
|
81
|
+
summary: verificationResult.summary,
|
|
82
|
+
overall_suggestions: verificationResult.overall_suggestions || [],
|
|
83
|
+
},
|
|
84
|
+
}, verbose);
|
|
85
|
+
// Check if we can iterate again
|
|
86
|
+
if (currentIteration < maxIterations) {
|
|
87
|
+
if (verbose) {
|
|
88
|
+
logInfo(` Will retry with improvement feedback (${maxIterations - currentIteration} attempts remaining)`);
|
|
89
|
+
}
|
|
90
|
+
// Create improvement prompt for next iteration
|
|
91
|
+
const nextPrompt = createTechnicalDesignImprovementPrompt(verificationResult, technicalDesign);
|
|
92
|
+
return { passed: false, verificationResult, nextPrompt };
|
|
93
|
+
}
|
|
94
|
+
// Max iterations reached - create checklist results based on final verification
|
|
95
|
+
logError(`❌ Maximum iterations (${maxIterations}) reached. Checklist verification still failing.`);
|
|
96
|
+
// Create checklist results for all items (both passed and failed)
|
|
97
|
+
const checklistItemResults = verificationResult.item_verifications.map((item) => ({
|
|
98
|
+
checklist_item_id: item.checklist_item_id,
|
|
99
|
+
is_passed: item.is_satisfied && item.verification_status === 'confirmed',
|
|
100
|
+
value: item.verification_status,
|
|
101
|
+
notes: item.verification_reason || undefined,
|
|
102
|
+
}));
|
|
103
|
+
await processChecklistItemResultsFromResponse({ featureId, mcpServerUrl, mcpToken }, 'technical_design', checklistItemResults, verbose);
|
|
104
|
+
return { passed: false, verificationResult };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Build successful design result
|
|
108
|
+
*/
|
|
109
|
+
export function buildDesignResult(featureId, technicalDesign, summary, iterations, checklistItemResults) {
|
|
110
|
+
return {
|
|
111
|
+
featureId,
|
|
112
|
+
technicalDesign,
|
|
113
|
+
status: 'success',
|
|
114
|
+
summary,
|
|
115
|
+
iterations,
|
|
116
|
+
data: checklistItemResults
|
|
117
|
+
? { checklist_item_results: checklistItemResults }
|
|
118
|
+
: undefined,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Build verification failure result
|
|
123
|
+
*/
|
|
124
|
+
export function buildVerificationFailureResult(featureId, technicalDesign, verificationResult, iterations) {
|
|
125
|
+
return {
|
|
126
|
+
featureId,
|
|
127
|
+
technicalDesign,
|
|
128
|
+
status: 'error',
|
|
129
|
+
summary: `Checklist verification failed after ${iterations} iterations: ${verificationResult.summary}`,
|
|
130
|
+
verificationResult,
|
|
131
|
+
iterations,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Build error result when no design was generated
|
|
136
|
+
*/
|
|
137
|
+
export function buildNoResultsError(featureId) {
|
|
138
|
+
return {
|
|
139
|
+
featureId,
|
|
140
|
+
technicalDesign: null,
|
|
141
|
+
status: 'error',
|
|
142
|
+
summary: 'Failed to generate technical design - no valid result received',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -5,12 +5,15 @@ export interface TechnicalDesignOptions {
|
|
|
5
5
|
mcpServerUrl: string;
|
|
6
6
|
mcpToken: string;
|
|
7
7
|
verbose?: boolean;
|
|
8
|
+
maxVerificationIterations?: number;
|
|
8
9
|
}
|
|
9
10
|
export interface TechnicalDesignResult {
|
|
10
11
|
featureId: string;
|
|
11
12
|
technicalDesign: string | null;
|
|
12
13
|
status: 'success' | 'error';
|
|
13
14
|
summary: string;
|
|
15
|
+
verificationResult?: any;
|
|
16
|
+
iterations?: number;
|
|
14
17
|
savedViaHttp?: boolean;
|
|
15
18
|
data?: {
|
|
16
19
|
checklist_item_results?: any[];
|