ai-sdlc 0.2.0 → 0.2.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/agents/implementation.d.ts.map +1 -1
  2. package/dist/agents/implementation.js +64 -0
  3. package/dist/agents/implementation.js.map +1 -1
  4. package/dist/agents/index.d.ts +2 -0
  5. package/dist/agents/index.d.ts.map +1 -1
  6. package/dist/agents/index.js +2 -0
  7. package/dist/agents/index.js.map +1 -1
  8. package/dist/agents/orchestrator.d.ts +61 -0
  9. package/dist/agents/orchestrator.d.ts.map +1 -0
  10. package/dist/agents/orchestrator.js +443 -0
  11. package/dist/agents/orchestrator.js.map +1 -0
  12. package/dist/agents/planning.d.ts +1 -1
  13. package/dist/agents/planning.d.ts.map +1 -1
  14. package/dist/agents/planning.js +33 -1
  15. package/dist/agents/planning.js.map +1 -1
  16. package/dist/agents/review.d.ts +10 -0
  17. package/dist/agents/review.d.ts.map +1 -1
  18. package/dist/agents/review.js +138 -25
  19. package/dist/agents/review.js.map +1 -1
  20. package/dist/agents/single-task.d.ts +41 -0
  21. package/dist/agents/single-task.d.ts.map +1 -0
  22. package/dist/agents/single-task.js +357 -0
  23. package/dist/agents/single-task.js.map +1 -0
  24. package/dist/cli/commands.d.ts.map +1 -1
  25. package/dist/cli/commands.js +22 -3
  26. package/dist/cli/commands.js.map +1 -1
  27. package/dist/cli/runner.d.ts.map +1 -1
  28. package/dist/cli/runner.js +4 -8
  29. package/dist/cli/runner.js.map +1 -1
  30. package/dist/core/config.d.ts.map +1 -1
  31. package/dist/core/config.js +4 -2
  32. package/dist/core/config.js.map +1 -1
  33. package/dist/core/index.d.ts +2 -0
  34. package/dist/core/index.d.ts.map +1 -1
  35. package/dist/core/index.js +2 -0
  36. package/dist/core/index.js.map +1 -1
  37. package/dist/core/llm-utils.d.ts +103 -0
  38. package/dist/core/llm-utils.d.ts.map +1 -0
  39. package/dist/core/llm-utils.js +368 -0
  40. package/dist/core/llm-utils.js.map +1 -0
  41. package/dist/core/story.d.ts +11 -1
  42. package/dist/core/story.d.ts.map +1 -1
  43. package/dist/core/story.js +33 -1
  44. package/dist/core/story.js.map +1 -1
  45. package/dist/core/task-parser.d.ts +59 -0
  46. package/dist/core/task-parser.d.ts.map +1 -0
  47. package/dist/core/task-parser.js +235 -0
  48. package/dist/core/task-parser.js.map +1 -0
  49. package/dist/core/task-progress.d.ts +92 -0
  50. package/dist/core/task-progress.d.ts.map +1 -0
  51. package/dist/core/task-progress.js +280 -0
  52. package/dist/core/task-progress.js.map +1 -0
  53. package/dist/services/error-classifier.d.ts +119 -0
  54. package/dist/services/error-classifier.d.ts.map +1 -0
  55. package/dist/services/error-classifier.js +182 -0
  56. package/dist/services/error-classifier.js.map +1 -0
  57. package/dist/types/index.d.ts +183 -0
  58. package/dist/types/index.d.ts.map +1 -1
  59. package/dist/types/index.js.map +1 -1
  60. package/package.json +2 -1
