specweave 0.21.3 → 0.22.0
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.md +198 -6
- package/README.md +33 -3
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts +101 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js +219 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js.map +1 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +182 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +603 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js.map +1 -0
- package/dist/plugins/specweave-github/lib/types.d.ts +34 -0
- package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +60 -5
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/config/types.d.ts +8 -8
- package/dist/src/core/living-docs/CompletionPropagator.d.ts.map +1 -1
- package/dist/src/core/living-docs/CompletionPropagator.js +4 -3
- package/dist/src/core/living-docs/CompletionPropagator.js.map +1 -1
- package/dist/src/core/living-docs/SpecDistributor.d.ts +5 -0
- package/dist/src/core/living-docs/SpecDistributor.d.ts.map +1 -1
- package/dist/src/core/living-docs/SpecDistributor.js +12 -0
- package/dist/src/core/living-docs/SpecDistributor.js.map +1 -1
- package/dist/src/core/living-docs/project-detector.d.ts.map +1 -1
- package/dist/src/core/living-docs/project-detector.js +38 -0
- package/dist/src/core/living-docs/project-detector.js.map +1 -1
- package/dist/src/core/types/config.d.ts +23 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +10 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/init/ArchitecturePresenter.d.ts +47 -0
- package/dist/src/init/ArchitecturePresenter.d.ts.map +1 -0
- package/dist/src/init/ArchitecturePresenter.js +180 -0
- package/dist/src/init/ArchitecturePresenter.js.map +1 -0
- package/dist/src/init/InitFlow.d.ts.map +1 -1
- package/dist/src/init/InitFlow.js +30 -1
- package/dist/src/init/InitFlow.js.map +1 -1
- package/dist/src/init/architecture/CostEstimator.d.ts +52 -0
- package/dist/src/init/architecture/CostEstimator.d.ts.map +1 -0
- package/dist/src/init/architecture/CostEstimator.js +107 -0
- package/dist/src/init/architecture/CostEstimator.js.map +1 -0
- package/dist/src/init/architecture/InfrastructureMapper.d.ts +41 -0
- package/dist/src/init/architecture/InfrastructureMapper.d.ts.map +1 -0
- package/dist/src/init/architecture/InfrastructureMapper.js +140 -0
- package/dist/src/init/architecture/InfrastructureMapper.js.map +1 -0
- package/dist/src/init/architecture/ProjectGenerator.d.ts +44 -0
- package/dist/src/init/architecture/ProjectGenerator.d.ts.map +1 -0
- package/dist/src/init/architecture/ProjectGenerator.js +216 -0
- package/dist/src/init/architecture/ProjectGenerator.js.map +1 -0
- package/dist/src/init/research/src/config/types.d.ts +8 -8
- package/package.json +9 -8
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-github/lib/CodeValidator.js +195 -0
- package/plugins/specweave-github/lib/CodeValidator.ts +284 -0
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.js +545 -0
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +809 -0
- package/plugins/specweave-github/lib/types.ts +38 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1200 -0
- package/src/templates/AGENTS.md.template +22 -1
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Three-Layer Bidirectional Sync Manager
|
|
3
|
+
*
|
|
4
|
+
* Handles synchronization across three layers:
|
|
5
|
+
* - Layer 1: GitHub Issue (stakeholder UI)
|
|
6
|
+
* - Layer 2: Living Docs User Story files (intermediate representation)
|
|
7
|
+
* - Layer 3: Increment spec.md + tasks.md (source of truth)
|
|
8
|
+
*
|
|
9
|
+
* Supports two sync flows:
|
|
10
|
+
* 1. GitHub → Living Docs → Increment (stakeholder checks checkbox)
|
|
11
|
+
* 2. Increment → Living Docs → GitHub (developer completes work)
|
|
12
|
+
*
|
|
13
|
+
* Features:
|
|
14
|
+
* - Code validation (reopen tasks if code doesn't exist)
|
|
15
|
+
* - Completion propagation (Tasks → ACs → User Stories)
|
|
16
|
+
* - Conflict resolution (Increment always wins)
|
|
17
|
+
*
|
|
18
|
+
* @module ThreeLayerSyncManager
|
|
19
|
+
*/
|
|
20
|
+
import fs from 'fs-extra';
|
|
21
|
+
import path from 'path';
|
|
22
|
+
import { execFileNoThrow } from '../../../src/utils/execFileNoThrow.js';
|
|
23
|
+
import { CodeValidator } from './CodeValidator.js';
|
|
24
|
+
export class ThreeLayerSyncManager {
|
|
25
|
+
constructor(projectRoot = process.cwd()) {
|
|
26
|
+
this.userStoryFileCache = new Map();
|
|
27
|
+
this.projectRoot = projectRoot;
|
|
28
|
+
this.codeValidator = new CodeValidator({ projectRoot });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Clear User Story file cache
|
|
32
|
+
* Call this when file structure changes or for testing
|
|
33
|
+
*/
|
|
34
|
+
clearCache() {
|
|
35
|
+
this.userStoryFileCache.clear();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sync from GitHub to Increment (Flow 1: GitHub → Living Docs → Increment)
|
|
39
|
+
*
|
|
40
|
+
* Triggered when stakeholder checks AC/Task checkbox in GitHub issue.
|
|
41
|
+
*/
|
|
42
|
+
async syncGitHubToIncrement(issueNumber, incrementPath, livingDocsPath) {
|
|
43
|
+
const result = {
|
|
44
|
+
acsUpdated: 0,
|
|
45
|
+
tasksUpdated: 0,
|
|
46
|
+
tasksReopened: 0,
|
|
47
|
+
conflicts: [],
|
|
48
|
+
errors: []
|
|
49
|
+
};
|
|
50
|
+
try {
|
|
51
|
+
console.log(`🔄 Syncing GitHub issue #${issueNumber} → Increment`);
|
|
52
|
+
// 1. Fetch GitHub issue state
|
|
53
|
+
const githubState = await this.fetchGitHubIssueState(issueNumber);
|
|
54
|
+
// 2. Extract AC and Task completion state from issue body
|
|
55
|
+
const githubAcs = this.extractAcsFromIssue(githubState.body);
|
|
56
|
+
const githubTasks = this.extractTasksFromIssue(githubState.body);
|
|
57
|
+
// 3. Update Living Docs User Stories (Layer 2) - PARALLEL I/O for performance
|
|
58
|
+
const acUpdatePromises = githubAcs.map(async (ac) => {
|
|
59
|
+
const userStoryPath = await this.findUserStoryFile(livingDocsPath, ac.userStoryId);
|
|
60
|
+
if (userStoryPath) {
|
|
61
|
+
await this.updateUserStoryAc(userStoryPath, ac.id, ac.completed);
|
|
62
|
+
result.acsUpdated++;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const taskUpdatePromises = githubTasks.map(async (task) => {
|
|
66
|
+
// Find User Story that contains this task
|
|
67
|
+
const userStoryPath = await this.findUserStoryFileForTask(livingDocsPath, task.id);
|
|
68
|
+
if (userStoryPath) {
|
|
69
|
+
await this.updateUserStoryTask(userStoryPath, task.id, task.completed);
|
|
70
|
+
result.tasksUpdated++;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
// Wait for all updates to complete in parallel
|
|
74
|
+
await Promise.all([...acUpdatePromises, ...taskUpdatePromises]);
|
|
75
|
+
// 4. Update Increment (Layer 3 - source of truth) with conflict resolution
|
|
76
|
+
await this.updateIncrementAcsWithConflictResolution(incrementPath, githubAcs, result);
|
|
77
|
+
await this.updateIncrementTasksWithConflictResolution(incrementPath, githubTasks, result);
|
|
78
|
+
// 5. Code validation: If task marked complete, check if code exists - PARALLEL for performance
|
|
79
|
+
const completedTasks = githubTasks.filter(t => t.completed);
|
|
80
|
+
const validationPromises = completedTasks.map(async (task) => {
|
|
81
|
+
const codeExists = await this.validateCodeExists(task);
|
|
82
|
+
if (!codeExists) {
|
|
83
|
+
console.log(`⚠️ Task ${task.id} marked complete but code missing - reopening`);
|
|
84
|
+
await this.reopenTask(task.id, incrementPath, livingDocsPath, issueNumber);
|
|
85
|
+
result.tasksReopened++;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
await Promise.all(validationPromises);
|
|
89
|
+
console.log(`✅ Sync complete: ${result.acsUpdated} ACs, ${result.tasksUpdated} tasks updated`);
|
|
90
|
+
if (result.tasksReopened > 0) {
|
|
91
|
+
console.log(` ${result.tasksReopened} tasks reopened due to missing code`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
96
|
+
result.errors.push(errorMsg);
|
|
97
|
+
console.error(`❌ Error syncing GitHub → Increment:`, error);
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Sync from Increment to GitHub (Flow 2: Increment → Living Docs → GitHub)
|
|
103
|
+
*
|
|
104
|
+
* Triggered when developer completes work and updates increment files.
|
|
105
|
+
*/
|
|
106
|
+
async syncIncrementToGitHub(incrementPath, livingDocsPath, issueNumber) {
|
|
107
|
+
const result = {
|
|
108
|
+
acsUpdated: 0,
|
|
109
|
+
tasksUpdated: 0,
|
|
110
|
+
tasksReopened: 0,
|
|
111
|
+
conflicts: [],
|
|
112
|
+
errors: []
|
|
113
|
+
};
|
|
114
|
+
try {
|
|
115
|
+
console.log(`🔄 Syncing Increment → GitHub issue #${issueNumber}`);
|
|
116
|
+
// 1. Read increment spec.md and tasks.md
|
|
117
|
+
const specPath = path.join(incrementPath, 'spec.md');
|
|
118
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
119
|
+
const specContent = await fs.readFile(specPath, 'utf-8');
|
|
120
|
+
const tasksContent = await fs.readFile(tasksPath, 'utf-8');
|
|
121
|
+
// 2. Parse ACs and Tasks
|
|
122
|
+
const acs = this.parseAcceptanceCriteria(specContent);
|
|
123
|
+
const tasks = this.parseTasks(tasksContent);
|
|
124
|
+
// 3. Update Living Docs User Stories (Layer 2)
|
|
125
|
+
const acsByUserStory = this.groupAcsByUserStory(acs);
|
|
126
|
+
for (const [userStoryId, userStoryAcs] of Object.entries(acsByUserStory)) {
|
|
127
|
+
const userStoryPath = await this.findUserStoryFile(livingDocsPath, userStoryId);
|
|
128
|
+
if (userStoryPath) {
|
|
129
|
+
// Update ACs in User Story
|
|
130
|
+
await this.updateUserStoryAcs(userStoryPath, userStoryAcs);
|
|
131
|
+
result.acsUpdated += userStoryAcs.length;
|
|
132
|
+
// Update Tasks in User Story (filter by AC IDs)
|
|
133
|
+
const acIds = userStoryAcs.map(ac => ac.id);
|
|
134
|
+
const userStoryTasks = this.filterTasksByAcIds(tasks, acIds);
|
|
135
|
+
await this.updateUserStoryTasks(userStoryPath, userStoryTasks);
|
|
136
|
+
result.tasksUpdated += userStoryTasks.length;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// 4. Update GitHub issue (Layer 1)
|
|
140
|
+
await this.updateGitHubIssue(issueNumber, acs, tasks);
|
|
141
|
+
console.log(`✅ Sync complete: ${result.acsUpdated} ACs, ${result.tasksUpdated} tasks updated`);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
145
|
+
result.errors.push(errorMsg);
|
|
146
|
+
console.error(`❌ Error syncing Increment → GitHub:`, error);
|
|
147
|
+
}
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Validate that code exists for completed task
|
|
152
|
+
* Uses CodeValidator for comprehensive validation
|
|
153
|
+
*/
|
|
154
|
+
async validateCodeExists(task) {
|
|
155
|
+
// Use CodeValidator for robust validation
|
|
156
|
+
const validationResult = await this.codeValidator.validateTask(task.title, task.id);
|
|
157
|
+
return validationResult.valid;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Reopen task if code validation fails
|
|
161
|
+
*/
|
|
162
|
+
async reopenTask(taskId, incrementPath, livingDocsPath, issueNumber) {
|
|
163
|
+
// 1. Reopen in increment tasks.md
|
|
164
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
165
|
+
let tasksContent = await fs.readFile(tasksPath, 'utf-8');
|
|
166
|
+
// Find task and mark as incomplete
|
|
167
|
+
const taskRegex = new RegExp(`(### ${taskId}:[^#]*?)\\*\\*Completed\\*\\*:[^\\n]*\\n`, 's');
|
|
168
|
+
tasksContent = tasksContent.replace(taskRegex, '$1');
|
|
169
|
+
await fs.writeFile(tasksPath, tasksContent, 'utf-8');
|
|
170
|
+
// 2. Propagate to Living Docs
|
|
171
|
+
const userStoryPath = await this.findUserStoryFileForTask(livingDocsPath, taskId);
|
|
172
|
+
if (userStoryPath) {
|
|
173
|
+
await this.updateUserStoryTask(userStoryPath, taskId, false);
|
|
174
|
+
}
|
|
175
|
+
// 3. Propagate to GitHub (add comment explaining why)
|
|
176
|
+
await this.addGitHubComment(issueNumber, `⚠️ Task ${taskId} reopened: Code validation failed (missing or empty file). Please implement the required code.`);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Propagate completion from Tasks → ACs → User Stories (bottom-up)
|
|
180
|
+
*/
|
|
181
|
+
async propagateCompletion(incrementPath, livingDocsPath) {
|
|
182
|
+
// 1. Read increment files
|
|
183
|
+
const specPath = path.join(incrementPath, 'spec.md');
|
|
184
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
185
|
+
const specContent = await fs.readFile(specPath, 'utf-8');
|
|
186
|
+
const tasksContent = await fs.readFile(tasksPath, 'utf-8');
|
|
187
|
+
const acs = this.parseAcceptanceCriteria(specContent);
|
|
188
|
+
const tasks = this.parseTasks(tasksContent);
|
|
189
|
+
// 2. For each AC, check if all its tasks are complete
|
|
190
|
+
for (const ac of acs) {
|
|
191
|
+
const acTasks = tasks.filter(t => t.acIds.includes(ac.id));
|
|
192
|
+
const allTasksComplete = acTasks.length > 0 && acTasks.every(t => t.completed);
|
|
193
|
+
if (allTasksComplete && !ac.completed) {
|
|
194
|
+
// Mark AC as complete
|
|
195
|
+
console.log(`✅ All tasks for ${ac.id} complete - marking AC as complete`);
|
|
196
|
+
await this.updateIncrementAc(incrementPath, ac.id, true);
|
|
197
|
+
// Propagate to Living Docs
|
|
198
|
+
const userStoryPath = await this.findUserStoryFile(livingDocsPath, ac.userStoryId);
|
|
199
|
+
if (userStoryPath) {
|
|
200
|
+
await this.updateUserStoryAc(userStoryPath, ac.id, true);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// 3. For each User Story, check if all ACs are complete
|
|
205
|
+
const acsByUserStory = this.groupAcsByUserStory(acs);
|
|
206
|
+
for (const [userStoryId, userStoryAcs] of Object.entries(acsByUserStory)) {
|
|
207
|
+
const allAcsComplete = userStoryAcs.every(ac => ac.completed);
|
|
208
|
+
if (allAcsComplete) {
|
|
209
|
+
console.log(`✅ All ACs for ${userStoryId} complete - User Story complete`);
|
|
210
|
+
// Could trigger User Story completion workflow here
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// ==================== Helper Methods ====================
|
|
215
|
+
/**
|
|
216
|
+
* Fetch GitHub issue state
|
|
217
|
+
*/
|
|
218
|
+
async fetchGitHubIssueState(issueNumber) {
|
|
219
|
+
const result = await execFileNoThrow('gh', [
|
|
220
|
+
'issue',
|
|
221
|
+
'view',
|
|
222
|
+
String(issueNumber),
|
|
223
|
+
'--json',
|
|
224
|
+
'body,state'
|
|
225
|
+
]);
|
|
226
|
+
if (result.stderr) {
|
|
227
|
+
throw new Error(`Failed to fetch GitHub issue: ${result.stderr}`);
|
|
228
|
+
}
|
|
229
|
+
return JSON.parse(result.stdout);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Extract ACs from GitHub issue body
|
|
233
|
+
*/
|
|
234
|
+
extractAcsFromIssue(body) {
|
|
235
|
+
const acs = [];
|
|
236
|
+
const lines = body.split('\n');
|
|
237
|
+
// Match lines like: - [x] AC-US1-01: Description
|
|
238
|
+
const acRegex = /^- \[([ x])\] (AC-[A-Z0-9]+-\d+):\s*(.+)$/;
|
|
239
|
+
for (const line of lines) {
|
|
240
|
+
const match = line.match(acRegex);
|
|
241
|
+
if (match) {
|
|
242
|
+
const completed = match[1] === 'x';
|
|
243
|
+
const id = match[2];
|
|
244
|
+
const description = match[3];
|
|
245
|
+
const userStoryMatch = id.match(/AC-([A-Z0-9]+)-\d+/);
|
|
246
|
+
const userStoryId = userStoryMatch ? userStoryMatch[1] : '';
|
|
247
|
+
acs.push({
|
|
248
|
+
id,
|
|
249
|
+
userStoryId,
|
|
250
|
+
description,
|
|
251
|
+
completed,
|
|
252
|
+
projects: [],
|
|
253
|
+
rawLine: line
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return acs;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Extract Tasks from GitHub issue body
|
|
261
|
+
*/
|
|
262
|
+
extractTasksFromIssue(body) {
|
|
263
|
+
const tasks = [];
|
|
264
|
+
const lines = body.split('\n');
|
|
265
|
+
// Match lines like: - [x] T-001: Description
|
|
266
|
+
const taskRegex = /^- \[([ x])\] (T-\d+):\s*(.+)$/;
|
|
267
|
+
for (const line of lines) {
|
|
268
|
+
const match = line.match(taskRegex);
|
|
269
|
+
if (match) {
|
|
270
|
+
const completed = match[1] === 'x';
|
|
271
|
+
const id = match[2];
|
|
272
|
+
const title = match[3];
|
|
273
|
+
tasks.push({
|
|
274
|
+
id,
|
|
275
|
+
title,
|
|
276
|
+
completed,
|
|
277
|
+
acIds: []
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return tasks;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Parse ACs from spec.md
|
|
285
|
+
*/
|
|
286
|
+
parseAcceptanceCriteria(specContent) {
|
|
287
|
+
const acs = [];
|
|
288
|
+
const lines = specContent.split('\n');
|
|
289
|
+
const acRegex = /^- \[([ x])\] (AC-[A-Z0-9]+-\d+):\s*(.+)$/;
|
|
290
|
+
for (const line of lines) {
|
|
291
|
+
const match = line.match(acRegex);
|
|
292
|
+
if (match) {
|
|
293
|
+
const completed = match[1] === 'x';
|
|
294
|
+
const id = match[2];
|
|
295
|
+
const description = match[3];
|
|
296
|
+
const userStoryMatch = id.match(/AC-([A-Z0-9]+)-\d+/);
|
|
297
|
+
const userStoryId = userStoryMatch ? userStoryMatch[1] : '';
|
|
298
|
+
acs.push({
|
|
299
|
+
id,
|
|
300
|
+
userStoryId,
|
|
301
|
+
description,
|
|
302
|
+
completed,
|
|
303
|
+
projects: [],
|
|
304
|
+
rawLine: line
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return acs;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Parse Tasks from tasks.md
|
|
312
|
+
*/
|
|
313
|
+
parseTasks(tasksContent) {
|
|
314
|
+
const tasks = [];
|
|
315
|
+
const lines = tasksContent.split('\n');
|
|
316
|
+
let currentTask = null;
|
|
317
|
+
for (const line of lines) {
|
|
318
|
+
// Match task header: ### T-001: Title (P1)
|
|
319
|
+
const headerMatch = line.match(/^### (T-\d+):\s*(.+?)\s*\(P\d+\)$/);
|
|
320
|
+
if (headerMatch) {
|
|
321
|
+
if (currentTask && currentTask.id) {
|
|
322
|
+
tasks.push(currentTask);
|
|
323
|
+
}
|
|
324
|
+
currentTask = {
|
|
325
|
+
id: headerMatch[1],
|
|
326
|
+
title: headerMatch[2],
|
|
327
|
+
completed: false,
|
|
328
|
+
acIds: []
|
|
329
|
+
};
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
// Check for completion
|
|
333
|
+
const completedMatch = line.match(/^\*\*Completed\*\*:\s*(.+)$/);
|
|
334
|
+
if (completedMatch && currentTask) {
|
|
335
|
+
currentTask.completed = true;
|
|
336
|
+
currentTask.completedDate = completedMatch[1];
|
|
337
|
+
}
|
|
338
|
+
// Extract AC IDs
|
|
339
|
+
const acMatch = line.match(/\*\*AC\*\*:\s*(.+)$/);
|
|
340
|
+
if (acMatch && currentTask) {
|
|
341
|
+
const acIds = acMatch[1].split(',').map(id => id.trim());
|
|
342
|
+
currentTask.acIds = acIds;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (currentTask && currentTask.id) {
|
|
346
|
+
tasks.push(currentTask);
|
|
347
|
+
}
|
|
348
|
+
return tasks;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Group ACs by User Story ID
|
|
352
|
+
*/
|
|
353
|
+
groupAcsByUserStory(acs) {
|
|
354
|
+
const grouped = {};
|
|
355
|
+
for (const ac of acs) {
|
|
356
|
+
if (!grouped[ac.userStoryId]) {
|
|
357
|
+
grouped[ac.userStoryId] = [];
|
|
358
|
+
}
|
|
359
|
+
grouped[ac.userStoryId].push(ac);
|
|
360
|
+
}
|
|
361
|
+
return grouped;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Filter tasks by AC IDs
|
|
365
|
+
*/
|
|
366
|
+
filterTasksByAcIds(tasks, acIds) {
|
|
367
|
+
return tasks.filter(task => task.acIds.some(acId => acIds.includes(acId)));
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Find User Story file by ID (with caching for performance)
|
|
371
|
+
*/
|
|
372
|
+
async findUserStoryFile(livingDocsPath, userStoryId) {
|
|
373
|
+
// Check cache first
|
|
374
|
+
const cacheKey = `${livingDocsPath}:${userStoryId}`;
|
|
375
|
+
if (this.userStoryFileCache.has(cacheKey)) {
|
|
376
|
+
return this.userStoryFileCache.get(cacheKey);
|
|
377
|
+
}
|
|
378
|
+
// Search in specs directory
|
|
379
|
+
const specsPath = path.join(livingDocsPath, 'internal', 'specs');
|
|
380
|
+
// Use glob to find user story files
|
|
381
|
+
const pattern = `**/us-*${userStoryId.toLowerCase()}*.md`;
|
|
382
|
+
const { glob } = await import('glob');
|
|
383
|
+
const files = await glob(pattern, { cwd: specsPath, absolute: true });
|
|
384
|
+
const result = files.length > 0 ? files[0] : null;
|
|
385
|
+
// Cache the result
|
|
386
|
+
this.userStoryFileCache.set(cacheKey, result);
|
|
387
|
+
return result;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Find User Story file that contains specific task
|
|
391
|
+
*/
|
|
392
|
+
async findUserStoryFileForTask(livingDocsPath, taskId) {
|
|
393
|
+
// Search all user story files for the task
|
|
394
|
+
const specsPath = path.join(livingDocsPath, 'internal', 'specs');
|
|
395
|
+
const { glob } = await import('glob');
|
|
396
|
+
const files = await glob('**/us-*.md', { cwd: specsPath, absolute: true });
|
|
397
|
+
for (const file of files) {
|
|
398
|
+
const content = await fs.readFile(file, 'utf-8');
|
|
399
|
+
if (content.includes(taskId)) {
|
|
400
|
+
return file;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Update AC in User Story file
|
|
407
|
+
*/
|
|
408
|
+
async updateUserStoryAc(userStoryPath, acId, completed) {
|
|
409
|
+
let content = await fs.readFile(userStoryPath, 'utf-8');
|
|
410
|
+
// Update checkbox state
|
|
411
|
+
const checkboxState = completed ? 'x' : ' ';
|
|
412
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${acId}:)`, 'g');
|
|
413
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
414
|
+
await fs.writeFile(userStoryPath, content, 'utf-8');
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Update Task in User Story file
|
|
418
|
+
*/
|
|
419
|
+
async updateUserStoryTask(userStoryPath, taskId, completed) {
|
|
420
|
+
let content = await fs.readFile(userStoryPath, 'utf-8');
|
|
421
|
+
// Update checkbox state
|
|
422
|
+
const checkboxState = completed ? 'x' : ' ';
|
|
423
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${taskId}:)`, 'g');
|
|
424
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
425
|
+
await fs.writeFile(userStoryPath, content, 'utf-8');
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Update multiple ACs in User Story file
|
|
429
|
+
*/
|
|
430
|
+
async updateUserStoryAcs(userStoryPath, acs) {
|
|
431
|
+
let content = await fs.readFile(userStoryPath, 'utf-8');
|
|
432
|
+
for (const ac of acs) {
|
|
433
|
+
const checkboxState = ac.completed ? 'x' : ' ';
|
|
434
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${ac.id}:)`, 'g');
|
|
435
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
436
|
+
}
|
|
437
|
+
await fs.writeFile(userStoryPath, content, 'utf-8');
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Update multiple Tasks in User Story file
|
|
441
|
+
*/
|
|
442
|
+
async updateUserStoryTasks(userStoryPath, tasks) {
|
|
443
|
+
let content = await fs.readFile(userStoryPath, 'utf-8');
|
|
444
|
+
for (const task of tasks) {
|
|
445
|
+
const checkboxState = task.completed ? 'x' : ' ';
|
|
446
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${task.id}:)`, 'g');
|
|
447
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
448
|
+
}
|
|
449
|
+
await fs.writeFile(userStoryPath, content, 'utf-8');
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Update AC in increment spec.md
|
|
453
|
+
*/
|
|
454
|
+
async updateIncrementAc(incrementPath, acId, completed) {
|
|
455
|
+
const specPath = path.join(incrementPath, 'spec.md');
|
|
456
|
+
let content = await fs.readFile(specPath, 'utf-8');
|
|
457
|
+
const checkboxState = completed ? 'x' : ' ';
|
|
458
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${acId}:)`, 'g');
|
|
459
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
460
|
+
await fs.writeFile(specPath, content, 'utf-8');
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Update multiple ACs in increment spec.md
|
|
464
|
+
*/
|
|
465
|
+
async updateIncrementAcs(incrementPath, acs) {
|
|
466
|
+
const specPath = path.join(incrementPath, 'spec.md');
|
|
467
|
+
let content = await fs.readFile(specPath, 'utf-8');
|
|
468
|
+
for (const ac of acs) {
|
|
469
|
+
const checkboxState = ac.completed ? 'x' : ' ';
|
|
470
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${ac.id}:)`, 'g');
|
|
471
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
472
|
+
}
|
|
473
|
+
await fs.writeFile(specPath, content, 'utf-8');
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Update multiple Tasks in increment tasks.md
|
|
477
|
+
*/
|
|
478
|
+
async updateIncrementTasks(incrementPath, tasks) {
|
|
479
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
480
|
+
let content = await fs.readFile(tasksPath, 'utf-8');
|
|
481
|
+
for (const task of tasks) {
|
|
482
|
+
if (task.completed) {
|
|
483
|
+
// Add **Completed** marker if not present
|
|
484
|
+
const taskHeader = `### ${task.id}:`;
|
|
485
|
+
const completedMarker = `**Completed**: ${new Date().toISOString().split('T')[0]}`;
|
|
486
|
+
if (!content.includes(`${taskHeader}`) || !content.includes(`**Completed**`)) {
|
|
487
|
+
// Find task section and add completed marker
|
|
488
|
+
const regex = new RegExp(`(### ${task.id}:[^#]*?)(###|$)`, 's');
|
|
489
|
+
content = content.replace(regex, `$1\n${completedMarker}\n\n$2`);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
await fs.writeFile(tasksPath, content, 'utf-8');
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Update ACs in increment with conflict resolution (Increment wins)
|
|
497
|
+
*
|
|
498
|
+
* If GitHub and Increment disagree, Increment state wins as it's the source of truth.
|
|
499
|
+
* Conflicts are logged for transparency.
|
|
500
|
+
*/
|
|
501
|
+
async updateIncrementAcsWithConflictResolution(incrementPath, githubAcs, result) {
|
|
502
|
+
const specPath = path.join(incrementPath, 'spec.md');
|
|
503
|
+
const currentContent = await fs.readFile(specPath, 'utf-8');
|
|
504
|
+
// Parse current state from increment
|
|
505
|
+
const currentAcs = this.parseAcceptanceCriteria(currentContent);
|
|
506
|
+
let content = currentContent;
|
|
507
|
+
for (const githubAc of githubAcs) {
|
|
508
|
+
const currentAc = currentAcs.find(ac => ac.id === githubAc.id);
|
|
509
|
+
if (currentAc && currentAc.completed !== githubAc.completed) {
|
|
510
|
+
// CONFLICT: Increment state differs from GitHub state
|
|
511
|
+
const conflictMsg = `AC ${githubAc.id}: GitHub says ${githubAc.completed ? 'complete' : 'incomplete'}, Increment says ${currentAc.completed ? 'complete' : 'incomplete'} → Increment wins`;
|
|
512
|
+
result.conflicts.push(conflictMsg);
|
|
513
|
+
console.log(`⚠️ CONFLICT RESOLVED: ${conflictMsg}`);
|
|
514
|
+
// Keep increment state (do not update)
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
// No conflict - apply GitHub change
|
|
518
|
+
const checkboxState = githubAc.completed ? 'x' : ' ';
|
|
519
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${githubAc.id}:)`, 'g');
|
|
520
|
+
content = content.replace(regex, `$1${checkboxState}$2`);
|
|
521
|
+
}
|
|
522
|
+
await fs.writeFile(specPath, content, 'utf-8');
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Update Tasks in increment with conflict resolution (Increment wins)
|
|
526
|
+
*/
|
|
527
|
+
async updateIncrementTasksWithConflictResolution(incrementPath, githubTasks, result) {
|
|
528
|
+
const tasksPath = path.join(incrementPath, 'tasks.md');
|
|
529
|
+
const currentContent = await fs.readFile(tasksPath, 'utf-8');
|
|
530
|
+
// Parse current state from increment
|
|
531
|
+
const currentTasks = this.parseTasks(currentContent);
|
|
532
|
+
let content = currentContent;
|
|
533
|
+
for (const githubTask of githubTasks) {
|
|
534
|
+
const currentTask = currentTasks.find(t => t.id === githubTask.id);
|
|
535
|
+
if (currentTask && currentTask.completed !== githubTask.completed) {
|
|
536
|
+
// CONFLICT: Increment state differs from GitHub state
|
|
537
|
+
const conflictMsg = `Task ${githubTask.id}: GitHub says ${githubTask.completed ? 'complete' : 'incomplete'}, Increment says ${currentTask.completed ? 'complete' : 'incomplete'} → Increment wins`;
|
|
538
|
+
result.conflicts.push(conflictMsg);
|
|
539
|
+
console.log(`⚠️ CONFLICT RESOLVED: ${conflictMsg}`);
|
|
540
|
+
// Keep increment state (do not update)
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
// No conflict - apply GitHub change
|
|
544
|
+
if (githubTask.completed) {
|
|
545
|
+
const taskHeader = `### ${githubTask.id}:`;
|
|
546
|
+
const completedMarker = `**Completed**: ${new Date().toISOString().split('T')[0]}`;
|
|
547
|
+
if (!content.includes(`${taskHeader}`) || !content.includes(`**Completed**`)) {
|
|
548
|
+
const regex = new RegExp(`(### ${githubTask.id}:[^#]*?)(###|$)`, 's');
|
|
549
|
+
content = content.replace(regex, `$1\n${completedMarker}\n\n$2`);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
await fs.writeFile(tasksPath, content, 'utf-8');
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Update GitHub issue with ACs and Tasks
|
|
557
|
+
*/
|
|
558
|
+
async updateGitHubIssue(issueNumber, acs, tasks) {
|
|
559
|
+
// Fetch current issue
|
|
560
|
+
const result = await execFileNoThrow('gh', [
|
|
561
|
+
'issue',
|
|
562
|
+
'view',
|
|
563
|
+
String(issueNumber),
|
|
564
|
+
'--json',
|
|
565
|
+
'body'
|
|
566
|
+
]);
|
|
567
|
+
const { body } = JSON.parse(result.stdout);
|
|
568
|
+
// Update AC checkboxes
|
|
569
|
+
let updatedBody = body;
|
|
570
|
+
for (const ac of acs) {
|
|
571
|
+
const checkboxState = ac.completed ? 'x' : ' ';
|
|
572
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${ac.id}:)`, 'g');
|
|
573
|
+
updatedBody = updatedBody.replace(regex, `$1${checkboxState}$2`);
|
|
574
|
+
}
|
|
575
|
+
// Update Task checkboxes
|
|
576
|
+
for (const task of tasks) {
|
|
577
|
+
const checkboxState = task.completed ? 'x' : ' ';
|
|
578
|
+
const regex = new RegExp(`(- \\[)[ x](\\] ${task.id}:)`, 'g');
|
|
579
|
+
updatedBody = updatedBody.replace(regex, `$1${checkboxState}$2`);
|
|
580
|
+
}
|
|
581
|
+
// Update issue via gh CLI
|
|
582
|
+
await execFileNoThrow('gh', [
|
|
583
|
+
'issue',
|
|
584
|
+
'edit',
|
|
585
|
+
String(issueNumber),
|
|
586
|
+
'--body',
|
|
587
|
+
updatedBody
|
|
588
|
+
]);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Add comment to GitHub issue
|
|
592
|
+
*/
|
|
593
|
+
async addGitHubComment(issueNumber, comment) {
|
|
594
|
+
await execFileNoThrow('gh', [
|
|
595
|
+
'issue',
|
|
596
|
+
'comment',
|
|
597
|
+
String(issueNumber),
|
|
598
|
+
'--body',
|
|
599
|
+
comment
|
|
600
|
+
]);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
//# sourceMappingURL=ThreeLayerSyncManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeLayerSyncManager.js","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/ThreeLayerSyncManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAiD9E,MAAM,OAAO,qBAAqB;IAKh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