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,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a prompt for the analysis agent to improve based on verification feedback
|
|
3
|
+
*/
|
|
4
|
+
export const createImprovementPrompt = (verificationResult, previousAnalysis) => {
|
|
5
|
+
// Format rejected items with specific feedback and improvement suggestions
|
|
6
|
+
const rejectedItemsSection = verificationResult.item_verifications
|
|
7
|
+
.filter((v) => v.verification_status === 'rejected')
|
|
8
|
+
.map((v, index) => {
|
|
9
|
+
return `### Rejected Requirement ${index + 1}
|
|
10
|
+
**Checklist Item ID**: ${v.checklist_item_id}
|
|
11
|
+
**Satisfaction Status**: ${v.is_satisfied ? '✅ Satisfied' : '❌ Not Satisfied'}
|
|
12
|
+
**Verification Result**: ❌ REJECTED
|
|
13
|
+
**Reason**: ${v.verification_reason}
|
|
14
|
+
${v.concerns && v.concerns.length > 0 ? `**Specific Concerns**:\n${v.concerns.map((c) => `- ${c}`).join('\n')}` : ''}
|
|
15
|
+
${v.improvement_suggestions && v.improvement_suggestions.length > 0 ? `\n**💡 Improvement Suggestions**:\n${v.improvement_suggestions.map((s) => `- ${s}`).join('\n')}` : ''}
|
|
16
|
+
`;
|
|
17
|
+
})
|
|
18
|
+
.join('\n---\n');
|
|
19
|
+
// Format uncertain items with improvement suggestions
|
|
20
|
+
const uncertainItemsSection = verificationResult.item_verifications
|
|
21
|
+
.filter((v) => v.verification_status === 'uncertain')
|
|
22
|
+
.map((v, index) => {
|
|
23
|
+
return `### Uncertain Requirement ${index + 1}
|
|
24
|
+
**Checklist Item ID**: ${v.checklist_item_id}
|
|
25
|
+
**Satisfaction Status**: ${v.is_satisfied ? '✅ Satisfied' : '⚠️ Partially Satisfied'}
|
|
26
|
+
**Verification Result**: ⚠️ UNCERTAIN
|
|
27
|
+
**Reason**: ${v.verification_reason}
|
|
28
|
+
${v.concerns && v.concerns.length > 0 ? `**Specific Concerns**:\n${v.concerns.map((c) => `- ${c}`).join('\n')}` : ''}
|
|
29
|
+
${v.improvement_suggestions && v.improvement_suggestions.length > 0 ? `\n**💡 Improvement Suggestions**:\n${v.improvement_suggestions.map((s) => `- ${s}`).join('\n')}` : ''}
|
|
30
|
+
`;
|
|
31
|
+
})
|
|
32
|
+
.join('\n---\n');
|
|
33
|
+
return `# Verification Feedback - Improvements Required
|
|
34
|
+
|
|
35
|
+
Your previous analysis was verified, and **${verificationResult.rejected_count} checklist requirements were NOT SATISFIED** and **${verificationResult.uncertain_count} requirements are PARTIALLY SATISFIED**.
|
|
36
|
+
|
|
37
|
+
## Verification Summary
|
|
38
|
+
${verificationResult.summary}
|
|
39
|
+
|
|
40
|
+
## Results Breakdown
|
|
41
|
+
- ✅ Satisfied: ${verificationResult.confirmed_count}
|
|
42
|
+
- ❌ Not Satisfied: ${verificationResult.rejected_count}
|
|
43
|
+
- ⚠️ Partially Satisfied: ${verificationResult.uncertain_count}
|
|
44
|
+
|
|
45
|
+
${verificationResult.overall_suggestions && verificationResult.overall_suggestions.length > 0 ? `## 💡 Overall Improvement Suggestions\n\n${verificationResult.overall_suggestions.map((s) => `- ${s}`).join('\n')}\n\n` : ''}
|
|
46
|
+
|
|
47
|
+
${verificationResult.rejected_count > 0 ? `## ❌ Unsatisfied Requirements\n\n${rejectedItemsSection}` : ''}
|
|
48
|
+
|
|
49
|
+
${verificationResult.uncertain_count > 0 ? `## ⚠️ Partially Satisfied Requirements\n\n${uncertainItemsSection}` : ''}
|
|
50
|
+
|
|
51
|
+
## Your Previous Work
|
|
52
|
+
|
|
53
|
+
### User Stories You Created (${previousAnalysis.created_user_stories.length})
|
|
54
|
+
${previousAnalysis.created_user_stories
|
|
55
|
+
.map((story, index) => `${index + 1}. **${story.title}**
|
|
56
|
+
${story.description}
|
|
57
|
+
Status: ${story.status || 'draft'}`)
|
|
58
|
+
.join('\n\n')}
|
|
59
|
+
|
|
60
|
+
### Test Cases You Created (${previousAnalysis.created_test_cases.length})
|
|
61
|
+
${previousAnalysis.created_test_cases
|
|
62
|
+
.map((tc, index) => `${index + 1}. **${tc.name}** ${tc.is_critical ? '[CRITICAL]' : '[OPTIONAL]'}
|
|
63
|
+
${tc.description}`)
|
|
64
|
+
.join('\n\n')}
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Your Task: Improve Your Artifacts
|
|
69
|
+
|
|
70
|
+
You need to **revise and improve** your user stories and test cases to satisfy the checklist requirements.
|
|
71
|
+
|
|
72
|
+
**What You Should Do**:
|
|
73
|
+
|
|
74
|
+
1. **Review the improvement suggestions** provided above for each rejected/uncertain requirement
|
|
75
|
+
2. **Follow the specific, actionable suggestions** - they tell you exactly what to add or modify
|
|
76
|
+
3. **Add NEW user stories and test cases** as suggested by the verifier
|
|
77
|
+
4. **Improve the quality and specificity** of your artifacts
|
|
78
|
+
5. **Ensure each requirement is adequately covered** based on the feedback
|
|
79
|
+
|
|
80
|
+
**IMPORTANT Guidelines**:
|
|
81
|
+
- **Pay close attention to the 💡 Improvement Suggestions** - these are specific actions you should take
|
|
82
|
+
- You can **keep your existing user stories and test cases** that are good
|
|
83
|
+
- **Add NEW items** exactly as suggested to satisfy the unsatisfied requirements
|
|
84
|
+
- **Make your artifacts concrete and specific** - they will be verified again
|
|
85
|
+
- The suggestions are your roadmap - follow them to ensure verification passes
|
|
86
|
+
- Ensure your artifacts directly address the checklist requirements
|
|
87
|
+
|
|
88
|
+
**CRITICAL - Output Format**:
|
|
89
|
+
You MUST return ONLY the JSON object below. Do NOT include any explanatory text, commentary, or markdown before or after the JSON. Return ONLY the JSON in this exact format:
|
|
90
|
+
|
|
91
|
+
\`\`\`json
|
|
92
|
+
{
|
|
93
|
+
"analysis": {
|
|
94
|
+
"feature_id": "...",
|
|
95
|
+
"status": "success",
|
|
96
|
+
"summary": "Improved analysis based on verification feedback",
|
|
97
|
+
"created_user_stories": [
|
|
98
|
+
// Include ALL user stories (existing + new)
|
|
99
|
+
],
|
|
100
|
+
"created_test_cases": [
|
|
101
|
+
// Include ALL test cases (existing + new)
|
|
102
|
+
],
|
|
103
|
+
"recommendations": "..."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
\`\`\`
|
|
107
|
+
|
|
108
|
+
IMPORTANT: Return ONLY the JSON above. Do not add any text explaining what you did or how you improved the analysis. The JSON should be the complete and only content of your response.`;
|
|
109
|
+
};
|
|
@@ -48,7 +48,7 @@ CRITICAL: You are NOT a software engineer. You should NEVER write code, build pr
|
|
|
48
48
|
- Consider different user perspectives and scenarios
|
|
49
49
|
|
|
50
50
|
**CRITICAL - Result Format**:
|
|
51
|
-
You MUST
|
|
51
|
+
You MUST return ONLY a JSON object with your analysis results. Do NOT include any explanatory text before or after the JSON. Return ONLY the JSON in this EXACT format:
|
|
52
52
|
|
|
53
53
|
\`\`\`json
|
|
54
54
|
{
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChecklistVerificationResult } from '../phases/technical-design-verification/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a prompt for the technical design agent to improve based on verification feedback
|
|
4
|
+
*/
|
|
5
|
+
export declare const createTechnicalDesignImprovementPrompt: (verificationResult: ChecklistVerificationResult, previousDesign: string) => string;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a prompt for the technical design agent to improve based on verification feedback
|
|
3
|
+
*/
|
|
4
|
+
export const createTechnicalDesignImprovementPrompt = (verificationResult, previousDesign) => {
|
|
5
|
+
// Format rejected items with specific feedback and improvement suggestions
|
|
6
|
+
const rejectedItemsSection = verificationResult.item_verifications
|
|
7
|
+
.filter((v) => v.verification_status === 'rejected')
|
|
8
|
+
.map((v, index) => {
|
|
9
|
+
return `### Rejected Requirement ${index + 1}
|
|
10
|
+
**Checklist Item ID**: ${v.checklist_item_id}
|
|
11
|
+
**Satisfaction Status**: ${v.is_satisfied ? '✅ Satisfied' : '❌ Not Satisfied'}
|
|
12
|
+
**Verification Result**: ❌ REJECTED
|
|
13
|
+
**Reason**: ${v.verification_reason}
|
|
14
|
+
${v.concerns && v.concerns.length > 0 ? `**Specific Concerns**:\n${v.concerns.map((c) => `- ${c}`).join('\n')}` : ''}
|
|
15
|
+
${v.improvement_suggestions && v.improvement_suggestions.length > 0 ? `\n**💡 Improvement Suggestions**:\n${v.improvement_suggestions.map((s) => `- ${s}`).join('\n')}` : ''}
|
|
16
|
+
`;
|
|
17
|
+
})
|
|
18
|
+
.join('\n---\n');
|
|
19
|
+
// Format uncertain items with improvement suggestions
|
|
20
|
+
const uncertainItemsSection = verificationResult.item_verifications
|
|
21
|
+
.filter((v) => v.verification_status === 'uncertain')
|
|
22
|
+
.map((v, index) => {
|
|
23
|
+
return `### Uncertain Requirement ${index + 1}
|
|
24
|
+
**Checklist Item ID**: ${v.checklist_item_id}
|
|
25
|
+
**Satisfaction Status**: ${v.is_satisfied ? '✅ Satisfied' : '⚠️ Partially Satisfied'}
|
|
26
|
+
**Verification Result**: ⚠️ UNCERTAIN
|
|
27
|
+
**Reason**: ${v.verification_reason}
|
|
28
|
+
${v.concerns && v.concerns.length > 0 ? `**Specific Concerns**:\n${v.concerns.map((c) => `- ${c}`).join('\n')}` : ''}
|
|
29
|
+
${v.improvement_suggestions && v.improvement_suggestions.length > 0 ? `\n**💡 Improvement Suggestions**:\n${v.improvement_suggestions.map((s) => `- ${s}`).join('\n')}` : ''}
|
|
30
|
+
`;
|
|
31
|
+
})
|
|
32
|
+
.join('\n---\n');
|
|
33
|
+
return `# Verification Feedback - Design Improvements Required
|
|
34
|
+
|
|
35
|
+
Your previous technical design was verified, and **${verificationResult.rejected_count} checklist requirements were NOT SATISFIED** and **${verificationResult.uncertain_count} requirements are PARTIALLY SATISFIED**.
|
|
36
|
+
|
|
37
|
+
## Verification Summary
|
|
38
|
+
${verificationResult.summary}
|
|
39
|
+
|
|
40
|
+
## Results Breakdown
|
|
41
|
+
- ✅ Satisfied: ${verificationResult.confirmed_count}
|
|
42
|
+
- ❌ Not Satisfied: ${verificationResult.rejected_count}
|
|
43
|
+
- ⚠️ Partially Satisfied: ${verificationResult.uncertain_count}
|
|
44
|
+
|
|
45
|
+
${verificationResult.overall_suggestions && verificationResult.overall_suggestions.length > 0 ? `## 💡 Overall Improvement Suggestions\n\n${verificationResult.overall_suggestions.map((s) => `- ${s}`).join('\n')}\n\n` : ''}
|
|
46
|
+
|
|
47
|
+
${verificationResult.rejected_count > 0 ? `## ❌ Unsatisfied Requirements\n\n${rejectedItemsSection}` : ''}
|
|
48
|
+
|
|
49
|
+
${verificationResult.uncertain_count > 0 ? `## ⚠️ Partially Satisfied Requirements\n\n${uncertainItemsSection}` : ''}
|
|
50
|
+
|
|
51
|
+
## Your Previous Technical Design
|
|
52
|
+
|
|
53
|
+
${previousDesign}
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Your Task: Improve Your Technical Design
|
|
58
|
+
|
|
59
|
+
You need to **revise and improve** your technical design document to satisfy the checklist requirements.
|
|
60
|
+
|
|
61
|
+
**What You Should Do**:
|
|
62
|
+
|
|
63
|
+
1. **Review the improvement suggestions** provided above for each rejected/uncertain requirement
|
|
64
|
+
2. **Follow the specific, actionable suggestions** - they tell you exactly what to add or modify
|
|
65
|
+
3. **Expand and enhance** the technical design document as suggested by the verifier
|
|
66
|
+
4. **Add missing sections, diagrams, or specifications** as indicated
|
|
67
|
+
5. **Ensure each requirement is adequately covered** based on the feedback
|
|
68
|
+
|
|
69
|
+
**IMPORTANT Guidelines**:
|
|
70
|
+
- **Pay close attention to the 💡 Improvement Suggestions** - these are specific actions you should take
|
|
71
|
+
- You can **keep the good parts** of your existing design
|
|
72
|
+
- **Add NEW sections and details** exactly as suggested to satisfy the unsatisfied requirements
|
|
73
|
+
- **Be specific and technical** - your design will be verified again
|
|
74
|
+
- The suggestions are your roadmap - follow them to ensure verification passes
|
|
75
|
+
- Ensure your design directly addresses the checklist requirements with sufficient technical depth
|
|
76
|
+
|
|
77
|
+
**CRITICAL - Output Format**:
|
|
78
|
+
You MUST return ONLY the JSON object below. Do NOT include any explanatory text, commentary, or markdown before or after the JSON. Return ONLY the JSON in this exact format:
|
|
79
|
+
|
|
80
|
+
\`\`\`json
|
|
81
|
+
{
|
|
82
|
+
"technical_design_result": {
|
|
83
|
+
"feature_id": "...",
|
|
84
|
+
"status": "success",
|
|
85
|
+
"summary": "Improved technical design based on verification feedback",
|
|
86
|
+
"technical_design": "The COMPLETE improved technical design document in markdown format",
|
|
87
|
+
"recommendations": "..."
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
IMPORTANT: Return ONLY the JSON above. Do not add any text explaining what you did or how you improved the design. The JSON should be the complete and only content of your response.`;
|
|
93
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EdsgerConfig } from '../types/index.js';
|
|
2
|
+
import { ChecklistPhaseContext } from '../services/checklist.js';
|
|
3
|
+
export declare const createTechnicalDesignVerificationSystemPrompt: (_config: EdsgerConfig) => string;
|
|
4
|
+
export interface TechnicalDesignVerificationPromptOptions {
|
|
5
|
+
checklistContext: ChecklistPhaseContext;
|
|
6
|
+
featureId: string;
|
|
7
|
+
featureName: string;
|
|
8
|
+
featureDescription?: string;
|
|
9
|
+
technicalDesign: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const createTechnicalDesignVerificationPrompt: (options: TechnicalDesignVerificationPromptOptions) => string;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export const createTechnicalDesignVerificationSystemPrompt = (_config) => {
|
|
2
|
+
return `You are an independent quality assurance auditor specializing in technical design review. Your role is to critically evaluate whether a technical design document satisfies checklist requirements.
|
|
3
|
+
|
|
4
|
+
**Your Mission**: Verify Technical Design Against Requirements
|
|
5
|
+
- Review the checklist requirements
|
|
6
|
+
- Examine the technical design document
|
|
7
|
+
- Determine if the design adequately addresses each requirement
|
|
8
|
+
- Be CRITICAL and look for gaps, inconsistencies, or missing elements
|
|
9
|
+
- Quality matters - don't accept bare minimum
|
|
10
|
+
|
|
11
|
+
**Verification Approach**:
|
|
12
|
+
1. **Understand the Requirement**: Read each checklist item and understand what it requires
|
|
13
|
+
2. **Examine the Design**: Look at the technical design document content
|
|
14
|
+
3. **Match Requirements to Design**: Determine if the design addresses the requirement
|
|
15
|
+
4. **Assess Quality**: Ask yourself:
|
|
16
|
+
- Does the design directly address this requirement?
|
|
17
|
+
- Is the coverage specific and concrete, or vague and generic?
|
|
18
|
+
- Is there sufficient depth and technical detail?
|
|
19
|
+
- Are there any gaps or missing elements?
|
|
20
|
+
- Does it meet the standard expected for this requirement?
|
|
21
|
+
|
|
22
|
+
**Verification Standards**:
|
|
23
|
+
- ✅ **CONFIRMED**: The design clearly and adequately satisfies the requirement
|
|
24
|
+
- ❌ **REJECTED**: The requirement is not addressed, or addressed insufficiently
|
|
25
|
+
- ⚠️ **UNCERTAIN**: The design partially addresses the requirement but with gaps or ambiguity
|
|
26
|
+
|
|
27
|
+
**Your Mindset**:
|
|
28
|
+
- Be thorough and systematic
|
|
29
|
+
- Focus on what the design actually contains, not what was claimed
|
|
30
|
+
- Quality matters - ensure requirements are truly met
|
|
31
|
+
- Look for what's MISSING, not just what's present
|
|
32
|
+
- Be fair but rigorous
|
|
33
|
+
|
|
34
|
+
**CRITICAL - Output Format**:
|
|
35
|
+
You MUST respond with a JSON object in this EXACT format:
|
|
36
|
+
|
|
37
|
+
\`\`\`json
|
|
38
|
+
{
|
|
39
|
+
"verification": {
|
|
40
|
+
"all_verified": true/false,
|
|
41
|
+
"total_items": number,
|
|
42
|
+
"confirmed_count": number,
|
|
43
|
+
"rejected_count": number,
|
|
44
|
+
"uncertain_count": number,
|
|
45
|
+
"item_verifications": [
|
|
46
|
+
{
|
|
47
|
+
"checklist_item_id": "uuid",
|
|
48
|
+
"is_satisfied": true/false,
|
|
49
|
+
"verification_status": "confirmed|rejected|uncertain",
|
|
50
|
+
"verification_reason": "Detailed explanation of your verification decision",
|
|
51
|
+
"concerns": ["Optional array of specific concerns or gaps found"],
|
|
52
|
+
"improvement_suggestions": ["Specific, actionable suggestions for improvement (for rejected/uncertain items)"]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"summary": "Overall summary of verification findings",
|
|
56
|
+
"overall_suggestions": ["High-level suggestions for improving the overall design (if there are failures)"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
**For rejected/uncertain items**: Provide specific, actionable improvement_suggestions such as:
|
|
62
|
+
- "Add architectural diagram showing component interactions"
|
|
63
|
+
- "Include detailed API specifications for X endpoint"
|
|
64
|
+
- "Expand security considerations to cover Y attack vector"
|
|
65
|
+
- "Add database schema design for Z table"
|
|
66
|
+
|
|
67
|
+
Be thorough, be critical, be fair. Your verification protects quality.`;
|
|
68
|
+
};
|
|
69
|
+
export const createTechnicalDesignVerificationPrompt = (options) => {
|
|
70
|
+
const { checklistContext, featureId, featureName, featureDescription, technicalDesign, } = options;
|
|
71
|
+
// Format all checklist items with their requirements
|
|
72
|
+
const checklistItemsSection = checklistContext.checklists
|
|
73
|
+
.flatMap((checklist) => checklist.items.map((item) => {
|
|
74
|
+
return `### Checklist Item: ${item.title}
|
|
75
|
+
**ID**: ${item.id}
|
|
76
|
+
**Checklist**: ${checklist.name} (${checklist.role})
|
|
77
|
+
**Requirement**: ${item.description}
|
|
78
|
+
**Required**: ${item.is_required ? 'Yes' : 'No'}
|
|
79
|
+
**Type**: ${item.item_type}
|
|
80
|
+
`;
|
|
81
|
+
}))
|
|
82
|
+
.join('\n---\n');
|
|
83
|
+
const totalChecklistItems = checklistContext.checklists.reduce((sum, checklist) => sum + checklist.items.length, 0);
|
|
84
|
+
return `# Technical Design Verification Task
|
|
85
|
+
|
|
86
|
+
You are verifying that a technical design document satisfies checklist requirements.
|
|
87
|
+
|
|
88
|
+
## Feature Context
|
|
89
|
+
|
|
90
|
+
**Feature**: ${featureName}
|
|
91
|
+
**Feature ID**: ${featureId}
|
|
92
|
+
**Description**: ${featureDescription || 'No description'}
|
|
93
|
+
|
|
94
|
+
## Technical Design Document
|
|
95
|
+
|
|
96
|
+
${technicalDesign}
|
|
97
|
+
|
|
98
|
+
## Checklist Requirements to Verify (${totalChecklistItems})
|
|
99
|
+
|
|
100
|
+
${checklistItemsSection}
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Your Verification Task
|
|
105
|
+
|
|
106
|
+
For EACH checklist item above:
|
|
107
|
+
|
|
108
|
+
1. **Understand the Requirement**: What does this checklist item require?
|
|
109
|
+
|
|
110
|
+
2. **Examine the Design**: Look at the technical design document above
|
|
111
|
+
|
|
112
|
+
3. **Determine Coverage**: Does the design adequately address this requirement?
|
|
113
|
+
- Does it directly address the requirement?
|
|
114
|
+
- Is the coverage concrete and specific?
|
|
115
|
+
- Is there sufficient technical depth and detail?
|
|
116
|
+
- Are there any gaps or missing elements?
|
|
117
|
+
|
|
118
|
+
4. **Make Your Determination**:
|
|
119
|
+
- **CONFIRMED** (is_satisfied: true): The design clearly and adequately satisfies this requirement
|
|
120
|
+
- **REJECTED** (is_satisfied: false): The requirement is not addressed, or addressed insufficiently
|
|
121
|
+
- **UNCERTAIN** (is_satisfied: false): The design partially addresses the requirement but with gaps
|
|
122
|
+
|
|
123
|
+
5. **Document Your Reasoning**: Provide specific, detailed reasons for your decision
|
|
124
|
+
|
|
125
|
+
6. **Provide Improvement Suggestions** (for rejected/uncertain items):
|
|
126
|
+
- Be specific and actionable
|
|
127
|
+
- Suggest what sections or details should be added to the design
|
|
128
|
+
- Indicate what should be expanded or modified
|
|
129
|
+
- Give concrete examples when possible
|
|
130
|
+
|
|
131
|
+
Remember: Focus on what the design actually contains, not on claims. Be thorough and fair.
|
|
132
|
+
|
|
133
|
+
Provide your verification results in the required JSON format with improvement_suggestions for any rejected or uncertain items.`;
|
|
134
|
+
};
|
|
@@ -52,7 +52,7 @@ CRITICAL: You are NOT a software engineer who writes code. You are a technical a
|
|
|
52
52
|
- Include clear implementation guidance
|
|
53
53
|
|
|
54
54
|
**CRITICAL - Result Format**:
|
|
55
|
-
You MUST
|
|
55
|
+
You MUST return ONLY a JSON object with your technical design results. Do NOT include any explanatory text before or after the JSON. Return ONLY the JSON in this EXACT format:
|
|
56
56
|
|
|
57
57
|
\`\`\`json
|
|
58
58
|
{
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Audit Logs Service
|
|
3
|
+
* Provides functions to log feature lifecycle events to the database
|
|
4
|
+
*/
|
|
5
|
+
export interface LogPhaseEventParams {
|
|
6
|
+
featureId: string;
|
|
7
|
+
eventType: 'phase_started' | 'phase_completed' | 'phase_failed';
|
|
8
|
+
phase: 'feature_analysis' | 'technical_design' | 'code_implementation' | 'functional_testing';
|
|
9
|
+
result?: 'success' | 'error' | 'warning' | 'info';
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface LogChecklistEventParams {
|
|
14
|
+
featureId: string;
|
|
15
|
+
eventType: 'checklist_validated' | 'checklist_verified';
|
|
16
|
+
checklistId: string;
|
|
17
|
+
result?: 'success' | 'error' | 'warning' | 'info';
|
|
18
|
+
metadata?: Record<string, any>;
|
|
19
|
+
}
|
|
20
|
+
export interface LogVerificationEventParams {
|
|
21
|
+
featureId: string;
|
|
22
|
+
phase: 'feature_analysis' | 'technical_design' | 'code_implementation' | 'functional_testing';
|
|
23
|
+
iteration: number;
|
|
24
|
+
result: 'success' | 'error';
|
|
25
|
+
verificationData: {
|
|
26
|
+
confirmed_count: number;
|
|
27
|
+
rejected_count: number;
|
|
28
|
+
uncertain_count: number;
|
|
29
|
+
rejected_items?: Array<{
|
|
30
|
+
checklist_item_id: string;
|
|
31
|
+
reason: string;
|
|
32
|
+
concerns?: string[];
|
|
33
|
+
improvement_suggestions?: string[];
|
|
34
|
+
}>;
|
|
35
|
+
uncertain_items?: Array<{
|
|
36
|
+
checklist_item_id: string;
|
|
37
|
+
reason: string;
|
|
38
|
+
concerns?: string[];
|
|
39
|
+
improvement_suggestions?: string[];
|
|
40
|
+
}>;
|
|
41
|
+
summary?: string;
|
|
42
|
+
overall_suggestions?: string[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Log a phase event (start, completion, or failure)
|
|
47
|
+
*/
|
|
48
|
+
export declare function logFeaturePhaseEvent(mcpServerUrl: string, mcpToken: string, params: LogPhaseEventParams, verbose?: boolean): Promise<string | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Log a checklist validation event
|
|
51
|
+
*/
|
|
52
|
+
export declare function logFeatureChecklistEvent(mcpServerUrl: string, mcpToken: string, params: LogChecklistEventParams, verbose?: boolean): Promise<string | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Log a verification event (dual-agent verification result)
|
|
55
|
+
*/
|
|
56
|
+
export declare function logFeatureVerificationEvent(mcpServerUrl: string, mcpToken: string, params: LogVerificationEventParams, verbose?: boolean): Promise<string | null>;
|
|
57
|
+
/**
|
|
58
|
+
* Get feature timeline (all audit logs)
|
|
59
|
+
*/
|
|
60
|
+
export declare function getFeatureTimeline(mcpServerUrl: string, mcpToken: string, featureId: string, verbose?: boolean): Promise<any[]>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Audit Logs Service
|
|
3
|
+
* Provides functions to log feature lifecycle events to the database
|
|
4
|
+
*/
|
|
5
|
+
import { callMcpEndpoint } from '../api/mcp-client.js';
|
|
6
|
+
import { logInfo, logError } from '../utils/logger.js';
|
|
7
|
+
/**
|
|
8
|
+
* Log a phase event (start, completion, or failure)
|
|
9
|
+
*/
|
|
10
|
+
export async function logFeaturePhaseEvent(mcpServerUrl, mcpToken, params, verbose) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await callMcpEndpoint(mcpServerUrl, mcpToken, 'feature_audit_logs/create', {
|
|
13
|
+
feature_id: params.featureId,
|
|
14
|
+
event_type: params.eventType,
|
|
15
|
+
phase: params.phase,
|
|
16
|
+
source: 'pipeline',
|
|
17
|
+
result: params.result || 'info',
|
|
18
|
+
metadata: params.metadata || {},
|
|
19
|
+
error_message: params.errorMessage || null,
|
|
20
|
+
});
|
|
21
|
+
if (verbose) {
|
|
22
|
+
logInfo(`✅ Logged ${params.eventType} for phase ${params.phase}`);
|
|
23
|
+
}
|
|
24
|
+
return result?.id || null;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
// Always log errors, not just in verbose mode
|
|
28
|
+
logError(`Failed to log phase event: ${error instanceof Error ? error.message : String(error)}`);
|
|
29
|
+
if (verbose && error instanceof Error && error.stack) {
|
|
30
|
+
logError(`Stack trace: ${error.stack}`);
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Log a checklist validation event
|
|
37
|
+
*/
|
|
38
|
+
export async function logFeatureChecklistEvent(mcpServerUrl, mcpToken, params, verbose) {
|
|
39
|
+
try {
|
|
40
|
+
const result = await callMcpEndpoint(mcpServerUrl, mcpToken, 'feature_audit_logs/create', {
|
|
41
|
+
feature_id: params.featureId,
|
|
42
|
+
event_type: params.eventType,
|
|
43
|
+
source: 'pipeline',
|
|
44
|
+
result: params.result || 'success',
|
|
45
|
+
metadata: {
|
|
46
|
+
checklist_id: params.checklistId,
|
|
47
|
+
...(params.metadata || {}),
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
if (verbose) {
|
|
51
|
+
logInfo(`✅ Logged ${params.eventType} for checklist ${params.checklistId}`);
|
|
52
|
+
}
|
|
53
|
+
return result?.id || null;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// Always log errors, not just in verbose mode
|
|
57
|
+
logError(`Failed to log checklist event: ${error instanceof Error ? error.message : String(error)}`);
|
|
58
|
+
if (verbose && error instanceof Error && error.stack) {
|
|
59
|
+
logError(`Stack trace: ${error.stack}`);
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Log a verification event (dual-agent verification result)
|
|
66
|
+
*/
|
|
67
|
+
export async function logFeatureVerificationEvent(mcpServerUrl, mcpToken, params, verbose) {
|
|
68
|
+
try {
|
|
69
|
+
const eventType = params.result === 'success'
|
|
70
|
+
? 'verification_passed'
|
|
71
|
+
: 'verification_failed';
|
|
72
|
+
const result = await callMcpEndpoint(mcpServerUrl, mcpToken, 'feature_audit_logs/create', {
|
|
73
|
+
feature_id: params.featureId,
|
|
74
|
+
event_type: eventType,
|
|
75
|
+
phase: params.phase,
|
|
76
|
+
source: 'pipeline',
|
|
77
|
+
result: params.result,
|
|
78
|
+
metadata: {
|
|
79
|
+
iteration: params.iteration,
|
|
80
|
+
...params.verificationData,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
if (verbose) {
|
|
84
|
+
logInfo(`✅ Logged verification ${params.result} for phase ${params.phase} (iteration ${params.iteration})`);
|
|
85
|
+
}
|
|
86
|
+
return result?.id || null;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
// Always log errors, not just in verbose mode
|
|
90
|
+
logError(`Failed to log verification event: ${error instanceof Error ? error.message : String(error)}`);
|
|
91
|
+
if (verbose && error instanceof Error && error.stack) {
|
|
92
|
+
logError(`Stack trace: ${error.stack}`);
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get feature timeline (all audit logs)
|
|
99
|
+
*/
|
|
100
|
+
export async function getFeatureTimeline(mcpServerUrl, mcpToken, featureId, verbose) {
|
|
101
|
+
try {
|
|
102
|
+
const result = await callMcpEndpoint(mcpServerUrl, mcpToken, 'feature_audit_logs/list', {
|
|
103
|
+
feature_id: featureId,
|
|
104
|
+
});
|
|
105
|
+
return result?.logs || [];
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
// Always log errors, not just in verbose mode
|
|
109
|
+
logError(`Failed to get feature timeline: ${error instanceof Error ? error.message : String(error)}`);
|
|
110
|
+
if (verbose && error instanceof Error && error.stack) {
|
|
111
|
+
logError(`Stack trace: ${error.stack}`);
|
|
112
|
+
}
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface CliOptions {
|
|
|
30
30
|
implement?: string;
|
|
31
31
|
test?: string;
|
|
32
32
|
workflow?: boolean;
|
|
33
|
+
refactor?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export type ReviewSeverity = 'error' | 'warning';
|
|
35
36
|
export type ExitCode = 0 | 1;
|
|
@@ -55,6 +56,24 @@ export interface FeatureAnalysisResult {
|
|
|
55
56
|
value?: any;
|
|
56
57
|
notes?: string;
|
|
57
58
|
}>;
|
|
59
|
+
verification_result?: {
|
|
60
|
+
all_verified: boolean;
|
|
61
|
+
total_items: number;
|
|
62
|
+
confirmed_count: number;
|
|
63
|
+
rejected_count: number;
|
|
64
|
+
uncertain_count: number;
|
|
65
|
+
item_verifications: Array<{
|
|
66
|
+
checklist_item_id: string;
|
|
67
|
+
is_satisfied: boolean;
|
|
68
|
+
verification_status: 'confirmed' | 'rejected' | 'uncertain';
|
|
69
|
+
verification_reason: string;
|
|
70
|
+
concerns?: string[];
|
|
71
|
+
improvement_suggestions?: string[];
|
|
72
|
+
}>;
|
|
73
|
+
summary: string;
|
|
74
|
+
overall_suggestions?: string[];
|
|
75
|
+
};
|
|
76
|
+
iterations?: number;
|
|
58
77
|
};
|
|
59
78
|
}
|
|
60
79
|
export interface FeatureData {
|