@@ -0,0 +1,357 @@
1
+ import { spawnSync } from 'child_process';
2
+ import { createHash } from 'crypto';
3
+ import { runAgentQuery } from '../core/client.js';
4
+ import { getLogger } from '../core/logger.js';
5
+ /**
6
+ * System prompt for single-task implementation agent
7
+ * Focused instructions without full story context
8
+ */
9
+ export const TASK_AGENT_SYSTEM_PROMPT = `You are a senior software engineer executing a single implementation task.
10
+
11
+ Your job is to:
12
+ 1. Read and understand the task description
13
+ 2. Review the existing code in the target files
14
+ 3. Make the necessary changes to satisfy the task requirements
15
+ 4. Follow the project conventions strictly
16
+ 5. Write clean, maintainable code that follows existing patterns
17
+
18
+ CRITICAL RULES:
19
+ - Modify ONLY the files listed in the task context
20
+ - If you need a file that's not provided, state this clearly in your output
21
+ - Do NOT create new files unless explicitly listed in the task
22
+ - Follow the acceptance criteria relevant to this task
23
+ - Ensure your changes are focused and minimal (do what's needed, nothing more)
24
+
25
+ When complete, provide a brief summary of:
26
+ - What you changed
27
+ - Which files you modified
28
+ - Any issues or missing dependencies encountered`;
29
+ /**
30
+ * Build minimal context prompt for a single task
31
+ */
32
+ export function buildTaskPrompt(context) {
33
+ const { task, acceptanceCriteria, existingFiles, projectPatterns } = context;
34
+ let prompt = `# Implementation Task\n\n`;
35
+ prompt += `**Task ID:** ${task.id}\n`;
36
+ prompt += `**Description:** ${task.description}\n\n`;
37
+ // Add existing files
38
+ if (existingFiles.length > 0) {
39
+ prompt += `## Target Files\n\n`;
40
+ for (const file of existingFiles) {
41
+ prompt += `### ${file.path}\n\n`;
42
+ prompt += `\`\`\`\n${file.content}\n\`\`\`\n\n`;
43
+ }
44
+ }
45
+ else {
46
+ prompt += `## Target Files\n\nNo existing files provided. You may need to create new files as specified in the task.\n\n`;
47
+ }
48
+ // Add relevant acceptance criteria
49
+ if (acceptanceCriteria.length > 0) {
50
+ prompt += `## Acceptance Criteria\n\n`;
51
+ for (const ac of acceptanceCriteria) {
52
+ prompt += `- ${ac}\n`;
53
+ }
54
+ prompt += `\n`;
55
+ }
56
+ // Add project conventions (enforce max length)
57
+ if (projectPatterns) {
58
+ const MAX_PATTERN_LENGTH = 2000; // ~500 tokens
59
+ let patterns = projectPatterns;
60
+ if (patterns.length > MAX_PATTERN_LENGTH) {
61
+ console.warn(`projectPatterns truncated from ${patterns.length} to ${MAX_PATTERN_LENGTH} characters`);
62
+ patterns = patterns.substring(0, MAX_PATTERN_LENGTH) + '\n\n[... truncated for length]';
63
+ }
64
+ prompt += `## Project Conventions\n\n${patterns}\n\n`;
65
+ }
66
+ prompt += `## Instructions\n\n`;
67
+ prompt += `1. Implement the task by modifying the files listed above\n`;
68
+ prompt += `2. Follow the project conventions strictly\n`;
69
+ prompt += `3. Ensure your changes satisfy the relevant acceptance criteria\n`;
70
+ prompt += `4. Report if you need additional files not provided\n\n`;
71
+ prompt += `Proceed with the implementation.`;
72
+ return prompt;
73
+ }
74
+ /**
75
+ * Detect if agent modified files outside the declared scope
76
+ */
77
+ export function detectScopeViolation(declaredFiles, actualFiles) {
78
+ const violations = actualFiles.filter((f) => !declaredFiles.includes(f));
79
+ return violations.length > 0 ? violations : undefined;
80
+ }
81
+ /**
82
+ * Get current git diff hash to detect changes
83
+ */
84
+ function getCurrentDiffHash(workingDir) {
85
+ const result = spawnSync('git', ['diff', 'HEAD'], {
86
+ cwd: workingDir,
87
+ encoding: 'utf8',
88
+ maxBuffer: 50 * 1024 * 1024,
89
+ });
90
+ if (result.error) {
91
+ throw new Error(`Failed to get git diff: ${result.error.message}`);
92
+ }
93
+ const diff = result.stdout || '';
94
+ return createHash('sha256').update(diff).digest('hex');
95
+ }
96
+ /**
97
+ * Get list of files changed in working directory
98
+ */
99
+ function getChangedFiles(workingDir) {
100
+ const result = spawnSync('git', ['diff', '--name-only', 'HEAD'], {
101
+ cwd: workingDir,
102
+ encoding: 'utf8',
103
+ });
104
+ if (result.error) {
105
+ throw new Error(`Failed to get changed files: ${result.error.message}`);
106
+ }
107
+ const files = (result.stdout || '')
108
+ .split('\n')
109
+ .map((f) => f.trim())
110
+ .filter((f) => f.length > 0);
111
+ return files;
112
+ }
113
+ /**
114
+ * Validate file paths to prevent command injection
115
+ * Throws an error if any path contains suspicious characters or patterns
116
+ */
117
+ export function validateFilePaths(paths) {
118
+ // Shell metacharacters that could be used for injection
119
+ const dangerousChars = /[;|&`$()<>]/;
120
+ for (const path of paths) {
121
+ // Check for shell metacharacters
122
+ if (dangerousChars.test(path)) {
123
+ throw new Error(`Invalid file path "${path}": contains shell metacharacters that could be used for command injection`);
124
+ }
125
+ // Check for directory traversal attempts
126
+ if (path.includes('..')) {
127
+ throw new Error(`Invalid file path "${path}": directory traversal is not allowed`);
128
+ }
129
+ // Ensure path starts with expected directories (basic sanity check)
130
+ // Allow: src/, tests/, dist/, .ai-sdlc/, or relative paths starting with ./
131
+ const validPrefixes = ['src/', 'tests/', 'dist/', '.ai-sdlc/', './', ''];
132
+ const hasValidPrefix = validPrefixes.some((prefix) => path.startsWith(prefix) || path === prefix.slice(0, -1));
133
+ if (!hasValidPrefix && !path.match(/^[a-zA-Z0-9_.-]+$/)) {
134
+ throw new Error(`Invalid file path "${path}": must start with an expected directory (src/, tests/, etc.) or be a simple filename`);
135
+ }
136
+ }
137
+ }
138
+ /**
139
+ * Detect test files related to changed modules
140
+ * Checks for co-located .test.ts files
141
+ */
142
+ function detectTestFiles(filesChanged) {
143
+ const testFiles = new Set();
144
+ for (const file of filesChanged) {
145
+ // Check for co-located test files (e.g., foo.ts -> foo.test.ts)
146
+ if (file.endsWith('.ts') || file.endsWith('.tsx')) {
147
+ const testFile = file.replace(/\.(ts|tsx)$/, '.test.$1');
148
+ testFiles.add(testFile);
149
+ }
150
+ }
151
+ return Array.from(testFiles);
152
+ }
153
+ /**
154
+ * Verify changes using TypeScript, ESLint, and tests
155
+ */
156
+ export async function verifyChanges(filesChanged, workingDir) {
157
+ const errors = [];
158
+ let testsRun = false;
159
+ if (filesChanged.length === 0) {
160
+ return { passed: true, errors: [], testsRun: false };
161
+ }
162
+ // Validate file paths to prevent command injection
163
+ try {
164
+ validateFilePaths(filesChanged);
165
+ }
166
+ catch (error) {
167
+ errors.push(`Path validation failed: ${error.message}`);
168
+ return { passed: false, errors, testsRun: false };
169
+ }
170
+ // Run TypeScript type checking
171
+ // NOTE: TypeScript doesn't support true per-file checking - it always checks the whole project
172
+ // to ensure type safety across module boundaries. This is a TypeScript limitation.
173
+ const tscResult = spawnSync('npx', ['tsc', '--noEmit'], {
174
+ cwd: workingDir,
175
+ encoding: 'utf8',
176
+ });
177
+ if (tscResult.status !== 0) {
178
+ const stderr = tscResult.stderr || tscResult.stdout || '';
179
+ if (stderr.trim()) {
180
+ errors.push(`TypeScript errors (whole project checked):\n${stderr}`);
181
+ }
182
+ }
183
+ // Run ESLint on changed files
184
+ const tsFiles = filesChanged.filter((f) => f.endsWith('.ts') || f.endsWith('.tsx'));
185
+ if (tsFiles.length > 0) {
186
+ const eslintResult = spawnSync('npx', ['eslint', ...tsFiles], {
187
+ cwd: workingDir,
188
+ encoding: 'utf8',
189
+ });
190
+ if (eslintResult.status !== 0) {
191
+ const stderr = eslintResult.stderr || eslintResult.stdout || '';
192
+ if (stderr.trim()) {
193
+ errors.push(`ESLint errors:\n${stderr}`);
194
+ }
195
+ }
196
+ }
197
+ // Run tests for changed modules
198
+ const testFiles = detectTestFiles(filesChanged);
199
+ if (testFiles.length > 0) {
200
+ // Check if test files actually exist before running
201
+ const testResult = spawnSync('npm', ['test', '--', ...testFiles], {
202
+ cwd: workingDir,
203
+ encoding: 'utf8',
204
+ });
205
+ testsRun = true;
206
+ if (testResult.status !== 0) {
207
+ const stderr = testResult.stderr || testResult.stdout || '';
208
+ if (stderr.trim()) {
209
+ errors.push(`Test failures:\n${stderr}`);
210
+ }
211
+ }
212
+ }
213
+ else {
214
+ errors.push('No tests detected for changed files');
215
+ }
216
+ return {
217
+ passed: errors.length === 0,
218
+ errors,
219
+ testsRun,
220
+ };
221
+ }
222
+ /**
223
+ * Detect missing dependencies or files mentioned in agent output
224
+ * Scans for phrases indicating the agent needs additional files
225
+ */
226
+ export function detectMissingDependencies(agentOutput) {
227
+ const missingFiles = [];
228
+ const lines = agentOutput.split('\n');
229
+ // Keywords that indicate missing dependencies
230
+ const keywords = ['need', 'missing file', 'not provided', 'required file', 'cannot find'];
231
+ for (const line of lines) {
232
+ const lowerLine = line.toLowerCase();
233
+ // Check if line contains any missing dependency keywords
234
+ if (keywords.some((keyword) => lowerLine.includes(keyword))) {
235
+ // Try to extract file paths from the line
236
+ // Match common path patterns: src/foo.ts, ./foo.ts, foo.ts, etc.
237
+ // Note: Order extensions from longest to shortest to avoid partial matches (json before js, tsx before ts)
238
+ const pathMatches = line.match(/[\w/./-]+\.(json|tsx|jsx|ts|js)/g);
239
+ if (pathMatches) {
240
+ missingFiles.push(...pathMatches);
241
+ }
242
+ }
243
+ }
244
+ return missingFiles.length > 0 ? missingFiles : undefined;
245
+ }
246
+ /**
247
+ * Parse agent output and construct structured result
248
+ */
249
+ export async function parseTaskResult(agentOutput, task, workingDir) {
250
+ const logger = getLogger();
251
+ try {
252
+ // Get files actually changed
253
+ const filesChanged = getChangedFiles(workingDir);
254
+ // Detect scope violations
255
+ const declaredFiles = task.files || [];
256
+ const scopeViolation = detectScopeViolation(declaredFiles, filesChanged);
257
+ // Detect missing dependencies from agent output
258
+ const missingDependencies = detectMissingDependencies(agentOutput);
259
+ // Run verification on changed files
260
+ const verification = await verifyChanges(filesChanged, workingDir);
261
+ // Determine overall success
262
+ const success = verification.passed && filesChanged.length > 0;
263
+ const result = {
264
+ success,
265
+ task,
266
+ filesChanged,
267
+ verificationPassed: verification.passed,
268
+ agentOutput,
269
+ scopeViolation,
270
+ missingDependencies,
271
+ };
272
+ if (!verification.passed) {
273
+ result.error = verification.errors.join('\n\n');
274
+ }
275
+ else if (filesChanged.length === 0) {
276
+ result.error = 'No files were modified';
277
+ result.success = false;
278
+ }
279
+ logger.debug('single-task', 'Task result parsed', {
280
+ taskId: task.id,
281
+ success,
282
+ filesChanged: filesChanged.length,
283
+ verificationPassed: verification.passed,
284
+ hasScopeViolation: !!scopeViolation,
285
+ hasMissingDependencies: !!missingDependencies,
286
+ });
287
+ return result;
288
+ }
289
+ catch (error) {
290
+ // Git operation failed - this is an environment issue
291
+ logger.error('single-task', 'Git operation failed during result parsing', {
292
+ error: error.message,
293
+ });
294
+ return {
295
+ success: false,
296
+ task,
297
+ filesChanged: [],
298
+ verificationPassed: false,
299
+ agentOutput,
300
+ error: `Git operation failed: ${error.message}`,
301
+ };
302
+ }
303
+ }
304
+ /**
305
+ * Execute a single implementation task with minimal context
306
+ */
307
+ export async function runSingleTaskAgent(context, options) {
308
+ const logger = getLogger();
309
+ const { task, workingDirectory } = context;
310
+ logger.info('single-task', `Starting task ${task.id}: ${task.description}`);
311
+ // Build focused prompt
312
+ const prompt = buildTaskPrompt(context);
313
+ // Handle dry run
314
+ if (options?.dryRun) {
315
+ logger.info('single-task', 'DRY RUN MODE - Prompt generated but not executed');
316
+ logger.debug('single-task', 'Generated prompt', { prompt });
317
+ return {
318
+ success: false,
319
+ task,
320
+ filesChanged: [],
321
+ verificationPassed: false,
322
+ error: 'Dry run - no execution performed',
323
+ agentOutput: prompt,
324
+ };
325
+ }
326
+ try {
327
+ // Execute agent query
328
+ const agentOutput = await runAgentQuery({
329
+ prompt,
330
+ systemPrompt: TASK_AGENT_SYSTEM_PROMPT,
331
+ workingDirectory,
332
+ timeout: options?.timeout,
333
+ onProgress: options?.onProgress,
334
+ });
335
+ // Parse and return structured result
336
+ const result = await parseTaskResult(agentOutput, task, workingDirectory);
337
+ if (result.success) {
338
+ logger.info('single-task', `Task ${task.id} completed successfully`);
339
+ }
340
+ else {
341
+ logger.warn('single-task', `Task ${task.id} failed`, { error: result.error });
342
+ }
343
+ return result;
344
+ }
345
+ catch (error) {
346
+ logger.error('single-task', `Task ${task.id} execution failed`, { error: error.message });
347
+ return {
348
+ success: false,
349
+ task,
350
+ filesChanged: [],
351
+ verificationPassed: false,
352
+ error: error.message || 'Unknown error during task execution',
353
+ agentOutput: undefined,
354
+ };
355
+ }
356
+ }
357
+ //# sourceMappingURL=single-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-task.js","sourceRoot":"","sources":["../../src/agents/single-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQ9C;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;iDAmBS,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB;IAClD,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAE7E,IAAI,MAAM,GAAG,2BAA2B,CAAC;IACzC,MAAM,IAA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ONFIG } from '../core/config.js';
6
6
  import { initializeKanban, kanbanExists, assessState, getBoardStats, findStoryBySlug, findStoriesByStatus } from '../core/kanban.js';
7
- import { createStory, parseStory, resetRPIVCycle, isAtMaxRetries, unblockStory, getStory, findStoryById, updateStoryField, writeStory, sanitizeStoryId } from '../core/story.js';
7
+ import { createStory, parseStory, resetRPIVCycle, isAtMaxRetries, unblockStory, getStory, findStoryById, updateStoryField, writeStory, sanitizeStoryId, autoCompleteStoryAfterReview } from '../core/story.js';
8
8
  import { GitWorktreeService } from '../core/worktree.js';
9
9
  import { ReviewDecision } from '../types/index.js';
10
10
  import { getThemedChalk } from '../core/theme.js';
@@ -912,11 +912,15 @@ export async function run(options) {
912
912
  }
913
913
  // Validate git state before processing actions that modify git
914
914
  // Skip protected branch check if worktree mode is active (worktree is on feature branch)
915
- // Exclude .ai-sdlc/** from clean check when worktree was created (story file was just updated)
915
+ // Skip clean check entirely when worktree was just created:
916
+ // - The worktree starts from a clean base branch
917
+ // - npm install may modify package-lock.json
918
+ // - Story file was just updated with worktree_path
919
+ // - There's no prior user work to protect in a fresh worktree
916
920
  if (!options.force && requiresGitValidation(actionsToProcess)) {
917
921
  const workingDir = path.dirname(sdlcRoot);
918
922
  const gitValidationOptions = worktreeCreated
919
- ? { skipBranchCheck: true, excludePatterns: ['.ai-sdlc/**'] }
923
+ ? { skipBranchCheck: true, skipCleanCheck: true }
920
924
  : {};
921
925
  const gitValidation = validateGitState(workingDir, gitValidationOptions);
922
926
  if (!gitValidation.valid) {
@@ -1230,6 +1234,21 @@ async function executeAction(action, sdlcRoot) {
1230
1234
  }
1231
1235
  },
1232
1236
  });
1237
+ // Auto-complete story if review was approved
1238
+ if (result && result.success) {
1239
+ const reviewResult = result;
1240
+ let story = parseStory(action.storyPath);
1241
+ story = await autoCompleteStoryAfterReview(story, config, reviewResult);
1242
+ // Log auto-completion if it occurred
1243
+ if (reviewResult.decision === ReviewDecision.APPROVED && config.reviewConfig.autoCompleteOnApproval) {
1244
+ spinner.text = c.success('Review approved - auto-completing story');
1245
+ storyLogger?.log('INFO', `Story auto-completed after review approval: "${story.frontmatter.title}"`);
1246
+ // Handle worktree cleanup if story has a worktree
1247
+ if (story.frontmatter.worktree_path) {
1248
+ await handleWorktreeCleanup(story, config, c);
1249
+ }
1250
+ }
1251
+ }
1233
1252
  break;
1234
1253
  case 'rework':
1235
1254
  const { runReworkAgent } = await import('../agents/rework.js');