edsger 0.30.0 → 0.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +28 -0
- package/.env.local +12 -0
- package/dist/api/features/__tests__/regression-prevention.test.d.ts +5 -0
- package/dist/api/features/__tests__/regression-prevention.test.js +338 -0
- package/dist/api/features/__tests__/status-updater.integration.test.d.ts +5 -0
- package/dist/api/features/__tests__/status-updater.integration.test.js +497 -0
- package/dist/commands/workflow/pipeline-runner.d.ts +17 -0
- package/dist/commands/workflow/pipeline-runner.js +393 -0
- package/dist/commands/workflow/runner.d.ts +26 -0
- package/dist/commands/workflow/runner.js +119 -0
- package/dist/commands/workflow/workflow-runner.d.ts +26 -0
- package/dist/commands/workflow/workflow-runner.js +119 -0
- package/dist/index.js +0 -0
- package/dist/phases/autonomous/index.js +9 -56
- 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 +32 -0
- package/dist/phases/code-implementation/analyzer.js +629 -0
- package/dist/phases/code-implementation/branch-pr-creator.js +2 -58
- package/dist/phases/code-implementation/context-fetcher.d.ts +17 -0
- package/dist/phases/code-implementation/context-fetcher.js +86 -0
- package/dist/phases/code-implementation/index.js +9 -67
- package/dist/phases/code-implementation/mcp-server.d.ts +1 -0
- package/dist/phases/code-implementation/mcp-server.js +93 -0
- package/dist/phases/code-implementation/prompts-improvement.d.ts +5 -0
- package/dist/phases/code-implementation/prompts-improvement.js +108 -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/code-refine/analyzer.d.ts +41 -0
- package/dist/phases/code-refine/analyzer.js +561 -0
- package/dist/phases/code-refine/context-fetcher.d.ts +94 -0
- package/dist/phases/code-refine/context-fetcher.js +423 -0
- package/dist/phases/code-refine/index.js +6 -37
- package/dist/phases/code-refine-verification/analysis/llm-analyzer.d.ts +22 -0
- package/dist/phases/code-refine-verification/analysis/llm-analyzer.js +134 -0
- package/dist/phases/code-refine-verification/verifier.d.ts +47 -0
- package/dist/phases/code-refine-verification/verifier.js +597 -0
- package/dist/phases/code-review/analyzer.d.ts +29 -0
- package/dist/phases/code-review/analyzer.js +363 -0
- package/dist/phases/code-review/context-fetcher.d.ts +92 -0
- package/dist/phases/code-review/context-fetcher.js +296 -0
- package/dist/phases/code-review/index.js +1 -0
- package/dist/phases/feature-analysis/analyzer-helpers.d.ts +10 -0
- package/dist/phases/feature-analysis/analyzer-helpers.js +47 -0
- package/dist/phases/feature-analysis/analyzer.d.ts +11 -0
- package/dist/phases/feature-analysis/analyzer.js +208 -0
- package/dist/phases/feature-analysis/context-fetcher.d.ts +26 -0
- package/dist/phases/feature-analysis/context-fetcher.js +134 -0
- package/dist/phases/feature-analysis/http-fallback.d.ts +20 -0
- package/dist/phases/feature-analysis/http-fallback.js +95 -0
- package/dist/phases/feature-analysis/mcp-server.d.ts +1 -0
- package/dist/phases/feature-analysis/mcp-server.js +144 -0
- package/dist/phases/feature-analysis/prompts-improvement.d.ts +8 -0
- package/dist/phases/feature-analysis/prompts-improvement.js +109 -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/pr-execution/index.js +1 -0
- package/dist/phases/pr-execution/pr-executor.d.ts +2 -1
- package/dist/phases/pr-execution/pr-executor.js +9 -38
- package/dist/phases/pull-request/creator.js +9 -35
- package/dist/phases/technical-design/analyzer-helpers.d.ts +25 -0
- package/dist/phases/technical-design/analyzer-helpers.js +39 -0
- package/dist/phases/technical-design/analyzer.d.ts +21 -0
- package/dist/phases/technical-design/analyzer.js +461 -0
- package/dist/phases/technical-design/context-fetcher.d.ts +12 -0
- package/dist/phases/technical-design/context-fetcher.js +39 -0
- package/dist/phases/technical-design/http-fallback.d.ts +17 -0
- package/dist/phases/technical-design/http-fallback.js +151 -0
- package/dist/phases/technical-design/mcp-server.d.ts +1 -0
- package/dist/phases/technical-design/mcp-server.js +157 -0
- package/dist/phases/technical-design/prompts-improvement.d.ts +5 -0
- package/dist/phases/technical-design/prompts-improvement.js +93 -0
- package/dist/phases/technical-design-verification/verifier.d.ts +53 -0
- package/dist/phases/technical-design-verification/verifier.js +170 -0
- package/dist/services/feature-branches.d.ts +77 -0
- package/dist/services/feature-branches.js +205 -0
- package/dist/utils/git-branch-manager.d.ts +2 -0
- package/dist/utils/git-branch-manager.js +8 -35
- package/dist/utils/git-push.d.ts +43 -0
- package/dist/utils/git-push.js +127 -0
- package/dist/workflow-runner/config/phase-configs.d.ts +5 -0
- package/dist/workflow-runner/config/phase-configs.js +120 -0
- package/dist/workflow-runner/core/feature-filter.d.ts +16 -0
- package/dist/workflow-runner/core/feature-filter.js +46 -0
- package/dist/workflow-runner/core/index.d.ts +8 -0
- package/dist/workflow-runner/core/index.js +12 -0
- package/dist/workflow-runner/core/pipeline-evaluator.d.ts +24 -0
- package/dist/workflow-runner/core/pipeline-evaluator.js +32 -0
- package/dist/workflow-runner/core/state-manager.d.ts +24 -0
- package/dist/workflow-runner/core/state-manager.js +42 -0
- package/dist/workflow-runner/core/workflow-logger.d.ts +20 -0
- package/dist/workflow-runner/core/workflow-logger.js +65 -0
- package/dist/workflow-runner/executors/phase-executor.d.ts +8 -0
- package/dist/workflow-runner/executors/phase-executor.js +248 -0
- package/dist/workflow-runner/feature-workflow-runner.d.ts +26 -0
- package/dist/workflow-runner/feature-workflow-runner.js +119 -0
- package/dist/workflow-runner/index.d.ts +2 -0
- package/dist/workflow-runner/index.js +2 -0
- package/dist/workflow-runner/pipeline-runner.d.ts +17 -0
- package/dist/workflow-runner/pipeline-runner.js +393 -0
- package/dist/workflow-runner/workflow-processor.d.ts +54 -0
- package/dist/workflow-runner/workflow-processor.js +170 -0
- package/dist/workspace/workspace-manager.js +5 -3
- package/package.json +1 -1
- package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.d.ts +0 -4
- package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.js +0 -133
- package/dist/services/lifecycle-agent/__tests__/transition-rules.test.d.ts +0 -4
- package/dist/services/lifecycle-agent/__tests__/transition-rules.test.js +0 -336
- package/dist/services/lifecycle-agent/index.d.ts +0 -24
- package/dist/services/lifecycle-agent/index.js +0 -25
- package/dist/services/lifecycle-agent/phase-criteria.d.ts +0 -57
- package/dist/services/lifecycle-agent/phase-criteria.js +0 -335
- package/dist/services/lifecycle-agent/transition-rules.d.ts +0 -60
- package/dist/services/lifecycle-agent/transition-rules.js +0 -184
- package/dist/services/lifecycle-agent/types.d.ts +0 -190
- package/dist/services/lifecycle-agent/types.js +0 -12
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { query } from '@anthropic-ai/claude-code';
|
|
2
|
+
import { logInfo, logError } from '../../utils/logger.js';
|
|
3
|
+
import { createCodeImplementationVerificationSystemPrompt, createCodeImplementationVerificationPrompt, } from './prompts.js';
|
|
4
|
+
function userMessage(content) {
|
|
5
|
+
return {
|
|
6
|
+
type: 'user',
|
|
7
|
+
message: { role: 'user', content: content },
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
async function* prompt(verificationPrompt) {
|
|
11
|
+
yield userMessage(verificationPrompt);
|
|
12
|
+
await new Promise((res) => setTimeout(res, 10000));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Verify code implementation against checklist requirements by reviewing git diff
|
|
16
|
+
*/
|
|
17
|
+
export async function verifyCodeImplementationCompliance(options, config) {
|
|
18
|
+
const { featureId, branchName, baseBranch, featureName, featureDescription, checklistContext, verbose, } = options;
|
|
19
|
+
if (verbose) {
|
|
20
|
+
logInfo(`\n🔍 Starting code implementation verification for feature: ${featureName}`);
|
|
21
|
+
logInfo(` Branch: ${branchName}`);
|
|
22
|
+
logInfo(` Base: ${baseBranch}`);
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const systemPrompt = createCodeImplementationVerificationSystemPrompt(config);
|
|
26
|
+
const verificationPrompt = createCodeImplementationVerificationPrompt(featureId, branchName, baseBranch, featureName, featureDescription || '', checklistContext);
|
|
27
|
+
let lastAssistantResponse = '';
|
|
28
|
+
let verificationResult = null;
|
|
29
|
+
if (verbose) {
|
|
30
|
+
logInfo('🤖 Starting verification agent query...');
|
|
31
|
+
}
|
|
32
|
+
// Use Claude Code SDK for verification
|
|
33
|
+
for await (const message of query({
|
|
34
|
+
prompt: prompt(verificationPrompt),
|
|
35
|
+
options: {
|
|
36
|
+
appendSystemPrompt: systemPrompt,
|
|
37
|
+
model: config.claude.model || 'sonnet',
|
|
38
|
+
maxTurns: 1000,
|
|
39
|
+
permissionMode: 'bypassPermissions',
|
|
40
|
+
},
|
|
41
|
+
})) {
|
|
42
|
+
if (verbose) {
|
|
43
|
+
logInfo(` Received message type: ${message.type}`);
|
|
44
|
+
}
|
|
45
|
+
// Stream verification process
|
|
46
|
+
if (message.type === 'assistant' && message.message?.content) {
|
|
47
|
+
for (const content of message.message.content) {
|
|
48
|
+
if (content.type === 'text') {
|
|
49
|
+
lastAssistantResponse += content.text + '\n';
|
|
50
|
+
if (verbose) {
|
|
51
|
+
console.log(`\n🔍 ${content.text}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (content.type === 'tool_use') {
|
|
55
|
+
if (verbose) {
|
|
56
|
+
console.log(`\n🔧 ${content.name}: ${content.input.description || 'Running...'}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (message.type === 'result') {
|
|
62
|
+
if (message.subtype === 'success') {
|
|
63
|
+
if (verbose) {
|
|
64
|
+
logInfo('\n✅ Code verification completed, parsing results...');
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const responseText = message.result || lastAssistantResponse;
|
|
68
|
+
let jsonResult = null;
|
|
69
|
+
// Try to extract JSON from markdown code block
|
|
70
|
+
const jsonBlockMatch = responseText.match(/```json\s*\n([\s\S]*?)\n\s*```/);
|
|
71
|
+
if (jsonBlockMatch) {
|
|
72
|
+
jsonResult = JSON.parse(jsonBlockMatch[1]);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Try to find JSON object containing "verification_result"
|
|
76
|
+
let jsonStartIndex = -1;
|
|
77
|
+
if (responseText.includes('"verification_result"')) {
|
|
78
|
+
const targetIndex = responseText.indexOf('"verification_result"');
|
|
79
|
+
// Work backwards to find opening brace
|
|
80
|
+
for (let i = targetIndex; i >= 0; i--) {
|
|
81
|
+
if (responseText[i] === '{') {
|
|
82
|
+
jsonStartIndex = i;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (jsonStartIndex !== -1) {
|
|
88
|
+
// Find matching closing brace
|
|
89
|
+
let braceCount = 0;
|
|
90
|
+
let endIndex = jsonStartIndex;
|
|
91
|
+
let inString = false;
|
|
92
|
+
let escapeNext = false;
|
|
93
|
+
for (let i = jsonStartIndex; i < responseText.length; i++) {
|
|
94
|
+
const char = responseText[i];
|
|
95
|
+
if (escapeNext) {
|
|
96
|
+
escapeNext = false;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (char === '\\' && inString) {
|
|
100
|
+
escapeNext = true;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (char === '"') {
|
|
104
|
+
inString = !inString;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (!inString) {
|
|
108
|
+
if (char === '{') {
|
|
109
|
+
braceCount++;
|
|
110
|
+
}
|
|
111
|
+
else if (char === '}') {
|
|
112
|
+
braceCount--;
|
|
113
|
+
if (braceCount === 0) {
|
|
114
|
+
endIndex = i;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const jsonStr = responseText.substring(jsonStartIndex, endIndex + 1);
|
|
121
|
+
try {
|
|
122
|
+
jsonResult = JSON.parse(jsonStr);
|
|
123
|
+
}
|
|
124
|
+
catch (parseError) {
|
|
125
|
+
logError(`Failed to parse extracted JSON: ${parseError}`);
|
|
126
|
+
jsonResult = JSON.parse(responseText);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
jsonResult = JSON.parse(responseText);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (jsonResult && jsonResult.verification_result) {
|
|
134
|
+
verificationResult = jsonResult.verification_result;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
throw new Error('Invalid JSON structure');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
logError(`Failed to parse verification result: ${error}`);
|
|
142
|
+
// Return a failed verification result
|
|
143
|
+
verificationResult = {
|
|
144
|
+
overall_status: 'failed',
|
|
145
|
+
summary: 'Verification failed due to parse error',
|
|
146
|
+
confirmed_count: 0,
|
|
147
|
+
rejected_count: 1,
|
|
148
|
+
uncertain_count: 0,
|
|
149
|
+
item_verifications: [],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
logError(`\n⚠️ Verification incomplete: ${message.subtype}`);
|
|
155
|
+
verificationResult = {
|
|
156
|
+
overall_status: 'failed',
|
|
157
|
+
summary: 'Verification incomplete',
|
|
158
|
+
confirmed_count: 0,
|
|
159
|
+
rejected_count: 1,
|
|
160
|
+
uncertain_count: 0,
|
|
161
|
+
item_verifications: [],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!verificationResult) {
|
|
167
|
+
return {
|
|
168
|
+
overall_status: 'failed',
|
|
169
|
+
summary: 'No verification result received',
|
|
170
|
+
confirmed_count: 0,
|
|
171
|
+
rejected_count: 1,
|
|
172
|
+
uncertain_count: 0,
|
|
173
|
+
item_verifications: [],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (verbose) {
|
|
177
|
+
logInfo('\n📊 Verification Results:');
|
|
178
|
+
logInfo(` Status: ${verificationResult.overall_status}`);
|
|
179
|
+
logInfo(` ✅ Confirmed: ${verificationResult.confirmed_count}`);
|
|
180
|
+
logInfo(` ❌ Rejected: ${verificationResult.rejected_count}`);
|
|
181
|
+
logInfo(` ⚠️ Uncertain: ${verificationResult.uncertain_count}`);
|
|
182
|
+
}
|
|
183
|
+
return verificationResult;
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
logError(`Code verification failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
187
|
+
return {
|
|
188
|
+
overall_status: 'failed',
|
|
189
|
+
summary: `Verification error: ${error instanceof Error ? error.message : String(error)}`,
|
|
190
|
+
confirmed_count: 0,
|
|
191
|
+
rejected_count: 1,
|
|
192
|
+
uncertain_count: 0,
|
|
193
|
+
item_verifications: [],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Refine Analyzer
|
|
3
|
+
* Processes GitHub PR review feedback and refines code accordingly
|
|
4
|
+
*/
|
|
5
|
+
import { EdsgerConfig } from '../../types/index.js';
|
|
6
|
+
export interface CodeRefineOptions {
|
|
7
|
+
featureId: string;
|
|
8
|
+
githubToken: string;
|
|
9
|
+
verbose?: boolean;
|
|
10
|
+
verificationFailureContext?: {
|
|
11
|
+
attempt: number;
|
|
12
|
+
suggestions: string[];
|
|
13
|
+
unresolvedCommentDetails: Array<{
|
|
14
|
+
commentId: string;
|
|
15
|
+
author: string;
|
|
16
|
+
file: string;
|
|
17
|
+
line: number | null;
|
|
18
|
+
body: string;
|
|
19
|
+
failureReason: string;
|
|
20
|
+
url: string;
|
|
21
|
+
}>;
|
|
22
|
+
unresolvedReviewDetails?: Array<{
|
|
23
|
+
reviewId: number;
|
|
24
|
+
author: string;
|
|
25
|
+
state: string;
|
|
26
|
+
body: string | null;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface CodeRefineResult {
|
|
31
|
+
featureId: string;
|
|
32
|
+
status: 'success' | 'error';
|
|
33
|
+
message: string;
|
|
34
|
+
summary?: string;
|
|
35
|
+
filesModified?: string[];
|
|
36
|
+
commitsCreated?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Main code refine function
|
|
40
|
+
*/
|
|
41
|
+
export declare const refineCodeFromPRFeedback: (options: CodeRefineOptions, config: EdsgerConfig) => Promise<CodeRefineResult>;
|