specweave 0.34.6 → 0.34.9
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/dist/plugins/specweave-ado/lib/ado-profile-resolver.d.ts +1 -4
- package/dist/plugins/specweave-ado/lib/ado-profile-resolver.d.ts.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-profile-resolver.js +3 -6
- package/dist/plugins/specweave-ado/lib/ado-profile-resolver.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync-cli.js +3 -3
- package/dist/plugins/specweave-github/lib/github-feature-sync-cli.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-increment-sync-cli.js +3 -3
- package/dist/plugins/specweave-github/lib/github-increment-sync-cli.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-sync.js.map +1 -1
- package/dist/src/cli/commands/import-docs.d.ts +3 -0
- package/dist/src/cli/commands/import-docs.d.ts.map +1 -1
- package/dist/src/cli/commands/import-docs.js +110 -91
- package/dist/src/cli/commands/import-docs.js.map +1 -1
- package/dist/src/cli/commands/init.js +5 -5
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-commits.js +1 -1
- package/dist/src/cli/commands/sync-spec-commits.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-content.js +1 -1
- package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
- package/dist/src/cli/helpers/github/increment-profile-selector.js +1 -1
- package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
- package/dist/src/cli/helpers/github/profile-manager.d.ts +5 -5
- package/dist/src/cli/helpers/github/profile-manager.d.ts.map +1 -1
- package/dist/src/cli/helpers/github/profile-manager.js +24 -24
- package/dist/src/cli/helpers/github/profile-manager.js.map +1 -1
- package/dist/src/cli/helpers/init/config-detection.js +1 -1
- package/dist/src/cli/helpers/init/config-detection.js.map +1 -1
- package/dist/src/cli/helpers/init/sync-profile-helpers.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/sync-profile-helpers.js +2 -4
- package/dist/src/cli/helpers/init/sync-profile-helpers.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.d.ts +1 -4
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.js +0 -32
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +3 -13
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +0 -1
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +0 -7
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/types.d.ts +1 -5
- package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -1
- package/dist/src/cli/workers/import-worker.js +5 -111
- package/dist/src/cli/workers/import-worker.js.map +1 -1
- package/dist/src/core/config/types.d.ts +0 -5
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/credentials/credentials-manager.d.ts +2 -4
- package/dist/src/core/credentials/credentials-manager.d.ts.map +1 -1
- package/dist/src/core/credentials/credentials-manager.js +10 -24
- package/dist/src/core/credentials/credentials-manager.js.map +1 -1
- package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
- package/dist/src/core/increment/increment-archiver.js +0 -6
- package/dist/src/core/increment/increment-archiver.js.map +1 -1
- package/dist/src/core/increment/increment-utils.d.ts +0 -4
- package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
- package/dist/src/core/increment/increment-utils.js +0 -6
- package/dist/src/core/increment/increment-utils.js.map +1 -1
- package/dist/src/core/living-docs/cross-project-sync.d.ts +0 -13
- package/dist/src/core/living-docs/cross-project-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/cross-project-sync.js +0 -25
- package/dist/src/core/living-docs/cross-project-sync.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/project/project-manager.d.ts +0 -20
- package/dist/src/core/project/project-manager.d.ts.map +1 -1
- package/dist/src/core/project/project-manager.js +0 -49
- package/dist/src/core/project/project-manager.js.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts +0 -8
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.js +0 -28
- package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
- package/dist/src/core/sync/profile-manager.d.ts +5 -5
- package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
- package/dist/src/core/sync/profile-manager.js +17 -17
- package/dist/src/core/sync/profile-manager.js.map +1 -1
- package/dist/src/core/types/sync-profile.d.ts +3 -20
- package/dist/src/core/types/sync-profile.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.js +4 -10
- package/dist/src/core/types/sync-profile.js.map +1 -1
- package/dist/src/integrations/ado/ado-client-factory.d.ts +2 -2
- package/dist/src/integrations/ado/ado-client-factory.js +2 -2
- package/dist/src/utils/project-detection.d.ts +16 -16
- package/dist/src/utils/project-detection.d.ts.map +1 -1
- package/dist/src/utils/project-detection.js +39 -39
- package/dist/src/utils/project-detection.js.map +1 -1
- package/dist/src/utils/validators/ado-validator.d.ts +0 -5
- package/dist/src/utils/validators/ado-validator.d.ts.map +1 -1
- package/dist/src/utils/validators/ado-validator.js +0 -23
- package/dist/src/utils/validators/ado-validator.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +8 -8
- package/plugins/specweave/hooks/post-increment-planning.sh +3 -3
- package/plugins/specweave-ado/lib/ado-profile-resolver.js +2 -3
- package/plugins/specweave-ado/lib/ado-profile-resolver.ts +3 -9
- package/plugins/specweave-github/lib/github-feature-sync-cli.js +2 -2
- package/plugins/specweave-github/lib/github-feature-sync-cli.ts +3 -3
- package/plugins/specweave-github/lib/github-increment-sync-cli.js +2 -2
- package/plugins/specweave-github/lib/github-increment-sync-cli.ts +3 -3
- package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
- package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
- package/plugins/specweave-jira/lib/jira-profile-resolver.js +2 -3
- package/plugins/specweave-jira/lib/jira-profile-resolver.ts +3 -9
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +0 -45
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +0 -247
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +0 -1
- package/dist/src/core/brownfield/analyzer.d.ts +0 -86
- package/dist/src/core/brownfield/analyzer.d.ts.map +0 -1
- package/dist/src/core/brownfield/analyzer.js +0 -365
- package/dist/src/core/brownfield/analyzer.js.map +0 -1
- package/dist/src/core/brownfield/importer.d.ts +0 -76
- package/dist/src/core/brownfield/importer.d.ts.map +0 -1
- package/dist/src/core/brownfield/importer.js +0 -287
- package/dist/src/core/brownfield/importer.js.map +0 -1
- package/dist/src/utils/env-multi-project-parser.d.ts +0 -237
- package/dist/src/utils/env-multi-project-parser.d.ts.map +0 -1
- package/dist/src/utils/env-multi-project-parser.js +0 -426
- package/dist/src/utils/env-multi-project-parser.js.map +0 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.d.js +0 -0
- package/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +0 -36
- package/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +0 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.js +0 -206
- package/plugins/specweave-github/lib/github-sync-bidirectional.js.map +0 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.ts +0 -362
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github-sync-bidirectional.js","sourceRoot":"","sources":["github-sync-bidirectional.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,qBAAqB,EAErB,UAAU,EACX,MAAM,2BAA2B,CAAC;AA4BnC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,WAAmB;IACtD,OAAO,CAAC,GAAG,CAAC,2CAA2C,WAAW,EAAE,CAAC,CAAC;IAEtE,IAAI,CAAC;QACH,mBAAmB;QACnB,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;YAC3D,OAAO;QACT,CAAC;QAED,uBAAuB;QACvB,MAAM,QAAQ,GAAG,MAAM,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;YACtD,OAAO;QACT,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;QACjC,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;QAE1C,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,IAAI,IAAI,IAAI,WAAW,EAAE,CAAC,CAAC;QAE/D,g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24.0 (Three-Permission Architecture).
|
|
5
|
-
* The "bidirectional" terminology has been replaced with granular permission controls:
|
|
6
|
-
* - canUpsertInternalItems: CREATE + UPDATE internal items
|
|
7
|
-
* - canUpdateExternalItems: UPDATE external items (full content)
|
|
8
|
-
* - canUpdateStatus: UPDATE status (both types)
|
|
9
|
-
*
|
|
10
|
-
* This file is kept for backward compatibility but is no longer actively maintained.
|
|
11
|
-
* See: .specweave/increments/0047-us-task-linkage/reports/THREE-PERMISSION-ARCHITECTURE-CHANGES.md
|
|
12
|
-
*
|
|
13
|
-
* Syncs state from GitHub back to SpecWeave.
|
|
14
|
-
* Handles issue state changes, comments, assignees, labels, milestones.
|
|
15
|
-
*
|
|
16
|
-
* @module github-sync-bidirectional
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import * as fs from '../../../src/utils/fs-native.js';
|
|
20
|
-
import path from 'path';
|
|
21
|
-
import { execFileNoThrow } from '../../../src/utils/execFileNoThrow.js';
|
|
22
|
-
import {
|
|
23
|
-
loadIncrementMetadata,
|
|
24
|
-
IncrementMetadata,
|
|
25
|
-
detectRepo
|
|
26
|
-
} from './github-issue-updater.js';
|
|
27
|
-
import { getGitHubAuthFromProject } from '../../../src/utils/auth-helpers.js';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get environment object with GH_TOKEN for gh CLI commands.
|
|
31
|
-
*/
|
|
32
|
-
function getGhEnv(): NodeJS.ProcessEnv {
|
|
33
|
-
const { token } = getGitHubAuthFromProject(process.cwd());
|
|
34
|
-
return token
|
|
35
|
-
? { ...process.env, GH_TOKEN: token }
|
|
36
|
-
: process.env;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface GitHubIssueState {
|
|
40
|
-
number: number;
|
|
41
|
-
title: string;
|
|
42
|
-
body: string;
|
|
43
|
-
state: 'open' | 'closed';
|
|
44
|
-
labels: string[];
|
|
45
|
-
assignees: string[];
|
|
46
|
-
milestone?: string;
|
|
47
|
-
comments: GitHubComment[];
|
|
48
|
-
updated_at: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface GitHubComment {
|
|
52
|
-
id: number;
|
|
53
|
-
author: string;
|
|
54
|
-
body: string;
|
|
55
|
-
created_at: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface SyncConflict {
|
|
59
|
-
type: 'status' | 'assignee' | 'label';
|
|
60
|
-
githubValue: any;
|
|
61
|
-
specweaveValue: any;
|
|
62
|
-
resolution: 'github-wins' | 'specweave-wins' | 'prompt';
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Sync from GitHub to SpecWeave
|
|
67
|
-
*/
|
|
68
|
-
export async function syncFromGitHub(incrementId: string): Promise<void> {
|
|
69
|
-
console.log(`\n🔄 Syncing from GitHub for increment: ${incrementId}`);
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
// 1. Load metadata
|
|
73
|
-
const metadata = await loadIncrementMetadata(incrementId);
|
|
74
|
-
if (!metadata?.github?.issue) {
|
|
75
|
-
console.log('ℹ️ No GitHub issue linked, nothing to sync');
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// 2. Detect repository
|
|
80
|
-
const repoInfo = await detectRepo();
|
|
81
|
-
if (!repoInfo) {
|
|
82
|
-
console.log('⚠️ Could not detect GitHub repository');
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const { owner, repo } = repoInfo;
|
|
87
|
-
const issueNumber = metadata.github.issue;
|
|
88
|
-
|
|
89
|
-
console.log(` Syncing from ${owner}/${repo}#${issueNumber}`);
|
|
90
|
-
|
|
91
|
-
// 3. Fetch current GitHub state
|
|
92
|
-
const githubState = await fetchGitHubIssueState(issueNumber, owner, repo);
|
|
93
|
-
|
|
94
|
-
// 4. Compare with local state
|
|
95
|
-
const conflicts = detectConflicts(metadata, githubState);
|
|
96
|
-
|
|
97
|
-
if (conflicts.length === 0) {
|
|
98
|
-
console.log('✅ No conflicts - GitHub and SpecWeave in sync');
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
console.log(`⚠️ Detected ${conflicts.length} conflict(s)`);
|
|
103
|
-
|
|
104
|
-
// 5. Resolve conflicts
|
|
105
|
-
await resolveConflicts(incrementId, metadata, githubState, conflicts);
|
|
106
|
-
|
|
107
|
-
// 6. Sync comments
|
|
108
|
-
await syncComments(incrementId, githubState.comments);
|
|
109
|
-
|
|
110
|
-
// 7. Update metadata
|
|
111
|
-
await updateMetadata(incrementId, githubState);
|
|
112
|
-
|
|
113
|
-
console.log('✅ Three-permission sync complete');
|
|
114
|
-
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error('❌ Error syncing from GitHub:', error);
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Fetch current GitHub issue state
|
|
123
|
-
*/
|
|
124
|
-
async function fetchGitHubIssueState(
|
|
125
|
-
issueNumber: number,
|
|
126
|
-
owner: string,
|
|
127
|
-
repo: string
|
|
128
|
-
): Promise<GitHubIssueState> {
|
|
129
|
-
// Fetch issue details
|
|
130
|
-
const issueResult = await execFileNoThrow('gh', [
|
|
131
|
-
'issue',
|
|
132
|
-
'view',
|
|
133
|
-
String(issueNumber),
|
|
134
|
-
'--repo',
|
|
135
|
-
`${owner}/${repo}`,
|
|
136
|
-
'--json',
|
|
137
|
-
'number,title,body,state,labels,assignees,milestone,updatedAt'
|
|
138
|
-
], { env: getGhEnv() });
|
|
139
|
-
|
|
140
|
-
if (issueResult.exitCode !== 0) {
|
|
141
|
-
throw new Error(`Failed to fetch issue: ${issueResult.stderr}`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const issue = JSON.parse(issueResult.stdout);
|
|
145
|
-
|
|
146
|
-
// Fetch comments
|
|
147
|
-
const commentsResult = await execFileNoThrow('gh', [
|
|
148
|
-
'api',
|
|
149
|
-
`repos/${owner}/${repo}/issues/${issueNumber}/comments`,
|
|
150
|
-
'--jq',
|
|
151
|
-
'.[] | {id: .id, author: .user.login, body: .body, created_at: .created_at}'
|
|
152
|
-
], { env: getGhEnv() });
|
|
153
|
-
|
|
154
|
-
let comments: GitHubComment[] = [];
|
|
155
|
-
if (commentsResult.exitCode === 0 && commentsResult.stdout.trim()) {
|
|
156
|
-
const commentLines = commentsResult.stdout.trim().split('\n');
|
|
157
|
-
comments = commentLines.map(line => JSON.parse(line));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return {
|
|
161
|
-
number: issue.number,
|
|
162
|
-
title: issue.title,
|
|
163
|
-
body: issue.body,
|
|
164
|
-
state: issue.state,
|
|
165
|
-
labels: issue.labels?.map((l: any) => l.name) || [],
|
|
166
|
-
assignees: issue.assignees?.map((a: any) => a.login) || [],
|
|
167
|
-
milestone: issue.milestone?.title,
|
|
168
|
-
comments,
|
|
169
|
-
updated_at: issue.updatedAt
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Detect conflicts between GitHub and SpecWeave
|
|
175
|
-
*/
|
|
176
|
-
function detectConflicts(
|
|
177
|
-
metadata: IncrementMetadata,
|
|
178
|
-
githubState: GitHubIssueState
|
|
179
|
-
): SyncConflict[] {
|
|
180
|
-
const conflicts: SyncConflict[] = [];
|
|
181
|
-
|
|
182
|
-
// Status conflict
|
|
183
|
-
const specweaveStatus = metadata.status; // "active", "completed", "paused", "abandoned"
|
|
184
|
-
const githubStatus = githubState.state; // "open", "closed"
|
|
185
|
-
|
|
186
|
-
const expectedGitHubStatus = mapSpecWeaveStatusToGitHub(specweaveStatus);
|
|
187
|
-
|
|
188
|
-
if (githubStatus !== expectedGitHubStatus) {
|
|
189
|
-
conflicts.push({
|
|
190
|
-
type: 'status',
|
|
191
|
-
githubValue: githubStatus,
|
|
192
|
-
specweaveValue: specweaveStatus,
|
|
193
|
-
resolution: 'prompt' // Ask user
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// TODO: Add assignee/label conflicts if needed in future
|
|
198
|
-
|
|
199
|
-
return conflicts;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Resolve conflicts
|
|
204
|
-
*/
|
|
205
|
-
async function resolveConflicts(
|
|
206
|
-
incrementId: string,
|
|
207
|
-
metadata: IncrementMetadata,
|
|
208
|
-
githubState: GitHubIssueState,
|
|
209
|
-
conflicts: SyncConflict[]
|
|
210
|
-
): Promise<void> {
|
|
211
|
-
for (const conflict of conflicts) {
|
|
212
|
-
console.log(`\n⚠️ Conflict detected: ${conflict.type}`);
|
|
213
|
-
console.log(` GitHub: ${conflict.githubValue}`);
|
|
214
|
-
console.log(` SpecWeave: ${conflict.specweaveValue}`);
|
|
215
|
-
|
|
216
|
-
if (conflict.type === 'status') {
|
|
217
|
-
await resolveStatusConflict(incrementId, metadata, githubState);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Resolve status conflict
|
|
224
|
-
*/
|
|
225
|
-
async function resolveStatusConflict(
|
|
226
|
-
incrementId: string,
|
|
227
|
-
metadata: IncrementMetadata,
|
|
228
|
-
githubState: GitHubIssueState
|
|
229
|
-
): Promise<void> {
|
|
230
|
-
const specweaveStatus = metadata.status;
|
|
231
|
-
const githubStatus = githubState.state;
|
|
232
|
-
|
|
233
|
-
// GitHub closed but SpecWeave active
|
|
234
|
-
if (githubStatus === 'closed' && specweaveStatus === 'active') {
|
|
235
|
-
console.log(`\n⚠️ **CONFLICT**: GitHub issue closed but SpecWeave increment still active!`);
|
|
236
|
-
console.log(` Recommendation: Run /sw:done ${incrementId} to close increment`);
|
|
237
|
-
console.log(` Or reopen issue on GitHub if work is not complete`);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// GitHub open but SpecWeave completed
|
|
241
|
-
if (githubStatus === 'open' && specweaveStatus === 'completed') {
|
|
242
|
-
console.log(`\n⚠️ **CONFLICT**: SpecWeave increment completed but GitHub issue still open!`);
|
|
243
|
-
console.log(` Recommendation: Close GitHub issue #${metadata.github!.issue}`);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// GitHub open but SpecWeave paused
|
|
247
|
-
if (githubStatus === 'open' && specweaveStatus === 'paused') {
|
|
248
|
-
console.log(`\nℹ️ GitHub issue open, SpecWeave increment paused (OK)`);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// GitHub open but SpecWeave abandoned
|
|
252
|
-
if (githubStatus === 'open' && specweaveStatus === 'abandoned') {
|
|
253
|
-
console.log(`\n⚠️ **CONFLICT**: SpecWeave increment abandoned but GitHub issue still open!`);
|
|
254
|
-
console.log(` Recommendation: Close GitHub issue #${metadata.github!.issue} with reason`);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Sync comments from GitHub to SpecWeave
|
|
260
|
-
*/
|
|
261
|
-
async function syncComments(
|
|
262
|
-
incrementId: string,
|
|
263
|
-
comments: GitHubComment[]
|
|
264
|
-
): Promise<void> {
|
|
265
|
-
if (comments.length === 0) {
|
|
266
|
-
console.log('ℹ️ No comments to sync');
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const commentsPath = path.join(
|
|
271
|
-
process.cwd(),
|
|
272
|
-
'.specweave/increments',
|
|
273
|
-
incrementId,
|
|
274
|
-
'logs/github-comments.md'
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
await fs.ensureFile(commentsPath);
|
|
278
|
-
|
|
279
|
-
// Load existing comments
|
|
280
|
-
let existingContent = '';
|
|
281
|
-
if (await fs.pathExists(commentsPath)) {
|
|
282
|
-
existingContent = await fs.readFile(commentsPath, 'utf-8');
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Extract existing comment IDs
|
|
286
|
-
const existingIds = new Set<number>();
|
|
287
|
-
const idMatches = existingContent.matchAll(/<!-- comment-id: (\d+) -->/g);
|
|
288
|
-
for (const match of idMatches) {
|
|
289
|
-
existingIds.add(parseInt(match[1], 10));
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// Append new comments
|
|
293
|
-
const newComments = comments.filter(c => !existingIds.has(c.id));
|
|
294
|
-
|
|
295
|
-
if (newComments.length === 0) {
|
|
296
|
-
console.log('ℹ️ All comments already synced');
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
console.log(`📝 Syncing ${newComments.length} new comment(s)`);
|
|
301
|
-
|
|
302
|
-
const commentsMarkdown = newComments.map(comment => `
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
<!-- comment-id: ${comment.id} -->
|
|
306
|
-
|
|
307
|
-
**Author**: @${comment.author}
|
|
308
|
-
**Date**: ${new Date(comment.created_at).toLocaleString()}
|
|
309
|
-
|
|
310
|
-
${comment.body}
|
|
311
|
-
`.trim()).join('\n\n');
|
|
312
|
-
|
|
313
|
-
await fs.appendFile(
|
|
314
|
-
commentsPath,
|
|
315
|
-
(existingContent ? '\n\n' : '') + commentsMarkdown
|
|
316
|
-
);
|
|
317
|
-
|
|
318
|
-
console.log(`✅ Comments saved to: logs/github-comments.md`);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Update metadata with GitHub state
|
|
323
|
-
*/
|
|
324
|
-
async function updateMetadata(
|
|
325
|
-
incrementId: string,
|
|
326
|
-
githubState: GitHubIssueState
|
|
327
|
-
): Promise<void> {
|
|
328
|
-
const metadataPath = path.join(
|
|
329
|
-
process.cwd(),
|
|
330
|
-
'.specweave/increments',
|
|
331
|
-
incrementId,
|
|
332
|
-
'metadata.json'
|
|
333
|
-
);
|
|
334
|
-
|
|
335
|
-
const metadata = await fs.readJson(metadataPath);
|
|
336
|
-
|
|
337
|
-
// Update GitHub section
|
|
338
|
-
metadata.github = metadata.github || {};
|
|
339
|
-
metadata.github.synced = new Date().toISOString();
|
|
340
|
-
metadata.github.lastUpdated = githubState.updated_at;
|
|
341
|
-
metadata.github.state = githubState.state;
|
|
342
|
-
|
|
343
|
-
await fs.writeJson(metadataPath, metadata, { spaces: 2 });
|
|
344
|
-
|
|
345
|
-
console.log('✅ Metadata updated');
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Map SpecWeave status to GitHub state
|
|
350
|
-
*/
|
|
351
|
-
function mapSpecWeaveStatusToGitHub(status: string): 'open' | 'closed' {
|
|
352
|
-
switch (status) {
|
|
353
|
-
case 'completed':
|
|
354
|
-
case 'abandoned':
|
|
355
|
-
return 'closed';
|
|
356
|
-
case 'active':
|
|
357
|
-
case 'paused':
|
|
358
|
-
case 'planning':
|
|
359
|
-
default:
|
|
360
|
-
return 'open';
|
|
361
|
-
}
|
|
362
|
-
}
|