specweave 1.0.465 → 1.0.467

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 (117) hide show
  1. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.d.ts +16 -0
  2. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js +139 -0
  3. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js.map +1 -0
  4. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.d.ts +111 -0
  5. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.js +304 -0
  6. package/dist/plugins/specweave/lib/vendor/core/ac-test-validator.js.map +1 -0
  7. package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
  8. package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +359 -0
  9. package/dist/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
  10. package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +121 -0
  11. package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +273 -0
  12. package/dist/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
  13. package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +72 -0
  14. package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +237 -0
  15. package/dist/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
  16. package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
  17. package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +281 -0
  18. package/dist/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
  19. package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +278 -0
  20. package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +925 -0
  21. package/dist/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
  22. package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.d.ts +113 -0
  23. package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js +317 -0
  24. package/dist/plugins/specweave/lib/vendor/core/increment/status-auto-transition.js.map +1 -0
  25. package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +442 -0
  26. package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.js +246 -0
  27. package/dist/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
  28. package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.d.ts +64 -0
  29. package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.js +228 -0
  30. package/dist/plugins/specweave/lib/vendor/core/universal-auto-create.js.map +1 -0
  31. package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
  32. package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.js +300 -0
  33. package/dist/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
  34. package/dist/plugins/specweave/lib/vendor/sync/config.d.ts +73 -0
  35. package/dist/plugins/specweave/lib/vendor/sync/config.js +132 -0
  36. package/dist/plugins/specweave/lib/vendor/sync/config.js.map +1 -0
  37. package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.d.ts +167 -0
  38. package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.js +915 -0
  39. package/dist/plugins/specweave/lib/vendor/sync/github-reconciler.js.map +1 -0
  40. package/dist/plugins/specweave/lib/vendor/sync/provider-router.d.ts +86 -0
  41. package/dist/plugins/specweave/lib/vendor/sync/provider-router.js +147 -0
  42. package/dist/plugins/specweave/lib/vendor/sync/provider-router.js.map +1 -0
  43. package/dist/plugins/specweave/lib/vendor/sync/status-mapper.d.ts +120 -0
  44. package/dist/plugins/specweave/lib/vendor/sync/status-mapper.js +164 -0
  45. package/dist/plugins/specweave/lib/vendor/sync/status-mapper.js.map +1 -0
  46. package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.d.ts +151 -0
  47. package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.js +359 -0
  48. package/dist/plugins/specweave/lib/vendor/utils/auth-helpers.js.map +1 -0
  49. package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.d.ts +38 -0
  50. package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.js +118 -0
  51. package/dist/plugins/specweave/lib/vendor/utils/chalk-fallback.js.map +1 -0
  52. package/dist/plugins/specweave/lib/vendor/utils/clean-env.d.ts +47 -0
  53. package/dist/plugins/specweave/lib/vendor/utils/clean-env.js +63 -0
  54. package/dist/plugins/specweave/lib/vendor/utils/clean-env.js.map +1 -0
  55. package/dist/plugins/specweave/lib/vendor/utils/credential-masker.d.ts +118 -0
  56. package/dist/plugins/specweave/lib/vendor/utils/credential-masker.js +275 -0
  57. package/dist/plugins/specweave/lib/vendor/utils/credential-masker.js.map +1 -0
  58. package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.d.ts +99 -0
  59. package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.js +149 -0
  60. package/dist/plugins/specweave/lib/vendor/utils/execFileNoThrow.js.map +1 -0
  61. package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.d.ts +63 -0
  62. package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.js +85 -0
  63. package/dist/plugins/specweave/lib/vendor/utils/feature-id-derivation.js.map +1 -0
  64. package/dist/plugins/specweave/lib/vendor/utils/fs-native.d.ts +219 -0
  65. package/dist/plugins/specweave/lib/vendor/utils/fs-native.js +397 -0
  66. package/dist/plugins/specweave/lib/vendor/utils/fs-native.js.map +1 -0
  67. package/dist/plugins/specweave/lib/vendor/utils/logger.d.ts +56 -0
  68. package/dist/plugins/specweave/lib/vendor/utils/logger.js +123 -0
  69. package/dist/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
  70. package/dist/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
  71. package/dist/plugins/specweave/lib/vendor/utils/translation.js +414 -0
  72. package/dist/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
  73. package/dist/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js +1 -1
  74. package/dist/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js.map +1 -1
  75. package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts.map +1 -1
  76. package/dist/plugins/specweave-github/lib/duplicate-detector.js +22 -18
  77. package/dist/plugins/specweave-github/lib/duplicate-detector.js.map +1 -1
  78. package/dist/plugins/specweave-github/lib/github-ac-checkbox-sync.js +2 -2
  79. package/dist/plugins/specweave-github/lib/github-ac-checkbox-sync.js.map +1 -1
  80. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +2 -0
  81. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
  82. package/dist/plugins/specweave-github/lib/github-client-v2.js +13 -1
  83. package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
  84. package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
  85. package/dist/plugins/specweave-github/lib/github-feature-sync.js +13 -4
  86. package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
  87. package/dist/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js +1 -1
  88. package/dist/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js.map +1 -1
  89. package/dist/src/sync/github-reconciler.d.ts +5 -1
  90. package/dist/src/sync/github-reconciler.d.ts.map +1 -1
  91. package/dist/src/sync/github-reconciler.js +25 -8
  92. package/dist/src/sync/github-reconciler.js.map +1 -1
  93. package/package.json +1 -1
  94. package/plugins/specweave/lib/vendor/sync/github-reconciler.d.ts +5 -1
  95. package/plugins/specweave/lib/vendor/sync/github-reconciler.js +25 -8
  96. package/plugins/specweave/lib/vendor/sync/github-reconciler.js.map +1 -1
  97. package/plugins/specweave/lib/vendor/utils/auth-helpers.d.ts +151 -0
  98. package/plugins/specweave/lib/vendor/utils/auth-helpers.js +359 -0
  99. package/plugins/specweave/lib/vendor/utils/auth-helpers.js.map +1 -0
  100. package/plugins/specweave/skills/team-lead/SKILL.md +163 -60
  101. package/plugins/specweave/skills/team-lead/agents/backend.md +13 -6
  102. package/plugins/specweave/skills/team-lead/agents/database.md +21 -12
  103. package/plugins/specweave/skills/team-lead/agents/frontend.md +15 -8
  104. package/plugins/specweave/skills/team-lead/agents/security.md +18 -12
  105. package/plugins/specweave/skills/team-lead/agents/testing.md +17 -12
  106. package/plugins/specweave-ado/lib/ado-ac-checkbox-sync.js +1 -1
  107. package/plugins/specweave-ado/lib/ado-ac-checkbox-sync.ts +1 -1
  108. package/plugins/specweave-github/lib/duplicate-detector.js +19 -18
  109. package/plugins/specweave-github/lib/duplicate-detector.ts +9 -5
  110. package/plugins/specweave-github/lib/github-ac-checkbox-sync.js +1 -1
  111. package/plugins/specweave-github/lib/github-ac-checkbox-sync.ts +2 -2
  112. package/plugins/specweave-github/lib/github-client-v2.js +15 -4
  113. package/plugins/specweave-github/lib/github-client-v2.ts +16 -1
  114. package/plugins/specweave-github/lib/github-feature-sync.js +11 -3
  115. package/plugins/specweave-github/lib/github-feature-sync.ts +13 -4
  116. package/plugins/specweave-jira/lib/jira-ac-checkbox-sync.js +1 -1
  117. package/plugins/specweave-jira/lib/jira-ac-checkbox-sync.ts +1 -1
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AC Test Validator CLI
4
+ *
5
+ * Command-line interface for validating Acceptance Criteria tests before task completion.
6
+ *
7
+ * Usage:
8
+ * node ac-test-validator-cli.js <increment-id>
9
+ *
10
+ * Exit codes:
11
+ * 0 - All AC tests passed
12
+ * 1 - Validation failed (tests failed or missing)
13
+ * 2 - Configuration error (missing files, invalid setup)
14
+ */
15
+ export {};
16
+ //# sourceMappingURL=ac-test-validator-cli.d.ts.map
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * AC Test Validator CLI
4
+ *
5
+ * Command-line interface for validating Acceptance Criteria tests before task completion.
6
+ *
7
+ * Usage:
8
+ * node ac-test-validator-cli.js <increment-id>
9
+ *
10
+ * Exit codes:
11
+ * 0 - All AC tests passed
12
+ * 1 - Validation failed (tests failed or missing)
13
+ * 2 - Configuration error (missing files, invalid setup)
14
+ */
15
+ import path from 'path';
16
+ import * as fs from '../utils/fs-native.js';
17
+ import { createACTestValidator } from './ac-test-validator.js';
18
+ import { parseTasksWithUSLinks, getAllTasks } from '../generators/spec/task-parser.js';
19
+ import chalkFallback, { getChalk } from '../utils/chalk-fallback.js';
20
+ // Use chalk if available, otherwise fallback to ANSI codes
21
+ let chalk = chalkFallback;
22
+ getChalk().then(c => { chalk = c; }).catch((err) => {
23
+ // Fallback already set, just log at debug level
24
+ if (process.env.DEBUG) {
25
+ console.debug(`Chalk loading failed, using fallback: ${err.message}`);
26
+ }
27
+ });
28
+ /**
29
+ * Validate increment ID format to prevent path traversal attacks
30
+ * Valid format: 4 digits followed by alphanumeric/hyphen name (e.g., "0001-feature-name")
31
+ */
32
+ function isValidIncrementId(id) {
33
+ return /^\d{4}[A-Za-z]?-[a-zA-Z0-9-]+$/.test(id);
34
+ }
35
+ async function main() {
36
+ // Parse arguments
37
+ const incrementId = process.argv[2];
38
+ if (!incrementId) {
39
+ console.error(chalk.red('Error: Missing increment ID'));
40
+ console.error(chalk.gray('Usage: node ac-test-validator-cli.js <increment-id>'));
41
+ process.exit(2);
42
+ }
43
+ // Security: Validate increment ID format to prevent path traversal
44
+ if (!isValidIncrementId(incrementId)) {
45
+ console.error(chalk.red('Error: Invalid increment ID format'));
46
+ console.error(chalk.gray('Expected format: NNNN-name (e.g., 0001-feature-name)'));
47
+ process.exit(2);
48
+ }
49
+ // Find project root
50
+ const projectRoot = process.cwd();
51
+ // Validate increment exists
52
+ const incrementPath = path.join(projectRoot, '.specweave/increments', incrementId);
53
+ if (!await fs.pathExists(incrementPath)) {
54
+ console.error(chalk.red(`Error: Increment not found: ${incrementId}`));
55
+ process.exit(2);
56
+ }
57
+ const tasksPath = path.join(incrementPath, 'tasks.md');
58
+ if (!await fs.pathExists(tasksPath)) {
59
+ console.error(chalk.red(`Error: tasks.md not found in ${incrementId}`));
60
+ process.exit(2);
61
+ }
62
+ try {
63
+ // Parse tasks
64
+ console.log(chalk.blue('\n[AC Test Validator]') + ' Parsing tasks...');
65
+ const tasksByUS = parseTasksWithUSLinks(tasksPath);
66
+ const tasks = getAllTasks(tasksByUS);
67
+ // Filter tasks being marked complete (looking for recently modified tasks)
68
+ // For now, validate ALL tasks with ACs
69
+ const tasksToValidate = tasks.filter(t => {
70
+ return t.satisfiesACs && t.satisfiesACs.length > 0 && t.status === 'completed';
71
+ });
72
+ if (tasksToValidate.length === 0) {
73
+ console.log(chalk.yellow('No completed tasks with Acceptance Criteria to validate.'));
74
+ process.exit(0);
75
+ }
76
+ console.log(chalk.blue(`Found ${tasksToValidate.length} completed task(s) with ACs to validate\n`));
77
+ // Create validator
78
+ const validator = await createACTestValidator(projectRoot);
79
+ // Validate each task
80
+ const results = [];
81
+ let allPassed = true;
82
+ for (const task of tasksToValidate) {
83
+ console.log(chalk.bold(`\nValidating ${task.id}: ${task.title}`));
84
+ const result = await validator.validateTask(task, projectRoot);
85
+ results.push(result);
86
+ // Display formatted result
87
+ console.log(validator.formatResult(result));
88
+ if (!result.passed) {
89
+ allPassed = false;
90
+ }
91
+ }
92
+ // Overall summary
93
+ console.log(chalk.bold('\n' + '='.repeat(60)));
94
+ console.log(chalk.bold('OVERALL VALIDATION SUMMARY'));
95
+ console.log('='.repeat(60));
96
+ const totalTasks = results.length;
97
+ const passedTasks = results.filter(r => r.passed).length;
98
+ const failedTasks = totalTasks - passedTasks;
99
+ console.log(`Tasks Validated: ${totalTasks}`);
100
+ console.log(`Passed: ${chalk.green(passedTasks)}`);
101
+ console.log(`Failed: ${chalk.red(failedTasks)}`);
102
+ const totalACs = results.reduce((sum, r) => sum + r.summary.totalACs, 0);
103
+ const acsPassed = results.reduce((sum, r) => sum + r.summary.acsTested, 0);
104
+ const acsFailed = totalACs - acsPassed;
105
+ console.log(`\nTotal ACs: ${totalACs}`);
106
+ console.log(`ACs with Passing Tests: ${chalk.green(acsPassed)}`);
107
+ console.log(`ACs with Failing Tests: ${chalk.red(acsFailed)}`);
108
+ console.log('='.repeat(60));
109
+ if (allPassed) {
110
+ console.log(chalk.green.bold('\n✓ ALL VALIDATIONS PASSED\n'));
111
+ console.log(chalk.green('All Acceptance Criteria have passing tests.'));
112
+ console.log(chalk.green('Task completion allowed.\n'));
113
+ process.exit(0);
114
+ }
115
+ else {
116
+ console.log(chalk.red.bold('\n✗ VALIDATION FAILED\n'));
117
+ console.log(chalk.red('Some Acceptance Criteria have failing or missing tests.'));
118
+ console.log(chalk.red('Task completion blocked until all tests pass.\n'));
119
+ console.log(chalk.yellow('Fix the failing tests and try again.'));
120
+ console.log(chalk.gray('Run tests manually: npm test\n'));
121
+ process.exit(1);
122
+ }
123
+ }
124
+ catch (error) {
125
+ console.error(chalk.red('\nValidation Error:'));
126
+ console.error(chalk.red(error.message));
127
+ if (error.stack) {
128
+ console.error(chalk.gray('\nStack trace:'));
129
+ console.error(chalk.gray(error.stack));
130
+ }
131
+ process.exit(2);
132
+ }
133
+ }
134
+ // Run CLI
135
+ main().catch(error => {
136
+ console.error(chalk.red('Fatal error:'), error);
137
+ process.exit(2);
138
+ });
139
+ //# sourceMappingURL=ac-test-validator-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ac-test-validator-cli.js","sourceRoot":"","sources":["../../../src/core/ac-test-validator-cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAA0B,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,aAAa,EAAE,EAAE,QAAQ,EAAE,MAA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EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * AC Test Validator
3
+ *
4
+ * Validates that all Acceptance Criteria linked to a task have passing tests
5
+ * before allowing the task to be marked complete.
6
+ *
7
+ * **CRITICAL QUALITY GATE**: This is the enforcement point that prevents
8
+ * tasks from being marked complete without validated ACs.
9
+ *
10
+ * Workflow:
11
+ * 1. Task completion requested via TodoWrite
12
+ * 2. Validator extracts task's satisfiesACs field
13
+ * 3. Validator finds corresponding test files from Test Plan section
14
+ * 4. Validator runs tests using configured test runner (vitest/jest)
15
+ * 5. If ALL tests pass → Allow completion, auto-check ACs in spec.md
16
+ * 6. If ANY test fails → Block completion, show detailed error
17
+ */
18
+ import { Task } from '../generators/spec/task-parser.js';
19
+ /**
20
+ * Test validation result
21
+ */
22
+ export interface ACTestValidationResult {
23
+ /** Whether all tests passed */
24
+ passed: boolean;
25
+ /** Task ID being validated */
26
+ taskId: string;
27
+ /** AC-IDs this task satisfies */
28
+ acIds: string[];
29
+ /** Test results by AC-ID */
30
+ testResults: Map<string, ACTestResult>;
31
+ /** Overall summary */
32
+ summary: {
33
+ totalACs: number;
34
+ acsTested: number;
35
+ acsUntested: number;
36
+ testsPassed: number;
37
+ testsFailed: number;
38
+ };
39
+ /** Detailed error messages (if validation failed) */
40
+ errors: string[];
41
+ }
42
+ /**
43
+ * Test result for a single AC
44
+ */
45
+ export interface ACTestResult {
46
+ acId: string;
47
+ testFile?: string;
48
+ testCases: string[];
49
+ passed: boolean;
50
+ duration: number;
51
+ error?: string;
52
+ }
53
+ /**
54
+ * Test runner configuration
55
+ */
56
+ export interface TestRunnerConfig {
57
+ /** Test runner command (e.g., "npm test", "vitest run") */
58
+ command: string;
59
+ /** Test file pattern (glob pattern for test files) */
60
+ pattern: string;
61
+ /** Working directory for test execution */
62
+ cwd: string;
63
+ /** Environment variables for test execution */
64
+ env?: Record<string, string>;
65
+ /** Timeout in milliseconds (default: 30000) */
66
+ timeout?: number;
67
+ }
68
+ /**
69
+ * AC Test Validator - Core validation engine
70
+ */
71
+ export declare class ACTestValidator {
72
+ private config;
73
+ constructor(config: TestRunnerConfig);
74
+ /**
75
+ * Validate all ACs for a task have passing tests
76
+ *
77
+ * @param task - Task to validate (must have satisfiesACs field)
78
+ * @param projectRoot - Project root directory
79
+ * @returns Validation result
80
+ */
81
+ validateTask(task: Task, projectRoot: string): Promise<ACTestValidationResult>;
82
+ /**
83
+ * Validate a single AC has passing tests
84
+ */
85
+ private validateAC;
86
+ /**
87
+ * Build test command with AC-ID filter
88
+ */
89
+ private buildTestCommand;
90
+ /**
91
+ * Extract test case names from test output
92
+ */
93
+ private extractTestCases;
94
+ /**
95
+ * Extract failure message from test output
96
+ */
97
+ private extractFailureMessage;
98
+ /**
99
+ * Extract test file path from task description (Test Plan section)
100
+ */
101
+ private extractTestFile;
102
+ /**
103
+ * Format validation result for display
104
+ */
105
+ formatResult(result: ACTestValidationResult): string;
106
+ }
107
+ /**
108
+ * Create AC test validator from project config
109
+ */
110
+ export declare function createACTestValidator(projectRoot: string): Promise<ACTestValidator>;
111
+ //# sourceMappingURL=ac-test-validator.d.ts.map
@@ -0,0 +1,304 @@
1
+ /**
2
+ * AC Test Validator
3
+ *
4
+ * Validates that all Acceptance Criteria linked to a task have passing tests
5
+ * before allowing the task to be marked complete.
6
+ *
7
+ * **CRITICAL QUALITY GATE**: This is the enforcement point that prevents
8
+ * tasks from being marked complete without validated ACs.
9
+ *
10
+ * Workflow:
11
+ * 1. Task completion requested via TodoWrite
12
+ * 2. Validator extracts task's satisfiesACs field
13
+ * 3. Validator finds corresponding test files from Test Plan section
14
+ * 4. Validator runs tests using configured test runner (vitest/jest)
15
+ * 5. If ALL tests pass → Allow completion, auto-check ACs in spec.md
16
+ * 6. If ANY test fails → Block completion, show detailed error
17
+ */
18
+ import { exec } from 'child_process';
19
+ import { promisify } from 'util';
20
+ import path from 'path';
21
+ import * as fs from '../utils/fs-native.js';
22
+ import chalkFallback, { getChalk } from '../utils/chalk-fallback.js';
23
+ // CRITICAL: Import getCleanEnv to remove NODE_OPTIONS debugger flags from child processes
24
+ import { getCleanEnv } from '../utils/clean-env.js';
25
+ // Use chalk if available, otherwise fallback to ANSI codes
26
+ let chalk = chalkFallback;
27
+ getChalk().then(c => { chalk = c; }).catch((err) => {
28
+ // Fallback already set, just log at debug level
29
+ if (process.env.DEBUG) {
30
+ console.debug(`Chalk loading failed, using fallback: ${err.message}`);
31
+ }
32
+ });
33
+ const execAsync = promisify(exec);
34
+ /**
35
+ * AC Test Validator - Core validation engine
36
+ */
37
+ export class ACTestValidator {
38
+ constructor(config) {
39
+ this.config = {
40
+ timeout: 30000, // 30 second default timeout
41
+ ...config
42
+ };
43
+ }
44
+ /**
45
+ * Validate all ACs for a task have passing tests
46
+ *
47
+ * @param task - Task to validate (must have satisfiesACs field)
48
+ * @param projectRoot - Project root directory
49
+ * @returns Validation result
50
+ */
51
+ async validateTask(task, projectRoot) {
52
+ const startTime = Date.now();
53
+ // Initialize result
54
+ const result = {
55
+ passed: false,
56
+ taskId: task.id,
57
+ acIds: task.satisfiesACs || [],
58
+ testResults: new Map(),
59
+ summary: {
60
+ totalACs: 0,
61
+ acsTested: 0,
62
+ acsUntested: 0,
63
+ testsPassed: 0,
64
+ testsFailed: 0
65
+ },
66
+ errors: []
67
+ };
68
+ // Check if task has ACs to validate
69
+ if (!task.satisfiesACs || task.satisfiesACs.length === 0) {
70
+ result.errors.push(`Task ${task.id} has no Acceptance Criteria linked (satisfiesACs field missing or empty)`);
71
+ return result;
72
+ }
73
+ result.summary.totalACs = task.satisfiesACs.length;
74
+ // Extract test file from task's Test Plan section
75
+ const testFile = this.extractTestFile(task);
76
+ if (!testFile) {
77
+ result.errors.push(`Task ${task.id} has no Test Plan section or test file specified`);
78
+ return result;
79
+ }
80
+ // Check test file exists
81
+ const testFilePath = path.join(projectRoot, testFile);
82
+ if (!await fs.pathExists(testFilePath)) {
83
+ result.errors.push(`Test file not found: ${testFile}`);
84
+ return result;
85
+ }
86
+ // Run tests for each AC
87
+ for (const acId of task.satisfiesACs) {
88
+ const acTestResult = await this.validateAC(acId, testFile, projectRoot);
89
+ result.testResults.set(acId, acTestResult);
90
+ if (acTestResult.passed) {
91
+ result.summary.acsTested++;
92
+ result.summary.testsPassed++;
93
+ }
94
+ else {
95
+ result.summary.acsUntested++;
96
+ result.summary.testsFailed++;
97
+ result.errors.push(`AC ${acId} tests failed: ${acTestResult.error || 'Unknown error'}`);
98
+ }
99
+ }
100
+ // Overall pass/fail
101
+ result.passed = result.summary.testsFailed === 0 && result.summary.acsTested === result.summary.totalACs;
102
+ const duration = Date.now() - startTime;
103
+ console.log(`\n${chalk.blue('[AC Test Validator]')} Validated task ${task.id} in ${duration}ms`);
104
+ return result;
105
+ }
106
+ /**
107
+ * Validate a single AC has passing tests
108
+ */
109
+ async validateAC(acId, testFile, projectRoot) {
110
+ const startTime = Date.now();
111
+ const result = {
112
+ acId,
113
+ testFile,
114
+ testCases: [],
115
+ passed: false,
116
+ duration: 0
117
+ };
118
+ try {
119
+ // Run test file with filter for AC-ID
120
+ // Most test runners support filtering: vitest -t "AC-US1-01", jest --testNamePattern="AC-US1-01"
121
+ const command = this.buildTestCommand(testFile, acId);
122
+ console.log(` ${chalk.gray('Running:')} ${command}`);
123
+ // CRITICAL: Use getCleanEnv() to remove NODE_OPTIONS debugger flags
124
+ // Without this, running tests from VSCode debug mode fails silently
125
+ const { stdout, stderr } = await execAsync(command, {
126
+ cwd: this.config.cwd,
127
+ env: { ...getCleanEnv(), ...this.config.env },
128
+ timeout: this.config.timeout
129
+ });
130
+ // Parse test output (basic implementation - can be enhanced)
131
+ const output = stdout + stderr;
132
+ result.testCases = this.extractTestCases(output, acId);
133
+ // Check for test failures
134
+ const hasFailures = output.includes('FAIL') ||
135
+ output.includes('failed') ||
136
+ output.includes('✗') ||
137
+ output.includes('0 passed');
138
+ result.passed = !hasFailures && result.testCases.length > 0;
139
+ if (!result.passed) {
140
+ result.error = this.extractFailureMessage(output);
141
+ }
142
+ }
143
+ catch (error) {
144
+ result.passed = false;
145
+ result.error = error.message || 'Test execution failed';
146
+ // Check if it's a timeout
147
+ if (error.killed && error.signal === 'SIGTERM') {
148
+ result.error = `Test timeout (exceeded ${this.config.timeout}ms)`;
149
+ }
150
+ }
151
+ result.duration = Date.now() - startTime;
152
+ return result;
153
+ }
154
+ /**
155
+ * Build test command with AC-ID filter
156
+ */
157
+ buildTestCommand(testFile, acId) {
158
+ // Detect test runner from config command
159
+ const command = this.config.command.toLowerCase();
160
+ if (command.includes('vitest')) {
161
+ // Vitest: vitest run <file> -t "AC-US1-01"
162
+ return `${this.config.command} ${testFile} -t "${acId}"`;
163
+ }
164
+ else if (command.includes('jest')) {
165
+ // Jest: jest <file> --testNamePattern="AC-US1-01"
166
+ return `${this.config.command} ${testFile} --testNamePattern="${acId}"`;
167
+ }
168
+ else if (command.includes('npm test')) {
169
+ // NPM script - try to pass args
170
+ return `${this.config.command} -- ${testFile} -t "${acId}"`;
171
+ }
172
+ else {
173
+ // Default: assume vitest-style
174
+ return `${this.config.command} ${testFile} -t "${acId}"`;
175
+ }
176
+ }
177
+ /**
178
+ * Extract test case names from test output
179
+ */
180
+ extractTestCases(output, acId) {
181
+ const testCases = [];
182
+ // Look for lines containing the AC-ID and test indicators
183
+ const lines = output.split('\n');
184
+ for (const line of lines) {
185
+ if (line.includes(acId) && (line.includes('✓') || line.includes('PASS') || line.includes('√'))) {
186
+ // Extract test name (basic heuristic)
187
+ const match = line.match(/✓\s+(.+)/) || line.match(/PASS\s+(.+)/);
188
+ if (match) {
189
+ testCases.push(match[1].trim());
190
+ }
191
+ }
192
+ }
193
+ return testCases;
194
+ }
195
+ /**
196
+ * Extract failure message from test output
197
+ */
198
+ extractFailureMessage(output) {
199
+ const lines = output.split('\n');
200
+ // Find first error/failure message
201
+ for (let i = 0; i < lines.length; i++) {
202
+ const line = lines[i];
203
+ if (line.includes('FAIL') || line.includes('✗') || line.includes('Error:')) {
204
+ // Collect next few lines for context
205
+ const errorLines = lines.slice(i, i + 5).join('\n');
206
+ return errorLines.substring(0, 200); // Truncate long messages
207
+ }
208
+ }
209
+ // Fallback: return last few lines
210
+ return lines.slice(-5).join('\n');
211
+ }
212
+ /**
213
+ * Extract test file path from task description (Test Plan section)
214
+ */
215
+ extractTestFile(task) {
216
+ if (!task.description)
217
+ return null;
218
+ // Look for Test Plan section with file path
219
+ // Format: **Test Plan**:
220
+ // - **File**: `tests/unit/component.test.ts`
221
+ const testFileRegex = /\*\*File\*\*:\s*`([^`]+)`/;
222
+ const match = task.description.match(testFileRegex);
223
+ return match ? match[1] : null;
224
+ }
225
+ /**
226
+ * Format validation result for display
227
+ */
228
+ formatResult(result) {
229
+ const lines = [];
230
+ lines.push(chalk.bold(`\nAC Test Validation: ${result.taskId}`));
231
+ lines.push(chalk.gray('─'.repeat(60)));
232
+ // Summary
233
+ lines.push(chalk.bold('Summary:'));
234
+ lines.push(` Total ACs: ${result.summary.totalACs}`);
235
+ lines.push(` ACs Tested: ${chalk.green(result.summary.acsTested)}`);
236
+ lines.push(` ACs Untested: ${chalk.red(result.summary.acsUntested)}`);
237
+ lines.push(` Tests Passed: ${chalk.green(result.summary.testsPassed)}`);
238
+ lines.push(` Tests Failed: ${chalk.red(result.summary.testsFailed)}`);
239
+ // Overall status
240
+ lines.push('');
241
+ if (result.passed) {
242
+ lines.push(chalk.green.bold('✓ VALIDATION PASSED'));
243
+ lines.push(chalk.green('All Acceptance Criteria have passing tests. Task can be marked complete.'));
244
+ }
245
+ else {
246
+ lines.push(chalk.red.bold('✗ VALIDATION FAILED'));
247
+ lines.push(chalk.red('Task cannot be marked complete until all AC tests pass.'));
248
+ }
249
+ // Errors
250
+ if (result.errors.length > 0) {
251
+ lines.push('');
252
+ lines.push(chalk.bold('Errors:'));
253
+ result.errors.forEach(error => {
254
+ lines.push(chalk.red(` • ${error}`));
255
+ });
256
+ }
257
+ // Test details
258
+ if (result.testResults.size > 0) {
259
+ lines.push('');
260
+ lines.push(chalk.bold('Test Results:'));
261
+ result.testResults.forEach((acResult, acId) => {
262
+ const icon = acResult.passed ? chalk.green('✓') : chalk.red('✗');
263
+ const status = acResult.passed ? chalk.green('PASSED') : chalk.red('FAILED');
264
+ lines.push(` ${icon} ${acId}: ${status} (${acResult.duration}ms)`);
265
+ if (acResult.testCases.length > 0) {
266
+ acResult.testCases.forEach(testCase => {
267
+ lines.push(chalk.gray(` - ${testCase}`));
268
+ });
269
+ }
270
+ if (acResult.error) {
271
+ lines.push(chalk.red(` Error: ${acResult.error}`));
272
+ }
273
+ });
274
+ }
275
+ lines.push(chalk.gray('─'.repeat(60)));
276
+ return lines.join('\n');
277
+ }
278
+ }
279
+ /**
280
+ * Create AC test validator from project config
281
+ */
282
+ export async function createACTestValidator(projectRoot) {
283
+ // Read test configuration from package.json or specweave config
284
+ const packageJsonPath = path.join(projectRoot, 'package.json');
285
+ let testCommand = 'npm test';
286
+ if (await fs.pathExists(packageJsonPath)) {
287
+ const packageJson = await fs.readJson(packageJsonPath);
288
+ // Detect test runner
289
+ if (packageJson.devDependencies?.vitest || packageJson.dependencies?.vitest) {
290
+ testCommand = 'npx vitest run';
291
+ }
292
+ else if (packageJson.devDependencies?.jest || packageJson.dependencies?.jest) {
293
+ testCommand = 'npx jest';
294
+ }
295
+ }
296
+ const config = {
297
+ command: testCommand,
298
+ pattern: 'tests/**/*.test.ts',
299
+ cwd: projectRoot,
300
+ timeout: 30000
301
+ };
302
+ return new ACTestValidator(config);
303
+ }
304
+ //# sourceMappingURL=ac-test-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ac-test-validator.js","sourceRoot":"","sources":["../../../src/core/ac-test-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA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